consumption

package
v12.4.0-beta+incompatible Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Feb 3, 2018 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Overview

Package consumption implements the Azure ARM Consumption service API version 2017-04-24-preview.

Consumption management client provides access to consumption resources for Azure Web-Direct subscriptions. Other subscription types which were not purchased directly through the Azure web portal are not supported through this preview API.

Deprecated: Please instead use github.com/Azure/azure-sdk-for-go/services/consumption/mgmt/2017-04-24-preview/consumption

Index

Constants

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

Variables

This section is empty.

Functions

func UserAgent

func UserAgent() string

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

func Version

func Version() string

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

Types

type ErrorDetails

type ErrorDetails struct {
	Code    *string `json:"code,omitempty"`
	Message *string `json:"message,omitempty"`
	Target  *string `json:"target,omitempty"`
}

ErrorDetails is the details of the error.

type ErrorResponse

type ErrorResponse struct {
	Error *ErrorDetails `json:"error,omitempty"`
}

ErrorResponse is error response indicates that the service is not able to process the incoming request. The reason is provided in the error message.

type ManagementClient

type ManagementClient struct {
	autorest.Client
	BaseURI        string
	SubscriptionID string
}

ManagementClient is the base client for Consumption.

func New

func New(subscriptionID string) ManagementClient

New creates an instance of the ManagementClient client.

func NewWithBaseURI

func NewWithBaseURI(baseURI string, subscriptionID string) ManagementClient

NewWithBaseURI creates an instance of the ManagementClient client.

type MeterDetails

type MeterDetails struct {
	MeterName             *string          `json:"meterName,omitempty"`
	MeterCategory         *string          `json:"meterCategory,omitempty"`
	MeterSubCategory      *string          `json:"meterSubCategory,omitempty"`
	Unit                  *string          `json:"unit,omitempty"`
	MeterLocation         *string          `json:"meterLocation,omitempty"`
	TotalIncludedQuantity *decimal.Decimal `json:"totalIncludedQuantity,omitempty"`
	PretaxStandardRate    *decimal.Decimal `json:"pretaxStandardRate,omitempty"`
}

MeterDetails is the properties of the meter detail.

type Operation

type Operation struct {
	Name    *string           `json:"name,omitempty"`
	Display *OperationDisplay `json:"display,omitempty"`
}

Operation is a Consumption REST API operation.

type OperationDisplay

type OperationDisplay struct {
	Provider  *string `json:"provider,omitempty"`
	Resource  *string `json:"resource,omitempty"`
	Operation *string `json:"operation,omitempty"`
}

OperationDisplay is the object that represents the operation.

type OperationListResult

type OperationListResult struct {
	autorest.Response `json:"-"`
	Value             *[]Operation `json:"value,omitempty"`
	NextLink          *string      `json:"nextLink,omitempty"`
}

OperationListResult is result of listing consumption operations. It contains a list of operations and a URL link to get the next set of results.

func (OperationListResult) OperationListResultPreparer

func (client OperationListResult) OperationListResultPreparer() (*http.Request, error)

OperationListResultPreparer prepares a request to retrieve the next set of results. It returns nil if no more results exist.

type OperationsClient

type OperationsClient struct {
	ManagementClient
}

OperationsClient is the consumption management client provides access to consumption resources for Azure Web-Direct subscriptions. Other subscription types which were not purchased directly through the Azure web portal are not supported through this preview API.

func NewOperationsClient

func NewOperationsClient(subscriptionID string) OperationsClient

NewOperationsClient creates an instance of the OperationsClient client.

func NewOperationsClientWithBaseURI

func NewOperationsClientWithBaseURI(baseURI string, subscriptionID string) OperationsClient

NewOperationsClientWithBaseURI creates an instance of the OperationsClient client.

func (OperationsClient) List

func (client OperationsClient) List() (result OperationListResult, err error)

List lists all of the available consumption REST API operations.

func (OperationsClient) ListComplete

func (client OperationsClient) ListComplete(cancel <-chan struct{}) (<-chan Operation, <-chan error)

ListComplete gets all elements from the list without paging.

func (OperationsClient) ListNextResults

func (client OperationsClient) ListNextResults(lastResults OperationListResult) (result OperationListResult, err error)

ListNextResults retrieves the next set of results, if any.

func (OperationsClient) ListPreparer

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

ListPreparer prepares the List request.

func (OperationsClient) ListResponder

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

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 Resource

type Resource struct {
	ID   *string             `json:"id,omitempty"`
	Name *string             `json:"name,omitempty"`
	Type *string             `json:"type,omitempty"`
	Tags *map[string]*string `json:"tags,omitempty"`
}

Resource is the Resource model definition.

type UsageDetail

