exports

package
v0.20241004.1180715 Latest Latest
Warning

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

Go to latest
Published: Oct 4, 2024 License: MPL-2.0 Imports: 15 Imported by: 0

README

github.com/hashicorp/go-azure-sdk/resource-manager/costmanagement/2023-08-01/exports Documentation

The exports SDK allows for interaction with Azure Resource Manager costmanagement (API Version 2023-08-01).

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-helpers/resourcemanager/commonids"
import "github.com/hashicorp/go-azure-sdk/resource-manager/costmanagement/2023-08-01/exports"

Client Initialization

client := exports.NewExportsClientWithBaseURI("https://management.azure.com")
client.Client.Authorizer = authorizer

Example Usage: ExportsClient.CreateOrUpdate

ctx := context.TODO()
id := exports.NewScopedExportID("/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/some-resource-group", "exportName")

payload := exports.Export{
	// ...
}


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: ExportsClient.Delete

ctx := context.TODO()
id := exports.NewScopedExportID("/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/some-resource-group", "exportName")

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

Example Usage: ExportsClient.Execute

ctx := context.TODO()
id := exports.NewScopedExportID("/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/some-resource-group", "exportName")

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

Example Usage: ExportsClient.Get

ctx := context.TODO()
id := exports.NewScopedExportID("/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/some-resource-group", "exportName")

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

Example Usage: ExportsClient.GetExecutionHistory

ctx := context.TODO()
id := exports.NewScopedExportID("/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/some-resource-group", "exportName")

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

Example Usage: ExportsClient.List

ctx := context.TODO()
id := commonids.NewScopeID("/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/some-resource-group")

read, err := client.List(ctx, id, exports.DefaultListOperationOptions())
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 PossibleValuesForExecutionStatus

func PossibleValuesForExecutionStatus() []string

func PossibleValuesForExecutionType

func PossibleValuesForExecutionType() []string

func PossibleValuesForExportType

func PossibleValuesForExportType() []string

func PossibleValuesForFormatType

func PossibleValuesForFormatType() []string

func PossibleValuesForGranularityType

func PossibleValuesForGranularityType() []string

func PossibleValuesForRecurrenceType

func PossibleValuesForRecurrenceType() []string

func PossibleValuesForStatusType

func PossibleValuesForStatusType() []string

func PossibleValuesForTimeframeType

func PossibleValuesForTimeframeType() []string

func ValidateScopedExportID

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

ValidateScopedExportID checks that 'input' can be parsed as a Scoped Export ID

Types

type CommonExportProperties

type CommonExportProperties struct {
	Definition          ExportDefinition           `json:"definition"`
	DeliveryInfo        ExportDeliveryInfo         `json:"deliveryInfo"`
	Format              *FormatType                `json:"format,omitempty"`
	NextRunTimeEstimate *string                    `json:"nextRunTimeEstimate,omitempty"`
	PartitionData       *bool                      `json:"partitionData,omitempty"`
	RunHistory          *ExportExecutionListResult `json:"runHistory,omitempty"`
}

func (*CommonExportProperties) GetNextRunTimeEstimateAsTime

func (o *CommonExportProperties) GetNextRunTimeEstimateAsTime() (*time.Time, error)

func (*CommonExportProperties) SetNextRunTimeEstimateAsTime

func (o *CommonExportProperties) SetNextRunTimeEstimateAsTime(input time.Time)

type CreateOrUpdateOperationResponse

type CreateOrUpdateOperationResponse struct {
	HttpResponse *http.Response
	OData        *odata.OData
	Model        *Export
}

type DeleteOperationResponse

type DeleteOperationResponse struct {
	HttpResponse *http.Response
	OData        *odata.OData
}

type ErrorDetails

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

type ExecuteOperationResponse

type ExecuteOperationResponse struct {
	HttpResponse *http.Response
	OData        *odata.OData
}

type ExecutionStatus

type ExecutionStatus string
const (
	ExecutionStatusCompleted           ExecutionStatus = "Completed"
	ExecutionStatusDataNotAvailable    ExecutionStatus = "DataNotAvailable"
	ExecutionStatusFailed              ExecutionStatus = "Failed"
	ExecutionStatusInProgress          ExecutionStatus = "InProgress"
	ExecutionStatusNewDataNotAvailable ExecutionStatus = "NewDataNotAvailable"
	ExecutionStatusQueued              ExecutionStatus = "Queued"
	ExecutionStatusTimeout             ExecutionStatus = "Timeout"
)

