costs

package
v0.20230414.1145511 Latest Latest
Warning

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

Go to latest
Published: Apr 14, 2023 License: MPL-2.0 Imports: 9 Imported by: 1

README

github.com/hashicorp/go-azure-sdk/resource-manager/devtestlab/2018-09-15/costs Documentation

The costs SDK allows for interaction with the Azure Resource Manager Service devtestlab (API Version 2018-09-15).

This readme covers example usages, but further information on using this SDK can be found in the project root.

Import Path

import "github.com/hashicorp/go-azure-sdk/resource-manager/devtestlab/2018-09-15/costs"

Client Initialization

client := costs.NewCostsClientWithBaseURI("https://management.azure.com")
client.Client.Authorizer = authorizer

Example Usage: CostsClient.CreateOrUpdate

ctx := context.TODO()
id := costs.NewCostID("12345678-1234-9876-4563-123456789012", "example-resource-group", "labValue", "costValue")

payload := costs.LabCost{
	// ...
}


read, err := client.CreateOrUpdate(ctx, id, payload)
if err != nil {
	// handle the error
}
if model := read.Model; model != nil {
	// do something with the model/response object
}

Example Usage: CostsClient.Get

ctx := context.TODO()
id := costs.NewCostID("12345678-1234-9876-4563-123456789012", "example-resource-group", "labValue", "costValue")

read, err := client.Get(ctx, id, costs.DefaultGetOperationOptions())
if err != nil {
	// handle the error
}
if model := read.Model; model != nil {
	// do something with the model/response object
}

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func PossibleValuesForCostThresholdStatus

func PossibleValuesForCostThresholdStatus() []string

func PossibleValuesForCostType

func PossibleValuesForCostType() []string

func PossibleValuesForReportingCycleType

func PossibleValuesForReportingCycleType() []string

func PossibleValuesForTargetCostStatus

func PossibleValuesForTargetCostStatus() []string

func ValidateCostID

func ValidateCostID(input interface{}, key string) (warnings []string, errors []error)

ValidateCostID checks that 'input' can be parsed as a Cost ID

Types

type CostId

type CostId struct {
	SubscriptionId    string
	ResourceGroupName string
	LabName           string
	CostName          string
}

CostId is a struct representing the Resource ID for a Cost

func NewCostID

func NewCostID(subscriptionId string, resourceGroupName string, labName string, costName string) CostId

NewCostID returns a new CostId struct

func ParseCostID

func ParseCostID(input string) (*CostId, error)

ParseCostID parses 'input' into a CostId

func ParseCostIDInsensitively

func ParseCostIDInsensitively(input string) (*CostId, error)

ParseCostIDInsensitively parses 'input' case-insensitively into a CostId note: this method should only be used for API response data and not user input

func (CostId) ID

func (id CostId) ID() string

ID returns the formatted Cost ID

func (CostId) Segments

func (id CostId) Segments() []resourceids.Segment

Segments returns a slice of Resource ID Segments which comprise this Cost ID

func (CostId) String

func (id CostId) String() string

String returns a human-readable description of this Cost ID

type CostThresholdProperties

type CostThresholdProperties struct {
	DisplayOnChart               *CostThresholdStatus               `json:"displayOnChart,omitempty"`
	NotificationSent             *string                            `json:"notificationSent,omitempty"`
	PercentageThreshold          *PercentageCostThresholdProperties `json:"percentageThreshold,omitempty"`
	SendNotificationWhenExceeded *CostThresholdStatus               `json:"sendNotificationWhenExceeded,omitempty"`
	ThresholdId                  *string                            `json:"thresholdId,omitempty"`
}

type CostThresholdStatus

type CostThresholdStatus string
const (
	CostThresholdStatusDisabled CostThresholdStatus = "Disabled"
	CostThresholdStatusEnabled  CostThresholdStatus = "Enabled"
)

type CostType

type CostType string
const (
	CostTypeProjected   CostType = "Projected"
	CostTypeReported    CostType = "Reported"
	CostTypeUnavailable CostType = "Unavailable"
)

type CostsClient

type CostsClient struct {
	Client autorest.Client
	// contains filtered or unexported fields
}

func NewCostsClientWithBaseURI

func NewCostsClientWithBaseURI(endpoint string) CostsClient

func (CostsClient) CreateOrUpdate

func (c CostsClient) CreateOrUpdate(ctx context.Context, id CostId, input LabCost) (result CreateOrUpdateOperationResponse, err error)

CreateOrUpdate ...

func (CostsClient) Get

func (c CostsClient) Get(ctx context.Context, id CostId, options GetOperationOptions) (result GetOperationResponse, err error)

Get ...

type CreateOrUpdateOperationResponse

type CreateOrUpdateOperationResponse struct {
	HttpResponse *http.Response
	Model        *LabCost
}

type GetOperationOptions

type GetOperationOptions struct {
	Expand *string
}

func DefaultGetOperationOptions

func DefaultGetOperationOptions() GetOperationOptions

type GetOperationResponse

type GetOperationResponse struct {
	HttpResponse *http.Response
	Model        *LabCost
}

type LabCost

type LabCost struct {
	Id         *string            `json:"id,omitempty"`
	Location   *string            `json:"location,omitempty"`
	Name       *string            `json:"name,omitempty"`
	Properties LabCostProperties  `json:"properties"`
	Tags       *map[string]string `json:"tags,omitempty"`
	Type       *string            `json:"type,omitempty"`
}

type LabCostDetailsProperties

type LabCostDetailsProperties struct {
	Cost     *float64  `json:"cost,omitempty"`
	CostType *CostType `json:"costType,omitempty"`
	Date     *string   `json:"date,omitempty"`
}

func (*LabCostDetailsProperties) GetDateAsTime

func (o *LabCostDetailsProperties) GetDateAsTime() (*time.Time, error)

func (*LabCostDetailsProperties) SetDateAsTime

func (o *LabCostDetailsProperties) SetDateAsTime(input time.Time)

type LabCostProperties

type LabCostProperties struct {
	CreatedDate       *string                      `json:"createdDate,omitempty"`
	CurrencyCode      *string                      `json:"currencyCode,omitempty"`
	EndDateTime       *string                      `json:"endDateTime,omitempty"`
	LabCostDetails    *[]LabCostDetailsProperties  `json:"labCostDetails,omitempty"`
	LabCostSummary    *LabCostSummaryProperties    `json:"labCostSummary,omitempty"`
	ProvisioningState *string                      `json:"provisioningState,omitempty"`
	ResourceCosts     *[]LabResourceCostProperties `json:"resourceCosts,omitempty"`
	StartDateTime     *string                      `json:"startDateTime,omitempty"`
	TargetCost        *TargetCostProperties        `json:"targetCost,omitempty"`
	UniqueIdentifier  *string                      `json:"uniqueIdentifier,omitempty"`
}

func (*LabCostProperties) GetCreatedDateAsTime

func (o *LabCostProperties) GetCreatedDateAsTime() (*time.Time, error)

func (*LabCostProperties) GetEndDateTimeAsTime

func (o *LabCostProperties) GetEndDateTimeAsTime() (*time.Time, error)

func (*LabCostProperties) GetStartDateTimeAsTime

func (o *LabCostProperties) GetStartDateTimeAsTime() (*time.Time, error)

func (*LabCostProperties) SetCreatedDateAsTime

func (o *LabCostProperties) SetCreatedDateAsTime(input time.Time)

func (*LabCostProperties) SetEndDateTimeAsTime

func (o *LabCostProperties) SetEndDateTimeAsTime(input time.Time)

func (*LabCostProperties) SetStartDateTimeAsTime

func (o *LabCostProperties) SetStartDateTimeAsTime(input time.Time)

type LabCostSummaryProperties

type LabCostSummaryProperties struct {
	EstimatedLabCost *float64 `json:"estimatedLabCost,omitempty"`
}

type LabResourceCostProperties

type LabResourceCostProperties struct {
	ExternalResourceId  *string  `json:"externalResourceId,omitempty"`
	ResourceCost        *float64 `json:"resourceCost,omitempty"`
	ResourceId          *string  `json:"resourceId,omitempty"`
	ResourceOwner       *string  `json:"resourceOwner,omitempty"`
	ResourcePricingTier *string  `json:"resourcePricingTier,omitempty"`
	ResourceStatus      *string  `json:"resourceStatus,omitempty"`
	ResourceType        *string  `json:"resourceType,omitempty"`
	ResourceUId         *string  `json:"resourceUId,omitempty"`
	Resourcename        *string  `json:"resourcename,omitempty"`
}

type PercentageCostThresholdProperties

type PercentageCostThresholdProperties struct {
	ThresholdValue *float64 `json:"thresholdValue,omitempty"`
}

type ReportingCycleType

type ReportingCycleType string
const (
	ReportingCycleTypeCalendarMonth ReportingCycleType = "CalendarMonth"
	ReportingCycleTypeCustom        ReportingCycleType = "Custom"
)

type TargetCostProperties

type TargetCostProperties struct {
	CostThresholds     *[]CostThresholdProperties `json:"costThresholds,omitempty"`
	CycleEndDateTime   *string                    `json:"cycleEndDateTime,omitempty"`
	CycleStartDateTime *string                    `json:"cycleStartDateTime,omitempty"`
	CycleType          *ReportingCycleType        `json:"cycleType,omitempty"`
	Status             *TargetCostStatus          `json:"status,omitempty"`
	Target             *int64                     `json:"target,omitempty"`
}

func (*TargetCostProperties) GetCycleEndDateTimeAsTime

func (o *TargetCostProperties) GetCycleEndDateTimeAsTime() (*time.Time, error)

func (*TargetCostProperties) GetCycleStartDateTimeAsTime

func (o *TargetCostProperties) GetCycleStartDateTimeAsTime() (*time.Time, error)

func (*TargetCostProperties) SetCycleEndDateTimeAsTime

func (o *TargetCostProperties) SetCycleEndDateTimeAsTime(input time.Time)

func (*TargetCostProperties) SetCycleStartDateTimeAsTime

func (o *TargetCostProperties) SetCycleStartDateTimeAsTime(input time.Time)

type TargetCostStatus

type TargetCostStatus string
const (
	TargetCostStatusDisabled TargetCostStatus = "Disabled"
	TargetCostStatusEnabled  TargetCostStatus = "Enabled"
)

Jump to

Keyboard shortcuts

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