Documentation ¶
Index ¶
- type AggregatedCostClient
- func (client *AggregatedCostClient) GetByManagementGroup(ctx context.Context, managementGroupID string, ...) (AggregatedCostClientGetByManagementGroupResponse, error)
- func (client *AggregatedCostClient) GetForBillingPeriodByManagementGroup(ctx context.Context, managementGroupID string, billingPeriodName string, ...) (AggregatedCostClientGetForBillingPeriodByManagementGroupResponse, error)
- type AggregatedCostClientGetByManagementGroupOptions
- type AggregatedCostClientGetByManagementGroupResponse
- type AggregatedCostClientGetForBillingPeriodByManagementGroupOptions
- type AggregatedCostClientGetForBillingPeriodByManagementGroupResponse
- type Amount
- type AmountWithExchangeRate
- type Balance
- type BalanceProperties
- type BalancePropertiesAdjustmentDetailsItem
- type BalancePropertiesNewPurchasesDetailsItem
- type BalancesClient
- func (client *BalancesClient) GetByBillingAccount(ctx context.Context, billingAccountID string, ...) (BalancesClientGetByBillingAccountResponse, error)
- func (client *BalancesClient) GetForBillingPeriodByBillingAccount(ctx context.Context, billingAccountID string, billingPeriodName string, ...) (BalancesClientGetForBillingPeriodByBillingAccountResponse, error)
- type BalancesClientGetByBillingAccountOptions
- type BalancesClientGetByBillingAccountResponse
- type BalancesClientGetForBillingPeriodByBillingAccountOptions
- type BalancesClientGetForBillingPeriodByBillingAccountResponse
- type BillingFrequency
- type Budget
- type BudgetComparisonExpression
- type BudgetFilter
- type BudgetFilterProperties
- type BudgetOperatorType
- type BudgetProperties
- type BudgetTimePeriod
- type BudgetsClient
- func (client *BudgetsClient) CreateOrUpdate(ctx context.Context, scope string, budgetName string, parameters Budget, ...) (BudgetsClientCreateOrUpdateResponse, error)
- func (client *BudgetsClient) Delete(ctx context.Context, scope string, budgetName string, ...) (BudgetsClientDeleteResponse, error)
- func (client *BudgetsClient) Get(ctx context.Context, scope string, budgetName string, ...) (BudgetsClientGetResponse, error)
- func (client *BudgetsClient) NewListPager(scope string, options *BudgetsClientListOptions) *runtime.Pager[BudgetsClientListResponse]
- type BudgetsClientCreateOrUpdateOptions
- type BudgetsClientCreateOrUpdateResponse
- type BudgetsClientDeleteOptions
- type BudgetsClientDeleteResponse
- type BudgetsClientGetOptions
- type BudgetsClientGetResponse
- type BudgetsClientListOptions
- type BudgetsClientListResponse
- type BudgetsListResult
- type CategoryType
- type ChargeSummary
- type ChargeSummaryClassification
- type ChargeSummaryKind
- type ChargesClient
- type ChargesClientListOptions
- type ChargesClientListResponse
- type ChargesListResult
- type CreditBalanceSummary
- type CreditSummary
- type CreditSummaryProperties
- type CreditsClient
- type CreditsClientGetOptions
- type CreditsClientGetResponse
- type CultureCode
- type CurrentSpend
- type Datagrain
- type DownloadProperties
- type ErrorDetails
- type ErrorResponse
- type EventProperties
- type EventSummary
- type EventType
- type Events
- type EventsClient
- func (client *EventsClient) NewListByBillingAccountPager(billingAccountID string, options *EventsClientListByBillingAccountOptions) *runtime.Pager[EventsClientListByBillingAccountResponse]
- func (client *EventsClient) NewListByBillingProfilePager(billingAccountID string, billingProfileID string, startDate string, ...) *runtime.Pager[EventsClientListByBillingProfileResponse]
- type EventsClientListByBillingAccountOptions
- type EventsClientListByBillingAccountResponse
- type EventsClientListByBillingProfileOptions
- type EventsClientListByBillingProfileResponse
- type ForecastSpend
- type HighCasedErrorDetails
- type HighCasedErrorResponse
- type LegacyChargeSummary
- type LegacyChargeSummaryProperties
- type LegacyReservationRecommendation
- type LegacyReservationRecommendationProperties
- func (l *LegacyReservationRecommendationProperties) GetLegacyReservationRecommendationProperties() *LegacyReservationRecommendationProperties
- func (l LegacyReservationRecommendationProperties) MarshalJSON() ([]byte, error)
- func (l *LegacyReservationRecommendationProperties) UnmarshalJSON(data []byte) error
- type LegacyReservationRecommendationPropertiesClassification
- type LegacyReservationTransaction
- type LegacyReservationTransactionProperties
- type LegacySharedScopeReservationRecommendationProperties
- func (l *LegacySharedScopeReservationRecommendationProperties) GetLegacyReservationRecommendationProperties() *LegacyReservationRecommendationProperties
- func (l LegacySharedScopeReservationRecommendationProperties) MarshalJSON() ([]byte, error)
- func (l *LegacySharedScopeReservationRecommendationProperties) UnmarshalJSON(data []byte) error
- type LegacySingleScopeReservationRecommendationProperties
- func (l *LegacySingleScopeReservationRecommendationProperties) GetLegacyReservationRecommendationProperties() *LegacyReservationRecommendationProperties
- func (l LegacySingleScopeReservationRecommendationProperties) MarshalJSON() ([]byte, error)
- func (l *LegacySingleScopeReservationRecommendationProperties) UnmarshalJSON(data []byte) error
- type LegacyUsageDetail
- type LegacyUsageDetailProperties
- type LookBackPeriod
- type LotProperties
- type LotSource
- type LotSummary
- type Lots
- type LotsClient
- func (client *LotsClient) NewListByBillingAccountPager(billingAccountID string, options *LotsClientListByBillingAccountOptions) *runtime.Pager[LotsClientListByBillingAccountResponse]
- func (client *LotsClient) NewListByBillingProfilePager(billingAccountID string, billingProfileID string, ...) *runtime.Pager[LotsClientListByBillingProfileResponse]
- func (client *LotsClient) NewListByCustomerPager(billingAccountID string, customerID string, ...) *runtime.Pager[LotsClientListByCustomerResponse]
- type LotsClientListByBillingAccountOptions
- type LotsClientListByBillingAccountResponse
- type LotsClientListByBillingProfileOptions
- type LotsClientListByBillingProfileResponse
- type LotsClientListByCustomerOptions
- type LotsClientListByCustomerResponse
- type ManagementGroupAggregatedCostProperties
- type ManagementGroupAggregatedCostResult
- type Marketplace
- type MarketplaceProperties
- type MarketplacesClient
- type MarketplacesClientListOptions
- type MarketplacesClientListResponse
- type MarketplacesListResult
- type MeterDetails
- type MeterDetailsResponse
- type Metrictype
- type ModernChargeSummary
- type ModernChargeSummaryProperties
- type ModernReservationRecommendation
- type ModernReservationRecommendationProperties
- type ModernReservationTransaction
- type ModernReservationTransactionProperties
- type ModernReservationTransactionsListResult
- type ModernUsageDetail
- type ModernUsageDetailProperties
- type Notification
- type Operation
- type OperationDisplay
- type OperationListResult
- type OperationsClient
- type OperationsClientListOptions
- type OperationsClientListResponse
- type OperatorType
- type PriceSheetClient
- type PriceSheetClientGetByBillingPeriodOptions
- type PriceSheetClientGetByBillingPeriodResponse
- type PriceSheetClientGetOptions
- type PriceSheetClientGetResponse
- type PriceSheetModel
- type PriceSheetProperties
- type PriceSheetResult
- type PricingModelType
- type ProxyResource
- type Reseller
- type ReservationDetail
- type ReservationDetailProperties
- type ReservationDetailsListResult
- type ReservationRecommendation
- type ReservationRecommendationClassification
- type ReservationRecommendationDetailsCalculatedSavingsProperties
- type ReservationRecommendationDetailsClient
- type ReservationRecommendationDetailsClientGetOptions
- type ReservationRecommendationDetailsClientGetResponse
- type ReservationRecommendationDetailsModel
- type ReservationRecommendationDetailsProperties
- type ReservationRecommendationDetailsResourceProperties
- type ReservationRecommendationDetailsSavingsProperties
- type ReservationRecommendationDetailsUsageProperties
- type ReservationRecommendationKind
- type ReservationRecommendationsClient
- type ReservationRecommendationsClientListOptions
- type ReservationRecommendationsClientListResponse
- type ReservationRecommendationsListResult
- type ReservationSummariesListResult
- type ReservationSummary
- type ReservationSummaryProperties
- type ReservationTransaction
- type ReservationTransactionResource
- type ReservationTransactionsClient
- func (client *ReservationTransactionsClient) NewListByBillingProfilePager(billingAccountID string, billingProfileID string, ...) *runtime.Pager[ReservationTransactionsClientListByBillingProfileResponse]
- func (client *ReservationTransactionsClient) NewListPager(billingAccountID string, options *ReservationTransactionsClientListOptions) *runtime.Pager[ReservationTransactionsClientListResponse]
- type ReservationTransactionsClientListByBillingProfileOptions
- type ReservationTransactionsClientListByBillingProfileResponse
- type ReservationTransactionsClientListOptions
- type ReservationTransactionsClientListResponse
- type ReservationTransactionsListResult
- type ReservationsDetailsClient
- func (client *ReservationsDetailsClient) NewListByReservationOrderAndReservationPager(reservationOrderID string, reservationID string, filter string, ...) ...
- func (client *ReservationsDetailsClient) NewListByReservationOrderPager(reservationOrderID string, filter string, ...) *runtime.Pager[ReservationsDetailsClientListByReservationOrderResponse]
- func (client *ReservationsDetailsClient) NewListPager(scope string, options *ReservationsDetailsClientListOptions) *runtime.Pager[ReservationsDetailsClientListResponse]
- type ReservationsDetailsClientListByReservationOrderAndReservationOptions
- type ReservationsDetailsClientListByReservationOrderAndReservationResponse
- type ReservationsDetailsClientListByReservationOrderOptions
- type ReservationsDetailsClientListByReservationOrderResponse
- type ReservationsDetailsClientListOptions
- type ReservationsDetailsClientListResponse
- type ReservationsSummariesClient
- func (client *ReservationsSummariesClient) NewListByReservationOrderAndReservationPager(reservationOrderID string, reservationID string, grain Datagrain, ...) ...
- func (client *ReservationsSummariesClient) NewListByReservationOrderPager(reservationOrderID string, grain Datagrain, ...) *runtime.Pager[ReservationsSummariesClientListByReservationOrderResponse]
- func (client *ReservationsSummariesClient) NewListPager(scope string, grain Datagrain, options *ReservationsSummariesClientListOptions) *runtime.Pager[ReservationsSummariesClientListResponse]
- type ReservationsSummariesClientListByReservationOrderAndReservationOptions
- type ReservationsSummariesClientListByReservationOrderAndReservationResponse
- type ReservationsSummariesClientListByReservationOrderOptions
- type ReservationsSummariesClientListByReservationOrderResponse
- type ReservationsSummariesClientListOptions
- type ReservationsSummariesClientListResponse
- type Resource
- type ResourceAttributes
- type SKUProperty
- type Scope
- type Status
- type Tag
- type TagProperties
- type TagsClient
- type TagsClientGetOptions
- type TagsClientGetResponse
- type TagsResult
- type Term
- type ThresholdType
- type TimeGrainType
- type UsageDetail
- type UsageDetailClassification
- type UsageDetailsClient
- type UsageDetailsClientListOptions
- type UsageDetailsClientListResponse
- type UsageDetailsKind
- type UsageDetailsListResult
Examples ¶
- AggregatedCostClient.GetByManagementGroup
- AggregatedCostClient.GetForBillingPeriodByManagementGroup
- BalancesClient.GetByBillingAccount
- BalancesClient.GetForBillingPeriodByBillingAccount
- BudgetsClient.CreateOrUpdate
- BudgetsClient.Delete
- BudgetsClient.Get
- BudgetsClient.NewListPager
- ChargesClient.List
- CreditsClient.Get
- EventsClient.NewListByBillingAccountPager
- EventsClient.NewListByBillingProfilePager
- LotsClient.NewListByBillingAccountPager
- LotsClient.NewListByBillingProfilePager
- LotsClient.NewListByCustomerPager
- MarketplacesClient.NewListPager
- OperationsClient.NewListPager
- PriceSheetClient.Get
- PriceSheetClient.GetByBillingPeriod
- ReservationRecommendationDetailsClient.Get
- ReservationRecommendationsClient.NewListPager
- ReservationTransactionsClient.NewListByBillingProfilePager
- ReservationTransactionsClient.NewListPager
- ReservationsDetailsClient.NewListByReservationOrderAndReservationPager
- ReservationsDetailsClient.NewListByReservationOrderPager
- ReservationsDetailsClient.NewListPager
- ReservationsSummariesClient.NewListByReservationOrderAndReservationPager
- ReservationsSummariesClient.NewListByReservationOrderPager
- ReservationsSummariesClient.NewListPager
- TagsClient.Get
- UsageDetailsClient.NewListPager
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type AggregatedCostClient ¶
type AggregatedCostClient struct {
// contains filtered or unexported fields
}
AggregatedCostClient contains the methods for the AggregatedCost group. Don't use this type directly, use NewAggregatedCostClient() instead.
func NewAggregatedCostClient ¶
func NewAggregatedCostClient(credential azcore.TokenCredential, options *arm.ClientOptions) (*AggregatedCostClient, error)
NewAggregatedCostClient creates a new instance of AggregatedCostClient with the specified values. credential - used to authorize requests. Usually a credential from azidentity. options - pass nil to accept the default values.
func (*AggregatedCostClient) GetByManagementGroup ¶
func (client *AggregatedCostClient) GetByManagementGroup(ctx context.Context, managementGroupID string, options *AggregatedCostClientGetByManagementGroupOptions) (AggregatedCostClientGetByManagementGroupResponse, error)
GetByManagementGroup - Provides the aggregate cost of a management group and all child management groups by current billing period. If the operation fails it returns an *azcore.ResponseError type. managementGroupID - Azure Management Group ID. options - AggregatedCostClientGetByManagementGroupOptions contains the optional parameters for the AggregatedCostClient.GetByManagementGroup method.
Example ¶
Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/consumption/resource-manager/Microsoft.Consumption/stable/2021-10-01/examples/AggregatedCostByManagementGroup.json
package main import ( "context" "log" "github.com/Azure/azure-sdk-for-go/sdk/azidentity" "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/consumption/armconsumption" ) func main() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) return } ctx := context.Background() client, err := armconsumption.NewAggregatedCostClient(cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) return } res, err := client.GetByManagementGroup(ctx, "<management-group-id>", &armconsumption.AggregatedCostClientGetByManagementGroupOptions{Filter: nil}) if err != nil { log.Fatalf("failed to finish the request: %v", err) return } // TODO: use response item _ = res }
Output:
func (*AggregatedCostClient) GetForBillingPeriodByManagementGroup ¶
func (client *AggregatedCostClient) GetForBillingPeriodByManagementGroup(ctx context.Context, managementGroupID string, billingPeriodName string, options *AggregatedCostClientGetForBillingPeriodByManagementGroupOptions) (AggregatedCostClientGetForBillingPeriodByManagementGroupResponse, error)
GetForBillingPeriodByManagementGroup - Provides the aggregate cost of a management group and all child management groups by specified billing period If the operation fails it returns an *azcore.ResponseError type. managementGroupID - Azure Management Group ID. billingPeriodName - Billing Period Name. options - AggregatedCostClientGetForBillingPeriodByManagementGroupOptions contains the optional parameters for the AggregatedCostClient.GetForBillingPeriodByManagementGroup method.
Example ¶
Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/consumption/resource-manager/Microsoft.Consumption/stable/2021-10-01/examples/AggregatedCostForBillingPeriodByManagementGroup.json
package main import ( "context" "log" "github.com/Azure/azure-sdk-for-go/sdk/azidentity" "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/consumption/armconsumption" ) func main() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) return } ctx := context.Background() client, err := armconsumption.NewAggregatedCostClient(cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) return } res, err := client.GetForBillingPeriodByManagementGroup(ctx, "<management-group-id>", "<billing-period-name>", nil) if err != nil { log.Fatalf("failed to finish the request: %v", err) return } // TODO: use response item _ = res }
Output:
type AggregatedCostClientGetByManagementGroupOptions ¶ added in v0.3.0
type AggregatedCostClientGetByManagementGroupOptions struct { // May be used to filter aggregated cost by properties/usageStart (Utc time), properties/usageEnd (Utc time). The filter supports // 'eq', 'lt', 'gt', 'le', 'ge', and 'and'. It does not currently support // 'ne', 'or', or 'not'. Tag filter is a key value pair string where key and value is separated by a colon (:). Filter *string }
AggregatedCostClientGetByManagementGroupOptions contains the optional parameters for the AggregatedCostClient.GetByManagementGroup method.
type AggregatedCostClientGetByManagementGroupResponse ¶ added in v0.3.0
type AggregatedCostClientGetByManagementGroupResponse struct {
ManagementGroupAggregatedCostResult
}
AggregatedCostClientGetByManagementGroupResponse contains the response from method AggregatedCostClient.GetByManagementGroup.
type AggregatedCostClientGetForBillingPeriodByManagementGroupOptions ¶ added in v0.3.0
type AggregatedCostClientGetForBillingPeriodByManagementGroupOptions struct { }
AggregatedCostClientGetForBillingPeriodByManagementGroupOptions contains the optional parameters for the AggregatedCostClient.GetForBillingPeriodByManagementGroup method.
type AggregatedCostClientGetForBillingPeriodByManagementGroupResponse ¶ added in v0.3.0
type AggregatedCostClientGetForBillingPeriodByManagementGroupResponse struct {
ManagementGroupAggregatedCostResult
}
AggregatedCostClientGetForBillingPeriodByManagementGroupResponse contains the response from method AggregatedCostClient.GetForBillingPeriodByManagementGroup.
type Amount ¶
type Amount struct { // READ-ONLY; Amount currency. Currency *string `json:"currency,omitempty" azure:"ro"` // READ-ONLY; Amount. Value *float64 `json:"value,omitempty" azure:"ro"` }
Amount - The amount plus currency .
type AmountWithExchangeRate ¶
type AmountWithExchangeRate struct { // READ-ONLY; Amount currency. Currency *string `json:"currency,omitempty" azure:"ro"` // READ-ONLY; The exchange rate. ExchangeRate *float64 `json:"exchangeRate,omitempty" azure:"ro"` // READ-ONLY; The exchange rate month. ExchangeRateMonth *int32 `json:"exchangeRateMonth,omitempty" azure:"ro"` // READ-ONLY; Amount. Value *float64 `json:"value,omitempty" azure:"ro"` }
AmountWithExchangeRate - The amount with exchange rate.
type Balance ¶
type Balance struct { // The properties of the balance. Properties *BalanceProperties `json:"properties,omitempty"` // READ-ONLY; The etag for the resource. Etag *string `json:"etag,omitempty" azure:"ro"` // READ-ONLY; The full qualified ARM ID of an event. ID *string `json:"id,omitempty" azure:"ro"` // READ-ONLY; The ID that uniquely identifies an event. 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"` }
Balance - A balance resource.
func (Balance) MarshalJSON ¶
MarshalJSON implements the json.Marshaller interface for type Balance.
type BalanceProperties ¶
type BalanceProperties struct { // The billing frequency. BillingFrequency *BillingFrequency `json:"billingFrequency,omitempty"` // READ-ONLY; List of Adjustments (Promo credit, SIE credit etc.). AdjustmentDetails []*BalancePropertiesAdjustmentDetailsItem `json:"adjustmentDetails,omitempty" azure:"ro"` // READ-ONLY; Total adjustment amount. Adjustments *float64 `json:"adjustments,omitempty" azure:"ro"` // READ-ONLY; Total charges for Azure Marketplace. AzureMarketplaceServiceCharges *float64 `json:"azureMarketplaceServiceCharges,omitempty" azure:"ro"` // READ-ONLY; The beginning balance for the billing period. BeginningBalance *float64 `json:"beginningBalance,omitempty" azure:"ro"` // READ-ONLY; Charges Billed separately. ChargesBilledSeparately *float64 `json:"chargesBilledSeparately,omitempty" azure:"ro"` // READ-ONLY; The ISO currency in which the meter is charged, for example, USD. Currency *string `json:"currency,omitempty" azure:"ro"` // READ-ONLY; The ending balance for the billing period (for open periods this will be updated daily). EndingBalance *float64 `json:"endingBalance,omitempty" azure:"ro"` // READ-ONLY; Total new purchase amount. NewPurchases *float64 `json:"newPurchases,omitempty" azure:"ro"` // READ-ONLY; List of new purchases. NewPurchasesDetails []*BalancePropertiesNewPurchasesDetailsItem `json:"newPurchasesDetails,omitempty" azure:"ro"` // READ-ONLY; Price is hidden or not. PriceHidden *bool `json:"priceHidden,omitempty" azure:"ro"` // READ-ONLY; Overage for Azure services. ServiceOverage *float64 `json:"serviceOverage,omitempty" azure:"ro"` // READ-ONLY; serviceOverage + chargesBilledSeparately. TotalOverage *float64 `json:"totalOverage,omitempty" azure:"ro"` // READ-ONLY; Azure service commitment + total Overage. TotalUsage *float64 `json:"totalUsage,omitempty" azure:"ro"` // READ-ONLY; Total Commitment usage. Utilized *float64 `json:"utilized,omitempty" azure:"ro"` }
BalanceProperties - The properties of the balance.
func (BalanceProperties) MarshalJSON ¶
func (b BalanceProperties) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type BalanceProperties.
type BalancesClient ¶
type BalancesClient struct {
// contains filtered or unexported fields
}
BalancesClient contains the methods for the Balances group. Don't use this type directly, use NewBalancesClient() instead.
func NewBalancesClient ¶
func NewBalancesClient(credential azcore.TokenCredential, options *arm.ClientOptions) (*BalancesClient, error)
NewBalancesClient creates a new instance of BalancesClient with the specified values. credential - used to authorize requests. Usually a credential from azidentity. options - pass nil to accept the default values.
func (*BalancesClient) GetByBillingAccount ¶
func (client *BalancesClient) GetByBillingAccount(ctx context.Context, billingAccountID string, options *BalancesClientGetByBillingAccountOptions) (BalancesClientGetByBillingAccountResponse, error)
GetByBillingAccount - Gets the balances for a scope by billingAccountId. Balances are available via this API only for May 1, 2014 or later. If the operation fails it returns an *azcore.ResponseError type. billingAccountID - BillingAccount ID options - BalancesClientGetByBillingAccountOptions contains the optional parameters for the BalancesClient.GetByBillingAccount method.
Example ¶
Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/consumption/resource-manager/Microsoft.Consumption/stable/2021-10-01/examples/BalancesByBillingAccount.json
package main import ( "context" "log" "github.com/Azure/azure-sdk-for-go/sdk/azidentity" "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/consumption/armconsumption" ) func main() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) return } ctx := context.Background() client, err := armconsumption.NewBalancesClient(cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) return } res, err := client.GetByBillingAccount(ctx, "<billing-account-id>", nil) if err != nil { log.Fatalf("failed to finish the request: %v", err) return } // TODO: use response item _ = res }
Output:
func (*BalancesClient) GetForBillingPeriodByBillingAccount ¶
func (client *BalancesClient) GetForBillingPeriodByBillingAccount(ctx context.Context, billingAccountID string, billingPeriodName string, options *BalancesClientGetForBillingPeriodByBillingAccountOptions) (BalancesClientGetForBillingPeriodByBillingAccountResponse, error)
GetForBillingPeriodByBillingAccount - Gets the balances for a scope by billing period and billingAccountId. Balances are available via this API only for May 1, 2014 or later. If the operation fails it returns an *azcore.ResponseError type. billingAccountID - BillingAccount ID billingPeriodName - Billing Period Name. options - BalancesClientGetForBillingPeriodByBillingAccountOptions contains the optional parameters for the BalancesClient.GetForBillingPeriodByBillingAccount method.
Example ¶
Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/consumption/resource-manager/Microsoft.Consumption/stable/2021-10-01/examples/BalancesByBillingAccountForBillingPeriod.json
package main import ( "context" "log" "github.com/Azure/azure-sdk-for-go/sdk/azidentity" "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/consumption/armconsumption" ) func main() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) return } ctx := context.Background() client, err := armconsumption.NewBalancesClient(cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) return } res, err := client.GetForBillingPeriodByBillingAccount(ctx, "<billing-account-id>", "<billing-period-name>", nil) if err != nil { log.Fatalf("failed to finish the request: %v", err) return } // TODO: use response item _ = res }
Output:
type BalancesClientGetByBillingAccountOptions ¶ added in v0.3.0
type BalancesClientGetByBillingAccountOptions struct { }
BalancesClientGetByBillingAccountOptions contains the optional parameters for the BalancesClient.GetByBillingAccount method.
type BalancesClientGetByBillingAccountResponse ¶ added in v0.3.0
type BalancesClientGetByBillingAccountResponse struct {
Balance
}
BalancesClientGetByBillingAccountResponse contains the response from method BalancesClient.GetByBillingAccount.
type BalancesClientGetForBillingPeriodByBillingAccountOptions ¶ added in v0.3.0
type BalancesClientGetForBillingPeriodByBillingAccountOptions struct { }
BalancesClientGetForBillingPeriodByBillingAccountOptions contains the optional parameters for the BalancesClient.GetForBillingPeriodByBillingAccount method.
type BalancesClientGetForBillingPeriodByBillingAccountResponse ¶ added in v0.3.0
type BalancesClientGetForBillingPeriodByBillingAccountResponse struct {
Balance
}
BalancesClientGetForBillingPeriodByBillingAccountResponse contains the response from method BalancesClient.GetForBillingPeriodByBillingAccount.
type BillingFrequency ¶
type BillingFrequency string
BillingFrequency - The billing frequency.
const ( BillingFrequencyMonth BillingFrequency = "Month" BillingFrequencyQuarter BillingFrequency = "Quarter" BillingFrequencyYear BillingFrequency = "Year" )
func PossibleBillingFrequencyValues ¶
func PossibleBillingFrequencyValues() []BillingFrequency
PossibleBillingFrequencyValues returns the possible values for the BillingFrequency const type.
type Budget ¶
type Budget 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 budget. Properties *BudgetProperties `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"` }
Budget - A budget resource.
type BudgetComparisonExpression ¶
type BudgetComparisonExpression struct { // REQUIRED; The name of the column to use in comparison. Name *string `json:"name,omitempty"` // REQUIRED; The operator to use for comparison. Operator *BudgetOperatorType `json:"operator,omitempty"` // REQUIRED; Array of values to use for comparison Values []*string `json:"values,omitempty"` }
BudgetComparisonExpression - The comparison expression to be used in the budgets.
func (BudgetComparisonExpression) MarshalJSON ¶
func (b BudgetComparisonExpression) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type BudgetComparisonExpression.
type BudgetFilter ¶
type BudgetFilter struct { // The logical "AND" expression. Must have at least 2 items. And []*BudgetFilterProperties `json:"and,omitempty"` // Has comparison expression for a dimension Dimensions *BudgetComparisonExpression `json:"dimensions,omitempty"` // Has comparison expression for a tag Tags *BudgetComparisonExpression `json:"tags,omitempty"` }
BudgetFilter - May be used to filter budgets by resource group, resource, or meter.
func (BudgetFilter) MarshalJSON ¶
func (b BudgetFilter) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type BudgetFilter.
type BudgetFilterProperties ¶
type BudgetFilterProperties struct { // Has comparison expression for a dimension Dimensions *BudgetComparisonExpression `json:"dimensions,omitempty"` // Has comparison expression for a tag Tags *BudgetComparisonExpression `json:"tags,omitempty"` }
BudgetFilterProperties - The Dimensions or Tags to filter a budget by.
type BudgetOperatorType ¶
type BudgetOperatorType string
BudgetOperatorType - The operator to use for comparison.
const (
BudgetOperatorTypeIn BudgetOperatorType = "In"
)
func PossibleBudgetOperatorTypeValues ¶
func PossibleBudgetOperatorTypeValues() []BudgetOperatorType
PossibleBudgetOperatorTypeValues returns the possible values for the BudgetOperatorType const type.
type BudgetProperties ¶
type BudgetProperties struct { // REQUIRED; The total amount of cost to track with the budget Amount *float64 `json:"amount,omitempty"` // REQUIRED; The category of the budget, whether the budget tracks cost or usage. Category *CategoryType `json:"category,omitempty"` // REQUIRED; The time covered by a budget. Tracking of the amount will be reset based on the time grain. BillingMonth, BillingQuarter, // and BillingAnnual are only supported by WD customers TimeGrain *TimeGrainType `json:"timeGrain,omitempty"` // REQUIRED; Has start and end date of the budget. The start date must be first of the month and should be less than the end // date. Budget start date must be on or after June 1, 2017. Future start date should not // be more than twelve months. Past start date should be selected within the timegrain period. There are no restrictions on // the end date. TimePeriod *BudgetTimePeriod `json:"timePeriod,omitempty"` // May be used to filter budgets by user-specified dimensions and/or tags. Filter *BudgetFilter `json:"filter,omitempty"` // Dictionary of notifications associated with the budget. Budget can have up to five notifications. Notifications map[string]*Notification `json:"notifications,omitempty"` // READ-ONLY; The current amount of cost which is being tracked for a budget. CurrentSpend *CurrentSpend `json:"currentSpend,omitempty" azure:"ro"` // READ-ONLY; The forecasted cost which is being tracked for a budget. ForecastSpend *ForecastSpend `json:"forecastSpend,omitempty" azure:"ro"` }
BudgetProperties - The properties of the budget.
func (BudgetProperties) MarshalJSON ¶
func (b BudgetProperties) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type BudgetProperties.
type BudgetTimePeriod ¶
type BudgetTimePeriod struct { // REQUIRED; The start date for the budget. StartDate *time.Time `json:"startDate,omitempty"` // The end date for the budget. If not provided, we default this to 10 years from the start date. EndDate *time.Time `json:"endDate,omitempty"` }
BudgetTimePeriod - The start and end date for a budget.
func (BudgetTimePeriod) MarshalJSON ¶
func (b BudgetTimePeriod) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type BudgetTimePeriod.
func (*BudgetTimePeriod) UnmarshalJSON ¶
func (b *BudgetTimePeriod) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type BudgetTimePeriod.
type BudgetsClient ¶
type BudgetsClient struct {
// contains filtered or unexported fields
}
BudgetsClient contains the methods for the Budgets group. Don't use this type directly, use NewBudgetsClient() instead.
func NewBudgetsClient ¶
func NewBudgetsClient(credential azcore.TokenCredential, options *arm.ClientOptions) (*BudgetsClient, error)
NewBudgetsClient creates a new instance of BudgetsClient with the specified values. credential - used to authorize requests. Usually a credential from azidentity. options - pass nil to accept the default values.
func (*BudgetsClient) CreateOrUpdate ¶
func (client *BudgetsClient) CreateOrUpdate(ctx context.Context, scope string, budgetName string, parameters Budget, options *BudgetsClientCreateOrUpdateOptions) (BudgetsClientCreateOrUpdateResponse, error)
CreateOrUpdate - The operation to create or update a budget. You can optionally provide an eTag if desired as a form of concurrency control. To obtain the latest eTag for a given budget, perform a get operation prior to your put operation. If the operation fails it returns an *azcore.ResponseError type. scope - The scope associated with budget 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}/invoiceSections/{invoiceSectionId}' for invoiceSection scope. budgetName - Budget Name. parameters - Parameters supplied to the Create Budget operation. options - BudgetsClientCreateOrUpdateOptions contains the optional parameters for the BudgetsClient.CreateOrUpdate method.
Example ¶
Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/consumption/resource-manager/Microsoft.Consumption/stable/2021-10-01/examples/CreateOrUpdateBudget.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/consumption/armconsumption" ) func main() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) return } ctx := context.Background() client, err := armconsumption.NewBudgetsClient(cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) return } res, err := client.CreateOrUpdate(ctx, "<scope>", "<budget-name>", armconsumption.Budget{ ETag: to.Ptr("<etag>"), Properties: &armconsumption.BudgetProperties{ Amount: to.Ptr[float64](100.65), Category: to.Ptr(armconsumption.CategoryTypeCost), Filter: &armconsumption.BudgetFilter{ And: []*armconsumption.BudgetFilterProperties{ { Dimensions: &armconsumption.BudgetComparisonExpression{ Name: to.Ptr("<name>"), Operator: to.Ptr(armconsumption.BudgetOperatorTypeIn), Values: []*string{ to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/MYDEVTESTRG/providers/Microsoft.Compute/virtualMachines/MSVM2"), to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/MYDEVTESTRG/providers/Microsoft.Compute/virtualMachines/platformcloudplatformGeneric1")}, }, }, { Tags: &armconsumption.BudgetComparisonExpression{ Name: to.Ptr("<name>"), Operator: to.Ptr(armconsumption.BudgetOperatorTypeIn), Values: []*string{ to.Ptr("Dev"), to.Ptr("Prod")}, }, }, { Tags: &armconsumption.BudgetComparisonExpression{ Name: to.Ptr("<name>"), Operator: to.Ptr(armconsumption.BudgetOperatorTypeIn), Values: []*string{ to.Ptr("engineering"), to.Ptr("sales")}, }, }}, }, Notifications: map[string]*armconsumption.Notification{ "Actual_GreaterThan_80_Percent": { ContactEmails: []*string{ to.Ptr("johndoe@contoso.com"), to.Ptr("janesmith@contoso.com")}, ContactGroups: []*string{ to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/MYDEVTESTRG/providers/microsoft.insights/actionGroups/SampleActionGroup")}, ContactRoles: []*string{ to.Ptr("Contributor"), to.Ptr("Reader")}, Enabled: to.Ptr(true), Locale: to.Ptr(armconsumption.CultureCodeEnUs), Operator: to.Ptr(armconsumption.OperatorTypeGreaterThan), Threshold: to.Ptr[float64](80), ThresholdType: to.Ptr(armconsumption.ThresholdTypeActual), }, }, TimeGrain: to.Ptr(armconsumption.TimeGrainTypeMonthly), TimePeriod: &armconsumption.BudgetTimePeriod{ EndDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2018-10-31T00:00:00Z"); return t }()), StartDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-10-01T00:00:00Z"); return t }()), }, }, }, nil) if err != nil { log.Fatalf("failed to finish the request: %v", err) return } // TODO: use response item _ = res }
Output:
func (*BudgetsClient) Delete ¶
func (client *BudgetsClient) Delete(ctx context.Context, scope string, budgetName string, options *BudgetsClientDeleteOptions) (BudgetsClientDeleteResponse, error)
Delete - The operation to delete a budget. If the operation fails it returns an *azcore.ResponseError type. scope - The scope associated with budget 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}/invoiceSections/{invoiceSectionId}' for invoiceSection scope. budgetName - Budget Name. options - BudgetsClientDeleteOptions contains the optional parameters for the BudgetsClient.Delete method.
Example ¶
Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/consumption/resource-manager/Microsoft.Consumption/stable/2021-10-01/examples/DeleteBudget.json
package main import ( "context" "log" "github.com/Azure/azure-sdk-for-go/sdk/azidentity" "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/consumption/armconsumption" ) func main() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) return } ctx := context.Background() client, err := armconsumption.NewBudgetsClient(cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) return } _, err = client.Delete(ctx, "<scope>", "<budget-name>", nil) if err != nil { log.Fatalf("failed to finish the request: %v", err) return } }
Output:
func (*BudgetsClient) Get ¶
func (client *BudgetsClient) Get(ctx context.Context, scope string, budgetName string, options *BudgetsClientGetOptions) (BudgetsClientGetResponse, error)
Get - Gets the budget for the scope by budget name. If the operation fails it returns an *azcore.ResponseError type. scope - The scope associated with budget 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}/invoiceSections/{invoiceSectionId}' for invoiceSection scope. budgetName - Budget Name. options - BudgetsClientGetOptions contains the optional parameters for the BudgetsClient.Get method.
Example ¶
Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/consumption/resource-manager/Microsoft.Consumption/stable/2021-10-01/examples/Budget.json
package main import ( "context" "log" "github.com/Azure/azure-sdk-for-go/sdk/azidentity" "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/consumption/armconsumption" ) func main() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) return } ctx := context.Background() client, err := armconsumption.NewBudgetsClient(cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) return } res, err := client.Get(ctx, "<scope>", "<budget-name>", nil) if err != nil { log.Fatalf("failed to finish the request: %v", err) return } // TODO: use response item _ = res }
Output:
func (*BudgetsClient) NewListPager ¶ added in v0.5.0
func (client *BudgetsClient) NewListPager(scope string, options *BudgetsClientListOptions) *runtime.Pager[BudgetsClientListResponse]
NewListPager - Lists all budgets for the defined scope. If the operation fails it returns an *azcore.ResponseError type. scope - The scope associated with budget 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}/invoiceSections/{invoiceSectionId}' for invoiceSection scope. options - BudgetsClientListOptions contains the optional parameters for the BudgetsClient.List method.
Example ¶
Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/consumption/resource-manager/Microsoft.Consumption/stable/2021-10-01/examples/BudgetsList.json
package main import ( "context" "log" "github.com/Azure/azure-sdk-for-go/sdk/azidentity" "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/consumption/armconsumption" ) func main() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) return } ctx := context.Background() client, err := armconsumption.NewBudgetsClient(cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) return } pager := client.NewListPager("<scope>", nil) for pager.More() { nextResult, err := pager.NextPage(ctx) if err != nil { log.Fatalf("failed to advance page: %v", err) return } for _, v := range nextResult.Value { // TODO: use page item _ = v } } }
Output:
type BudgetsClientCreateOrUpdateOptions ¶ added in v0.3.0
type BudgetsClientCreateOrUpdateOptions struct { }
BudgetsClientCreateOrUpdateOptions contains the optional parameters for the BudgetsClient.CreateOrUpdate method.
type BudgetsClientCreateOrUpdateResponse ¶ added in v0.3.0
type BudgetsClientCreateOrUpdateResponse struct {
Budget
}
BudgetsClientCreateOrUpdateResponse contains the response from method BudgetsClient.CreateOrUpdate.
type BudgetsClientDeleteOptions ¶ added in v0.3.0
type BudgetsClientDeleteOptions struct { }
BudgetsClientDeleteOptions contains the optional parameters for the BudgetsClient.Delete method.
type BudgetsClientDeleteResponse ¶ added in v0.3.0
type BudgetsClientDeleteResponse struct { }
BudgetsClientDeleteResponse contains the response from method BudgetsClient.Delete.
type BudgetsClientGetOptions ¶ added in v0.3.0
type BudgetsClientGetOptions struct { }
BudgetsClientGetOptions contains the optional parameters for the BudgetsClient.Get method.
type BudgetsClientGetResponse ¶ added in v0.3.0
type BudgetsClientGetResponse struct {
Budget
}
BudgetsClientGetResponse contains the response from method BudgetsClient.Get.
type BudgetsClientListOptions ¶ added in v0.3.0
type BudgetsClientListOptions struct { }
BudgetsClientListOptions contains the optional parameters for the BudgetsClient.List method.
type BudgetsClientListResponse ¶ added in v0.3.0
type BudgetsClientListResponse struct {
BudgetsListResult
}
BudgetsClientListResponse contains the response from method BudgetsClient.List.
type BudgetsListResult ¶
type BudgetsListResult struct { // READ-ONLY; The link (url) to the next page of results. NextLink *string `json:"nextLink,omitempty" azure:"ro"` // READ-ONLY; The list of budgets. Value []*Budget `json:"value,omitempty" azure:"ro"` }
BudgetsListResult - Result of listing budgets. It contains a list of available budgets in the scope provided.
func (BudgetsListResult) MarshalJSON ¶
func (b BudgetsListResult) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type BudgetsListResult.
type CategoryType ¶
type CategoryType string
CategoryType - The category of the budget, whether the budget tracks cost or usage.
const (
CategoryTypeCost CategoryType = "Cost"
)
func PossibleCategoryTypeValues ¶
func PossibleCategoryTypeValues() []CategoryType
PossibleCategoryTypeValues returns the possible values for the CategoryType const type.
type ChargeSummary ¶
type ChargeSummary struct { // REQUIRED; Specifies the kind of charge summary. Kind *ChargeSummaryKind `json:"kind,omitempty"` // 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"` }
ChargeSummary - A charge summary resource.
func (*ChargeSummary) GetChargeSummary ¶
func (c *ChargeSummary) GetChargeSummary() *ChargeSummary
GetChargeSummary implements the ChargeSummaryClassification interface for type ChargeSummary.
type ChargeSummaryClassification ¶
type ChargeSummaryClassification interface { // GetChargeSummary returns the ChargeSummary content of the underlying type. GetChargeSummary() *ChargeSummary }
ChargeSummaryClassification provides polymorphic access to related types. Call the interface's GetChargeSummary() method to access the common type. Use a type switch to determine the concrete type. The possible types are: - *ChargeSummary, *LegacyChargeSummary, *ModernChargeSummary
type ChargeSummaryKind ¶
type ChargeSummaryKind string
ChargeSummaryKind - Specifies the kind of charge summary.
const ( ChargeSummaryKindLegacy ChargeSummaryKind = "legacy" ChargeSummaryKindModern ChargeSummaryKind = "modern" )
func PossibleChargeSummaryKindValues ¶
func PossibleChargeSummaryKindValues() []ChargeSummaryKind
PossibleChargeSummaryKindValues returns the possible values for the ChargeSummaryKind const type.
type ChargesClient ¶
type ChargesClient struct {
// contains filtered or unexported fields
}
ChargesClient contains the methods for the Charges group. Don't use this type directly, use NewChargesClient() instead.
func NewChargesClient ¶
func NewChargesClient(credential azcore.TokenCredential, options *arm.ClientOptions) (*ChargesClient, error)
NewChargesClient creates a new instance of ChargesClient with the specified values. credential - used to authorize requests. Usually a credential from azidentity. options - pass nil to accept the default values.
func (*ChargesClient) List ¶
func (client *ChargesClient) List(ctx context.Context, scope string, options *ChargesClientListOptions) (ChargesClientListResponse, error)
List - Lists the charges based for the defined scope. If the operation fails it returns an *azcore.ResponseError type. scope - The scope associated with charges operations. This includes '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/departments/{departmentId}' for Department scope, and '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/enrollmentAccounts/{enrollmentAccountId}' for EnrollmentAccount scope. For department and enrollment accounts, you can also add billing period to the scope using '/providers/Microsoft.Billing/billingPeriods/{billingPeriodName}'. For e.g. to specify billing period at department scope use '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/departments/{departmentId}/providers/Microsoft.Billing/billingPeriods/{billingPeriodName}'. 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 - ChargesClientListOptions contains the optional parameters for the ChargesClient.List method.
Example ¶
Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/consumption/resource-manager/Microsoft.Consumption/stable/2021-10-01/examples/ChargesForBillingPeriodByDepartment.json
package main import ( "context" "log" "github.com/Azure/azure-sdk-for-go/sdk/azidentity" "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/consumption/armconsumption" ) func main() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) return } ctx := context.Background() client, err := armconsumption.NewChargesClient(cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) return } res, err := client.List(ctx, "<scope>", &armconsumption.ChargesClientListOptions{StartDate: nil, EndDate: nil, Filter: nil, Apply: nil, }) if err != nil { log.Fatalf("failed to finish the request: %v", err) return } // TODO: use response item _ = res }
Output:
type ChargesClientListOptions ¶ added in v0.3.0
type ChargesClientListOptions struct { // May be used to group charges for billingAccount scope by properties/billingProfileId, properties/invoiceSectionId, properties/customerId // (specific for Partner Led), or for billingProfile scope by // properties/invoiceSectionId. Apply *string // End date EndDate *string // May be used to filter charges by properties/usageEnd (Utc time), properties/usageStart (Utc time). The filter supports // 'eq', 'lt', 'gt', 'le', 'ge', and 'and'. It does not currently support 'ne', // 'or', or 'not'. Tag filter is a key value pair string where key and value is separated by a colon (:). Filter *string // Start date StartDate *string }
ChargesClientListOptions contains the optional parameters for the ChargesClient.List method.
type ChargesClientListResponse ¶ added in v0.3.0
type ChargesClientListResponse struct {
ChargesListResult
}
ChargesClientListResponse contains the response from method ChargesClient.List.
type ChargesListResult ¶
type ChargesListResult struct { // READ-ONLY; The list of charge summary Value []ChargeSummaryClassification `json:"value,omitempty" azure:"ro"` }
ChargesListResult - Result of listing charge summary.
func (ChargesListResult) MarshalJSON ¶
func (c ChargesListResult) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type ChargesListResult.
func (*ChargesListResult) UnmarshalJSON ¶
func (c *ChargesListResult) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type ChargesListResult.
type CreditBalanceSummary ¶
type CreditBalanceSummary struct { // READ-ONLY; Current balance. CurrentBalance *Amount `json:"currentBalance,omitempty" azure:"ro"` // READ-ONLY; Estimated balance. EstimatedBalance *Amount `json:"estimatedBalance,omitempty" azure:"ro"` // READ-ONLY; Estimated balance in billing currency. EstimatedBalanceInBillingCurrency *AmountWithExchangeRate `json:"estimatedBalanceInBillingCurrency,omitempty" azure:"ro"` }
CreditBalanceSummary - Summary of credit balances.
type CreditSummary ¶
type CreditSummary struct { // The properties of the credit summary. Properties *CreditSummaryProperties `json:"properties,omitempty"` // READ-ONLY; The etag for the resource. Etag *string `json:"etag,omitempty" azure:"ro"` // READ-ONLY; The full qualified ARM ID of an event. ID *string `json:"id,omitempty" azure:"ro"` // READ-ONLY; The ID that uniquely identifies an event. 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"` }
CreditSummary - A credit summary resource.
func (CreditSummary) MarshalJSON ¶
func (c CreditSummary) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type CreditSummary.
type CreditSummaryProperties ¶
type CreditSummaryProperties struct { // READ-ONLY; Summary of balances associated with this credit summary. BalanceSummary *CreditBalanceSummary `json:"balanceSummary,omitempty" azure:"ro"` // READ-ONLY; The billing currency. BillingCurrency *string `json:"billingCurrency,omitempty" azure:"ro"` // READ-ONLY; The credit currency. CreditCurrency *string `json:"creditCurrency,omitempty" azure:"ro"` // READ-ONLY; The eTag for the resource. ETag *string `json:"eTag,omitempty" azure:"ro"` // READ-ONLY; Expired credit. ExpiredCredit *Amount `json:"expiredCredit,omitempty" azure:"ro"` // READ-ONLY; Pending credit adjustments. PendingCreditAdjustments *Amount `json:"pendingCreditAdjustments,omitempty" azure:"ro"` // READ-ONLY; Pending eligible charges. PendingEligibleCharges *Amount `json:"pendingEligibleCharges,omitempty" azure:"ro"` // READ-ONLY; Credit's reseller. Reseller *Reseller `json:"reseller,omitempty" azure:"ro"` }
CreditSummaryProperties - The properties of the credit summary.
type CreditsClient ¶
type CreditsClient struct {
// contains filtered or unexported fields
}
CreditsClient contains the methods for the Credits group. Don't use this type directly, use NewCreditsClient() instead.
func NewCreditsClient ¶
func NewCreditsClient(credential azcore.TokenCredential, options *arm.ClientOptions) (*CreditsClient, error)
NewCreditsClient creates a new instance of CreditsClient with the specified values. credential - used to authorize requests. Usually a credential from azidentity. options - pass nil to accept the default values.
func (*CreditsClient) Get ¶
func (client *CreditsClient) Get(ctx context.Context, billingAccountID string, billingProfileID string, options *CreditsClientGetOptions) (CreditsClientGetResponse, error)
Get - The credit summary by billingAccountId and billingProfileId. If the operation fails it returns an *azcore.ResponseError type. billingAccountID - BillingAccount ID billingProfileID - Azure Billing Profile ID. options - CreditsClientGetOptions contains the optional parameters for the CreditsClient.Get method.
Example ¶
Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/consumption/resource-manager/Microsoft.Consumption/stable/2021-10-01/examples/CreditSummaryByBillingProfile.json
package main import ( "context" "log" "github.com/Azure/azure-sdk-for-go/sdk/azidentity" "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/consumption/armconsumption" ) func main() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) return } ctx := context.Background() client, err := armconsumption.NewCreditsClient(cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) return } res, err := client.Get(ctx, "<billing-account-id>", "<billing-profile-id>", nil) if err != nil { log.Fatalf("failed to finish the request: %v", err) return } // TODO: use response item _ = res }
Output:
type CreditsClientGetOptions ¶ added in v0.3.0
type CreditsClientGetOptions struct { }
CreditsClientGetOptions contains the optional parameters for the CreditsClient.Get method.
type CreditsClientGetResponse ¶ added in v0.3.0
type CreditsClientGetResponse struct {
CreditSummary
}
CreditsClientGetResponse contains the response from method CreditsClient.Get.
type CultureCode ¶ added in v0.3.0
type CultureCode string
CultureCode - Language in which the recipient will receive the notification
const ( CultureCodeCsCz CultureCode = "cs-cz" CultureCodeDaDk CultureCode = "da-dk" CultureCodeDeDe CultureCode = "de-de" CultureCodeEnGb CultureCode = "en-gb" CultureCodeEnUs CultureCode = "en-us" CultureCodeEsEs CultureCode = "es-es" CultureCodeFrFr CultureCode = "fr-fr" CultureCodeHuHu CultureCode = "hu-hu" CultureCodeItIt CultureCode = "it-it" CultureCodeJaJp CultureCode = "ja-jp" CultureCodeKoKr CultureCode = "ko-kr" CultureCodeNbNo CultureCode = "nb-no" CultureCodeNlNl CultureCode = "nl-nl" CultureCodePlPl CultureCode = "pl-pl" CultureCodePtBr CultureCode = "pt-br" CultureCodePtPt CultureCode = "pt-pt" CultureCodeRuRu CultureCode = "ru-ru" CultureCodeSvSe CultureCode = "sv-se" CultureCodeTrTr CultureCode = "tr-tr" CultureCodeZhCn CultureCode = "zh-cn" CultureCodeZhTw CultureCode = "zh-tw" )
func PossibleCultureCodeValues ¶ added in v0.3.0
func PossibleCultureCodeValues() []CultureCode
PossibleCultureCodeValues returns the possible values for the CultureCode const type.
type CurrentSpend ¶
type CurrentSpend struct { // READ-ONLY; The total amount of cost which is being tracked by the budget. Amount *float64 `json:"amount,omitempty" azure:"ro"` // READ-ONLY; The unit of measure for the budget amount. Unit *string `json:"unit,omitempty" azure:"ro"` }
CurrentSpend - The current amount of cost which is being tracked for a budget.
type Datagrain ¶
type Datagrain string
func PossibleDatagrainValues ¶
func PossibleDatagrainValues() []Datagrain
PossibleDatagrainValues returns the possible values for the Datagrain const type.
type DownloadProperties ¶
type DownloadProperties struct { // READ-ONLY; The link (url) to download the pricesheet. DownloadURL *string `json:"downloadUrl,omitempty" azure:"ro"` // READ-ONLY; Download link validity. ValidTill *string `json:"validTill,omitempty" azure:"ro"` }
DownloadProperties - The properties of the price sheet download.
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 EventProperties ¶
type EventProperties struct { // Identifies the type of the event. EventType *EventType `json:"eventType,omitempty"` // READ-ONLY; The amount of balance adjustment. The property is not available for ConsumptionCommitment lots. Adjustments *Amount `json:"adjustments,omitempty" azure:"ro"` // READ-ONLY; The amount of balance adjustment in billing currency. AdjustmentsInBillingCurrency *AmountWithExchangeRate `json:"adjustmentsInBillingCurrency,omitempty" azure:"ro"` // READ-ONLY; The billing currency of the event. BillingCurrency *string `json:"billingCurrency,omitempty" azure:"ro"` // READ-ONLY; The display name of the billing profile for which the event happened. The property is only available for billing // account of type MicrosoftCustomerAgreement. BillingProfileDisplayName *string `json:"billingProfileDisplayName,omitempty" azure:"ro"` // READ-ONLY; The ID that uniquely identifies the billing profile for which the event happened. The property is only available // for billing account of type MicrosoftCustomerAgreement. BillingProfileID *string `json:"billingProfileId,omitempty" azure:"ro"` // READ-ONLY; Amount of canceled credit. CanceledCredit *Amount `json:"canceledCredit,omitempty" azure:"ro"` // READ-ONLY; The amount of charges for events of type SettleCharges and PendingEligibleCharges. Charges *Amount `json:"charges,omitempty" azure:"ro"` // READ-ONLY; The amount of charges for events of type SettleCharges and PendingEligibleCharges in billing currency. ChargesInBillingCurrency *AmountWithExchangeRate `json:"chargesInBillingCurrency,omitempty" azure:"ro"` // READ-ONLY; The balance after the event. ClosedBalance *Amount `json:"closedBalance,omitempty" azure:"ro"` // READ-ONLY; The balance in billing currency after the event. ClosedBalanceInBillingCurrency *AmountWithExchangeRate `json:"closedBalanceInBillingCurrency,omitempty" azure:"ro"` // READ-ONLY; The credit currency of the event. CreditCurrency *string `json:"creditCurrency,omitempty" azure:"ro"` // READ-ONLY; The amount of expired credit or commitment for NewCredit or SettleCharges event. CreditExpired *Amount `json:"creditExpired,omitempty" azure:"ro"` // READ-ONLY; The amount of expired credit or commitment for NewCredit or SettleCharges event in billing currency. CreditExpiredInBillingCurrency *AmountWithExchangeRate `json:"creditExpiredInBillingCurrency,omitempty" azure:"ro"` // READ-ONLY; The description of the event. Description *string `json:"description,omitempty" azure:"ro"` // READ-ONLY; The eTag for the resource. ETag *string `json:"eTag,omitempty" azure:"ro"` // READ-ONLY; The number which uniquely identifies the invoice on which the event was billed. This will be empty for unbilled // events. InvoiceNumber *string `json:"invoiceNumber,omitempty" azure:"ro"` // READ-ONLY; The ID that uniquely identifies the lot for which the event happened. LotID *string `json:"lotId,omitempty" azure:"ro"` // READ-ONLY; Identifies the source of the lot for which the event happened. LotSource *string `json:"lotSource,omitempty" azure:"ro"` // READ-ONLY; The amount of new credit or commitment for NewCredit or SettleCharges event. NewCredit *Amount `json:"newCredit,omitempty" azure:"ro"` // READ-ONLY; The amount of new credit or commitment for NewCredit or SettleCharges event in billing currency. NewCreditInBillingCurrency *AmountWithExchangeRate `json:"newCreditInBillingCurrency,omitempty" azure:"ro"` // READ-ONLY; The reseller of the event. Reseller *Reseller `json:"reseller,omitempty" azure:"ro"` // READ-ONLY; The date of the event. TransactionDate *time.Time `json:"transactionDate,omitempty" azure:"ro"` }
EventProperties - The event properties.
func (EventProperties) MarshalJSON ¶
func (e EventProperties) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type EventProperties.
func (*EventProperties) UnmarshalJSON ¶
func (e *EventProperties) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type EventProperties.
type EventSummary ¶
type EventSummary 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 event properties. Properties *EventProperties `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"` }
EventSummary - An event summary resource.
type EventType ¶
type EventType string
EventType - Identifies the type of the event.
const ( EventTypeNewCredit EventType = "NewCredit" EventTypePendingAdjustments EventType = "PendingAdjustments" EventTypePendingCharges EventType = "PendingCharges" EventTypePendingExpiredCredit EventType = "PendingExpiredCredit" EventTypePendingNewCredit EventType = "PendingNewCredit" EventTypeSettledCharges EventType = "SettledCharges" EventTypeUnKnown EventType = "UnKnown" )
func PossibleEventTypeValues ¶
func PossibleEventTypeValues() []EventType
PossibleEventTypeValues returns the possible values for the EventType const type.
type Events ¶
type Events struct { // READ-ONLY; The link (url) to the next page of results. NextLink *string `json:"nextLink,omitempty" azure:"ro"` // READ-ONLY; The list of event summary. Value []*EventSummary `json:"value,omitempty" azure:"ro"` }
Events - Result of listing event summary.
func (Events) MarshalJSON ¶
MarshalJSON implements the json.Marshaller interface for type Events.
type EventsClient ¶
type EventsClient struct {
// contains filtered or unexported fields
}
EventsClient contains the methods for the Events group. Don't use this type directly, use NewEventsClient() instead.
func NewEventsClient ¶
func NewEventsClient(credential azcore.TokenCredential, options *arm.ClientOptions) (*EventsClient, error)
NewEventsClient creates a new instance of EventsClient with the specified values. credential - used to authorize requests. Usually a credential from azidentity. options - pass nil to accept the default values.
func (*EventsClient) NewListByBillingAccountPager ¶ added in v0.5.0
func (client *EventsClient) NewListByBillingAccountPager(billingAccountID string, options *EventsClientListByBillingAccountOptions) *runtime.Pager[EventsClientListByBillingAccountResponse]
NewListByBillingAccountPager - Lists the events that decrements Azure credits or Microsoft Azure consumption commitment for a billing account or a billing profile for a given start and end date. If the operation fails it returns an *azcore.ResponseError type. billingAccountID - BillingAccount ID options - EventsClientListByBillingAccountOptions contains the optional parameters for the EventsClient.ListByBillingAccount method.
Example ¶
Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/consumption/resource-manager/Microsoft.Consumption/stable/2021-10-01/examples/EventsGetByBillingAccount.json
package main import ( "context" "log" "github.com/Azure/azure-sdk-for-go/sdk/azidentity" "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/consumption/armconsumption" ) func main() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) return } ctx := context.Background() client, err := armconsumption.NewEventsClient(cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) return } pager := client.NewListByBillingAccountPager("<billing-account-id>", &armconsumption.EventsClientListByBillingAccountOptions{Filter: nil}) for pager.More() { nextResult, err := pager.NextPage(ctx) if err != nil { log.Fatalf("failed to advance page: %v", err) return } for _, v := range nextResult.Value { // TODO: use page item _ = v } } }
Output:
func (*EventsClient) NewListByBillingProfilePager ¶ added in v0.5.0
func (client *EventsClient) NewListByBillingProfilePager(billingAccountID string, billingProfileID string, startDate string, endDate string, options *EventsClientListByBillingProfileOptions) *runtime.Pager[EventsClientListByBillingProfileResponse]
NewListByBillingProfilePager - Lists the events that decrements Azure credits or Microsoft Azure consumption commitment for a billing account or a billing profile for a given start and end date. If the operation fails it returns an *azcore.ResponseError type. billingAccountID - BillingAccount ID billingProfileID - Azure Billing Profile ID. startDate - Start date endDate - End date options - EventsClientListByBillingProfileOptions contains the optional parameters for the EventsClient.ListByBillingProfile method.
Example ¶
Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/consumption/resource-manager/Microsoft.Consumption/stable/2021-10-01/examples/EventsListByBillingProfile.json
package main import ( "context" "log" "github.com/Azure/azure-sdk-for-go/sdk/azidentity" "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/consumption/armconsumption" ) func main() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) return } ctx := context.Background() client, err := armconsumption.NewEventsClient(cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) return } pager := client.NewListByBillingProfilePager("<billing-account-id>", "<billing-profile-id>", "<start-date>", "<end-date>", nil) for pager.More() { nextResult, err := pager.NextPage(ctx) if err != nil { log.Fatalf("failed to advance page: %v", err) return } for _, v := range nextResult.Value { // TODO: use page item _ = v } } }
Output:
type EventsClientListByBillingAccountOptions ¶ added in v0.3.0
type EventsClientListByBillingAccountOptions struct { // May be used to filter the events by lotId, lotSource etc. The filter supports 'eq', 'lt', 'gt', 'le', 'ge', and 'and'. // It does not currently support 'ne', 'or', or 'not'. Tag filter is a key value // pair string where key and value is separated by a colon (:). Filter *string }
EventsClientListByBillingAccountOptions contains the optional parameters for the EventsClient.ListByBillingAccount method.
type EventsClientListByBillingAccountResponse ¶ added in v0.3.0
type EventsClientListByBillingAccountResponse struct {
Events
}
EventsClientListByBillingAccountResponse contains the response from method EventsClient.ListByBillingAccount.
type EventsClientListByBillingProfileOptions ¶ added in v0.3.0
type EventsClientListByBillingProfileOptions struct { }
EventsClientListByBillingProfileOptions contains the optional parameters for the EventsClient.ListByBillingProfile method.
type EventsClientListByBillingProfileResponse ¶ added in v0.3.0
type EventsClientListByBillingProfileResponse struct {
Events
}
EventsClientListByBillingProfileResponse contains the response from method EventsClient.ListByBillingProfile.
type ForecastSpend ¶
type ForecastSpend struct { // READ-ONLY; The forecasted cost for the total time period which is being tracked by the budget. This value is only provided // if the budget contains a forecast alert type. Amount *float64 `json:"amount,omitempty" azure:"ro"` // READ-ONLY; The unit of measure for the budget amount. Unit *string `json:"unit,omitempty" azure:"ro"` }
ForecastSpend - The forecasted cost which is being tracked for a budget.
type HighCasedErrorDetails ¶
type HighCasedErrorDetails 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"` }
HighCasedErrorDetails - The details of the error.
type HighCasedErrorResponse ¶
type HighCasedErrorResponse struct { // The details of the error. Error *HighCasedErrorDetails `json:"error,omitempty"` }
HighCasedErrorResponse - 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 LegacyChargeSummary ¶
type LegacyChargeSummary struct { // REQUIRED; Specifies the kind of charge summary. Kind *ChargeSummaryKind `json:"kind,omitempty"` // REQUIRED; Properties for legacy charge summary Properties *LegacyChargeSummaryProperties `json:"properties,omitempty"` // 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"` }
LegacyChargeSummary - Legacy charge summary.
func (*LegacyChargeSummary) GetChargeSummary ¶ added in v0.3.0
func (l *LegacyChargeSummary) GetChargeSummary() *ChargeSummary
GetChargeSummary implements the ChargeSummaryClassification interface for type LegacyChargeSummary.
func (LegacyChargeSummary) MarshalJSON ¶
func (l LegacyChargeSummary) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type LegacyChargeSummary.
func (*LegacyChargeSummary) UnmarshalJSON ¶
func (l *LegacyChargeSummary) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type LegacyChargeSummary.
type LegacyChargeSummaryProperties ¶
type LegacyChargeSummaryProperties struct { // READ-ONLY; Azure Charges. AzureCharges *float64 `json:"azureCharges,omitempty" azure:"ro"` // READ-ONLY; The id of the billing period resource that the charge belongs to. BillingPeriodID *string `json:"billingPeriodId,omitempty" azure:"ro"` // READ-ONLY; Charges Billed separately. ChargesBilledSeparately *float64 `json:"chargesBilledSeparately,omitempty" azure:"ro"` // READ-ONLY; Currency Code Currency *string `json:"currency,omitempty" azure:"ro"` // READ-ONLY; Marketplace Charges. MarketplaceCharges *float64 `json:"marketplaceCharges,omitempty" azure:"ro"` // READ-ONLY; Usage end date. UsageEnd *string `json:"usageEnd,omitempty" azure:"ro"` // READ-ONLY; Usage start date. UsageStart *string `json:"usageStart,omitempty" azure:"ro"` }
LegacyChargeSummaryProperties - The properties of legacy charge summary.
type LegacyReservationRecommendation ¶
type LegacyReservationRecommendation struct { // REQUIRED; Specifies the kind of reservation recommendation. Kind *ReservationRecommendationKind `json:"kind,omitempty"` // REQUIRED; Properties for legacy reservation recommendation Properties LegacyReservationRecommendationPropertiesClassification `json:"properties,omitempty"` // READ-ONLY; The etag for the resource. Etag *string `json:"etag,omitempty" azure:"ro"` // READ-ONLY; The full qualified ARM ID of an event. ID *string `json:"id,omitempty" azure:"ro"` // READ-ONLY; Resource location Location *string `json:"location,omitempty" azure:"ro"` // READ-ONLY; The ID that uniquely identifies an event. Name *string `json:"name,omitempty" azure:"ro"` // READ-ONLY; Resource sku 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"` }
LegacyReservationRecommendation - Legacy reservation recommendation.
func (*LegacyReservationRecommendation) GetReservationRecommendation ¶ added in v0.3.0
func (l *LegacyReservationRecommendation) GetReservationRecommendation() *ReservationRecommendation
GetReservationRecommendation implements the ReservationRecommendationClassification interface for type LegacyReservationRecommendation.
func (LegacyReservationRecommendation) MarshalJSON ¶
func (l LegacyReservationRecommendation) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type LegacyReservationRecommendation.
func (*LegacyReservationRecommendation) UnmarshalJSON ¶
func (l *LegacyReservationRecommendation) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type LegacyReservationRecommendation.
type LegacyReservationRecommendationProperties ¶
type LegacyReservationRecommendationProperties struct { // REQUIRED; Shared or single recommendation. Scope *string `json:"scope,omitempty"` // READ-ONLY; The total amount of cost without reserved instances. CostWithNoReservedInstances *float64 `json:"costWithNoReservedInstances,omitempty" azure:"ro"` // READ-ONLY; The usage date for looking back. FirstUsageDate *time.Time `json:"firstUsageDate,omitempty" azure:"ro"` // READ-ONLY; The instance Flexibility Group. InstanceFlexibilityGroup *string `json:"instanceFlexibilityGroup,omitempty" azure:"ro"` // READ-ONLY; The instance Flexibility Ratio. InstanceFlexibilityRatio *float32 `json:"instanceFlexibilityRatio,omitempty" azure:"ro"` // READ-ONLY; The number of days of usage to look back for recommendation. LookBackPeriod *string `json:"lookBackPeriod,omitempty" azure:"ro"` // READ-ONLY; The meter id (GUID) MeterID *string `json:"meterId,omitempty" azure:"ro"` // READ-ONLY; Total estimated savings with reserved instances. NetSavings *float64 `json:"netSavings,omitempty" azure:"ro"` // READ-ONLY; The normalized Size. NormalizedSize *string `json:"normalizedSize,omitempty" azure:"ro"` // READ-ONLY; Recommended quality for reserved instances. RecommendedQuantity *float64 `json:"recommendedQuantity,omitempty" azure:"ro"` // READ-ONLY; The recommended Quantity Normalized. RecommendedQuantityNormalized *float32 `json:"recommendedQuantityNormalized,omitempty" azure:"ro"` // READ-ONLY; The azure resource type. ResourceType *string `json:"resourceType,omitempty" azure:"ro"` // READ-ONLY; List of sku properties SKUProperties []*SKUProperty `json:"skuProperties,omitempty" azure:"ro"` // READ-ONLY; RI recommendations in one or three year terms. Term *string `json:"term,omitempty" azure:"ro"` // READ-ONLY; The total amount of cost with reserved instances. TotalCostWithReservedInstances *float64 `json:"totalCostWithReservedInstances,omitempty" azure:"ro"` }
LegacyReservationRecommendationProperties - The properties of the reservation recommendation.
func (*LegacyReservationRecommendationProperties) GetLegacyReservationRecommendationProperties ¶ added in v0.3.0
func (l *LegacyReservationRecommendationProperties) GetLegacyReservationRecommendationProperties() *LegacyReservationRecommendationProperties
GetLegacyReservationRecommendationProperties implements the LegacyReservationRecommendationPropertiesClassification interface for type LegacyReservationRecommendationProperties.
func (LegacyReservationRecommendationProperties) MarshalJSON ¶
func (l LegacyReservationRecommendationProperties) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type LegacyReservationRecommendationProperties.
func (*LegacyReservationRecommendationProperties) UnmarshalJSON ¶
func (l *LegacyReservationRecommendationProperties) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type LegacyReservationRecommendationProperties.
type LegacyReservationRecommendationPropertiesClassification ¶ added in v0.3.0
type LegacyReservationRecommendationPropertiesClassification interface { // GetLegacyReservationRecommendationProperties returns the LegacyReservationRecommendationProperties content of the underlying type. GetLegacyReservationRecommendationProperties() *LegacyReservationRecommendationProperties }
LegacyReservationRecommendationPropertiesClassification provides polymorphic access to related types. Call the interface's GetLegacyReservationRecommendationProperties() method to access the common type. Use a type switch to determine the concrete type. The possible types are: - *LegacyReservationRecommendationProperties, *LegacySharedScopeReservationRecommendationProperties, *LegacySingleScopeReservationRecommendationProperties
type LegacyReservationTransaction ¶
type LegacyReservationTransaction struct { // The properties of a legacy reservation transaction. Properties *LegacyReservationTransactionProperties `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 tags. Tags []*string `json:"tags,omitempty" azure:"ro"` // READ-ONLY; Resource type. Type *string `json:"type,omitempty" azure:"ro"` }
LegacyReservationTransaction - Legacy Reservation transaction resource.
func (LegacyReservationTransaction) MarshalJSON ¶ added in v0.3.0
func (l LegacyReservationTransaction) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type LegacyReservationTransaction.
type LegacyReservationTransactionProperties ¶
type LegacyReservationTransactionProperties struct { // READ-ONLY; The name of the account that makes the transaction. AccountName *string `json:"accountName,omitempty" azure:"ro"` // READ-ONLY; The email of the account owner that makes the transaction. AccountOwnerEmail *string `json:"accountOwnerEmail,omitempty" azure:"ro"` // READ-ONLY; The charge of the transaction. Amount *float64 `json:"amount,omitempty" azure:"ro"` // READ-ONLY; This is the ARM Sku name. It can be used to join with the serviceType field in additional info in usage records. ArmSKUName *string `json:"armSkuName,omitempty" azure:"ro"` // READ-ONLY; The billing frequency, which can be either one-time or recurring. BillingFrequency *string `json:"billingFrequency,omitempty" azure:"ro"` // READ-ONLY; The billing month(yyyyMMdd), on which the event initiated. BillingMonth *int32 `json:"billingMonth,omitempty" azure:"ro"` // READ-ONLY; The cost center of this department if it is a department and a cost center is provided. CostCenter *string `json:"costCenter,omitempty" azure:"ro"` // READ-ONLY; The ISO currency in which the transaction is charged, for example, USD. Currency *string `json:"currency,omitempty" azure:"ro"` // READ-ONLY; The current enrollment. CurrentEnrollment *string `json:"currentEnrollment,omitempty" azure:"ro"` // READ-ONLY; The department name. DepartmentName *string `json:"departmentName,omitempty" azure:"ro"` // READ-ONLY; The description of the transaction. Description *string `json:"description,omitempty" azure:"ro"` // READ-ONLY; The date of the transaction EventDate *time.Time `json:"eventDate,omitempty" azure:"ro"` // READ-ONLY; The type of the transaction (Purchase, Cancel, etc.) EventType *string `json:"eventType,omitempty" azure:"ro"` // READ-ONLY; The monetary commitment amount at the enrollment scope. MonetaryCommitment *float64 `json:"monetaryCommitment,omitempty" azure:"ro"` // READ-ONLY; The overage amount at the enrollment scope. Overage *float64 `json:"overage,omitempty" azure:"ro"` // READ-ONLY; The purchasing enrollment. PurchasingEnrollment *string `json:"purchasingEnrollment,omitempty" azure:"ro"` // READ-ONLY; The subscription guid that makes the transaction. PurchasingSubscriptionGUID *string `json:"purchasingSubscriptionGuid,omitempty" azure:"ro"` // READ-ONLY; The subscription name that makes the transaction. PurchasingSubscriptionName *string `json:"purchasingSubscriptionName,omitempty" azure:"ro"` // READ-ONLY; The quantity of the transaction. Quantity *float64 `json:"quantity,omitempty" azure:"ro"` // READ-ONLY; The region of the transaction. Region *string `json:"region,omitempty" azure:"ro"` // READ-ONLY; The reservation order ID is the identifier for a reservation purchase. Each reservation order ID represents // a single purchase transaction. A reservation order contains reservations. The reservation // order specifies the VM size and region for the reservations. ReservationOrderID *string `json:"reservationOrderId,omitempty" azure:"ro"` // READ-ONLY; The name of the reservation order. ReservationOrderName *string `json:"reservationOrderName,omitempty" azure:"ro"` // READ-ONLY; This is the term of the transaction. Term *string `json:"term,omitempty" azure:"ro"` }
LegacyReservationTransactionProperties - The properties of a legacy reservation transaction.
func (LegacyReservationTransactionProperties) MarshalJSON ¶
func (l LegacyReservationTransactionProperties) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type LegacyReservationTransactionProperties.
func (*LegacyReservationTransactionProperties) UnmarshalJSON ¶
func (l *LegacyReservationTransactionProperties) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type LegacyReservationTransactionProperties.
type LegacySharedScopeReservationRecommendationProperties ¶ added in v0.3.0
type LegacySharedScopeReservationRecommendationProperties struct { string `json:"scope,omitempty"` CostWithNoReservedInstances *float64 `json:"costWithNoReservedInstances,omitempty" azure:"ro"` FirstUsageDate *time.Time `json:"firstUsageDate,omitempty" azure:"ro"` InstanceFlexibilityGroup *string `json:"instanceFlexibilityGroup,omitempty" azure:"ro"` InstanceFlexibilityRatio *float32 `json:"instanceFlexibilityRatio,omitempty" azure:"ro"` LookBackPeriod *string `json:"lookBackPeriod,omitempty" azure:"ro"` MeterID *string `json:"meterId,omitempty" azure:"ro"` NetSavings *float64 `json:"netSavings,omitempty" azure:"ro"` NormalizedSize *string `json:"normalizedSize,omitempty" azure:"ro"` RecommendedQuantity *float64 `json:"recommendedQuantity,omitempty" azure:"ro"` RecommendedQuantityNormalized *float32 `json:"recommendedQuantityNormalized,omitempty" azure:"ro"` ResourceType *string `json:"resourceType,omitempty" azure:"ro"` SKUProperties []*SKUProperty `json:"skuProperties,omitempty" azure:"ro"` Term *string `json:"term,omitempty" azure:"ro"` TotalCostWithReservedInstances *float64 `json:"totalCostWithReservedInstances,omitempty" azure:"ro"` }Scope *
LegacySharedScopeReservationRecommendationProperties - The properties of the legacy reservation recommendation for shared scope.
func (*LegacySharedScopeReservationRecommendationProperties) GetLegacyReservationRecommendationProperties ¶ added in v0.3.0
func (l *LegacySharedScopeReservationRecommendationProperties) GetLegacyReservationRecommendationProperties() *LegacyReservationRecommendationProperties
GetLegacyReservationRecommendationProperties implements the LegacyReservationRecommendationPropertiesClassification interface for type LegacySharedScopeReservationRecommendationProperties.
func (LegacySharedScopeReservationRecommendationProperties) MarshalJSON ¶ added in v0.3.0
func (l LegacySharedScopeReservationRecommendationProperties) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type LegacySharedScopeReservationRecommendationProperties.
func (*LegacySharedScopeReservationRecommendationProperties) UnmarshalJSON ¶ added in v0.3.0
func (l *LegacySharedScopeReservationRecommendationProperties) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type LegacySharedScopeReservationRecommendationProperties.
type LegacySingleScopeReservationRecommendationProperties ¶ added in v0.3.0
type LegacySingleScopeReservationRecommendationProperties struct { // REQUIRED; Shared or single recommendation. Scope *string `json:"scope,omitempty"` // READ-ONLY; The total amount of cost without reserved instances. CostWithNoReservedInstances *float64 `json:"costWithNoReservedInstances,omitempty" azure:"ro"` // READ-ONLY; The usage date for looking back. FirstUsageDate *time.Time `json:"firstUsageDate,omitempty" azure:"ro"` // READ-ONLY; The instance Flexibility Group. InstanceFlexibilityGroup *string `json:"instanceFlexibilityGroup,omitempty" azure:"ro"` // READ-ONLY; The instance Flexibility Ratio. InstanceFlexibilityRatio *float32 `json:"instanceFlexibilityRatio,omitempty" azure:"ro"` // READ-ONLY; The number of days of usage to look back for recommendation. LookBackPeriod *string `json:"lookBackPeriod,omitempty" azure:"ro"` // READ-ONLY; The meter id (GUID) MeterID *string `json:"meterId,omitempty" azure:"ro"` // READ-ONLY; Total estimated savings with reserved instances. NetSavings *float64 `json:"netSavings,omitempty" azure:"ro"` // READ-ONLY; The normalized Size. NormalizedSize *string `json:"normalizedSize,omitempty" azure:"ro"` // READ-ONLY; Recommended quality for reserved instances. RecommendedQuantity *float64 `json:"recommendedQuantity,omitempty" azure:"ro"` // READ-ONLY; The recommended Quantity Normalized. RecommendedQuantityNormalized *float32 `json:"recommendedQuantityNormalized,omitempty" azure:"ro"` // READ-ONLY; The azure resource type. ResourceType *string `json:"resourceType,omitempty" azure:"ro"` // READ-ONLY; List of sku properties SKUProperties []*SKUProperty `json:"skuProperties,omitempty" azure:"ro"` // READ-ONLY; Subscription id associated with single scoped recommendation. SubscriptionID *string `json:"subscriptionId,omitempty" azure:"ro"` // READ-ONLY; RI recommendations in one or three year terms. Term *string `json:"term,omitempty" azure:"ro"` // READ-ONLY; The total amount of cost with reserved instances. TotalCostWithReservedInstances *float64 `json:"totalCostWithReservedInstances,omitempty" azure:"ro"` }
LegacySingleScopeReservationRecommendationProperties - The properties of the legacy reservation recommendation for single scope.
func (*LegacySingleScopeReservationRecommendationProperties) GetLegacyReservationRecommendationProperties ¶ added in v0.3.0
func (l *LegacySingleScopeReservationRecommendationProperties) GetLegacyReservationRecommendationProperties() *LegacyReservationRecommendationProperties
GetLegacyReservationRecommendationProperties implements the LegacyReservationRecommendationPropertiesClassification interface for type LegacySingleScopeReservationRecommendationProperties.
func (LegacySingleScopeReservationRecommendationProperties) MarshalJSON ¶ added in v0.3.0
func (l LegacySingleScopeReservationRecommendationProperties) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type LegacySingleScopeReservationRecommendationProperties.
func (*LegacySingleScopeReservationRecommendationProperties) UnmarshalJSON ¶ added in v0.3.0
func (l *LegacySingleScopeReservationRecommendationProperties) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type LegacySingleScopeReservationRecommendationProperties.
type LegacyUsageDetail ¶
type LegacyUsageDetail struct { // REQUIRED; Specifies the kind of usage details. Kind *UsageDetailsKind `json:"kind,omitempty"` // REQUIRED; Properties for legacy usage details Properties *LegacyUsageDetailProperties `json:"properties,omitempty"` // READ-ONLY; The etag for the resource. Etag *string `json:"etag,omitempty" azure:"ro"` // READ-ONLY; The full qualified ARM ID of an event. ID *string `json:"id,omitempty" azure:"ro"` // READ-ONLY; The ID that uniquely identifies an event. 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"` }
LegacyUsageDetail - Legacy usage detail.
func (*LegacyUsageDetail) GetUsageDetail ¶ added in v0.3.0
func (l *LegacyUsageDetail) GetUsageDetail() *UsageDetail
GetUsageDetail implements the UsageDetailClassification interface for type LegacyUsageDetail.
func (LegacyUsageDetail) MarshalJSON ¶
func (l LegacyUsageDetail) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type LegacyUsageDetail.
func (*LegacyUsageDetail) UnmarshalJSON ¶
func (l *LegacyUsageDetail) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type LegacyUsageDetail.
type LegacyUsageDetailProperties ¶
type LegacyUsageDetailProperties struct { // READ-ONLY; Account Name. AccountName *string `json:"accountName,omitempty" azure:"ro"` // READ-ONLY; Account Owner Id. AccountOwnerID *string `json:"accountOwnerId,omitempty" azure:"ro"` // READ-ONLY; Additional details of this usage item. By default this is not populated, unless it's specified in $expand. Use // this field to get usage line item specific details such as the actual VM Size // (ServiceType) or the ratio in which the reservation discount is applied. AdditionalInfo *string `json:"additionalInfo,omitempty" azure:"ro"` // READ-ONLY; Unique identifier for the applicable benefit. BenefitID *string `json:"benefitId,omitempty" azure:"ro"` // READ-ONLY; Name of the applicable benefit. BenefitName *string `json:"benefitName,omitempty" azure:"ro"` // READ-ONLY; Billing Account identifier. BillingAccountID *string `json:"billingAccountId,omitempty" azure:"ro"` // READ-ONLY; Billing Account Name. BillingAccountName *string `json:"billingAccountName,omitempty" azure:"ro"` // READ-ONLY; Billing Currency. BillingCurrency *string `json:"billingCurrency,omitempty" azure:"ro"` // READ-ONLY; The billing period end date. BillingPeriodEndDate *time.Time `json:"billingPeriodEndDate,omitempty" azure:"ro"` // READ-ONLY; The billing period start date. BillingPeriodStartDate *time.Time `json:"billingPeriodStartDate,omitempty" azure:"ro"` // READ-ONLY; Billing Profile identifier. BillingProfileID *string `json:"billingProfileId,omitempty" azure:"ro"` // READ-ONLY; Billing Profile Name. BillingProfileName *string `json:"billingProfileName,omitempty" azure:"ro"` // READ-ONLY; Indicates a charge represents credits, usage, a Marketplace purchase, a reservation fee, or a refund. ChargeType *string `json:"chargeType,omitempty" azure:"ro"` // READ-ONLY; Consumed service name. Name of the azure resource provider that emits the usage or was purchased. This value // is not provided for marketplace usage. ConsumedService *string `json:"consumedService,omitempty" azure:"ro"` // READ-ONLY; The amount of cost before tax. Cost *float64 `json:"cost,omitempty" azure:"ro"` // READ-ONLY; The cost center of this department if it is a department and a cost center is provided. CostCenter *string `json:"costCenter,omitempty" azure:"ro"` // READ-ONLY; Date for the usage record. Date *time.Time `json:"date,omitempty" azure:"ro"` // READ-ONLY; Effective Price that's charged for the usage. EffectivePrice *float64 `json:"effectivePrice,omitempty" azure:"ro"` // READ-ONLY; Indicates how frequently this charge will occur. OneTime for purchases which only happen once, Monthly for fees // which recur every month, and UsageBased for charges based on how much a service is used. Frequency *string `json:"frequency,omitempty" azure:"ro"` // READ-ONLY; Invoice Section Name. InvoiceSection *string `json:"invoiceSection,omitempty" azure:"ro"` // READ-ONLY; Is Azure Credit Eligible. IsAzureCreditEligible *bool `json:"isAzureCreditEligible,omitempty" azure:"ro"` // READ-ONLY; The details about the meter. By default this is not populated, unless it's specified in $expand. MeterDetails *MeterDetailsResponse `json:"meterDetails,omitempty" azure:"ro"` // READ-ONLY; The meter id (GUID). Not available for marketplace. For reserved instance this represents the primary meter // for which the reservation was purchased. For the actual VM Size for which the reservation is // purchased see productOrderName. MeterID *string `json:"meterId,omitempty" azure:"ro"` // READ-ONLY; Offer Id. Ex: MS-AZR-0017P, MS-AZR-0148P. OfferID *string `json:"offerId,omitempty" azure:"ro"` // READ-ONLY; Part Number of the service used. Can be used to join with the price sheet. Not available for marketplace. PartNumber *string `json:"partNumber,omitempty" azure:"ro"` // READ-ONLY; Retail price for the resource. PayGPrice *float64 `json:"payGPrice,omitempty" azure:"ro"` // READ-ONLY; Plan Name. PlanName *string `json:"planName,omitempty" azure:"ro"` // READ-ONLY; Identifier that indicates how the meter is priced. PricingModel *PricingModelType `json:"pricingModel,omitempty" azure:"ro"` // READ-ONLY; Product name for the consumed service or purchase. Not available for Marketplace. Product *string `json:"product,omitempty" azure:"ro"` // READ-ONLY; Product Order Id. For reservations this is the Reservation Order ID. ProductOrderID *string `json:"productOrderId,omitempty" azure:"ro"` // READ-ONLY; Product Order Name. For reservations this is the SKU that was purchased. ProductOrderName *string `json:"productOrderName,omitempty" azure:"ro"` // READ-ONLY; Publisher Name. PublisherName *string `json:"publisherName,omitempty" azure:"ro"` // READ-ONLY; Publisher Type. PublisherType *string `json:"publisherType,omitempty" azure:"ro"` // READ-ONLY; The usage quantity. Quantity *float64 `json:"quantity,omitempty" azure:"ro"` // READ-ONLY; ARM resource id of the reservation. Only applies to records relevant to reservations. ReservationID *string `json:"reservationId,omitempty" azure:"ro"` // READ-ONLY; User provided display name of the reservation. Last known name for a particular day is populated in the daily // data. Only applies to records relevant to reservations. ReservationName *string `json:"reservationName,omitempty" azure:"ro"` // READ-ONLY; Resource Group Name. ResourceGroup *string `json:"resourceGroup,omitempty" azure:"ro"` // READ-ONLY; Unique identifier of the Azure Resource Manager usage detail resource. ResourceID *string `json:"resourceId,omitempty" azure:"ro"` // READ-ONLY; Resource Location. ResourceLocation *string `json:"resourceLocation,omitempty" azure:"ro"` // READ-ONLY; Resource Name. ResourceName *string `json:"resourceName,omitempty" azure:"ro"` // READ-ONLY; Service-specific metadata. ServiceInfo1 *string `json:"serviceInfo1,omitempty" azure:"ro"` // READ-ONLY; Legacy field with optional service-specific metadata. ServiceInfo2 *string `json:"serviceInfo2,omitempty" azure:"ro"` // READ-ONLY; Subscription guid. SubscriptionID *string `json:"subscriptionId,omitempty" azure:"ro"` // READ-ONLY; Subscription name. SubscriptionName *string `json:"subscriptionName,omitempty" azure:"ro"` // READ-ONLY; Term (in months). 1 month for monthly recurring purchase. 12 months for a 1 year reservation. 36 months for // a 3 year reservation. Term *string `json:"term,omitempty" azure:"ro"` // READ-ONLY; Unit Price is the price applicable to you. (your EA or other contract price). UnitPrice *float64 `json:"unitPrice,omitempty" azure:"ro"` }
LegacyUsageDetailProperties - The properties of the legacy usage detail.
func (LegacyUsageDetailProperties) MarshalJSON ¶
func (l LegacyUsageDetailProperties) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type LegacyUsageDetailProperties.
func (*LegacyUsageDetailProperties) UnmarshalJSON ¶
func (l *LegacyUsageDetailProperties) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type LegacyUsageDetailProperties.
type LookBackPeriod ¶
type LookBackPeriod string
const ( // LookBackPeriodLast07Days - Use 7 days of data for recommendations LookBackPeriodLast07Days LookBackPeriod = "Last7Days" // LookBackPeriodLast30Days - Use 30 days of data for recommendations LookBackPeriodLast30Days LookBackPeriod = "Last30Days" // LookBackPeriodLast60Days - Use 60 days of data for recommendations LookBackPeriodLast60Days LookBackPeriod = "Last60Days" )
func PossibleLookBackPeriodValues ¶
func PossibleLookBackPeriodValues() []LookBackPeriod
PossibleLookBackPeriodValues returns the possible values for the LookBackPeriod const type.
type LotProperties ¶
type LotProperties struct { // READ-ONLY; The billing currency of the lot. BillingCurrency *string `json:"billingCurrency,omitempty" azure:"ro"` // READ-ONLY; The balance as of the last invoice. ClosedBalance *Amount `json:"closedBalance,omitempty" azure:"ro"` // READ-ONLY; The balance as of the last invoice in billing currency. ClosedBalanceInBillingCurrency *AmountWithExchangeRate `json:"closedBalanceInBillingCurrency,omitempty" azure:"ro"` // READ-ONLY; The currency of the lot. CreditCurrency *string `json:"creditCurrency,omitempty" azure:"ro"` // READ-ONLY; The eTag for the resource. ETag *string `json:"eTag,omitempty" azure:"ro"` // READ-ONLY; The expiration date of a lot. ExpirationDate *time.Time `json:"expirationDate,omitempty" azure:"ro"` // READ-ONLY; The original amount of a lot. OriginalAmount *Amount `json:"originalAmount,omitempty" azure:"ro"` // READ-ONLY; The original amount of a lot in billing currency. OriginalAmountInBillingCurrency *AmountWithExchangeRate `json:"originalAmountInBillingCurrency,omitempty" azure:"ro"` // READ-ONLY; The po number of the invoice on which the lot was added. This property is not available for ConsumptionCommitment // lots. PoNumber *string `json:"poNumber,omitempty" azure:"ro"` // READ-ONLY; The date when the lot was added. PurchasedDate *time.Time `json:"purchasedDate,omitempty" azure:"ro"` // READ-ONLY; The reseller of the lot. Reseller *Reseller `json:"reseller,omitempty" azure:"ro"` // READ-ONLY; The source of the lot. Source *LotSource `json:"source,omitempty" azure:"ro"` // READ-ONLY; The date when the lot became effective. StartDate *time.Time `json:"startDate,omitempty" azure:"ro"` // READ-ONLY; The status of the lot. Status *Status `json:"status,omitempty" azure:"ro"` }
LotProperties - The lot properties.
func (LotProperties) MarshalJSON ¶
func (l LotProperties) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type LotProperties.
func (*LotProperties) UnmarshalJSON ¶
func (l *LotProperties) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type LotProperties.
type LotSource ¶
type LotSource string
LotSource - The source of the lot.
func PossibleLotSourceValues ¶
func PossibleLotSourceValues() []LotSource
PossibleLotSourceValues returns the possible values for the LotSource const type.
type LotSummary ¶
type LotSummary 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 lot properties. Properties *LotProperties `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"` }
LotSummary - A lot summary resource.
type Lots ¶
type Lots struct { // READ-ONLY; The link (url) to the next page of results. NextLink *string `json:"nextLink,omitempty" azure:"ro"` // READ-ONLY; The list of lot summary. Value []*LotSummary `json:"value,omitempty" azure:"ro"` }
Lots - Result of listing lot summary.
func (Lots) MarshalJSON ¶
MarshalJSON implements the json.Marshaller interface for type Lots.
type LotsClient ¶
type LotsClient struct {
// contains filtered or unexported fields
}
LotsClient contains the methods for the Lots group. Don't use this type directly, use NewLotsClient() instead.
func NewLotsClient ¶
func NewLotsClient(credential azcore.TokenCredential, options *arm.ClientOptions) (*LotsClient, error)
NewLotsClient creates a new instance of LotsClient with the specified values. credential - used to authorize requests. Usually a credential from azidentity. options - pass nil to accept the default values.
func (*LotsClient) NewListByBillingAccountPager ¶ added in v0.5.0
func (client *LotsClient) NewListByBillingAccountPager(billingAccountID string, options *LotsClientListByBillingAccountOptions) *runtime.Pager[LotsClientListByBillingAccountResponse]
NewListByBillingAccountPager - Lists all Azure credits and Microsoft Azure consumption commitments for a billing account or a billing profile. Microsoft Azure consumption commitments are only supported for the billing account scope. If the operation fails it returns an *azcore.ResponseError type. billingAccountID - BillingAccount ID options - LotsClientListByBillingAccountOptions contains the optional parameters for the LotsClient.ListByBillingAccount method.
Example ¶
Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/consumption/resource-manager/Microsoft.Consumption/stable/2021-10-01/examples/LotsListByBillingAccount.json
package main import ( "context" "log" "github.com/Azure/azure-sdk-for-go/sdk/azidentity" "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/consumption/armconsumption" ) func main() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) return } ctx := context.Background() client, err := armconsumption.NewLotsClient(cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) return } pager := client.NewListByBillingAccountPager("<billing-account-id>", &armconsumption.LotsClientListByBillingAccountOptions{Filter: nil}) for pager.More() { nextResult, err := pager.NextPage(ctx) if err != nil { log.Fatalf("failed to advance page: %v", err) return } for _, v := range nextResult.Value { // TODO: use page item _ = v } } }
Output:
func (*LotsClient) NewListByBillingProfilePager ¶ added in v0.5.0
func (client *LotsClient) NewListByBillingProfilePager(billingAccountID string, billingProfileID string, options *LotsClientListByBillingProfileOptions) *runtime.Pager[LotsClientListByBillingProfileResponse]
NewListByBillingProfilePager - Lists all Azure credits and Microsoft Azure consumption commitments for a billing account or a billing profile. Microsoft Azure consumption commitments are only supported for the billing account scope. If the operation fails it returns an *azcore.ResponseError type. billingAccountID - BillingAccount ID billingProfileID - Azure Billing Profile ID. options - LotsClientListByBillingProfileOptions contains the optional parameters for the LotsClient.ListByBillingProfile method.
Example ¶
Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/consumption/resource-manager/Microsoft.Consumption/stable/2021-10-01/examples/LotsListByBillingProfile.json
package main import ( "context" "log" "github.com/Azure/azure-sdk-for-go/sdk/azidentity" "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/consumption/armconsumption" ) func main() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) return } ctx := context.Background() client, err := armconsumption.NewLotsClient(cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) return } pager := client.NewListByBillingProfilePager("<billing-account-id>", "<billing-profile-id>", nil) for pager.More() { nextResult, err := pager.NextPage(ctx) if err != nil { log.Fatalf("failed to advance page: %v", err) return } for _, v := range nextResult.Value { // TODO: use page item _ = v } } }
Output:
func (*LotsClient) NewListByCustomerPager ¶ added in v0.5.0
func (client *LotsClient) NewListByCustomerPager(billingAccountID string, customerID string, options *LotsClientListByCustomerOptions) *runtime.Pager[LotsClientListByCustomerResponse]
NewListByCustomerPager - Lists all Azure credits and Microsoft Azure consumption commitments for a billing account or a billing profile and a customer. Microsoft Azure consumption commitments are only supported for the billing account scope. If the operation fails it returns an *azcore.ResponseError type. billingAccountID - BillingAccount ID customerID - Customer ID options - LotsClientListByCustomerOptions contains the optional parameters for the LotsClient.ListByCustomer method.
Example ¶
Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/consumption/resource-manager/Microsoft.Consumption/stable/2021-10-01/examples/LotsListByCustomer.json
package main import ( "context" "log" "github.com/Azure/azure-sdk-for-go/sdk/azidentity" "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/consumption/armconsumption" ) func main() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) return } ctx := context.Background() client, err := armconsumption.NewLotsClient(cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) return } pager := client.NewListByCustomerPager("<billing-account-id>", "<customer-id>", &armconsumption.LotsClientListByCustomerOptions{Filter: nil}) for pager.More() { nextResult, err := pager.NextPage(ctx) if err != nil { log.Fatalf("failed to advance page: %v", err) return } for _, v := range nextResult.Value { // TODO: use page item _ = v } } }
Output:
type LotsClientListByBillingAccountOptions ¶ added in v0.3.0
type LotsClientListByBillingAccountOptions struct { // May be used to filter the lots by Status, Source etc. The filter supports 'eq', 'lt', 'gt', 'le', 'ge', and 'and'. It does // not currently support 'ne', 'or', or 'not'. Tag filter is a key value pair // string where key and value is separated by a colon (:). Filter *string }
LotsClientListByBillingAccountOptions contains the optional parameters for the LotsClient.ListByBillingAccount method.
type LotsClientListByBillingAccountResponse ¶ added in v0.3.0
type LotsClientListByBillingAccountResponse struct {
Lots
}
LotsClientListByBillingAccountResponse contains the response from method LotsClient.ListByBillingAccount.
type LotsClientListByBillingProfileOptions ¶ added in v0.3.0
type LotsClientListByBillingProfileOptions struct { }
LotsClientListByBillingProfileOptions contains the optional parameters for the LotsClient.ListByBillingProfile method.
type LotsClientListByBillingProfileResponse ¶ added in v0.3.0
type LotsClientListByBillingProfileResponse struct {
Lots
}
LotsClientListByBillingProfileResponse contains the response from method LotsClient.ListByBillingProfile.
type LotsClientListByCustomerOptions ¶ added in v0.4.0
type LotsClientListByCustomerOptions struct { // May be used to filter the lots by Status, Source etc. The filter supports 'eq', 'lt', 'gt', 'le', 'ge', and 'and'. Tag // filter is a key value pair string where key and value is separated by a colon // (:). Filter *string }
LotsClientListByCustomerOptions contains the optional parameters for the LotsClient.ListByCustomer method.
type LotsClientListByCustomerResponse ¶ added in v0.4.0
type LotsClientListByCustomerResponse struct {
Lots
}
LotsClientListByCustomerResponse contains the response from method LotsClient.ListByCustomer.
type ManagementGroupAggregatedCostProperties ¶
type ManagementGroupAggregatedCostProperties struct { // Children of a management group Children []*ManagementGroupAggregatedCostResult `json:"children,omitempty"` // List of subscription Guids excluded from the calculation of aggregated cost ExcludedSubscriptions []*string `json:"excludedSubscriptions,omitempty"` // List of subscription Guids included in the calculation of aggregated cost IncludedSubscriptions []*string `json:"includedSubscriptions,omitempty"` // READ-ONLY; Azure Charges. AzureCharges *float64 `json:"azureCharges,omitempty" azure:"ro"` // READ-ONLY; The id of the billing period resource that the aggregated cost belongs to. BillingPeriodID *string `json:"billingPeriodId,omitempty" azure:"ro"` // READ-ONLY; Charges Billed Separately. ChargesBilledSeparately *float64 `json:"chargesBilledSeparately,omitempty" azure:"ro"` // READ-ONLY; The ISO currency in which the meter is charged, for example, USD. Currency *string `json:"currency,omitempty" azure:"ro"` // READ-ONLY; Marketplace Charges. MarketplaceCharges *float64 `json:"marketplaceCharges,omitempty" azure:"ro"` // READ-ONLY; The end of the date time range covered by the aggregated cost. UsageEnd *time.Time `json:"usageEnd,omitempty" azure:"ro"` // READ-ONLY; The start of the date time range covered by aggregated cost. UsageStart *time.Time `json:"usageStart,omitempty" azure:"ro"` }
ManagementGroupAggregatedCostProperties - The properties of the Management Group Aggregated Cost.
func (ManagementGroupAggregatedCostProperties) MarshalJSON ¶
func (m ManagementGroupAggregatedCostProperties) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type ManagementGroupAggregatedCostProperties.
func (*ManagementGroupAggregatedCostProperties) UnmarshalJSON ¶
func (m *ManagementGroupAggregatedCostProperties) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type ManagementGroupAggregatedCostProperties.
type ManagementGroupAggregatedCostResult ¶
type ManagementGroupAggregatedCostResult struct { // The properties of the Management Group Aggregated Cost. Properties *ManagementGroupAggregatedCostProperties `json:"properties,omitempty"` // READ-ONLY; The etag for the resource. Etag *string `json:"etag,omitempty" azure:"ro"` // READ-ONLY; The full qualified ARM ID of an event. ID *string `json:"id,omitempty" azure:"ro"` // READ-ONLY; The ID that uniquely identifies an event. 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"` }
ManagementGroupAggregatedCostResult - A management group aggregated cost resource.
func (ManagementGroupAggregatedCostResult) MarshalJSON ¶
func (m ManagementGroupAggregatedCostResult) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type ManagementGroupAggregatedCostResult.
type Marketplace ¶
type Marketplace struct { // The properties of the marketplace usage detail. Properties *MarketplaceProperties `json:"properties,omitempty"` // READ-ONLY; The etag for the resource. Etag *string `json:"etag,omitempty" azure:"ro"` // READ-ONLY; The full qualified ARM ID of an event. ID *string `json:"id,omitempty" azure:"ro"` // READ-ONLY; The ID that uniquely identifies an event. 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"` }
Marketplace - A marketplace resource.
func (Marketplace) MarshalJSON ¶
func (m Marketplace) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type Marketplace.
type MarketplaceProperties ¶
type MarketplaceProperties struct { // READ-ONLY; Account name. AccountName *string `json:"accountName,omitempty" azure:"ro"` // READ-ONLY; Additional information. AdditionalInfo *string `json:"additionalInfo,omitempty" azure:"ro"` // READ-ONLY; Additional details of this usage item. By default this is not populated, unless it's specified in $expand. AdditionalProperties *string `json:"additionalProperties,omitempty" azure:"ro"` // READ-ONLY; The id of the billing period resource that the usage belongs to. BillingPeriodID *string `json:"billingPeriodId,omitempty" azure:"ro"` // READ-ONLY; The quantity of usage. ConsumedQuantity *float64 `json:"consumedQuantity,omitempty" azure:"ro"` // READ-ONLY; Consumed service name. ConsumedService *string `json:"consumedService,omitempty" azure:"ro"` // READ-ONLY; The cost center of this department if it is a department and a costcenter exists CostCenter *string `json:"costCenter,omitempty" azure:"ro"` // READ-ONLY; The ISO currency in which the meter is charged, for example, USD. Currency *string `json:"currency,omitempty" azure:"ro"` // READ-ONLY; Department name. DepartmentName *string `json:"departmentName,omitempty" azure:"ro"` // READ-ONLY; The uri of the resource instance that the usage is about. InstanceID *string `json:"instanceId,omitempty" azure:"ro"` // READ-ONLY; The name of the resource instance that the usage is about. InstanceName *string `json:"instanceName,omitempty" azure:"ro"` // READ-ONLY; The estimated usage is subject to change. IsEstimated *bool `json:"isEstimated,omitempty" azure:"ro"` // READ-ONLY; Flag indicating whether this is a recurring charge or not. IsRecurringCharge *bool `json:"isRecurringCharge,omitempty" azure:"ro"` // READ-ONLY; The meter id (GUID). MeterID *string `json:"meterId,omitempty" azure:"ro"` // READ-ONLY; The type of offer. OfferName *string `json:"offerName,omitempty" azure:"ro"` // READ-ONLY; The order number. OrderNumber *string `json:"orderNumber,omitempty" azure:"ro"` // READ-ONLY; The name of plan. PlanName *string `json:"planName,omitempty" azure:"ro"` // READ-ONLY; The amount of cost before tax. PretaxCost *float64 `json:"pretaxCost,omitempty" azure:"ro"` // READ-ONLY; The name of publisher. PublisherName *string `json:"publisherName,omitempty" azure:"ro"` // READ-ONLY; The name of resource group. ResourceGroup *string `json:"resourceGroup,omitempty" azure:"ro"` // READ-ONLY; The marketplace resource rate. ResourceRate *float64 `json:"resourceRate,omitempty" azure:"ro"` // READ-ONLY; Subscription guid. SubscriptionGUID *string `json:"subscriptionGuid,omitempty" azure:"ro"` // READ-ONLY; Subscription name. SubscriptionName *string `json:"subscriptionName,omitempty" azure:"ro"` // READ-ONLY; The unit of measure. UnitOfMeasure *string `json:"unitOfMeasure,omitempty" azure:"ro"` // READ-ONLY; The end of the date time range covered by the usage detail. UsageEnd *time.Time `json:"usageEnd,omitempty" azure:"ro"` // READ-ONLY; The start of the date time range covered by the usage detail. UsageStart *time.Time `json:"usageStart,omitempty" azure:"ro"` }
MarketplaceProperties - The properties of the marketplace usage detail.
func (MarketplaceProperties) MarshalJSON ¶
func (m MarketplaceProperties) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type MarketplaceProperties.
func (*MarketplaceProperties) UnmarshalJSON ¶
func (m *MarketplaceProperties) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type MarketplaceProperties.
type MarketplacesClient ¶
type MarketplacesClient struct {
// contains filtered or unexported fields
}
MarketplacesClient contains the methods for the Marketplaces group. Don't use this type directly, use NewMarketplacesClient() instead.
func NewMarketplacesClient ¶
func NewMarketplacesClient(credential azcore.TokenCredential, options *arm.ClientOptions) (*MarketplacesClient, error)
NewMarketplacesClient creates a new instance of MarketplacesClient with the specified values. credential - used to authorize requests. Usually a credential from azidentity. options - pass nil to accept the default values.
func (*MarketplacesClient) NewListPager ¶ added in v0.5.0
func (client *MarketplacesClient) NewListPager(scope string, options *MarketplacesClientListOptions) *runtime.Pager[MarketplacesClientListResponse]
NewListPager - Lists the marketplaces for a scope at the defined scope. Marketplaces are available via this API only for May 1, 2014 or later. If the operation fails it returns an *azcore.ResponseError type. scope - The scope associated with marketplace 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 and '/providers/Microsoft.Management/managementGroups/{managementGroupId}' for Management Group scope. For subscription, billing account, department, enrollment account and ManagementGroup, you can also add billing period to the scope using '/providers/Microsoft.Billing/billingPeriods/{billingPeriodName}'. For e.g. to specify billing period at department scope use '/providers/Microsoft.Billing/departments/{departmentId}/providers/Microsoft.Billing/billingPeriods/{billingPeriodName}' options - MarketplacesClientListOptions contains the optional parameters for the MarketplacesClient.List method.
Example ¶
Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/consumption/resource-manager/Microsoft.Consumption/stable/2021-10-01/examples/MarketplacesByBillingAccountList.json
package main import ( "context" "log" "github.com/Azure/azure-sdk-for-go/sdk/azidentity" "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/consumption/armconsumption" ) func main() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) return } ctx := context.Background() client, err := armconsumption.NewMarketplacesClient(cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) return } pager := client.NewListPager("<scope>", &armconsumption.MarketplacesClientListOptions{Filter: nil, Top: nil, Skiptoken: nil, }) for pager.More() { nextResult, err := pager.NextPage(ctx) if err != nil { log.Fatalf("failed to advance page: %v", err) return } for _, v := range nextResult.Value { // TODO: use page item _ = v } } }
Output:
type MarketplacesClientListOptions ¶ added in v0.3.0
type MarketplacesClientListOptions struct { // May be used to filter marketplaces by properties/usageEnd (Utc time), properties/usageStart (Utc time), properties/resourceGroup, // properties/instanceName or properties/instanceId. The filter supports // 'eq', 'lt', 'gt', 'le', 'ge', and 'and'. It does not currently support 'ne', 'or', or 'not'. 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 marketplaces. Top *int32 }
MarketplacesClientListOptions contains the optional parameters for the MarketplacesClient.List method.
type MarketplacesClientListResponse ¶ added in v0.3.0
type MarketplacesClientListResponse struct {
MarketplacesListResult
}
MarketplacesClientListResponse contains the response from method MarketplacesClient.List.
type MarketplacesListResult ¶
type MarketplacesListResult struct { // READ-ONLY; The link (url) to the next page of results. NextLink *string `json:"nextLink,omitempty" azure:"ro"` // READ-ONLY; The list of marketplaces. Value []*Marketplace `json:"value,omitempty" azure:"ro"` }
MarketplacesListResult - Result of listing marketplaces. It contains a list of available marketplaces in reverse chronological order by billing period.
func (MarketplacesListResult) MarshalJSON ¶
func (m MarketplacesListResult) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type MarketplacesListResult.
type MeterDetails ¶
type MeterDetails struct { // READ-ONLY; The category of the meter, for example, 'Cloud services', 'Networking', etc.. MeterCategory *string `json:"meterCategory,omitempty" azure:"ro"` // READ-ONLY; The location in which the Azure service is available. MeterLocation *string `json:"meterLocation,omitempty" azure:"ro"` // READ-ONLY; The name of the meter, within the given meter category MeterName *string `json:"meterName,omitempty" azure:"ro"` // READ-ONLY; The subcategory of the meter, for example, 'A6 Cloud services', 'ExpressRoute (IXP)', etc.. MeterSubCategory *string `json:"meterSubCategory,omitempty" azure:"ro"` // READ-ONLY; The pretax listing price. PretaxStandardRate *float64 `json:"pretaxStandardRate,omitempty" azure:"ro"` // READ-ONLY; The name of the service. ServiceName *string `json:"serviceName,omitempty" azure:"ro"` // READ-ONLY; The service tier. ServiceTier *string `json:"serviceTier,omitempty" azure:"ro"` // READ-ONLY; The total included quantity associated with the offer. TotalIncludedQuantity *float64 `json:"totalIncludedQuantity,omitempty" azure:"ro"` // READ-ONLY; The unit in which the meter consumption is charged, for example, 'Hours', 'GB', etc. Unit *string `json:"unit,omitempty" azure:"ro"` }
MeterDetails - The properties of the meter detail.
type MeterDetailsResponse ¶
type MeterDetailsResponse struct { // READ-ONLY; The category of the meter, for example, 'Cloud services', 'Networking', etc.. MeterCategory *string `json:"meterCategory,omitempty" azure:"ro"` // READ-ONLY; The name of the meter, within the given meter category MeterName *string `json:"meterName,omitempty" azure:"ro"` // READ-ONLY; The subcategory of the meter, for example, 'A6 Cloud services', 'ExpressRoute (IXP)', etc.. MeterSubCategory *string `json:"meterSubCategory,omitempty" azure:"ro"` // READ-ONLY; The service family. ServiceFamily *string `json:"serviceFamily,omitempty" azure:"ro"` // READ-ONLY; The unit in which the meter consumption is charged, for example, 'Hours', 'GB', etc. UnitOfMeasure *string `json:"unitOfMeasure,omitempty" azure:"ro"` }
MeterDetailsResponse - The properties of the meter detail.
type Metrictype ¶
type Metrictype string
const ( // MetrictypeActualCostMetricType - Actual cost data. MetrictypeActualCostMetricType Metrictype = "actualcost" // MetrictypeAmortizedCostMetricType - Amortized cost data. MetrictypeAmortizedCostMetricType Metrictype = "amortizedcost" // MetrictypeUsageMetricType - Usage data. MetrictypeUsageMetricType Metrictype = "usage" )
func PossibleMetrictypeValues ¶
func PossibleMetrictypeValues() []Metrictype
PossibleMetrictypeValues returns the possible values for the Metrictype const type.
type ModernChargeSummary ¶
type ModernChargeSummary struct { // REQUIRED; Specifies the kind of charge summary. Kind *ChargeSummaryKind `json:"kind,omitempty"` // REQUIRED; Properties for modern charge summary Properties *ModernChargeSummaryProperties `json:"properties,omitempty"` // 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"` }
ModernChargeSummary - Modern charge summary.
func (*ModernChargeSummary) GetChargeSummary ¶ added in v0.3.0
func (m *ModernChargeSummary) GetChargeSummary() *ChargeSummary
GetChargeSummary implements the ChargeSummaryClassification interface for type ModernChargeSummary.
func (ModernChargeSummary) MarshalJSON ¶
func (m ModernChargeSummary) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type ModernChargeSummary.
func (*ModernChargeSummary) UnmarshalJSON ¶
func (m *ModernChargeSummary) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type ModernChargeSummary.
type ModernChargeSummaryProperties ¶
type ModernChargeSummaryProperties struct { // READ-ONLY; Azure Charges. AzureCharges *Amount `json:"azureCharges,omitempty" azure:"ro"` // READ-ONLY; Billing Account Id BillingAccountID *string `json:"billingAccountId,omitempty" azure:"ro"` // READ-ONLY; The id of the billing period resource that the charge belongs to. BillingPeriodID *string `json:"billingPeriodId,omitempty" azure:"ro"` // READ-ONLY; Billing Profile Id BillingProfileID *string `json:"billingProfileId,omitempty" azure:"ro"` // READ-ONLY; Charges Billed separately. ChargesBilledSeparately *Amount `json:"chargesBilledSeparately,omitempty" azure:"ro"` // READ-ONLY; Customer Id CustomerID *string `json:"customerId,omitempty" azure:"ro"` // READ-ONLY; Invoice Section Id InvoiceSectionID *string `json:"invoiceSectionId,omitempty" azure:"ro"` // READ-ONLY; Is charge Invoiced IsInvoiced *bool `json:"isInvoiced,omitempty" azure:"ro"` // READ-ONLY; Marketplace Charges. MarketplaceCharges *Amount `json:"marketplaceCharges,omitempty" azure:"ro"` // READ-ONLY; Usage end date. UsageEnd *string `json:"usageEnd,omitempty" azure:"ro"` // READ-ONLY; Usage start date. UsageStart *string `json:"usageStart,omitempty" azure:"ro"` }
ModernChargeSummaryProperties - The properties of modern charge summary.
type ModernReservationRecommendation ¶
type ModernReservationRecommendation struct { // REQUIRED; Specifies the kind of reservation recommendation. Kind *ReservationRecommendationKind `json:"kind,omitempty"` // REQUIRED; Properties for modern reservation recommendation Properties *ModernReservationRecommendationProperties `json:"properties,omitempty"` // READ-ONLY; The etag for the resource. Etag *string `json:"etag,omitempty" azure:"ro"` // READ-ONLY; The full qualified ARM ID of an event. ID *string `json:"id,omitempty" azure:"ro"` // READ-ONLY; Resource location Location *string `json:"location,omitempty" azure:"ro"` // READ-ONLY; The ID that uniquely identifies an event. Name *string `json:"name,omitempty" azure:"ro"` // READ-ONLY; Resource sku 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"` }
ModernReservationRecommendation - Modern reservation recommendation.
func (*ModernReservationRecommendation) GetReservationRecommendation ¶ added in v0.3.0
func (m *ModernReservationRecommendation) GetReservationRecommendation() *ReservationRecommendation
GetReservationRecommendation implements the ReservationRecommendationClassification interface for type ModernReservationRecommendation.
func (ModernReservationRecommendation) MarshalJSON ¶
func (m ModernReservationRecommendation) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type ModernReservationRecommendation.
func (*ModernReservationRecommendation) UnmarshalJSON ¶
func (m *ModernReservationRecommendation) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type ModernReservationRecommendation.
type ModernReservationRecommendationProperties ¶
type ModernReservationRecommendationProperties struct { // READ-ONLY; The total amount of cost without reserved instances. CostWithNoReservedInstances *Amount `json:"costWithNoReservedInstances,omitempty" azure:"ro"` // READ-ONLY; The usage date for looking back. FirstUsageDate *time.Time `json:"firstUsageDate,omitempty" azure:"ro"` // READ-ONLY; The instance Flexibility Group. InstanceFlexibilityGroup *string `json:"instanceFlexibilityGroup,omitempty" azure:"ro"` // READ-ONLY; The instance Flexibility Ratio. InstanceFlexibilityRatio *float32 `json:"instanceFlexibilityRatio,omitempty" azure:"ro"` // READ-ONLY; Resource Location. Location *string `json:"location,omitempty" azure:"ro"` // READ-ONLY; The number of days of usage to look back for recommendation. LookBackPeriod *int32 `json:"lookBackPeriod,omitempty" azure:"ro"` // READ-ONLY; The meter id (GUID) MeterID *string `json:"meterId,omitempty" azure:"ro"` // READ-ONLY; Total estimated savings with reserved instances. NetSavings *Amount `json:"netSavings,omitempty" azure:"ro"` // READ-ONLY; The normalized Size. NormalizedSize *string `json:"normalizedSize,omitempty" azure:"ro"` // READ-ONLY; Recommended quality for reserved instances. RecommendedQuantity *float64 `json:"recommendedQuantity,omitempty" azure:"ro"` // READ-ONLY; The recommended Quantity Normalized. RecommendedQuantityNormalized *float32 `json:"recommendedQuantityNormalized,omitempty" azure:"ro"` // READ-ONLY; This is the ARM Sku name. SKUName *string `json:"skuName,omitempty" azure:"ro"` // READ-ONLY; List of sku properties SKUProperties []*SKUProperty `json:"skuProperties,omitempty" azure:"ro"` // READ-ONLY; Shared or single recommendation. Scope *string `json:"scope,omitempty" azure:"ro"` // READ-ONLY; RI recommendations in one or three year terms. Term *string `json:"term,omitempty" azure:"ro"` // READ-ONLY; The total amount of cost with reserved instances. TotalCostWithReservedInstances *Amount `json:"totalCostWithReservedInstances,omitempty" azure:"ro"` }
ModernReservationRecommendationProperties - The properties of the reservation recommendation.
func (ModernReservationRecommendationProperties) MarshalJSON ¶
func (m ModernReservationRecommendationProperties) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type ModernReservationRecommendationProperties.
func (*ModernReservationRecommendationProperties) UnmarshalJSON ¶
func (m *ModernReservationRecommendationProperties) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type ModernReservationRecommendationProperties.
type ModernReservationTransaction ¶
type ModernReservationTransaction struct { // REQUIRED; The properties of a modern reservation transaction. Properties *ModernReservationTransactionProperties `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 tags. Tags []*string `json:"tags,omitempty" azure:"ro"` // READ-ONLY; Resource type. Type *string `json:"type,omitempty" azure:"ro"` }
ModernReservationTransaction - Modern Reservation transaction resource.
func (ModernReservationTransaction) MarshalJSON ¶
func (m ModernReservationTransaction) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type ModernReservationTransaction.
type ModernReservationTransactionProperties ¶
type ModernReservationTransactionProperties struct { // READ-ONLY; The charge of the transaction. Amount *float64 `json:"amount,omitempty" azure:"ro"` // READ-ONLY; This is the ARM Sku name. It can be used to join with the serviceType field in additional info in usage records. ArmSKUName *string `json:"armSkuName,omitempty" azure:"ro"` // READ-ONLY; The billing frequency, which can be either one-time or recurring. BillingFrequency *string `json:"billingFrequency,omitempty" azure:"ro"` // READ-ONLY; Billing profile Id. BillingProfileID *string `json:"billingProfileId,omitempty" azure:"ro"` // READ-ONLY; Billing profile name. BillingProfileName *string `json:"billingProfileName,omitempty" azure:"ro"` // READ-ONLY; The ISO currency in which the transaction is charged, for example, USD. Currency *string `json:"currency,omitempty" azure:"ro"` // READ-ONLY; The description of the transaction. Description *string `json:"description,omitempty" azure:"ro"` // READ-ONLY; The date of the transaction EventDate *time.Time `json:"eventDate,omitempty" azure:"ro"` // READ-ONLY; The type of the transaction (Purchase, Cancel, etc.) EventType *string `json:"eventType,omitempty" azure:"ro"` // READ-ONLY; Invoice Number Invoice *string `json:"invoice,omitempty" azure:"ro"` // READ-ONLY; Invoice Id as on the invoice where the specific transaction appears. InvoiceID *string `json:"invoiceId,omitempty" azure:"ro"` // READ-ONLY; Invoice Section Id InvoiceSectionID *string `json:"invoiceSectionId,omitempty" azure:"ro"` // READ-ONLY; Invoice Section Name. InvoiceSectionName *string `json:"invoiceSectionName,omitempty" azure:"ro"` // READ-ONLY; The subscription guid that makes the transaction. PurchasingSubscriptionGUID *string `json:"purchasingSubscriptionGuid,omitempty" azure:"ro"` // READ-ONLY; The subscription name that makes the transaction. PurchasingSubscriptionName *string `json:"purchasingSubscriptionName,omitempty" azure:"ro"` // READ-ONLY; The quantity of the transaction. Quantity *float64 `json:"quantity,omitempty" azure:"ro"` // READ-ONLY; The region of the transaction. Region *string `json:"region,omitempty" azure:"ro"` // READ-ONLY; The reservation order ID is the identifier for a reservation purchase. Each reservation order ID represents // a single purchase transaction. A reservation order contains reservations. The reservation // order specifies the VM size and region for the reservations. ReservationOrderID *string `json:"reservationOrderId,omitempty" azure:"ro"` // READ-ONLY; The name of the reservation order. ReservationOrderName *string `json:"reservationOrderName,omitempty" azure:"ro"` // READ-ONLY; This is the term of the transaction. Term *string `json:"term,omitempty" azure:"ro"` }
ModernReservationTransactionProperties - The properties of a modern reservation transaction.
func (ModernReservationTransactionProperties) MarshalJSON ¶
func (m ModernReservationTransactionProperties) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type ModernReservationTransactionProperties.
func (*ModernReservationTransactionProperties) UnmarshalJSON ¶
func (m *ModernReservationTransactionProperties) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type ModernReservationTransactionProperties.
type ModernReservationTransactionsListResult ¶
type ModernReservationTransactionsListResult struct { // READ-ONLY; The link (url) to the next page of results. NextLink *string `json:"nextLink,omitempty" azure:"ro"` // READ-ONLY; The list of reservation recommendations. Value []*ModernReservationTransaction `json:"value,omitempty" azure:"ro"` }
ModernReservationTransactionsListResult - Result of listing reservation recommendations.
func (ModernReservationTransactionsListResult) MarshalJSON ¶
func (m ModernReservationTransactionsListResult) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type ModernReservationTransactionsListResult.
type ModernUsageDetail ¶
type ModernUsageDetail struct { // REQUIRED; Specifies the kind of usage details. Kind *UsageDetailsKind `json:"kind,omitempty"` // REQUIRED; Properties for modern usage details Properties *ModernUsageDetailProperties `json:"properties,omitempty"` // READ-ONLY; The etag for the resource. Etag *string `json:"etag,omitempty" azure:"ro"` // READ-ONLY; The full qualified ARM ID of an event. ID *string `json:"id,omitempty" azure:"ro"` // READ-ONLY; The ID that uniquely identifies an event. 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"` }
ModernUsageDetail - Modern usage detail.
func (*ModernUsageDetail) GetUsageDetail ¶ added in v0.3.0
func (m *ModernUsageDetail) GetUsageDetail() *UsageDetail
GetUsageDetail implements the UsageDetailClassification interface for type ModernUsageDetail.
func (ModernUsageDetail) MarshalJSON ¶
func (m ModernUsageDetail) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type ModernUsageDetail.
func (*ModernUsageDetail) UnmarshalJSON ¶
func (m *ModernUsageDetail) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type ModernUsageDetail.
type ModernUsageDetailProperties ¶
type ModernUsageDetailProperties struct { // READ-ONLY; Additional details of this usage item. Use this field to get usage line item specific details such as the actual // VM Size (ServiceType) or the ratio in which the reservation discount is applied. AdditionalInfo *string `json:"additionalInfo,omitempty" azure:"ro"` // READ-ONLY; Unique identifier for the applicable benefit. BenefitID *string `json:"benefitId,omitempty" azure:"ro"` // READ-ONLY; Name of the applicable benefit. BenefitName *string `json:"benefitName,omitempty" azure:"ro"` // READ-ONLY; Billing Account identifier. BillingAccountID *string `json:"billingAccountId,omitempty" azure:"ro"` // READ-ONLY; Name of the Billing Account. BillingAccountName *string `json:"billingAccountName,omitempty" azure:"ro"` // READ-ONLY; The currency defining the billed cost. BillingCurrencyCode *string `json:"billingCurrencyCode,omitempty" azure:"ro"` // READ-ONLY; Billing Period End Date as in the invoice. BillingPeriodEndDate *time.Time `json:"billingPeriodEndDate,omitempty" azure:"ro"` // READ-ONLY; Billing Period Start Date as in the invoice. BillingPeriodStartDate *time.Time `json:"billingPeriodStartDate,omitempty" azure:"ro"` // READ-ONLY; Identifier for the billing profile that groups costs across invoices in the a singular billing currency across // across the customers who have onboarded the Microsoft customer agreement and the // customers in CSP who have made entitlement purchases like SaaS, Marketplace, RI, etc. BillingProfileID *string `json:"billingProfileId,omitempty" azure:"ro"` // READ-ONLY; Name of the billing profile that groups costs across invoices in the a singular billing currency across across // the customers who have onboarded the Microsoft customer agreement and the customers in // CSP who have made entitlement purchases like SaaS, Marketplace, RI, etc. BillingProfileName *string `json:"billingProfileName,omitempty" azure:"ro"` // READ-ONLY; Indicates a charge represents credits, usage, a Marketplace purchase, a reservation fee, or a refund. ChargeType *string `json:"chargeType,omitempty" azure:"ro"` // READ-ONLY; Consumed service name. Name of the azure resource provider that emits the usage or was purchased. This value // is not provided for marketplace usage. ConsumedService *string `json:"consumedService,omitempty" azure:"ro"` // READ-ONLY; Name for Cost Allocation Rule. CostAllocationRuleName *string `json:"costAllocationRuleName,omitempty" azure:"ro"` // READ-ONLY; The cost center of this department if it is a department and a cost center is provided. CostCenter *string `json:"costCenter,omitempty" azure:"ro"` // READ-ONLY; ExtendedCost or blended cost before tax in billed currency. CostInBillingCurrency *float64 `json:"costInBillingCurrency,omitempty" azure:"ro"` // READ-ONLY; ExtendedCost or blended cost before tax in pricing currency to correlate with prices. CostInPricingCurrency *float64 `json:"costInPricingCurrency,omitempty" azure:"ro"` // READ-ONLY; Estimated extendedCost or blended cost before tax in USD. CostInUSD *float64 `json:"costInUSD,omitempty" azure:"ro"` // READ-ONLY; Name of the customer's AAD tenant. CustomerName *string `json:"customerName,omitempty" azure:"ro"` // READ-ONLY; Identifier of the customer's AAD tenant. CustomerTenantID *string `json:"customerTenantId,omitempty" azure:"ro"` // READ-ONLY; Date for the usage record. Date *time.Time `json:"date,omitempty" azure:"ro"` // READ-ONLY; Effective Price that's charged for the usage. EffectivePrice *float64 `json:"effectivePrice,omitempty" azure:"ro"` // READ-ONLY; Exchange rate used in conversion from pricing currency to billing currency. ExchangeRate *string `json:"exchangeRate,omitempty" azure:"ro"` // READ-ONLY; Date on which exchange rate used in conversion from pricing currency to billing currency. ExchangeRateDate *time.Time `json:"exchangeRateDate,omitempty" azure:"ro"` // READ-ONLY; Exchange Rate from pricing currency to billing currency. ExchangeRatePricingToBilling *float64 `json:"exchangeRatePricingToBilling,omitempty" azure:"ro"` // READ-ONLY; Indicates how frequently this charge will occur. OneTime for purchases which only happen once, Monthly for fees // which recur every month, and UsageBased for charges based on how much a service is used. Frequency *string `json:"frequency,omitempty" azure:"ro"` // READ-ONLY; Instance Name. InstanceName *string `json:"instanceName,omitempty" azure:"ro"` // READ-ONLY; Invoice ID as on the invoice where the specific transaction appears. InvoiceID *string `json:"invoiceId,omitempty" azure:"ro"` // READ-ONLY; Identifier of the project that is being charged in the invoice. Not applicable for Microsoft Customer Agreements // onboarded by partners. InvoiceSectionID *string `json:"invoiceSectionId,omitempty" azure:"ro"` // READ-ONLY; Name of the project that is being charged in the invoice. Not applicable for Microsoft Customer Agreements onboarded // by partners. InvoiceSectionName *string `json:"invoiceSectionName,omitempty" azure:"ro"` // READ-ONLY; Determines if the cost is eligible to be paid for using Azure credits. IsAzureCreditEligible *bool `json:"isAzureCreditEligible,omitempty" azure:"ro"` // READ-ONLY; Market Price that's charged for the usage. MarketPrice *float64 `json:"marketPrice,omitempty" azure:"ro"` // READ-ONLY; Identifies the top-level service for the usage. MeterCategory *string `json:"meterCategory,omitempty" azure:"ro"` // READ-ONLY; The meter id (GUID). Not available for marketplace. For reserved instance this represents the primary meter // for which the reservation was purchased. For the actual VM Size for which the reservation is // purchased see productOrderName. MeterID *string `json:"meterId,omitempty" azure:"ro"` // READ-ONLY; Identifies the name of the meter against which consumption is measured. MeterName *string `json:"meterName,omitempty" azure:"ro"` // READ-ONLY; Identifies the location of the datacenter for certain services that are priced based on datacenter location. MeterRegion *string `json:"meterRegion,omitempty" azure:"ro"` // READ-ONLY; Defines the type or sub-category of Azure service that can affect the rate. MeterSubCategory *string `json:"meterSubCategory,omitempty" azure:"ro"` // READ-ONLY; Flag to indicate if partner earned credit has been applied or not. PartnerEarnedCreditApplied *string `json:"partnerEarnedCreditApplied,omitempty" azure:"ro"` // READ-ONLY; Rate of discount applied if there is a partner earned credit (PEC) based on partner admin link access. PartnerEarnedCreditRate *float64 `json:"partnerEarnedCreditRate,omitempty" azure:"ro"` // READ-ONLY; Name of the partner' AAD tenant. PartnerName *string `json:"partnerName,omitempty" azure:"ro"` // READ-ONLY; Identifier for the partner's AAD tenant. PartnerTenantID *string `json:"partnerTenantId,omitempty" azure:"ro"` // READ-ONLY; Retail price for the resource. PayGPrice *float64 `json:"payGPrice,omitempty" azure:"ro"` // READ-ONLY; The amount of PayG cost before tax in billing currency. PaygCostInBillingCurrency *float64 `json:"paygCostInBillingCurrency,omitempty" azure:"ro"` // READ-ONLY; The amount of PayG cost before tax in US Dollar currency. PaygCostInUSD *float64 `json:"paygCostInUSD,omitempty" azure:"ro"` // READ-ONLY; Reference to an original invoice there is a refund (negative cost). This is populated only when there is a refund. PreviousInvoiceID *string `json:"previousInvoiceId,omitempty" azure:"ro"` // READ-ONLY; Pricing Billing Currency. PricingCurrencyCode *string `json:"pricingCurrencyCode,omitempty" azure:"ro"` // READ-ONLY; Identifier that indicates how the meter is priced PricingModel *PricingModelType `json:"pricingModel,omitempty" azure:"ro"` // READ-ONLY; Name of the product that has accrued charges by consumption or purchase as listed in the invoice. Not available // for Marketplace. Product *string `json:"product,omitempty" azure:"ro"` // READ-ONLY; Identifier for the product that has accrued charges by consumption or purchase . This is the concatenated key // of productId and SkuId in partner center. ProductIdentifier *string `json:"productIdentifier,omitempty" azure:"ro"` // READ-ONLY; The identifier for the asset or Azure plan name that the subscription belongs to. For example: Azure Plan. For // reservations this is the Reservation Order ID. ProductOrderID *string `json:"productOrderId,omitempty" azure:"ro"` // READ-ONLY; Product Order Name. For reservations this is the SKU that was purchased. ProductOrderName *string `json:"productOrderName,omitempty" azure:"ro"` // READ-ONLY; Identifier for Product Category or Line Of Business, Ex - Azure, Microsoft 365, AWS e.t.c Provider *string `json:"provider,omitempty" azure:"ro"` // READ-ONLY; Publisher Id. PublisherID *string `json:"publisherId,omitempty" azure:"ro"` // READ-ONLY; Name of the publisher of the service including Microsoft or Third Party publishers. PublisherName *string `json:"publisherName,omitempty" azure:"ro"` // READ-ONLY; Type of publisher that identifies if the publisher is first party, third party reseller or third party agency. PublisherType *string `json:"publisherType,omitempty" azure:"ro"` // READ-ONLY; Measure the quantity purchased or consumed.The amount of the meter used during the billing period. Quantity *float64 `json:"quantity,omitempty" azure:"ro"` // READ-ONLY; MPNId for the reseller associated with the subscription. ResellerMpnID *string `json:"resellerMpnId,omitempty" azure:"ro"` // READ-ONLY; Reseller Name. ResellerName *string `json:"resellerName,omitempty" azure:"ro"` // READ-ONLY; ARM resource id of the reservation. Only applies to records relevant to reservations. ReservationID *string `json:"reservationId,omitempty" azure:"ro"` // READ-ONLY; User provided display name of the reservation. Last known name for a particular day is populated in the daily // data. Only applies to records relevant to reservations. ReservationName *string `json:"reservationName,omitempty" azure:"ro"` // READ-ONLY; Name of the Azure resource group used for cohesive lifecycle management of resources. ResourceGroup *string `json:"resourceGroup,omitempty" azure:"ro"` // READ-ONLY; Name of the resource location. ResourceLocation *string `json:"resourceLocation,omitempty" azure:"ro"` // READ-ONLY; Resource Location Normalized. ResourceLocationNormalized *string `json:"resourceLocationNormalized,omitempty" azure:"ro"` // READ-ONLY; List the service family for the product purchased or charged (Example: Storage ; Compute). ServiceFamily *string `json:"serviceFamily,omitempty" azure:"ro"` // READ-ONLY; Service-specific metadata. ServiceInfo1 *string `json:"serviceInfo1,omitempty" azure:"ro"` // READ-ONLY; Legacy field with optional service-specific metadata. ServiceInfo2 *string `json:"serviceInfo2,omitempty" azure:"ro"` // READ-ONLY; End date for the period when the service usage was rated for charges. The prices for Azure services are determined // based on the rating period. ServicePeriodEndDate *time.Time `json:"servicePeriodEndDate,omitempty" azure:"ro"` // READ-ONLY; Start date for the rating period when the service usage was rated for charges. The prices for Azure services // are determined for the rating period. ServicePeriodStartDate *time.Time `json:"servicePeriodStartDate,omitempty" azure:"ro"` // READ-ONLY; Unique Microsoft generated identifier for the Azure Subscription. SubscriptionGUID *string `json:"subscriptionGuid,omitempty" azure:"ro"` // READ-ONLY; Name of the Azure Subscription. SubscriptionName *string `json:"subscriptionName,omitempty" azure:"ro"` // READ-ONLY; Term (in months). Displays the term for the validity of the offer. For example. In case of reserved instances // it displays 12 months for yearly term of reserved instance. For one time purchases or // recurring purchases, the terms displays 1 month; This is not applicable for Azure consumption. Term *string `json:"term,omitempty" azure:"ro"` // READ-ONLY; Identifies the Unit that the service is charged in. For example, GB, hours, 10,000 s. UnitOfMeasure *string `json:"unitOfMeasure,omitempty" azure:"ro"` // READ-ONLY; Unit Price is the price applicable to you. (your EA or other contract price). UnitPrice *float64 `json:"unitPrice,omitempty" azure:"ro"` }
ModernUsageDetailProperties - The properties of the usage detail.
func (ModernUsageDetailProperties) MarshalJSON ¶
func (m ModernUsageDetailProperties) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type ModernUsageDetailProperties.
func (*ModernUsageDetailProperties) UnmarshalJSON ¶
func (m *ModernUsageDetailProperties) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type ModernUsageDetailProperties.
type Notification ¶
type Notification struct { // REQUIRED; Email addresses to send the budget notification to when the threshold is exceeded. Must have at least one contact // email or contact group specified at the Subscription or Resource Group scopes. All // other scopes must have at least one contact email specified. ContactEmails []*string `json:"contactEmails,omitempty"` // REQUIRED; The notification is enabled or not. Enabled *bool `json:"enabled,omitempty"` // REQUIRED; The comparison operator. Operator *OperatorType `json:"operator,omitempty"` // REQUIRED; Threshold value associated with a notification. Notification is sent when the cost exceeded the threshold. It // is always percent and has to be between 0 and 1000. Threshold *float64 `json:"threshold,omitempty"` // Action groups to send the budget notification to when the threshold is exceeded. Must be provided as a fully qualified // Azure resource id. Only supported at Subscription or Resource Group scopes. ContactGroups []*string `json:"contactGroups,omitempty"` // Contact roles to send the budget notification to when the threshold is exceeded. ContactRoles []*string `json:"contactRoles,omitempty"` // Language in which the recipient will receive the notification Locale *CultureCode `json:"locale,omitempty"` // The type of threshold ThresholdType *ThresholdType `json:"thresholdType,omitempty"` }
Notification - The notification associated with a budget.
func (Notification) MarshalJSON ¶
func (n Notification) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type Notification.
type Operation ¶
type Operation struct { // The object that represents the operation. Display *OperationDisplay `json:"display,omitempty"` // READ-ONLY; Operation Id. ID *string `json:"id,omitempty" azure:"ro"` // READ-ONLY; Operation name: {provider}/{resource}/{operation}. Name *string `json:"name,omitempty" azure:"ro"` }
Operation - A Consumption REST API operation.
type OperationDisplay ¶
type OperationDisplay struct { // READ-ONLY; Description of the operation. Description *string `json:"description,omitempty" azure:"ro"` // READ-ONLY; Operation type: Read, write, delete, etc. Operation *string `json:"operation,omitempty" azure:"ro"` // READ-ONLY; Service provider: Microsoft.Consumption. Provider *string `json:"provider,omitempty" azure:"ro"` // READ-ONLY; Resource on which the operation is performed: UsageDetail, etc. 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 consumption operations supported by the Microsoft.Consumption resource provider. Value []*Operation `json:"value,omitempty" azure:"ro"` }
OperationListResult - Result of listing consumption 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 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, error)
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) NewListPager ¶ added in v0.5.0
func (client *OperationsClient) NewListPager(options *OperationsClientListOptions) *runtime.Pager[OperationsClientListResponse]
NewListPager - Lists all of the available consumption REST API operations. If the operation fails it returns an *azcore.ResponseError type. options - OperationsClientListOptions contains the optional parameters for the OperationsClient.List method.
Example ¶
Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/consumption/resource-manager/Microsoft.Consumption/stable/2021-10-01/examples/OperationList.json
package main import ( "context" "log" "github.com/Azure/azure-sdk-for-go/sdk/azidentity" "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/consumption/armconsumption" ) func main() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) return } ctx := context.Background() client, err := armconsumption.NewOperationsClient(cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) return } pager := client.NewListPager(nil) for pager.More() { nextResult, err := pager.NextPage(ctx) if err != nil { log.Fatalf("failed to advance page: %v", err) return } for _, v := range nextResult.Value { // TODO: use page item _ = v } } }
Output:
type OperationsClientListOptions ¶ added in v0.3.0
type OperationsClientListOptions struct { }
OperationsClientListOptions contains the optional parameters for the OperationsClient.List method.
type OperationsClientListResponse ¶ added in v0.3.0
type OperationsClientListResponse struct {
OperationListResult
}
OperationsClientListResponse contains the response from method OperationsClient.List.
type OperatorType ¶
type OperatorType string
OperatorType - The comparison operator.
const ( OperatorTypeEqualTo OperatorType = "EqualTo" OperatorTypeGreaterThan OperatorType = "GreaterThan" OperatorTypeGreaterThanOrEqualTo OperatorType = "GreaterThanOrEqualTo" )
func PossibleOperatorTypeValues ¶
func PossibleOperatorTypeValues() []OperatorType
PossibleOperatorTypeValues returns the possible values for the OperatorType const type.
type PriceSheetClient ¶
type PriceSheetClient struct {
// contains filtered or unexported fields
}
PriceSheetClient contains the methods for the PriceSheet group. Don't use this type directly, use NewPriceSheetClient() instead.
func NewPriceSheetClient ¶
func NewPriceSheetClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*PriceSheetClient, error)
NewPriceSheetClient creates a new instance of PriceSheetClient with the specified values. subscriptionID - Azure Subscription ID. credential - used to authorize requests. Usually a credential from azidentity. options - pass nil to accept the default values.
func (*PriceSheetClient) Get ¶
func (client *PriceSheetClient) Get(ctx context.Context, options *PriceSheetClientGetOptions) (PriceSheetClientGetResponse, error)
Get - Gets the price sheet for a subscription. Price sheet is available via this API only for May 1, 2014 or later. If the operation fails it returns an *azcore.ResponseError type. options - PriceSheetClientGetOptions contains the optional parameters for the PriceSheetClient.Get method.
Example ¶
Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/consumption/resource-manager/Microsoft.Consumption/stable/2021-10-01/examples/PriceSheet.json
package main import ( "context" "log" "github.com/Azure/azure-sdk-for-go/sdk/azidentity" "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/consumption/armconsumption" ) func main() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) return } ctx := context.Background() client, err := armconsumption.NewPriceSheetClient("<subscription-id>", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) return } res, err := client.Get(ctx, &armconsumption.PriceSheetClientGetOptions{Expand: nil, Skiptoken: nil, Top: nil, }) if err != nil { log.Fatalf("failed to finish the request: %v", err) return } // TODO: use response item _ = res }
Output:
func (*PriceSheetClient) GetByBillingPeriod ¶
func (client *PriceSheetClient) GetByBillingPeriod(ctx context.Context, billingPeriodName string, options *PriceSheetClientGetByBillingPeriodOptions) (PriceSheetClientGetByBillingPeriodResponse, error)
GetByBillingPeriod - Get the price sheet for a scope by subscriptionId and billing period. Price sheet is available via this API only for May 1, 2014 or later. If the operation fails it returns an *azcore.ResponseError type. billingPeriodName - Billing Period Name. options - PriceSheetClientGetByBillingPeriodOptions contains the optional parameters for the PriceSheetClient.GetByBillingPeriod method.
Example ¶
Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/consumption/resource-manager/Microsoft.Consumption/stable/2021-10-01/examples/PriceSheetExpand.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/consumption/armconsumption" ) func main() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) return } ctx := context.Background() client, err := armconsumption.NewPriceSheetClient("<subscription-id>", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) return } res, err := client.GetByBillingPeriod(ctx, "<billing-period-name>", &armconsumption.PriceSheetClientGetByBillingPeriodOptions{Expand: to.Ptr("<expand>"), Skiptoken: nil, Top: nil, }) if err != nil { log.Fatalf("failed to finish the request: %v", err) return } // TODO: use response item _ = res }
Output:
type PriceSheetClientGetByBillingPeriodOptions ¶ added in v0.3.0
type PriceSheetClientGetByBillingPeriodOptions struct { // May be used to expand the properties/meterDetails within a price sheet. By default, these fields are not included when // returning price sheet. Expand *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 top N results. Top *int32 }
PriceSheetClientGetByBillingPeriodOptions contains the optional parameters for the PriceSheetClient.GetByBillingPeriod method.
type PriceSheetClientGetByBillingPeriodResponse ¶ added in v0.3.0
type PriceSheetClientGetByBillingPeriodResponse struct {
PriceSheetResult
}
PriceSheetClientGetByBillingPeriodResponse contains the response from method PriceSheetClient.GetByBillingPeriod.
type PriceSheetClientGetOptions ¶ added in v0.3.0
type PriceSheetClientGetOptions struct { // May be used to expand the properties/meterDetails within a price sheet. By default, these fields are not included when // returning price sheet. Expand *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 top N results. Top *int32 }
PriceSheetClientGetOptions contains the optional parameters for the PriceSheetClient.Get method.
type PriceSheetClientGetResponse ¶ added in v0.3.0
type PriceSheetClientGetResponse struct {
PriceSheetResult
}
PriceSheetClientGetResponse contains the response from method PriceSheetClient.Get.
type PriceSheetModel ¶
type PriceSheetModel struct { // READ-ONLY; Pricesheet download details. Download *MeterDetails `json:"download,omitempty" azure:"ro"` // READ-ONLY; The link (url) to the next page of results. NextLink *string `json:"nextLink,omitempty" azure:"ro"` // READ-ONLY; Price sheet Pricesheets []*PriceSheetProperties `json:"pricesheets,omitempty" azure:"ro"` }
PriceSheetModel - price sheet result. It contains the pricesheet associated with billing period
func (PriceSheetModel) MarshalJSON ¶
func (p PriceSheetModel) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type PriceSheetModel.
type PriceSheetProperties ¶
type PriceSheetProperties struct { // READ-ONLY; The id of the billing period resource that the usage belongs to. BillingPeriodID *string `json:"billingPeriodId,omitempty" azure:"ro"` // READ-ONLY; Currency Code CurrencyCode *string `json:"currencyCode,omitempty" azure:"ro"` // READ-ONLY; Included quality for an offer IncludedQuantity *float64 `json:"includedQuantity,omitempty" azure:"ro"` // READ-ONLY; The details about the meter. By default this is not populated, unless it's specified in $expand. MeterDetails *MeterDetails `json:"meterDetails,omitempty" azure:"ro"` // READ-ONLY; The meter id (GUID) MeterID *string `json:"meterId,omitempty" azure:"ro"` // READ-ONLY; Offer Id OfferID *string `json:"offerId,omitempty" azure:"ro"` // READ-ONLY; Part Number PartNumber *string `json:"partNumber,omitempty" azure:"ro"` // READ-ONLY; Unit of measure UnitOfMeasure *string `json:"unitOfMeasure,omitempty" azure:"ro"` // READ-ONLY; Unit Price UnitPrice *float64 `json:"unitPrice,omitempty" azure:"ro"` }
PriceSheetProperties - The properties of the price sheet.
type PriceSheetResult ¶
type PriceSheetResult struct { // price sheet result. It contains the pricesheet associated with billing period Properties *PriceSheetModel `json:"properties,omitempty"` // READ-ONLY; The etag for the resource. Etag *string `json:"etag,omitempty" azure:"ro"` // READ-ONLY; The full qualified ARM ID of an event. ID *string `json:"id,omitempty" azure:"ro"` // READ-ONLY; The ID that uniquely identifies an event. 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"` }
PriceSheetResult - An pricesheet resource.
func (PriceSheetResult) MarshalJSON ¶
func (p PriceSheetResult) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type PriceSheetResult.
type PricingModelType ¶
type PricingModelType string
PricingModelType - Identifier that indicates how the meter is priced.
const ( PricingModelTypeOnDemand PricingModelType = "On Demand" PricingModelTypeReservation PricingModelType = "Reservation" PricingModelTypeSpot PricingModelType = "Spot" )
func PossiblePricingModelTypeValues ¶
func PossiblePricingModelTypeValues() []PricingModelType
PossiblePricingModelTypeValues returns the possible values for the PricingModelType 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 Reseller ¶
type Reseller struct { // READ-ONLY; The reseller property description. ResellerDescription *string `json:"resellerDescription,omitempty" azure:"ro"` // READ-ONLY; The reseller property ID. ResellerID *string `json:"resellerId,omitempty" azure:"ro"` }
Reseller - The reseller properties.
type ReservationDetail ¶
type ReservationDetail struct { // The properties of the reservation detail. Properties *ReservationDetailProperties `json:"properties,omitempty"` // READ-ONLY; The etag for the resource. Etag *string `json:"etag,omitempty" azure:"ro"` // READ-ONLY; The full qualified ARM ID of an event. ID *string `json:"id,omitempty" azure:"ro"` // READ-ONLY; The ID that uniquely identifies an event. 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"` }
ReservationDetail - reservation detail resource.
func (ReservationDetail) MarshalJSON ¶
func (r ReservationDetail) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type ReservationDetail.
type ReservationDetailProperties ¶
type ReservationDetailProperties struct { // READ-ONLY; The instance Flexibility Group. InstanceFlexibilityGroup *string `json:"instanceFlexibilityGroup,omitempty" azure:"ro"` // READ-ONLY; The instance Flexibility Ratio. InstanceFlexibilityRatio *string `json:"instanceFlexibilityRatio,omitempty" azure:"ro"` // READ-ONLY; This identifier is the name of the resource or the fully qualified Resource ID. InstanceID *string `json:"instanceId,omitempty" azure:"ro"` // READ-ONLY; The reservation kind. Kind *string `json:"kind,omitempty" azure:"ro"` // READ-ONLY; The reservation ID is the identifier of a reservation within a reservation order. Each reservation is the grouping // for applying the benefit scope and also specifies the number of instances to which // the reservation benefit can be applied to. ReservationID *string `json:"reservationId,omitempty" azure:"ro"` // READ-ONLY; The reservation order ID is the identifier for a reservation purchase. Each reservation order ID represents // a single purchase transaction. A reservation order contains reservations. The reservation // order specifies the VM size and region for the reservations. ReservationOrderID *string `json:"reservationOrderId,omitempty" azure:"ro"` // READ-ONLY; This is the total hours reserved for the day. E.g. if reservation for 1 instance was made on 1 PM, this will // be 11 hours for that day and 24 hours from subsequent days. ReservedHours *float64 `json:"reservedHours,omitempty" azure:"ro"` // READ-ONLY; This is the ARM Sku name. It can be used to join with the serviceType field in additional info in usage records. SKUName *string `json:"skuName,omitempty" azure:"ro"` // READ-ONLY; This is the total count of instances that are reserved for the reservationId. TotalReservedQuantity *float64 `json:"totalReservedQuantity,omitempty" azure:"ro"` // READ-ONLY; The date on which consumption occurred. UsageDate *time.Time `json:"usageDate,omitempty" azure:"ro"` // READ-ONLY; This is the total hours used by the instance. UsedHours *float64 `json:"usedHours,omitempty" azure:"ro"` }
ReservationDetailProperties - The properties of the reservation detail.
func (ReservationDetailProperties) MarshalJSON ¶
func (r ReservationDetailProperties) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type ReservationDetailProperties.
func (*ReservationDetailProperties) UnmarshalJSON ¶
func (r *ReservationDetailProperties) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type ReservationDetailProperties.
type ReservationDetailsListResult ¶
type ReservationDetailsListResult struct { // READ-ONLY; The link (url) to the next page of results. NextLink *string `json:"nextLink,omitempty" azure:"ro"` // READ-ONLY; The list of reservation details. Value []*ReservationDetail `json:"value,omitempty" azure:"ro"` }
ReservationDetailsListResult - Result of listing reservation details.
func (ReservationDetailsListResult) MarshalJSON ¶
func (r ReservationDetailsListResult) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type ReservationDetailsListResult.
type ReservationRecommendation ¶
type ReservationRecommendation struct { // REQUIRED; Specifies the kind of reservation recommendation. Kind *ReservationRecommendationKind `json:"kind,omitempty"` // READ-ONLY; The etag for the resource. Etag *string `json:"etag,omitempty" azure:"ro"` // READ-ONLY; The full qualified ARM ID of an event. ID *string `json:"id,omitempty" azure:"ro"` // READ-ONLY; Resource location Location *string `json:"location,omitempty" azure:"ro"` // READ-ONLY; The ID that uniquely identifies an event. Name *string `json:"name,omitempty" azure:"ro"` // READ-ONLY; Resource sku 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"` }
ReservationRecommendation - A reservation recommendation resource.
func (*ReservationRecommendation) GetReservationRecommendation ¶
func (r *ReservationRecommendation) GetReservationRecommendation() *ReservationRecommendation
GetReservationRecommendation implements the ReservationRecommendationClassification interface for type ReservationRecommendation.
func (ReservationRecommendation) MarshalJSON ¶ added in v0.3.0
func (r ReservationRecommendation) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type ReservationRecommendation.
type ReservationRecommendationClassification ¶
type ReservationRecommendationClassification interface { // GetReservationRecommendation returns the ReservationRecommendation content of the underlying type. GetReservationRecommendation() *ReservationRecommendation }
ReservationRecommendationClassification provides polymorphic access to related types. Call the interface's GetReservationRecommendation() method to access the common type. Use a type switch to determine the concrete type. The possible types are: - *LegacyReservationRecommendation, *ModernReservationRecommendation, *ReservationRecommendation
type ReservationRecommendationDetailsCalculatedSavingsProperties ¶
type ReservationRecommendationDetailsCalculatedSavingsProperties struct { // The number of reserved units used to calculate savings. Always 1 for virtual machines. ReservedUnitCount *float32 `json:"reservedUnitCount,omitempty"` // READ-ONLY; The cost without reservation. OnDemandCost *float32 `json:"onDemandCost,omitempty" azure:"ro"` // READ-ONLY; The difference between total reservation cost and reservation cost. OverageCost *float32 `json:"overageCost,omitempty" azure:"ro"` // READ-ONLY; The quantity for calculated savings. Quantity *float32 `json:"quantity,omitempty" azure:"ro"` // READ-ONLY; The exact cost of the estimated usage using reservation. ReservationCost *float32 `json:"reservationCost,omitempty" azure:"ro"` // READ-ONLY; The amount saved by purchasing the recommended quantity of reservation. Savings *float32 `json:"savings,omitempty" azure:"ro"` // READ-ONLY; The cost of the suggested quantity. TotalReservationCost *float32 `json:"totalReservationCost,omitempty" azure:"ro"` }
ReservationRecommendationDetailsCalculatedSavingsProperties - Details of estimated savings.
type ReservationRecommendationDetailsClient ¶
type ReservationRecommendationDetailsClient struct {
// contains filtered or unexported fields
}
ReservationRecommendationDetailsClient contains the methods for the ReservationRecommendationDetails group. Don't use this type directly, use NewReservationRecommendationDetailsClient() instead.
func NewReservationRecommendationDetailsClient ¶
func NewReservationRecommendationDetailsClient(credential azcore.TokenCredential, options *arm.ClientOptions) (*ReservationRecommendationDetailsClient, error)
NewReservationRecommendationDetailsClient creates a new instance of ReservationRecommendationDetailsClient with the specified values. credential - used to authorize requests. Usually a credential from azidentity. options - pass nil to accept the default values.
func (*ReservationRecommendationDetailsClient) Get ¶
func (client *ReservationRecommendationDetailsClient) Get(ctx context.Context, scope string, region string, term Term, lookBackPeriod LookBackPeriod, product string, options *ReservationRecommendationDetailsClientGetOptions) (ReservationRecommendationDetailsClientGetResponse, error)
Get - Details of a reservation recommendation for what-if analysis of reserved instances. If the operation fails it returns an *azcore.ResponseError type. scope - The scope associated with reservation recommendation details operations. This includes '/subscriptions/{subscriptionId}/' for subscription scope, '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}' for resource group scope, /providers/Microsoft.Billing/billingAccounts/{billingAccountId}' for BillingAccount scope, and '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfiles/{billingProfileId}' for billingProfile scope region - Used to select the region the recommendation should be generated for. term - Specify length of reservation recommendation term. lookBackPeriod - Filter the time period on which reservation recommendation results are based. product - Filter the products for which reservation recommendation results are generated. Examples: StandardDS1v2 (for VM), PremiumSSDManagedDisksP30 (for Managed Disks) options - ReservationRecommendationDetailsClientGetOptions contains the optional parameters for the ReservationRecommendationDetailsClient.Get method.
Example ¶
Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/consumption/resource-manager/Microsoft.Consumption/stable/2021-10-01/examples/ReservationRecommendationDetailsByBillingAccount.json
package main import ( "context" "log" "github.com/Azure/azure-sdk-for-go/sdk/azidentity" "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/consumption/armconsumption" ) func main() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) return } ctx := context.Background() client, err := armconsumption.NewReservationRecommendationDetailsClient(cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) return } res, err := client.Get(ctx, "<scope>", "<region>", armconsumption.TermP1Y, armconsumption.LookBackPeriodLast60Days, "<product>", nil) if err != nil { log.Fatalf("failed to finish the request: %v", err) return } // TODO: use response item _ = res }
Output:
type ReservationRecommendationDetailsClientGetOptions ¶ added in v0.3.0
type ReservationRecommendationDetailsClientGetOptions struct { }
ReservationRecommendationDetailsClientGetOptions contains the optional parameters for the ReservationRecommendationDetailsClient.Get method.
type ReservationRecommendationDetailsClientGetResponse ¶ added in v0.3.0
type ReservationRecommendationDetailsClientGetResponse struct {
ReservationRecommendationDetailsModel
}
ReservationRecommendationDetailsClientGetResponse contains the response from method ReservationRecommendationDetailsClient.Get.
type ReservationRecommendationDetailsModel ¶
type ReservationRecommendationDetailsModel struct { // Resource Location. Location *string `json:"location,omitempty"` // The properties of the reservation recommendation. Properties *ReservationRecommendationDetailsProperties `json:"properties,omitempty"` // Resource sku SKU *string `json:"sku,omitempty"` // READ-ONLY; The etag for the resource. Etag *string `json:"etag,omitempty" azure:"ro"` // READ-ONLY; The full qualified ARM ID of an event. ID *string `json:"id,omitempty" azure:"ro"` // READ-ONLY; The ID that uniquely identifies an event. 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"` }
ReservationRecommendationDetailsModel - Reservation recommendation details.
func (ReservationRecommendationDetailsModel) MarshalJSON ¶
func (r ReservationRecommendationDetailsModel) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type ReservationRecommendationDetailsModel.
type ReservationRecommendationDetailsProperties ¶
type ReservationRecommendationDetailsProperties struct { // READ-ONLY; An ISO 4217 currency code identifier for the costs and savings Currency *string `json:"currency,omitempty" azure:"ro"` // READ-ONLY; Resource specific properties. Resource *ReservationRecommendationDetailsResourceProperties `json:"resource,omitempty" azure:"ro"` // READ-ONLY; Resource Group. ResourceGroup *string `json:"resourceGroup,omitempty" azure:"ro"` // READ-ONLY; Savings information for the recommendation. Savings *ReservationRecommendationDetailsSavingsProperties `json:"savings,omitempty" azure:"ro"` // READ-ONLY; Scope of the reservation, ex: Single or Shared. Scope *string `json:"scope,omitempty" azure:"ro"` // READ-ONLY; Historical usage details used to calculate the estimated savings. Usage *ReservationRecommendationDetailsUsageProperties `json:"usage,omitempty" azure:"ro"` }
ReservationRecommendationDetailsProperties - The properties of the reservation recommendation.
type ReservationRecommendationDetailsResourceProperties ¶
type ReservationRecommendationDetailsResourceProperties struct { // READ-ONLY; List of subscriptions for which the reservation is applied. AppliedScopes []*string `json:"appliedScopes,omitempty" azure:"ro"` // READ-ONLY; On demand rate of the resource. OnDemandRate *float32 `json:"onDemandRate,omitempty" azure:"ro"` // READ-ONLY; Azure product ex: StandardE8sv3 etc. Product *string `json:"product,omitempty" azure:"ro"` // READ-ONLY; Azure resource region ex:EastUS, WestUS etc. Region *string `json:"region,omitempty" azure:"ro"` // READ-ONLY; Reservation rate of the resource. ReservationRate *float32 `json:"reservationRate,omitempty" azure:"ro"` // READ-ONLY; The azure resource type. ResourceType *string `json:"resourceType,omitempty" azure:"ro"` }
ReservationRecommendationDetailsResourceProperties - Details of the resource.
func (ReservationRecommendationDetailsResourceProperties) MarshalJSON ¶
func (r ReservationRecommendationDetailsResourceProperties) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type ReservationRecommendationDetailsResourceProperties.
type ReservationRecommendationDetailsSavingsProperties ¶
type ReservationRecommendationDetailsSavingsProperties struct { // List of calculated savings. CalculatedSavings []*ReservationRecommendationDetailsCalculatedSavingsProperties `json:"calculatedSavings,omitempty"` // READ-ONLY; Number of days of usage to look back used for computing the recommendation. LookBackPeriod *int32 `json:"lookBackPeriod,omitempty" azure:"ro"` // READ-ONLY; Number of recommended units of the resource. RecommendedQuantity *float32 `json:"recommendedQuantity,omitempty" azure:"ro"` // READ-ONLY; Term period of the reservation, ex: P1Y or P3Y. ReservationOrderTerm *string `json:"reservationOrderTerm,omitempty" azure:"ro"` // READ-ONLY; Type of savings, ex: instance. SavingsType *string `json:"savingsType,omitempty" azure:"ro"` // READ-ONLY; Measurement unit ex: hour etc. UnitOfMeasure *string `json:"unitOfMeasure,omitempty" azure:"ro"` }
ReservationRecommendationDetailsSavingsProperties - Details of the estimated savings.
func (ReservationRecommendationDetailsSavingsProperties) MarshalJSON ¶
func (r ReservationRecommendationDetailsSavingsProperties) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type ReservationRecommendationDetailsSavingsProperties.
type ReservationRecommendationDetailsUsageProperties ¶
type ReservationRecommendationDetailsUsageProperties struct { // READ-ONLY; The first usage date used for looking back for computing the recommendation. FirstConsumptionDate *string `json:"firstConsumptionDate,omitempty" azure:"ro"` // READ-ONLY; The last usage date used for looking back for computing the recommendation. LastConsumptionDate *string `json:"lastConsumptionDate,omitempty" azure:"ro"` // READ-ONLY; What the usage data values represent ex: virtual machine instance. LookBackUnitType *string `json:"lookBackUnitType,omitempty" azure:"ro"` // READ-ONLY; The breakdown of historical resource usage. The values are in the order of usage between the firstConsumptionDate // and the lastConsumptionDate. UsageData []*float32 `json:"usageData,omitempty" azure:"ro"` // READ-ONLY; The grain of the values represented in the usage data ex: hourly. UsageGrain *string `json:"usageGrain,omitempty" azure:"ro"` }
ReservationRecommendationDetailsUsageProperties - Details about historical usage data that has been used for computing the recommendation.
func (ReservationRecommendationDetailsUsageProperties) MarshalJSON ¶
func (r ReservationRecommendationDetailsUsageProperties) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type ReservationRecommendationDetailsUsageProperties.
type ReservationRecommendationKind ¶
type ReservationRecommendationKind string
ReservationRecommendationKind - Specifies the kind of reservation recommendation.
const ( ReservationRecommendationKindLegacy ReservationRecommendationKind = "legacy" ReservationRecommendationKindModern ReservationRecommendationKind = "modern" )
func PossibleReservationRecommendationKindValues ¶
func PossibleReservationRecommendationKindValues() []ReservationRecommendationKind
PossibleReservationRecommendationKindValues returns the possible values for the ReservationRecommendationKind const type.
type ReservationRecommendationsClient ¶
type ReservationRecommendationsClient struct {
// contains filtered or unexported fields
}
ReservationRecommendationsClient contains the methods for the ReservationRecommendations group. Don't use this type directly, use NewReservationRecommendationsClient() instead.
func NewReservationRecommendationsClient ¶
func NewReservationRecommendationsClient(credential azcore.TokenCredential, options *arm.ClientOptions) (*ReservationRecommendationsClient, error)
NewReservationRecommendationsClient creates a new instance of ReservationRecommendationsClient with the specified values. credential - used to authorize requests. Usually a credential from azidentity. options - pass nil to accept the default values.
func (*ReservationRecommendationsClient) NewListPager ¶ added in v0.5.0
func (client *ReservationRecommendationsClient) NewListPager(scope string, options *ReservationRecommendationsClientListOptions) *runtime.Pager[ReservationRecommendationsClientListResponse]
NewListPager - List of recommendations for purchasing reserved instances. If the operation fails it returns an *azcore.ResponseError type. scope - The scope associated with reservation recommendations operations. This includes '/subscriptions/{subscriptionId}/' for subscription scope, '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}' for resource group scope, '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}' for BillingAccount scope, and '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfiles/{billingProfileId}' for billingProfile scope options - ReservationRecommendationsClientListOptions contains the optional parameters for the ReservationRecommendationsClient.List method.
Example ¶
Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/consumption/resource-manager/Microsoft.Consumption/stable/2021-10-01/examples/ReservationRecommendationsByBillingAccount.json
package main import ( "context" "log" "github.com/Azure/azure-sdk-for-go/sdk/azidentity" "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/consumption/armconsumption" ) func main() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) return } ctx := context.Background() client, err := armconsumption.NewReservationRecommendationsClient(cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) return } pager := client.NewListPager("<scope>", &armconsumption.ReservationRecommendationsClientListOptions{Filter: nil}) for pager.More() { nextResult, err := pager.NextPage(ctx) if err != nil { log.Fatalf("failed to advance page: %v", err) return } for _, v := range nextResult.Value { // TODO: use page item _ = v } } }
Output:
type ReservationRecommendationsClientListOptions ¶ added in v0.3.0
type ReservationRecommendationsClientListOptions struct { // May be used to filter reservationRecommendations by: properties/scope with allowed values ['Single', 'Shared'] and default // value 'Single'; properties/resourceType with allowed values // ['VirtualMachines', 'SQLDatabases', 'PostgreSQL', 'ManagedDisk', 'MySQL', 'RedHat', 'MariaDB', 'RedisCache', 'CosmosDB', // 'SqlDataWarehouse', 'SUSELinux', 'AppService', 'BlockBlob', // 'AzureDataExplorer', 'VMwareCloudSimple'] and default value 'VirtualMachines'; and properties/lookBackPeriod with allowed // values ['Last7Days', 'Last30Days', 'Last60Days'] and default value // 'Last7Days'. Filter *string }
ReservationRecommendationsClientListOptions contains the optional parameters for the ReservationRecommendationsClient.List method.
type ReservationRecommendationsClientListResponse ¶ added in v0.3.0
type ReservationRecommendationsClientListResponse struct {
ReservationRecommendationsListResult
}
ReservationRecommendationsClientListResponse contains the response from method ReservationRecommendationsClient.List.
type ReservationRecommendationsListResult ¶
type ReservationRecommendationsListResult struct { // READ-ONLY; The link (url) to the next page of results. NextLink *string `json:"nextLink,omitempty" azure:"ro"` // READ-ONLY; The link (url) to the previous page of results. PreviousLink *string `json:"previousLink,omitempty" azure:"ro"` // READ-ONLY; The list of reservation recommendations. Value []ReservationRecommendationClassification `json:"value,omitempty" azure:"ro"` }
ReservationRecommendationsListResult - Result of listing reservation recommendations.
func (ReservationRecommendationsListResult) MarshalJSON ¶
func (r ReservationRecommendationsListResult) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type ReservationRecommendationsListResult.
func (*ReservationRecommendationsListResult) UnmarshalJSON ¶
func (r *ReservationRecommendationsListResult) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type ReservationRecommendationsListResult.
type ReservationSummariesListResult ¶
type ReservationSummariesListResult struct { // READ-ONLY; The link (url) to the next page of results. NextLink *string `json:"nextLink,omitempty" azure:"ro"` // READ-ONLY; The list of reservation summaries. Value []*ReservationSummary `json:"value,omitempty" azure:"ro"` }
ReservationSummariesListResult - Result of listing reservation summaries.
func (ReservationSummariesListResult) MarshalJSON ¶
func (r ReservationSummariesListResult) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type ReservationSummariesListResult.
type ReservationSummary ¶
type ReservationSummary struct { // The properties of the reservation summary. Properties *ReservationSummaryProperties `json:"properties,omitempty"` // READ-ONLY; The etag for the resource. Etag *string `json:"etag,omitempty" azure:"ro"` // READ-ONLY; The full qualified ARM ID of an event. ID *string `json:"id,omitempty" azure:"ro"` // READ-ONLY; The ID that uniquely identifies an event. 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"` }
ReservationSummary - reservation summary resource.
func (ReservationSummary) MarshalJSON ¶
func (r ReservationSummary) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type ReservationSummary.
type ReservationSummaryProperties ¶
type ReservationSummaryProperties struct { // READ-ONLY; This is average utilization for the entire time range. (day or month depending on the grain) AvgUtilizationPercentage *float64 `json:"avgUtilizationPercentage,omitempty" azure:"ro"` // READ-ONLY; The reservation kind. Kind *string `json:"kind,omitempty" azure:"ro"` // READ-ONLY; This is the maximum hourly utilization in the usage time (day or month). E.g. if usage record corresponds to // 12/10/2017 and on that for hour 4 and 5, utilization was 100%, this field will return 100% // for that day. MaxUtilizationPercentage *float64 `json:"maxUtilizationPercentage,omitempty" azure:"ro"` // READ-ONLY; This is the minimum hourly utilization in the usage time (day or month). E.g. if usage record corresponds to // 12/10/2017 and on that for hour 4 and 5, utilization was 10%, this field will return 10% // for that day MinUtilizationPercentage *float64 `json:"minUtilizationPercentage,omitempty" azure:"ro"` // READ-ONLY; This is the purchased quantity for the reservationId. PurchasedQuantity *float64 `json:"purchasedQuantity,omitempty" azure:"ro"` // READ-ONLY; This is the remaining quantity for the reservationId. RemainingQuantity *float64 `json:"remainingQuantity,omitempty" azure:"ro"` // READ-ONLY; The reservation ID is the identifier of a reservation within a reservation order. Each reservation is the grouping // for applying the benefit scope and also specifies the number of instances to which // the reservation benefit can be applied to. ReservationID *string `json:"reservationId,omitempty" azure:"ro"` // READ-ONLY; The reservation order ID is the identifier for a reservation purchase. Each reservation order ID represents // a single purchase transaction. A reservation order contains reservations. The reservation // order specifies the VM size and region for the reservations. ReservationOrderID *string `json:"reservationOrderId,omitempty" azure:"ro"` // READ-ONLY; This is the total hours reserved. E.g. if reservation for 1 instance was made on 1 PM, this will be 11 hours // for that day and 24 hours from subsequent days ReservedHours *float64 `json:"reservedHours,omitempty" azure:"ro"` // READ-ONLY; This is the ARM Sku name. It can be used to join with the serviceType field in additional info in usage records. SKUName *string `json:"skuName,omitempty" azure:"ro"` // READ-ONLY; This is the total count of instances that are reserved for the reservationId. TotalReservedQuantity *float64 `json:"totalReservedQuantity,omitempty" azure:"ro"` // READ-ONLY; Data corresponding to the utilization record. If the grain of data is monthly, it will be first day of month. UsageDate *time.Time `json:"usageDate,omitempty" azure:"ro"` // READ-ONLY; Total used hours by the reservation UsedHours *float64 `json:"usedHours,omitempty" azure:"ro"` // READ-ONLY; This is the used quantity for the reservationId. UsedQuantity *float64 `json:"usedQuantity,omitempty" azure:"ro"` // READ-ONLY; This is the utilized percentage for the reservation Id. UtilizedPercentage *float64 `json:"utilizedPercentage,omitempty" azure:"ro"` }
ReservationSummaryProperties - The properties of the reservation summary.
func (ReservationSummaryProperties) MarshalJSON ¶
func (r ReservationSummaryProperties) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type ReservationSummaryProperties.
func (*ReservationSummaryProperties) UnmarshalJSON ¶
func (r *ReservationSummaryProperties) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type ReservationSummaryProperties.
type ReservationTransaction ¶
type ReservationTransaction struct { // The properties of a legacy reservation transaction. Properties *LegacyReservationTransactionProperties `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 tags. Tags []*string `json:"tags,omitempty" azure:"ro"` // READ-ONLY; Resource type. Type *string `json:"type,omitempty" azure:"ro"` }
ReservationTransaction - Reservation transaction resource.
func (ReservationTransaction) MarshalJSON ¶
func (r ReservationTransaction) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type ReservationTransaction.
type ReservationTransactionResource ¶
type ReservationTransactionResource 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 []*string `json:"tags,omitempty" azure:"ro"` // READ-ONLY; Resource type. Type *string `json:"type,omitempty" azure:"ro"` }
ReservationTransactionResource - The Resource model definition.
func (ReservationTransactionResource) MarshalJSON ¶
func (r ReservationTransactionResource) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type ReservationTransactionResource.
type ReservationTransactionsClient ¶
type ReservationTransactionsClient struct {
// contains filtered or unexported fields
}
ReservationTransactionsClient contains the methods for the ReservationTransactions group. Don't use this type directly, use NewReservationTransactionsClient() instead.
func NewReservationTransactionsClient ¶
func NewReservationTransactionsClient(credential azcore.TokenCredential, options *arm.ClientOptions) (*ReservationTransactionsClient, error)
NewReservationTransactionsClient creates a new instance of ReservationTransactionsClient with the specified values. credential - used to authorize requests. Usually a credential from azidentity. options - pass nil to accept the default values.
func (*ReservationTransactionsClient) NewListByBillingProfilePager ¶ added in v0.5.0
func (client *ReservationTransactionsClient) NewListByBillingProfilePager(billingAccountID string, billingProfileID string, options *ReservationTransactionsClientListByBillingProfileOptions) *runtime.Pager[ReservationTransactionsClientListByBillingProfileResponse]
NewListByBillingProfilePager - List of transactions for reserved instances on billing account scope If the operation fails it returns an *azcore.ResponseError type. billingAccountID - BillingAccount ID billingProfileID - Azure Billing Profile ID. options - ReservationTransactionsClientListByBillingProfileOptions contains the optional parameters for the ReservationTransactionsClient.ListByBillingProfile method.
Example ¶
Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/consumption/resource-manager/Microsoft.Consumption/stable/2021-10-01/examples/ReservationTransactionsListByBillingProfileId.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/consumption/armconsumption" ) func main() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) return } ctx := context.Background() client, err := armconsumption.NewReservationTransactionsClient(cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) return } pager := client.NewListByBillingProfilePager("<billing-account-id>", "<billing-profile-id>", &armconsumption.ReservationTransactionsClientListByBillingProfileOptions{Filter: to.Ptr("<filter>")}) for pager.More() { nextResult, err := pager.NextPage(ctx) if err != nil { log.Fatalf("failed to advance page: %v", err) return } for _, v := range nextResult.Value { // TODO: use page item _ = v } } }
Output:
func (*ReservationTransactionsClient) NewListPager ¶ added in v0.5.0
func (client *ReservationTransactionsClient) NewListPager(billingAccountID string, options *ReservationTransactionsClientListOptions) *runtime.Pager[ReservationTransactionsClientListResponse]
NewListPager - List of transactions for reserved instances on billing account scope If the operation fails it returns an *azcore.ResponseError type. billingAccountID - BillingAccount ID options - ReservationTransactionsClientListOptions contains the optional parameters for the ReservationTransactionsClient.List method.
Example ¶
Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/consumption/resource-manager/Microsoft.Consumption/stable/2021-10-01/examples/ReservationTransactionsListByEnrollmentNumber.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/consumption/armconsumption" ) func main() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) return } ctx := context.Background() client, err := armconsumption.NewReservationTransactionsClient(cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) return } pager := client.NewListPager("<billing-account-id>", &armconsumption.ReservationTransactionsClientListOptions{Filter: to.Ptr("<filter>")}) for pager.More() { nextResult, err := pager.NextPage(ctx) if err != nil { log.Fatalf("failed to advance page: %v", err) return } for _, v := range nextResult.Value { // TODO: use page item _ = v } } }
Output:
type ReservationTransactionsClientListByBillingProfileOptions ¶ added in v0.3.0
type ReservationTransactionsClientListByBillingProfileOptions struct { // Filter reservation transactions by date range. The properties/EventDate for start date and end date. The filter supports // 'le' and 'ge' Filter *string }
ReservationTransactionsClientListByBillingProfileOptions contains the optional parameters for the ReservationTransactionsClient.ListByBillingProfile method.
type ReservationTransactionsClientListByBillingProfileResponse ¶ added in v0.3.0
type ReservationTransactionsClientListByBillingProfileResponse struct {
ModernReservationTransactionsListResult
}
ReservationTransactionsClientListByBillingProfileResponse contains the response from method ReservationTransactionsClient.ListByBillingProfile.
type ReservationTransactionsClientListOptions ¶ added in v0.3.0
type ReservationTransactionsClientListOptions struct { // Filter reservation transactions by date range. The properties/EventDate for start date and end date. The filter supports // 'le' and 'ge' Filter *string }
ReservationTransactionsClientListOptions contains the optional parameters for the ReservationTransactionsClient.List method.
type ReservationTransactionsClientListResponse ¶ added in v0.3.0
type ReservationTransactionsClientListResponse struct {
ReservationTransactionsListResult
}
ReservationTransactionsClientListResponse contains the response from method ReservationTransactionsClient.List.
type ReservationTransactionsListResult ¶
type ReservationTransactionsListResult struct { // READ-ONLY; The link (url) to the next page of results. NextLink *string `json:"nextLink,omitempty" azure:"ro"` // READ-ONLY; The list of reservation recommendations. Value []*ReservationTransaction `json:"value,omitempty" azure:"ro"` }
ReservationTransactionsListResult - Result of listing reservation recommendations.
func (ReservationTransactionsListResult) MarshalJSON ¶
func (r ReservationTransactionsListResult) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type ReservationTransactionsListResult.
type ReservationsDetailsClient ¶
type ReservationsDetailsClient struct {
// contains filtered or unexported fields
}
ReservationsDetailsClient contains the methods for the ReservationsDetails group. Don't use this type directly, use NewReservationsDetailsClient() instead.
func NewReservationsDetailsClient ¶
func NewReservationsDetailsClient(credential azcore.TokenCredential, options *arm.ClientOptions) (*ReservationsDetailsClient, error)
NewReservationsDetailsClient creates a new instance of ReservationsDetailsClient with the specified values. credential - used to authorize requests. Usually a credential from azidentity. options - pass nil to accept the default values.
func (*ReservationsDetailsClient) NewListByReservationOrderAndReservationPager ¶ added in v0.5.0
func (client *ReservationsDetailsClient) NewListByReservationOrderAndReservationPager(reservationOrderID string, reservationID string, filter string, options *ReservationsDetailsClientListByReservationOrderAndReservationOptions) *runtime.Pager[ReservationsDetailsClientListByReservationOrderAndReservationResponse]
NewListByReservationOrderAndReservationPager - Lists the reservations details for provided date range. If the operation fails it returns an *azcore.ResponseError type. reservationOrderID - Order Id of the reservation reservationID - Id of the reservation filter - Filter reservation details by date range. The properties/UsageDate for start date and end date. The filter supports 'le' and 'ge' options - ReservationsDetailsClientListByReservationOrderAndReservationOptions contains the optional parameters for the ReservationsDetailsClient.ListByReservationOrderAndReservation method.
Example ¶
Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/consumption/resource-manager/Microsoft.Consumption/stable/2021-10-01/examples/ReservationDetailsWithReservationId.json
package main import ( "context" "log" "github.com/Azure/azure-sdk-for-go/sdk/azidentity" "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/consumption/armconsumption" ) func main() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) return } ctx := context.Background() client, err := armconsumption.NewReservationsDetailsClient(cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) return } pager := client.NewListByReservationOrderAndReservationPager("<reservation-order-id>", "<reservation-id>", "<filter>", nil) for pager.More() { nextResult, err := pager.NextPage(ctx) if err != nil { log.Fatalf("failed to advance page: %v", err) return } for _, v := range nextResult.Value { // TODO: use page item _ = v } } }
Output:
func (*ReservationsDetailsClient) NewListByReservationOrderPager ¶ added in v0.5.0
func (client *ReservationsDetailsClient) NewListByReservationOrderPager(reservationOrderID string, filter string, options *ReservationsDetailsClientListByReservationOrderOptions) *runtime.Pager[ReservationsDetailsClientListByReservationOrderResponse]
NewListByReservationOrderPager - Lists the reservations details for provided date range. If the operation fails it returns an *azcore.ResponseError type. reservationOrderID - Order Id of the reservation filter - Filter reservation details by date range. The properties/UsageDate for start date and end date. The filter supports 'le' and 'ge' options - ReservationsDetailsClientListByReservationOrderOptions contains the optional parameters for the ReservationsDetailsClient.ListByReservationOrder method.
Example ¶
Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/consumption/resource-manager/Microsoft.Consumption/stable/2021-10-01/examples/ReservationDetails.json
package main import ( "context" "log" "github.com/Azure/azure-sdk-for-go/sdk/azidentity" "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/consumption/armconsumption" ) func main() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) return } ctx := context.Background() client, err := armconsumption.NewReservationsDetailsClient(cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) return } pager := client.NewListByReservationOrderPager("<reservation-order-id>", "<filter>", nil) for pager.More() { nextResult, err := pager.NextPage(ctx) if err != nil { log.Fatalf("failed to advance page: %v", err) return } for _, v := range nextResult.Value { // TODO: use page item _ = v } } }
Output:
func (*ReservationsDetailsClient) NewListPager ¶ added in v0.5.0
func (client *ReservationsDetailsClient) NewListPager(scope string, options *ReservationsDetailsClientListOptions) *runtime.Pager[ReservationsDetailsClientListResponse]
NewListPager - Lists the reservations details for the defined scope and provided date range. If the operation fails it returns an *azcore.ResponseError type. scope - The scope associated with reservations details operations. This includes '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}' for BillingAccount scope (legacy), and '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfiles/{billingProfileId}' for BillingProfile scope (modern). options - ReservationsDetailsClientListOptions contains the optional parameters for the ReservationsDetailsClient.List method.
Example ¶
Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/consumption/resource-manager/Microsoft.Consumption/stable/2021-10-01/examples/ReservationDetailsByBillingAccountId.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/consumption/armconsumption" ) func main() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) return } ctx := context.Background() client, err := armconsumption.NewReservationsDetailsClient(cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) return } pager := client.NewListPager("<scope>", &armconsumption.ReservationsDetailsClientListOptions{StartDate: nil, EndDate: nil, Filter: to.Ptr("<filter>"), ReservationID: nil, ReservationOrderID: nil, }) for pager.More() { nextResult, err := pager.NextPage(ctx) if err != nil { log.Fatalf("failed to advance page: %v", err) return } for _, v := range nextResult.Value { // TODO: use page item _ = v } } }
Output:
type ReservationsDetailsClientListByReservationOrderAndReservationOptions ¶ added in v0.3.0
type ReservationsDetailsClientListByReservationOrderAndReservationOptions struct { }
ReservationsDetailsClientListByReservationOrderAndReservationOptions contains the optional parameters for the ReservationsDetailsClient.ListByReservationOrderAndReservation method.
type ReservationsDetailsClientListByReservationOrderAndReservationResponse ¶ added in v0.3.0
type ReservationsDetailsClientListByReservationOrderAndReservationResponse struct {
ReservationDetailsListResult
}
ReservationsDetailsClientListByReservationOrderAndReservationResponse contains the response from method ReservationsDetailsClient.ListByReservationOrderAndReservation.
type ReservationsDetailsClientListByReservationOrderOptions ¶ added in v0.3.0
type ReservationsDetailsClientListByReservationOrderOptions struct { }
ReservationsDetailsClientListByReservationOrderOptions contains the optional parameters for the ReservationsDetailsClient.ListByReservationOrder method.
type ReservationsDetailsClientListByReservationOrderResponse ¶ added in v0.3.0
type ReservationsDetailsClientListByReservationOrderResponse struct {
ReservationDetailsListResult
}
ReservationsDetailsClientListByReservationOrderResponse contains the response from method ReservationsDetailsClient.ListByReservationOrder.
type ReservationsDetailsClientListOptions ¶ added in v0.3.0
type ReservationsDetailsClientListOptions struct { // End date. Only applicable when querying with billing profile EndDate *string // Filter reservation details by date range. The properties/UsageDate for start date and end date. The filter supports 'le' // and 'ge'. Not applicable when querying with billing profile Filter *string // Reservation Id GUID. Only valid if reservationOrderId is also provided. Filter to a specific reservation ReservationID *string // Reservation Order Id GUID. Required if reservationId is provided. Filter to a specific reservation order ReservationOrderID *string // Start date. Only applicable when querying with billing profile StartDate *string }
ReservationsDetailsClientListOptions contains the optional parameters for the ReservationsDetailsClient.List method.
type ReservationsDetailsClientListResponse ¶ added in v0.3.0
type ReservationsDetailsClientListResponse struct {
ReservationDetailsListResult
}
ReservationsDetailsClientListResponse contains the response from method ReservationsDetailsClient.List.
type ReservationsSummariesClient ¶
type ReservationsSummariesClient struct {
// contains filtered or unexported fields
}
ReservationsSummariesClient contains the methods for the ReservationsSummaries group. Don't use this type directly, use NewReservationsSummariesClient() instead.
func NewReservationsSummariesClient ¶
func NewReservationsSummariesClient(credential azcore.TokenCredential, options *arm.ClientOptions) (*ReservationsSummariesClient, error)
NewReservationsSummariesClient creates a new instance of ReservationsSummariesClient with the specified values. credential - used to authorize requests. Usually a credential from azidentity. options - pass nil to accept the default values.
func (*ReservationsSummariesClient) NewListByReservationOrderAndReservationPager ¶ added in v0.5.0
func (client *ReservationsSummariesClient) NewListByReservationOrderAndReservationPager(reservationOrderID string, reservationID string, grain Datagrain, options *ReservationsSummariesClientListByReservationOrderAndReservationOptions) *runtime.Pager[ReservationsSummariesClientListByReservationOrderAndReservationResponse]
NewListByReservationOrderAndReservationPager - Lists the reservations summaries for daily or monthly grain. If the operation fails it returns an *azcore.ResponseError type. reservationOrderID - Order Id of the reservation reservationID - Id of the reservation grain - Can be daily or monthly options - ReservationsSummariesClientListByReservationOrderAndReservationOptions contains the optional parameters for the ReservationsSummariesClient.ListByReservationOrderAndReservation method.
Example ¶
Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/consumption/resource-manager/Microsoft.Consumption/stable/2021-10-01/examples/ReservationSummariesDailyWithReservationId.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/consumption/armconsumption" ) func main() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) return } ctx := context.Background() client, err := armconsumption.NewReservationsSummariesClient(cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) return } pager := client.NewListByReservationOrderAndReservationPager("<reservation-order-id>", "<reservation-id>", armconsumption.DatagrainDailyGrain, &armconsumption.ReservationsSummariesClientListByReservationOrderAndReservationOptions{Filter: to.Ptr("<filter>")}) for pager.More() { nextResult, err := pager.NextPage(ctx) if err != nil { log.Fatalf("failed to advance page: %v", err) return } for _, v := range nextResult.Value { // TODO: use page item _ = v } } }
Output:
func (*ReservationsSummariesClient) NewListByReservationOrderPager ¶ added in v0.5.0
func (client *ReservationsSummariesClient) NewListByReservationOrderPager(reservationOrderID string, grain Datagrain, options *ReservationsSummariesClientListByReservationOrderOptions) *runtime.Pager[ReservationsSummariesClientListByReservationOrderResponse]
NewListByReservationOrderPager - Lists the reservations summaries for daily or monthly grain. If the operation fails it returns an *azcore.ResponseError type. reservationOrderID - Order Id of the reservation grain - Can be daily or monthly options - ReservationsSummariesClientListByReservationOrderOptions contains the optional parameters for the ReservationsSummariesClient.ListByReservationOrder method.
Example ¶
Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/consumption/resource-manager/Microsoft.Consumption/stable/2021-10-01/examples/ReservationSummariesDaily.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/consumption/armconsumption" ) func main() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) return } ctx := context.Background() client, err := armconsumption.NewReservationsSummariesClient(cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) return } pager := client.NewListByReservationOrderPager("<reservation-order-id>", armconsumption.DatagrainDailyGrain, &armconsumption.ReservationsSummariesClientListByReservationOrderOptions{Filter: to.Ptr("<filter>")}) for pager.More() { nextResult, err := pager.NextPage(ctx) if err != nil { log.Fatalf("failed to advance page: %v", err) return } for _, v := range nextResult.Value { // TODO: use page item _ = v } } }
Output:
func (*ReservationsSummariesClient) NewListPager ¶ added in v0.5.0
func (client *ReservationsSummariesClient) NewListPager(scope string, grain Datagrain, options *ReservationsSummariesClientListOptions) *runtime.Pager[ReservationsSummariesClientListResponse]
NewListPager - Lists the reservations summaries for the defined scope daily or monthly grain. If the operation fails it returns an *azcore.ResponseError type. scope - The scope associated with reservations summaries operations. This includes '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}' for BillingAccount scope (legacy), and '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfiles/{billingProfileId}' for BillingProfile scope (modern). grain - Can be daily or monthly options - ReservationsSummariesClientListOptions contains the optional parameters for the ReservationsSummariesClient.List method.
Example ¶
Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/consumption/resource-manager/Microsoft.Consumption/stable/2021-10-01/examples/ReservationSummariesDailyWithBillingAccountId.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/consumption/armconsumption" ) func main() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) return } ctx := context.Background() client, err := armconsumption.NewReservationsSummariesClient(cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) return } pager := client.NewListPager("<scope>", armconsumption.DatagrainDailyGrain, &armconsumption.ReservationsSummariesClientListOptions{StartDate: nil, EndDate: nil, Filter: to.Ptr("<filter>"), ReservationID: nil, ReservationOrderID: nil, }) for pager.More() { nextResult, err := pager.NextPage(ctx) if err != nil { log.Fatalf("failed to advance page: %v", err) return } for _, v := range nextResult.Value { // TODO: use page item _ = v } } }
Output:
type ReservationsSummariesClientListByReservationOrderAndReservationOptions ¶ added in v0.3.0
type ReservationsSummariesClientListByReservationOrderAndReservationOptions struct { // Required only for daily grain. The properties/UsageDate for start date and end date. The filter supports 'le' and 'ge' Filter *string }
ReservationsSummariesClientListByReservationOrderAndReservationOptions contains the optional parameters for the ReservationsSummariesClient.ListByReservationOrderAndReservation method.
type ReservationsSummariesClientListByReservationOrderAndReservationResponse ¶ added in v0.3.0
type ReservationsSummariesClientListByReservationOrderAndReservationResponse struct {
ReservationSummariesListResult
}
ReservationsSummariesClientListByReservationOrderAndReservationResponse contains the response from method ReservationsSummariesClient.ListByReservationOrderAndReservation.
type ReservationsSummariesClientListByReservationOrderOptions ¶ added in v0.3.0
type ReservationsSummariesClientListByReservationOrderOptions struct { // Required only for daily grain. The properties/UsageDate for start date and end date. The filter supports 'le' and 'ge' Filter *string }
ReservationsSummariesClientListByReservationOrderOptions contains the optional parameters for the ReservationsSummariesClient.ListByReservationOrder method.
type ReservationsSummariesClientListByReservationOrderResponse ¶ added in v0.3.0
type ReservationsSummariesClientListByReservationOrderResponse struct {
ReservationSummariesListResult
}
ReservationsSummariesClientListByReservationOrderResponse contains the response from method ReservationsSummariesClient.ListByReservationOrder.
type ReservationsSummariesClientListOptions ¶ added in v0.3.0
type ReservationsSummariesClientListOptions struct { // End date. Only applicable when querying with billing profile EndDate *string // Required only for daily grain. The properties/UsageDate for start date and end date. The filter supports 'le' and 'ge'. // Not applicable when querying with billing profile Filter *string // Reservation Id GUID. Only valid if reservationOrderId is also provided. Filter to a specific reservation ReservationID *string // Reservation Order Id GUID. Required if reservationId is provided. Filter to a specific reservation order ReservationOrderID *string // Start date. Only applicable when querying with billing profile StartDate *string }
ReservationsSummariesClientListOptions contains the optional parameters for the ReservationsSummariesClient.List method.
type ReservationsSummariesClientListResponse ¶ added in v0.3.0
type ReservationsSummariesClientListResponse struct {
ReservationSummariesListResult
}
ReservationsSummariesClientListResponse contains the response from method ReservationsSummariesClient.List.
type Resource ¶
type Resource struct { // READ-ONLY; The etag for the resource. Etag *string `json:"etag,omitempty" azure:"ro"` // READ-ONLY; The full qualified ARM ID of an event. ID *string `json:"id,omitempty" azure:"ro"` // READ-ONLY; The ID that uniquely identifies an event. 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"` }
Resource - The Resource model definition.
func (Resource) MarshalJSON ¶
MarshalJSON implements the json.Marshaller interface for type Resource.
type ResourceAttributes ¶
type ResourceAttributes struct { // READ-ONLY; Resource location Location *string `json:"location,omitempty" azure:"ro"` // READ-ONLY; Resource sku SKU *string `json:"sku,omitempty" azure:"ro"` }
ResourceAttributes - The Resource model definition.
type SKUProperty ¶
type SKUProperty struct { // READ-ONLY; The name of sku property. Name *string `json:"name,omitempty" azure:"ro"` // READ-ONLY; The value of sku property. Value *string `json:"value,omitempty" azure:"ro"` }
SKUProperty - The Sku property
type Scope ¶
type Scope string
const ( ScopeSingle Scope = "Single" )
func PossibleScopeValues ¶
func PossibleScopeValues() []Scope
PossibleScopeValues returns the possible values for the Scope const type.
type Status ¶
type Status string
Status - The status of the lot.
func PossibleStatusValues ¶
func PossibleStatusValues() []Status
PossibleStatusValues returns the possible values for the Status const type.
type Tag ¶
type Tag struct { // Tag key. Key *string `json:"key,omitempty"` // Tag values. Value []*string `json:"value,omitempty"` }
Tag - The tag resource.
func (Tag) MarshalJSON ¶
MarshalJSON implements the json.Marshaller interface for type Tag.
type TagProperties ¶
type TagProperties struct { // A list of Tag. Tags []*Tag `json:"tags,omitempty"` // READ-ONLY; The link (url) to the next page of results. NextLink *string `json:"nextLink,omitempty" azure:"ro"` // READ-ONLY; The link (url) to the previous page of results. PreviousLink *string `json:"previousLink,omitempty" azure:"ro"` }
TagProperties - The properties of the tag.
func (TagProperties) MarshalJSON ¶
func (t TagProperties) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type TagProperties.
type TagsClient ¶
type TagsClient struct {
// contains filtered or unexported fields
}
TagsClient contains the methods for the Tags group. Don't use this type directly, use NewTagsClient() instead.
func NewTagsClient ¶
func NewTagsClient(credential azcore.TokenCredential, options *arm.ClientOptions) (*TagsClient, error)
NewTagsClient creates a new instance of TagsClient with the specified values. credential - used to authorize requests. Usually a credential from azidentity. options - pass nil to accept the default values.
func (*TagsClient) Get ¶
func (client *TagsClient) Get(ctx context.Context, scope string, options *TagsClientGetOptions) (TagsClientGetResponse, error)
Get - Get all available tag keys for the defined scope If the operation fails it returns an *azcore.ResponseError type. scope - The scope associated with tags 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 and '/providers/Microsoft.Management/managementGroups/{managementGroupId}' for Management Group scope.. options - TagsClientGetOptions contains the optional parameters for the TagsClient.Get method.
Example ¶
Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/consumption/resource-manager/Microsoft.Consumption/stable/2021-10-01/examples/Tags.json
package main import ( "context" "log" "github.com/Azure/azure-sdk-for-go/sdk/azidentity" "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/consumption/armconsumption" ) func main() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) return } ctx := context.Background() client, err := armconsumption.NewTagsClient(cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) return } res, err := client.Get(ctx, "<scope>", nil) if err != nil { log.Fatalf("failed to finish the request: %v", err) return } // TODO: use response item _ = res }
Output:
type TagsClientGetOptions ¶ added in v0.3.0
type TagsClientGetOptions struct { }
TagsClientGetOptions contains the optional parameters for the TagsClient.Get method.
type TagsClientGetResponse ¶ added in v0.3.0
type TagsClientGetResponse struct {
TagsResult
}
TagsClientGetResponse contains the response from method TagsClient.Get.
type TagsResult ¶
type TagsResult 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 tag. Properties *TagProperties `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"` }
TagsResult - A resource listing all tags.
type Term ¶
type Term string
func PossibleTermValues ¶
func PossibleTermValues() []Term
PossibleTermValues returns the possible values for the Term const type.
type ThresholdType ¶
type ThresholdType string
ThresholdType - The type of threshold
const ( ThresholdTypeActual ThresholdType = "Actual" ThresholdTypeForecasted ThresholdType = "Forecasted" )
func PossibleThresholdTypeValues ¶
func PossibleThresholdTypeValues() []ThresholdType
PossibleThresholdTypeValues returns the possible values for the ThresholdType const type.
type TimeGrainType ¶
type TimeGrainType string
TimeGrainType - The time covered by a budget. Tracking of the amount will be reset based on the time grain. BillingMonth, BillingQuarter, and BillingAnnual are only supported by WD customers
const ( TimeGrainTypeAnnually TimeGrainType = "Annually" TimeGrainTypeBillingAnnual TimeGrainType = "BillingAnnual" TimeGrainTypeBillingMonth TimeGrainType = "BillingMonth" TimeGrainTypeBillingQuarter TimeGrainType = "BillingQuarter" TimeGrainTypeMonthly TimeGrainType = "Monthly" TimeGrainTypeQuarterly TimeGrainType = "Quarterly" )
func PossibleTimeGrainTypeValues ¶
func PossibleTimeGrainTypeValues() []TimeGrainType
PossibleTimeGrainTypeValues returns the possible values for the TimeGrainType const type.
type UsageDetail ¶
type UsageDetail struct { // REQUIRED; Specifies the kind of usage details. Kind *UsageDetailsKind `json:"kind,omitempty"` // READ-ONLY; The etag for the resource. Etag *string `json:"etag,omitempty" azure:"ro"` // READ-ONLY; The full qualified ARM ID of an event. ID *string `json:"id,omitempty" azure:"ro"` // READ-ONLY; The ID that uniquely identifies an event. 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"` }
UsageDetail - An usage detail resource.
func (*UsageDetail) GetUsageDetail ¶
func (u *UsageDetail) GetUsageDetail() *UsageDetail
GetUsageDetail implements the UsageDetailClassification interface for type UsageDetail.
func (UsageDetail) MarshalJSON ¶ added in v0.3.0
func (u UsageDetail) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type UsageDetail.
type UsageDetailClassification ¶
type UsageDetailClassification interface { // GetUsageDetail returns the UsageDetail content of the underlying type. GetUsageDetail() *UsageDetail }
UsageDetailClassification provides polymorphic access to related types. Call the interface's GetUsageDetail() method to access the common type. Use a type switch to determine the concrete type. The possible types are: - *LegacyUsageDetail, *ModernUsageDetail, *UsageDetail
type UsageDetailsClient ¶
type UsageDetailsClient struct {
// contains filtered or unexported fields
}
UsageDetailsClient contains the methods for the UsageDetails group. Don't use this type directly, use NewUsageDetailsClient() instead.
func NewUsageDetailsClient ¶
func NewUsageDetailsClient(credential azcore.TokenCredential, options *arm.ClientOptions) (*UsageDetailsClient, error)
NewUsageDetailsClient creates a new instance of UsageDetailsClient with the specified values. credential - used to authorize requests. Usually a credential from azidentity. options - pass nil to accept the default values.
func (*UsageDetailsClient) NewListPager ¶ added in v0.5.0
func (client *UsageDetailsClient) NewListPager(scope string, options *UsageDetailsClientListOptions) *runtime.Pager[UsageDetailsClientListResponse]
NewListPager - Lists the usage details for the defined scope. Usage details are available via this API only for May 1, 2014 or later. 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 and '/providers/Microsoft.Management/managementGroups/{managementGroupId}' for Management Group scope. For subscription, billing account, department, enrollment account and management group, you can also add billing period to the scope using '/providers/Microsoft.Billing/billingPeriods/{billingPeriodName}'. For e.g. to specify billing period at department scope use '/providers/Microsoft.Billing/departments/{departmentId}/providers/Microsoft.Billing/billingPeriods/{billingPeriodName}'. 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 - UsageDetailsClientListOptions contains the optional parameters for the UsageDetailsClient.List method.
Example ¶
Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/consumption/resource-manager/Microsoft.Consumption/stable/2021-10-01/examples/UsageDetailsListByBillingAccount.json
package main import ( "context" "log" "github.com/Azure/azure-sdk-for-go/sdk/azidentity" "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/consumption/armconsumption" ) func main() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) return } ctx := context.Background() client, err := armconsumption.NewUsageDetailsClient(cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) return } pager := client.NewListPager("<scope>", &armconsumption.UsageDetailsClientListOptions{Expand: nil, Filter: nil, Skiptoken: nil, Top: nil, Metric: nil, }) for pager.More() { nextResult, err := pager.NextPage(ctx) if err != nil { log.Fatalf("failed to advance page: %v", err) return } for _, v := range nextResult.Value { // TODO: use page item _ = v } } }
Output:
type UsageDetailsClientListOptions ¶ added in v0.3.0
type UsageDetailsClientListOptions struct { // May be used to expand the properties/additionalInfo or properties/meterDetails within a list of usage details. By default, // these fields are not included when listing usage details. Expand *string // May be used to filter usageDetails by properties/resourceGroup, properties/resourceName, properties/resourceId, properties/chargeType, // properties/reservationId, properties/publisherType or tags. The // filter supports 'eq', 'lt', 'gt', 'le', 'ge', and 'and'. It does not currently support 'ne', 'or', or 'not'. Tag filter // is a key value pair string where key and value is separated by a colon (:). // PublisherType Filter accepts two values azure and marketplace and it is currently supported for Web Direct Offer Type Filter *string // Allows to select different type of cost/usage records. Metric *Metrictype // 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 usageDetails. Top *int32 }
UsageDetailsClientListOptions contains the optional parameters for the UsageDetailsClient.List method.
type UsageDetailsClientListResponse ¶ added in v0.3.0
type UsageDetailsClientListResponse struct {
UsageDetailsListResult
}
UsageDetailsClientListResponse contains the response from method UsageDetailsClient.List.
type UsageDetailsKind ¶
type UsageDetailsKind string
UsageDetailsKind - Specifies the kind of usage details.
const ( UsageDetailsKindLegacy UsageDetailsKind = "legacy" UsageDetailsKindModern UsageDetailsKind = "modern" )
func PossibleUsageDetailsKindValues ¶
func PossibleUsageDetailsKindValues() []UsageDetailsKind
PossibleUsageDetailsKindValues returns the possible values for the UsageDetailsKind const type.
type UsageDetailsListResult ¶
type UsageDetailsListResult struct { // READ-ONLY; The link (url) to the next page of results. NextLink *string `json:"nextLink,omitempty" azure:"ro"` // READ-ONLY; The list of usage details. Value []UsageDetailClassification `json:"value,omitempty" azure:"ro"` }
UsageDetailsListResult - Result of listing usage details. It contains a list of available usage details in reverse chronological order by billing period.
func (UsageDetailsListResult) MarshalJSON ¶
func (u UsageDetailsListResult) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type UsageDetailsListResult.
func (*UsageDetailsListResult) UnmarshalJSON ¶
func (u *UsageDetailsListResult) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type UsageDetailsListResult.
Source Files ¶
- build.go
- zz_generated_aggregatedcost_client.go
- zz_generated_balances_client.go
- zz_generated_budgets_client.go
- zz_generated_charges_client.go
- zz_generated_constants.go
- zz_generated_credits_client.go
- zz_generated_events_client.go
- zz_generated_lots_client.go
- zz_generated_marketplaces_client.go
- zz_generated_models.go
- zz_generated_models_serde.go
- zz_generated_operations_client.go
- zz_generated_polymorphic_helpers.go
- zz_generated_pricesheet_client.go
- zz_generated_reservationrecommendationdetails_client.go
- zz_generated_reservationrecommendations_client.go
- zz_generated_reservationsdetails_client.go
- zz_generated_reservationssummaries_client.go
- zz_generated_reservationtransactions_client.go
- zz_generated_response_types.go
- zz_generated_tags_client.go
- zz_generated_time_rfc3339.go
- zz_generated_usagedetails_client.go