func (*ExecutionStatus) UnmarshalJSON

func (s *ExecutionStatus) UnmarshalJSON(bytes []byte) error

type ExecutionType

type ExecutionType string
const (
	ExecutionTypeOnDemand  ExecutionType = "OnDemand"
	ExecutionTypeScheduled ExecutionType = "Scheduled"
)

func (*ExecutionType) UnmarshalJSON

func (s *ExecutionType) UnmarshalJSON(bytes []byte) error

type Export

type Export struct {
	ETag       *string                  `json:"eTag,omitempty"`
	Id         *string                  `json:"id,omitempty"`
	Identity   *identity.SystemAssigned `json:"identity,omitempty"`
	Location   *string                  `json:"location,omitempty"`
	Name       *string                  `json:"name,omitempty"`
	Properties *ExportProperties        `json:"properties,omitempty"`
	Type       *string                  `json:"type,omitempty"`
}

type ExportDataset

type ExportDataset struct {
	Configuration *ExportDatasetConfiguration `json:"configuration,omitempty"`
	Granularity   *GranularityType            `json:"granularity,omitempty"`
}

type ExportDatasetConfiguration

type ExportDatasetConfiguration struct {
	Columns *[]string `json:"columns,omitempty"`
}

type ExportDefinition

type ExportDefinition struct {
	DataSet    *ExportDataset    `json:"dataSet,omitempty"`
	TimePeriod *ExportTimePeriod `json:"timePeriod,omitempty"`
	Timeframe  TimeframeType     `json:"timeframe"`
	Type       ExportType        `json:"type"`
}

type ExportDeliveryDestination

type ExportDeliveryDestination struct {
	Container      string  `json:"container"`
	ResourceId     *string `json:"resourceId,omitempty"`
	RootFolderPath *string `json:"rootFolderPath,omitempty"`
	SasToken       *string `json:"sasToken,omitempty"`
	StorageAccount *string `json:"storageAccount,omitempty"`
}

type ExportDeliveryInfo

type ExportDeliveryInfo struct {
	Destination ExportDeliveryDestination `json:"destination"`
}

type ExportExecutionListResult

type ExportExecutionListResult struct {
	Value *[]ExportRun `json:"value,omitempty"`
}

type ExportListResult

type ExportListResult struct {
	Value *[]Export `json:"value,omitempty"`
}

type ExportProperties

type ExportProperties struct {
	Definition          ExportDefinition           `json:"definition"`
	DeliveryInfo        ExportDeliveryInfo         `json:"deliveryInfo"`
	Format              *FormatType                `json:"format,omitempty"`
	NextRunTimeEstimate *string                    `json:"nextRunTimeEstimate,omitempty"`
	PartitionData       *bool                      `json:"partitionData,omitempty"`
	RunHistory          *ExportExecutionListResult `json:"runHistory,omitempty"`
	Schedule            *ExportSchedule            `json:"schedule,omitempty"`
}

func (*ExportProperties) GetNextRunTimeEstimateAsTime

func (o *ExportProperties) GetNextRunTimeEstimateAsTime() (*time.Time, error)

func (*ExportProperties) SetNextRunTimeEstimateAsTime

func (o *ExportProperties) SetNextRunTimeEstimateAsTime(input time.Time)

type ExportRecurrencePeriod

type ExportRecurrencePeriod struct {
	From string  `json:"from"`
	To   *string `json:"to,omitempty"`
}

func (*ExportRecurrencePeriod) GetFromAsTime

func (o *ExportRecurrencePeriod) GetFromAsTime() (*time.Time, error)

func (*ExportRecurrencePeriod) GetToAsTime

func (o *ExportRecurrencePeriod) GetToAsTime() (*time.Time, error)

func (*ExportRecurrencePeriod) SetFromAsTime

func (o *ExportRecurrencePeriod) SetFromAsTime(input time.Time)

func (*ExportRecurrencePeriod) SetToAsTime

func (o *ExportRecurrencePeriod) SetToAsTime(input time.Time)

type ExportRun

type ExportRun struct {
	ETag       *string              `json:"eTag,omitempty"`
	Id         *string              `json:"id,omitempty"`
	Name       *string              `json:"name,omitempty"`
	Properties *ExportRunProperties `json:"properties,omitempty"`
	Type       *string              `json:"type,omitempty"`
}