type UsageDetail struct {
	ID                     *string             `json:"id,omitempty"`
	Name                   *string             `json:"name,omitempty"`
	Type                   *string             `json:"type,omitempty"`
	Tags                   *map[string]*string `json:"tags,omitempty"`
	*UsageDetailProperties `json:"properties,omitempty"`
}

UsageDetail is an usage detail resource.

type UsageDetailProperties

type UsageDetailProperties struct {
	BillingPeriodID      *string             `json:"billingPeriodId,omitempty"`
	InvoiceID            *string             `json:"invoiceId,omitempty"`
	UsageStart           *date.Time          `json:"usageStart,omitempty"`
	UsageEnd             *date.Time          `json:"usageEnd,omitempty"`
	InstanceName         *string             `json:"instanceName,omitempty"`
	InstanceID           *string             `json:"instanceId,omitempty"`
	InstanceLocation     *string             `json:"instanceLocation,omitempty"`
	Currency             *string             `json:"currency,omitempty"`
	UsageQuantity        *decimal.Decimal    `json:"usageQuantity,omitempty"`
	BillableQuantity     *decimal.Decimal    `json:"billableQuantity,omitempty"`
	PretaxCost           *decimal.Decimal    `json:"pretaxCost,omitempty"`
	IsEstimated          *bool               `json:"isEstimated,omitempty"`
	MeterID              *string             `json:"meterId,omitempty"`
	MeterDetails         *MeterDetails       `json:"meterDetails,omitempty"`
	AdditionalProperties *map[string]*string `json:"additionalProperties,omitempty"`
}

UsageDetailProperties is the properties of the usage detail.

type UsageDetailsClient

type UsageDetailsClient struct {
	ManagementClient
}

UsageDetailsClient is the consumption management client provides access to consumption resources for Azure Web-Direct subscriptions. Other subscription types which were not purchased directly through the Azure web portal are not supported through this preview API.

func NewUsageDetailsClient

func NewUsageDetailsClient(subscriptionID string) UsageDetailsClient

NewUsageDetailsClient creates an instance of the UsageDetailsClient client.

func NewUsageDetailsClientWithBaseURI

func NewUsageDetailsClientWithBaseURI(baseURI string, subscriptionID string) UsageDetailsClient

NewUsageDetailsClientWithBaseURI creates an instance of the UsageDetailsClient client.

func (UsageDetailsClient) List

func (client UsageDetailsClient) List(scope string, expand string, filter string, skiptoken string, top *int32) (result UsageDetailsListResult, err error)

List lists the usage details for a scope in reverse chronological order by billing period. Usage details are available via this API only for January 1, 2017 or later.

scope is the scope of the usage details. The scope can be '/subscriptions/{subscriptionId}' for a subscription, or '/subscriptions/{subscriptionId}/providers/Microsoft.Billing/invoices/{invoiceName}' for an invoice or '/subscriptions/{subscriptionId}/providers/Microsoft.Billing/billingPeriods/{billingPeriodName}' for a billing perdiod. expand is may be used to expand the additionalProperties or meterDetails property within a list of usage details. By default, these fields are not included when listing usage details. filter is may be used to filter usageDetails by usageEnd (Utc time). The filter supports 'eq', 'lt', 'gt', 'le', 'ge', and 'and'. It does not currently support 'ne', 'or', or 'not'. skiptoken is 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. top is may be used to limit the number of results to the most recent N usageDetails.

func (UsageDetailsClient) ListComplete

func (client UsageDetailsClient) ListComplete(scope string, expand string, filter string, skiptoken string, top *int32, cancel <-chan struct{}) (<-chan UsageDetail, <-chan error)

ListComplete gets all elements from the list without paging.

func (UsageDetailsClient) ListNextResults

func (client UsageDetailsClient) ListNextResults(lastResults UsageDetailsListResult) (result UsageDetailsListResult, err error)

ListNextResults retrieves the next set of results, if any.

func (UsageDetailsClient) ListPreparer

func (client UsageDetailsClient) ListPreparer(scope string, expand string, filter string, skiptoken string, top *int32) (*http.Request, error)

ListPreparer prepares the List request.

func (UsageDetailsClient) ListResponder

func (client UsageDetailsClient) ListResponder(resp *http.Response) (result UsageDetailsListResult, err error)

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

func (UsageDetailsClient) ListSender

func (client UsageDetailsClient) 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 UsageDetailsListResult

type UsageDetailsListResult struct {
	autorest.Response `json:"-"`
	Value             *[]UsageDetail `json:"value,omitempty"`
	NextLink          *string        `json:"nextLink,omitempty"`
}

UsageDetailsListResult is result of listing usage details. It contains a list of available usage details in reverse chronological order by billing period.

func (UsageDetailsListResult) UsageDetailsListResultPreparer

func (client UsageDetailsListResult) UsageDetailsListResultPreparer() (*http.Request, error)

UsageDetailsListResultPreparer prepares a request to retrieve the next set of results. It returns nil if no more results exist.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL