azure-sdk-for-go: github.com/Azure/azure-sdk-for-go/services/preview/consumption/mgmt/2017-12-30-preview/consumption Index | Files | Directories

package consumption

import "github.com/Azure/azure-sdk-for-go/services/preview/consumption/mgmt/2017-12-30-preview/consumption"

Package consumption implements the Azure ARM Consumption service API version 2017-12-30-preview.

Consumption management client provides access to consumption resources for Azure Enterprise Subscriptions.

Index

Package Files

budgets.go client.go models.go operations.go version.go

Constants

const (
    // DefaultBaseURI is the default URI used for the service Consumption
    DefaultBaseURI = "https://management.azure.com"
)

func UserAgent Uses

func UserAgent() string

UserAgent returns the UserAgent string to use when sending http.Requests.

func Version Uses

func Version() string

Version returns the semantic version (see http://semver.org) of the client.

type BaseClient Uses

type BaseClient struct {
    autorest.Client
    BaseURI        string
    SubscriptionID string
    Name           string
}

BaseClient is the base client for Consumption.

func New Uses

func New(subscriptionID string, name string) BaseClient

New creates an instance of the BaseClient client.

func NewWithBaseURI Uses

func NewWithBaseURI(baseURI string, subscriptionID string, name string) BaseClient

NewWithBaseURI creates an instance of the BaseClient client.

type Budget Uses

type Budget struct {
    autorest.Response `json:"-"`
    *BudgetProperties `json:"properties,omitempty"`
    // ID - READ-ONLY; Resource Id.
    ID  *string `json:"id,omitempty"`
    // Name - READ-ONLY; Resource name.
    Name *string `json:"name,omitempty"`
    // Type - READ-ONLY; Resource type.
    Type *string `json:"type,omitempty"`
    // ETag - 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"`
}

Budget a budget resource.

func (Budget) MarshalJSON Uses

func (b Budget) MarshalJSON() ([]byte, error)

MarshalJSON is the custom marshaler for Budget.

func (*Budget) UnmarshalJSON Uses

func (b *Budget) UnmarshalJSON(body []byte) error

UnmarshalJSON is the custom unmarshaler for Budget struct.

type BudgetProperties Uses

type BudgetProperties struct {
    // Category - The category of the budget, whether the budget tracks cost or something else.
    Category *string `json:"category,omitempty"`
    // Amount - The total amount of cost to track with the budget
    Amount *decimal.Decimal `json:"amount,omitempty"`
    // TimeGrain - The time covered by a budget. Tracking of the amount will be reset based on the time grain. Possible values include: 'Monthly', 'Quarterly', 'Annually'
    TimeGrain TimeGrainType `json:"timeGrain,omitempty"`
    // TimePeriod - 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 three months. Past start date should  be selected within the timegrain period. There are no restrictions on the end date.
    TimePeriod *BudgetTimePeriod `json:"timePeriod,omitempty"`
    // CurrentSpend - READ-ONLY; The current amount of cost which is being tracked for a budget.
    CurrentSpend *CurrentSpend `json:"currentSpend,omitempty"`
    // Notifications - Dictionary of notifications associated with the budget. Budget can have up to five notifications.
    Notifications map[string]*Notification `json:"notifications"`
}

BudgetProperties the properties of the budget.

func (BudgetProperties) MarshalJSON Uses

func (bp BudgetProperties) MarshalJSON() ([]byte, error)

MarshalJSON is the custom marshaler for BudgetProperties.

type BudgetTimePeriod Uses

type BudgetTimePeriod struct {
    // StartDate - The start date for the budget.
    StartDate *date.Time `json:"startDate,omitempty"`
    // EndDate - The end date for the budget. If not provided, we default this to 10 years from the start date.
    EndDate *date.Time `json:"endDate,omitempty"`
}

BudgetTimePeriod the start and end date for a budget.

type BudgetsClient Uses

type BudgetsClient struct {
    BaseClient
}

BudgetsClient is the consumption management client provides access to consumption resources for Azure Enterprise Subscriptions.

func NewBudgetsClient Uses

func NewBudgetsClient(subscriptionID string, name string) BudgetsClient

NewBudgetsClient creates an instance of the BudgetsClient client.

func NewBudgetsClientWithBaseURI Uses

func NewBudgetsClientWithBaseURI(baseURI string, subscriptionID string, name string) BudgetsClient

NewBudgetsClientWithBaseURI creates an instance of the BudgetsClient client.

func (BudgetsClient) CreateOrUpdate Uses

func (client BudgetsClient) CreateOrUpdate(ctx context.Context, parameters Budget) (result Budget, err error)

CreateOrUpdate the operation to create or update a budget. Update operation requires latest eTag to be set in the request mandatorily. You may obtain the latest eTag by performing a get operation. Create operation does not require eTag. Parameters: parameters - parameters supplied to the Create Budget operation.

func (BudgetsClient) CreateOrUpdatePreparer Uses

func (client BudgetsClient) CreateOrUpdatePreparer(ctx context.Context, parameters Budget) (*http.Request, error)

CreateOrUpdatePreparer prepares the CreateOrUpdate request.

func (BudgetsClient) CreateOrUpdateResponder Uses

func (client BudgetsClient) CreateOrUpdateResponder(resp *http.Response) (result Budget, err error)

CreateOrUpdateResponder handles the response to the CreateOrUpdate request. The method always closes the http.Response Body.

func (BudgetsClient) CreateOrUpdateSender Uses

func (client BudgetsClient) CreateOrUpdateSender(req *http.Request) (*http.Response, error)

CreateOrUpdateSender sends the CreateOrUpdate request. The method will close the http.Response Body if it receives an error.

func (BudgetsClient) Delete Uses

func (client BudgetsClient) Delete(ctx context.Context) (result autorest.Response, err error)

Delete the operation to delete a budget.

func (BudgetsClient) DeletePreparer Uses

func (client BudgetsClient) DeletePreparer(ctx context.Context) (*http.Request, error)

DeletePreparer prepares the Delete request.

func (BudgetsClient) DeleteResponder Uses

func (client BudgetsClient) DeleteResponder(resp *http.Response) (result autorest.Response, err error)

DeleteResponder handles the response to the Delete request. The method always closes the http.Response Body.

func (BudgetsClient) DeleteSender Uses

func (client BudgetsClient) DeleteSender(req *http.Request) (*http.Response, error)

DeleteSender sends the Delete request. The method will close the http.Response Body if it receives an error.

func (BudgetsClient) Get Uses

func (client BudgetsClient) Get(ctx context.Context) (result Budget, err error)

Get gets the budget for a subscription by budget name.

func (BudgetsClient) GetPreparer Uses

func (client BudgetsClient) GetPreparer(ctx context.Context) (*http.Request, error)

GetPreparer prepares the Get request.

func (BudgetsClient) GetResponder Uses

func (client BudgetsClient) GetResponder(resp *http.Response) (result Budget, err error)

GetResponder handles the response to the Get request. The method always closes the http.Response Body.

func (BudgetsClient) GetSender Uses

func (client BudgetsClient) GetSender(req *http.Request) (*http.Response, error)

GetSender sends the Get request. The method will close the http.Response Body if it receives an error.

func (BudgetsClient) List Uses

func (client BudgetsClient) List(ctx context.Context) (result BudgetsListResult, err error)

List lists all budgets for a subscription.

func (BudgetsClient) ListPreparer Uses

func (client BudgetsClient) ListPreparer(ctx context.Context) (*http.Request, error)

ListPreparer prepares the List request.

func (BudgetsClient) ListResponder Uses

func (client BudgetsClient) ListResponder(resp *http.Response) (result BudgetsListResult, err error)

ListResponder handles the response to the List request. The method always closes the http.Response Body.

func (BudgetsClient) ListSender Uses

func (client BudgetsClient) ListSender(req *http.Request) (*http.Response, error)

ListSender sends the List request. The method will close the http.Response Body if it receives an error.

type BudgetsListResult Uses

type BudgetsListResult struct {
    autorest.Response `json:"-"`
    // Value - READ-ONLY; The list of budgets.
    Value *[]Budget `json:"value,omitempty"`
}

BudgetsListResult result of listing budgets. It contains a list of available budgets in the scope provided.

type CurrentSpend Uses

type CurrentSpend struct {
    // Amount - READ-ONLY; The total amount of cost which is being tracked by the budget.
    Amount *decimal.Decimal `json:"amount,omitempty"`
    // Unit - READ-ONLY; The unit of measure for the budget amount.
    Unit *string `json:"unit,omitempty"`
}

CurrentSpend the current amount of cost which is being tracked for a budget.

type ErrorDetails Uses

type ErrorDetails struct {
    // Code - READ-ONLY; Error code.
    Code *string `json:"code,omitempty"`
    // Message - READ-ONLY; Error message indicating why the operation failed.
    Message *string `json:"message,omitempty"`
}

ErrorDetails the details of the error.

type ErrorResponse Uses

type ErrorResponse struct {
    // Error - 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.

type Notification Uses

type Notification struct {
    // Enabled - The notification is enabled or not.
    Enabled *bool `json:"enabled,omitempty"`
    // Operator - The comparison operator. Possible values include: 'EqualTo', 'GreaterThan', 'GreaterThanOrEqualTo'
    Operator OperatorType `json:"operator,omitempty"`
    // Threshold - 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 *decimal.Decimal `json:"threshold,omitempty"`
    // ContactEmails - Email addresses to send the budget notification to when the threshold is exceeded.
    ContactEmails *[]string `json:"contactEmails,omitempty"`
    // ContactRoles - Contact roles to send the budget notification to when the threshold is exceeded.
    ContactRoles *[]string `json:"contactRoles,omitempty"`
}

Notification the notification associated with a budget.

type Operation Uses

type Operation struct {
    // Name - READ-ONLY; Operation name: {provider}/{resource}/{operation}.
    Name *string `json:"name,omitempty"`
    // Display - The object that represents the operation.
    Display *OperationDisplay `json:"display,omitempty"`
}

Operation a Consumption REST API operation.

type OperationDisplay Uses

type OperationDisplay struct {
    // Provider - READ-ONLY; Service provider: Microsoft.Consumption.
    Provider *string `json:"provider,omitempty"`
    // Resource - READ-ONLY; Resource on which the operation is performed: UsageDetail, etc.
    Resource *string `json:"resource,omitempty"`
    // Operation - READ-ONLY; Operation type: Read, write, delete, etc.
    Operation *string `json:"operation,omitempty"`
}

OperationDisplay the object that represents the operation.

type OperationListResult Uses

type OperationListResult struct {
    autorest.Response `json:"-"`
    // Value - READ-ONLY; List of consumption operations supported by the Microsoft.Consumption resource provider.
    Value *[]Operation `json:"value,omitempty"`
    // NextLink - READ-ONLY; URL to get the next set of operation list results if there are any.
    NextLink *string `json:"nextLink,omitempty"`
}

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) IsEmpty Uses

func (olr OperationListResult) IsEmpty() bool

IsEmpty returns true if the ListResult contains no values.

type OperationListResultIterator Uses

type OperationListResultIterator struct {
    // contains filtered or unexported fields
}

OperationListResultIterator provides access to a complete listing of Operation values.

func NewOperationListResultIterator Uses

func NewOperationListResultIterator(page OperationListResultPage) OperationListResultIterator

Creates a new instance of the OperationListResultIterator type.

func (*OperationListResultIterator) Next Uses

func (iter *OperationListResultIterator) Next() error

Next advances to the next value. If there was an error making the request the iterator does not advance and the error is returned. Deprecated: Use NextWithContext() instead.

func (*OperationListResultIterator) NextWithContext Uses

func (iter *OperationListResultIterator) NextWithContext(ctx context.Context) (err error)

NextWithContext advances to the next value. If there was an error making the request the iterator does not advance and the error is returned.

func (OperationListResultIterator) NotDone Uses

func (iter OperationListResultIterator) NotDone() bool

NotDone returns true if the enumeration should be started or is not yet complete.

func (OperationListResultIterator) Response Uses

func (iter OperationListResultIterator) Response() OperationListResult

Response returns the raw server response from the last page request.

func (OperationListResultIterator) Value Uses

func (iter OperationListResultIterator) Value() Operation

Value returns the current value or a zero-initialized value if the iterator has advanced beyond the end of the collection.

type OperationListResultPage Uses

type OperationListResultPage struct {
    // contains filtered or unexported fields
}

OperationListResultPage contains a page of Operation values.

func NewOperationListResultPage Uses

func NewOperationListResultPage(getNextPage func(context.Context, OperationListResult) (OperationListResult, error)) OperationListResultPage

Creates a new instance of the OperationListResultPage type.

func (*OperationListResultPage) Next Uses

func (page *OperationListResultPage) Next() error

Next advances to the next page of values. If there was an error making the request the page does not advance and the error is returned. Deprecated: Use NextWithContext() instead.

func (*OperationListResultPage) NextWithContext Uses

func (page *OperationListResultPage) NextWithContext(ctx context.Context) (err error)

NextWithContext advances to the next page of values. If there was an error making the request the page does not advance and the error is returned.

func (OperationListResultPage) NotDone Uses

func (page OperationListResultPage) NotDone() bool

NotDone returns true if the page enumeration should be started or is not yet complete.

func (OperationListResultPage) Response Uses

func (page OperationListResultPage) Response() OperationListResult

Response returns the raw server response from the last page request.

func (OperationListResultPage) Values Uses

func (page OperationListResultPage) Values() []Operation

Values returns the slice of values for the current page or nil if there are no values.

type OperationsClient Uses

type OperationsClient struct {
    BaseClient
}

OperationsClient is the consumption management client provides access to consumption resources for Azure Enterprise Subscriptions.

func NewOperationsClient Uses

func NewOperationsClient(subscriptionID string, name string) OperationsClient

NewOperationsClient creates an instance of the OperationsClient client.

func NewOperationsClientWithBaseURI Uses

func NewOperationsClientWithBaseURI(baseURI string, subscriptionID string, name string) OperationsClient

NewOperationsClientWithBaseURI creates an instance of the OperationsClient client.

func (OperationsClient) List Uses

func (client OperationsClient) List(ctx context.Context) (result OperationListResultPage, err error)

List lists all of the available consumption REST API operations.

func (OperationsClient) ListComplete Uses

func (client OperationsClient) ListComplete(ctx context.Context) (result OperationListResultIterator, err error)

ListComplete enumerates all values, automatically crossing page boundaries as required.

func (OperationsClient) ListPreparer Uses

func (client OperationsClient) ListPreparer(ctx context.Context) (*http.Request, error)

ListPreparer prepares the List request.

func (OperationsClient) ListResponder Uses

func (client OperationsClient) ListResponder(resp *http.Response) (result OperationListResult, err error)

ListResponder handles the response to the List request. The method always closes the http.Response Body.

func (OperationsClient) ListSender Uses

func (client OperationsClient) ListSender(req *http.Request) (*http.Response, error)

ListSender sends the List request. The method will close the http.Response Body if it receives an error.

type OperatorType Uses

type OperatorType string

OperatorType enumerates the values for operator type.

const (
    // EqualTo ...
    EqualTo OperatorType = "EqualTo"
    // GreaterThan ...
    GreaterThan OperatorType = "GreaterThan"
    // GreaterThanOrEqualTo ...
    GreaterThanOrEqualTo OperatorType = "GreaterThanOrEqualTo"
)

func PossibleOperatorTypeValues Uses

func PossibleOperatorTypeValues() []OperatorType

PossibleOperatorTypeValues returns an array of possible values for the OperatorType const type.

type ProxyResource Uses

type ProxyResource struct {
    // ID - READ-ONLY; Resource Id.
    ID  *string `json:"id,omitempty"`
    // Name - READ-ONLY; Resource name.
    Name *string `json:"name,omitempty"`
    // Type - READ-ONLY; Resource type.
    Type *string `json:"type,omitempty"`
    // ETag - 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"`
}

ProxyResource the Resource model definition.

type TimeGrainType Uses

type TimeGrainType string

TimeGrainType enumerates the values for time grain type.

const (
    // Annually ...
    Annually TimeGrainType = "Annually"
    // Monthly ...
    Monthly TimeGrainType = "Monthly"
    // Quarterly ...
    Quarterly TimeGrainType = "Quarterly"
)

func PossibleTimeGrainTypeValues Uses

func PossibleTimeGrainTypeValues() []TimeGrainType

PossibleTimeGrainTypeValues returns an array of possible values for the TimeGrainType const type.

Directories

PathSynopsis
consumptionapi

Package consumption imports 11 packages (graph) and is imported by 4 packages. Updated 2019-07-30. Refresh now. Tools for package owners.