type ExportRunProperties

type ExportRunProperties struct {
	Error               *ErrorDetails           `json:"error,omitempty"`
	ExecutionType       *ExecutionType          `json:"executionType,omitempty"`
	FileName            *string                 `json:"fileName,omitempty"`
	ProcessingEndTime   *string                 `json:"processingEndTime,omitempty"`
	ProcessingStartTime *string                 `json:"processingStartTime,omitempty"`
	RunSettings         *CommonExportProperties `json:"runSettings,omitempty"`
	Status              *ExecutionStatus        `json:"status,omitempty"`
	SubmittedBy         *string                 `json:"submittedBy,omitempty"`
	SubmittedTime       *string                 `json:"submittedTime,omitempty"`
}

func (*ExportRunProperties) GetProcessingEndTimeAsTime

func (o *ExportRunProperties) GetProcessingEndTimeAsTime() (*time.Time, error)

func (*ExportRunProperties) GetProcessingStartTimeAsTime

func (o *ExportRunProperties) GetProcessingStartTimeAsTime() (*time.Time, error)

func (*ExportRunProperties) GetSubmittedTimeAsTime

func (o *ExportRunProperties) GetSubmittedTimeAsTime() (*time.Time, error)

func (*ExportRunProperties) SetProcessingEndTimeAsTime

func (o *ExportRunProperties) SetProcessingEndTimeAsTime(input time.Time)

func (*ExportRunProperties) SetProcessingStartTimeAsTime

func (o *ExportRunProperties) SetProcessingStartTimeAsTime(input time.Time)

func (*ExportRunProperties) SetSubmittedTimeAsTime

func (o *ExportRunProperties) SetSubmittedTimeAsTime(input time.Time)

type ExportSchedule

type ExportSchedule struct {
	Recurrence       *RecurrenceType         `json:"recurrence,omitempty"`
	RecurrencePeriod *ExportRecurrencePeriod `json:"recurrencePeriod,omitempty"`
	Status           *StatusType             `json:"status,omitempty"`
}

type ExportTimePeriod

type ExportTimePeriod struct {
	From string `json:"from"`
	To   string `json:"to"`
}

func (*ExportTimePeriod) GetFromAsTime

func (o *ExportTimePeriod) GetFromAsTime() (*time.Time, error)

func (*ExportTimePeriod) GetToAsTime

func (o *ExportTimePeriod) GetToAsTime() (*time.Time, error)

func (*ExportTimePeriod) SetFromAsTime

func (o *ExportTimePeriod) SetFromAsTime(input time.Time)

func (*ExportTimePeriod) SetToAsTime

func (o *ExportTimePeriod) SetToAsTime(input time.Time)

type ExportType

type ExportType string
const (
	ExportTypeActualCost    ExportType = "ActualCost"
	ExportTypeAmortizedCost ExportType = "AmortizedCost"
	ExportTypeUsage         ExportType = "Usage"
)

func (*ExportType) UnmarshalJSON

func (s *ExportType) UnmarshalJSON(bytes []byte) error

type ExportsClient

type ExportsClient struct {
	Client *resourcemanager.Client
}

func NewExportsClientWithBaseURI

func NewExportsClientWithBaseURI(sdkApi sdkEnv.Api) (*ExportsClient, error)

func (ExportsClient) CreateOrUpdate

func (c ExportsClient) CreateOrUpdate(ctx context.Context, id ScopedExportId, input Export) (result CreateOrUpdateOperationResponse, err error)

CreateOrUpdate ...

func (ExportsClient) Delete

func (c ExportsClient) Delete(ctx context.Context, id ScopedExportId) (result DeleteOperationResponse, err error)

Delete ...

func (ExportsClient) Execute

func (c ExportsClient) Execute(ctx context.Context, id ScopedExportId) (result ExecuteOperationResponse, err error)

Execute ...

func (ExportsClient) Get

Get ...

func (ExportsClient) GetExecutionHistory

func (c ExportsClient) GetExecutionHistory(ctx context.Context, id ScopedExportId) (result GetExecutionHistoryOperationResponse, err error)

GetExecutionHistory ...

func (ExportsClient) List

List ...

type FormatType

type FormatType string
const (
	FormatTypeCsv FormatType = "Csv"
)

func (*FormatType) UnmarshalJSON

func (s *FormatType) UnmarshalJSON(bytes []byte) error

type GetExecutionHistoryOperationResponse

type GetExecutionHistoryOperationResponse struct {
	HttpResponse *http.Response
	OData        *odata.OData
	Model        *ExportExecutionListResult
}

type GetOperationOptions

type GetOperationOptions struct {
	Expand *string
}

func DefaultGetOperationOptions

func DefaultGetOperationOptions() GetOperationOptions

func (GetOperationOptions) ToHeaders

func (o GetOperationOptions) ToHeaders() *client.Headers

func (GetOperationOptions) ToOData

func (o GetOperationOptions) ToOData() *odata.Query

func (GetOperationOptions) ToQuery

func (o GetOperationOptions) ToQuery() *client.QueryParams

type GetOperationResponse

type GetOperationResponse struct {
	HttpResponse *http.Response
	OData        *odata.OData
	Model        *Export
}

type GranularityType

type GranularityType string
const (
	GranularityTypeDaily GranularityType = "Daily"
)

func (*GranularityType) UnmarshalJSON

func (s *GranularityType) UnmarshalJSON(bytes []byte) error

type ListOperationOptions

type ListOperationOptions struct {
	Expand *string
}

func DefaultListOperationOptions

func DefaultListOperationOptions() ListOperationOptions

func (ListOperationOptions) ToHeaders

func (o ListOperationOptions) ToHeaders() *client.Headers

func (ListOperationOptions) ToOData

func (o ListOperationOptions) ToOData() *odata.Query

func (ListOperationOptions) ToQuery

type ListOperationResponse

type ListOperationResponse struct {
	HttpResponse *http.Response
	OData        *odata.OData
	Model        *ExportListResult
}

type RecurrenceType

type RecurrenceType string
const (
	RecurrenceTypeAnnually RecurrenceType = "Annually"
	RecurrenceTypeDaily    RecurrenceType = "Daily"
	RecurrenceTypeMonthly  RecurrenceType = "Monthly"
	RecurrenceTypeWeekly   RecurrenceType = "Weekly"
)

func (*RecurrenceType) UnmarshalJSON

func (s *RecurrenceType) UnmarshalJSON(bytes []byte) error

type ScopedExportId

type ScopedExportId struct {
	Scope      string
	ExportName string
}

ScopedExportId is a struct representing the Resource ID for a Scoped Export

func NewScopedExportID

func NewScopedExportID(scope string, exportName string) ScopedExportId

NewScopedExportID returns a new ScopedExportId struct

func ParseScopedExportID

func ParseScopedExportID(input string) (*ScopedExportId, error)

ParseScopedExportID parses 'input' into a ScopedExportId

func ParseScopedExportIDInsensitively

func ParseScopedExportIDInsensitively(input string) (*ScopedExportId, error)

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

func (*ScopedExportId) FromParseResult

func (id *ScopedExportId) FromParseResult(input resourceids.ParseResult) error

func (ScopedExportId) ID

func (id ScopedExportId) ID() string

ID returns the formatted Scoped Export ID

func (ScopedExportId) Segments

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

Segments returns a slice of Resource ID Segments which comprise this Scoped Export ID

func (ScopedExportId) String

func (id ScopedExportId) String() string

String returns a human-readable description of this Scoped Export ID

type StatusType

type StatusType string
const (
	StatusTypeActive   StatusType = "Active"
	StatusTypeInactive StatusType = "Inactive"
)

func (*StatusType) UnmarshalJSON

func (s *StatusType) UnmarshalJSON(bytes []byte) error

type TimeframeType

type TimeframeType string
const (
	TimeframeTypeBillingMonthToDate  TimeframeType = "BillingMonthToDate"
	TimeframeTypeCustom              TimeframeType = "Custom"
	TimeframeTypeMonthToDate         TimeframeType = "MonthToDate"
	TimeframeTypeTheLastBillingMonth TimeframeType = "TheLastBillingMonth"
	TimeframeTypeTheLastMonth        TimeframeType = "TheLastMonth"
	TimeframeTypeWeekToDate          TimeframeType = "WeekToDate"
)

func (*TimeframeType) UnmarshalJSON

func (s *TimeframeType) UnmarshalJSON(bytes []byte) error

Jump to

Keyboard shortcuts

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