capacityreservations

package
v0.20240229.1102109 Latest Latest
Warning

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

Go to latest
Published: Feb 29, 2024 License: MPL-2.0 Imports: 14 Imported by: 1

README

github.com/hashicorp/go-azure-sdk/resource-manager/compute/2022-03-01/capacityreservations Documentation

The capacityreservations SDK allows for interaction with the Azure Resource Manager Service compute (API Version 2022-03-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-sdk/resource-manager/compute/2022-03-01/capacityreservations"

Client Initialization

client := capacityreservations.NewCapacityReservationsClientWithBaseURI("https://management.azure.com")
client.Client.Authorizer = authorizer

Example Usage: CapacityReservationsClient.CreateOrUpdate

ctx := context.TODO()
id := capacityreservations.NewCapacityReservationID("12345678-1234-9876-4563-123456789012", "example-resource-group", "capacityReservationGroupValue", "capacityReservationValue")

payload := capacityreservations.CapacityReservation{
	// ...
}


if err := client.CreateOrUpdateThenPoll(ctx, id, payload); err != nil {
	// handle the error
}

Example Usage: CapacityReservationsClient.Delete

ctx := context.TODO()
id := capacityreservations.NewCapacityReservationID("12345678-1234-9876-4563-123456789012", "example-resource-group", "capacityReservationGroupValue", "capacityReservationValue")

if err := client.DeleteThenPoll(ctx, id); err != nil {
	// handle the error
}

Example Usage: CapacityReservationsClient.Get

ctx := context.TODO()
id := capacityreservations.NewCapacityReservationID("12345678-1234-9876-4563-123456789012", "example-resource-group", "capacityReservationGroupValue", "capacityReservationValue")

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

Example Usage: CapacityReservationsClient.Update

ctx := context.TODO()
id := capacityreservations.NewCapacityReservationID("12345678-1234-9876-4563-123456789012", "example-resource-group", "capacityReservationGroupValue", "capacityReservationValue")

payload := capacityreservations.CapacityReservationUpdate{
	// ...
}


if err := client.UpdateThenPoll(ctx, id, payload); err != nil {
	// handle the error
}

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func PossibleValuesForCapacityReservationInstanceViewTypes

func PossibleValuesForCapacityReservationInstanceViewTypes() []string

func PossibleValuesForStatusLevelTypes

func PossibleValuesForStatusLevelTypes() []string

func ValidateCapacityReservationID

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

ValidateCapacityReservationID checks that 'input' can be parsed as a Capacity Reservation ID

Types

type CapacityReservation

type CapacityReservation struct {
	Id         *string                        `json:"id,omitempty"`
	Location   string                         `json:"location"`
	Name       *string                        `json:"name,omitempty"`
	Properties *CapacityReservationProperties `json:"properties,omitempty"`
	Sku        Sku                            `json:"sku"`
	Tags       *map[string]string             `json:"tags,omitempty"`
	Type       *string                        `json:"type,omitempty"`
	Zones      *zones.Schema                  `json:"zones,omitempty"`
}

type CapacityReservationId

type CapacityReservationId struct {
	SubscriptionId               string
	ResourceGroupName            string
	CapacityReservationGroupName string
	CapacityReservationName      string
}

CapacityReservationId is a struct representing the Resource ID for a Capacity Reservation

func NewCapacityReservationID

func NewCapacityReservationID(subscriptionId string, resourceGroupName string, capacityReservationGroupName string, capacityReservationName string) CapacityReservationId

NewCapacityReservationID returns a new CapacityReservationId struct

func ParseCapacityReservationID

func ParseCapacityReservationID(input string) (*CapacityReservationId, error)

ParseCapacityReservationID parses 'input' into a CapacityReservationId

func ParseCapacityReservationIDInsensitively

func ParseCapacityReservationIDInsensitively(input string) (*CapacityReservationId, error)

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

func (*CapacityReservationId) FromParseResult

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

func (CapacityReservationId) ID

func (id CapacityReservationId) ID() string

ID returns the formatted Capacity Reservation ID

func (CapacityReservationId) Segments

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

Segments returns a slice of Resource ID Segments which comprise this Capacity Reservation ID

func (CapacityReservationId) String

func (id CapacityReservationId) String() string

String returns a human-readable description of this Capacity Reservation ID

type CapacityReservationInstanceView

type CapacityReservationInstanceView struct {
	Statuses        *[]InstanceViewStatus           `json:"statuses,omitempty"`
	UtilizationInfo *CapacityReservationUtilization `json:"utilizationInfo,omitempty"`
}

type CapacityReservationInstanceViewTypes

type CapacityReservationInstanceViewTypes string
const (
	CapacityReservationInstanceViewTypesInstanceView CapacityReservationInstanceViewTypes = "instanceView"
)

func (*CapacityReservationInstanceViewTypes) UnmarshalJSON

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

type CapacityReservationProperties

type CapacityReservationProperties struct {
	InstanceView              *CapacityReservationInstanceView `json:"instanceView,omitempty"`
	ProvisioningState         *string                          `json:"provisioningState,omitempty"`
	ProvisioningTime          *string                          `json:"provisioningTime,omitempty"`
	ReservationId             *string                          `json:"reservationId,omitempty"`
	TimeCreated               *string                          `json:"timeCreated,omitempty"`
	VirtualMachinesAssociated *[]SubResourceReadOnly           `json:"virtualMachinesAssociated,omitempty"`
}

func (*CapacityReservationProperties) GetProvisioningTimeAsTime

func (o *CapacityReservationProperties) GetProvisioningTimeAsTime() (*time.Time, error)

func (*CapacityReservationProperties) GetTimeCreatedAsTime

func (o *CapacityReservationProperties) GetTimeCreatedAsTime() (*time.Time, error)

func (*CapacityReservationProperties) SetProvisioningTimeAsTime

func (o *CapacityReservationProperties) SetProvisioningTimeAsTime(input time.Time)

func (*CapacityReservationProperties) SetTimeCreatedAsTime

func (o *CapacityReservationProperties) SetTimeCreatedAsTime(input time.Time)

type CapacityReservationUpdate

type CapacityReservationUpdate struct {
	Properties *CapacityReservationProperties `json:"properties,omitempty"`
	Sku        *Sku                           `json:"sku,omitempty"`
	Tags       *map[string]string             `json:"tags,omitempty"`
}

type CapacityReservationUtilization

type CapacityReservationUtilization struct {
	VirtualMachinesAllocated *[]SubResourceReadOnly `json:"virtualMachinesAllocated,omitempty"`
}

type CapacityReservationsClient

type CapacityReservationsClient struct {
	Client *resourcemanager.Client
}

func NewCapacityReservationsClientWithBaseURI

func NewCapacityReservationsClientWithBaseURI(sdkApi sdkEnv.Api) (*CapacityReservationsClient, error)

func (CapacityReservationsClient) CreateOrUpdate

CreateOrUpdate ...

func (CapacityReservationsClient) CreateOrUpdateThenPoll

CreateOrUpdateThenPoll performs CreateOrUpdate then polls until it's completed

func (CapacityReservationsClient) Delete

Delete ...

func (CapacityReservationsClient) DeleteThenPoll

DeleteThenPoll performs Delete then polls until it's completed

func (CapacityReservationsClient) Get

Get ...

func (CapacityReservationsClient) Update

Update ...

func (CapacityReservationsClient) UpdateThenPoll

UpdateThenPoll performs Update then polls until it's completed

type CreateOrUpdateOperationResponse

type CreateOrUpdateOperationResponse struct {
	Poller       pollers.Poller
	HttpResponse *http.Response
	OData        *odata.OData
	Model        *CapacityReservation
}

type DeleteOperationResponse

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

type GetOperationOptions

type GetOperationOptions struct {
	Expand *CapacityReservationInstanceViewTypes
}

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        *CapacityReservation
}

type InstanceViewStatus

type InstanceViewStatus struct {
	Code          *string           `json:"code,omitempty"`
	DisplayStatus *string           `json:"displayStatus,omitempty"`
	Level         *StatusLevelTypes `json:"level,omitempty"`
	Message       *string           `json:"message,omitempty"`
	Time          *string           `json:"time,omitempty"`
}

func (*InstanceViewStatus) GetTimeAsTime

func (o *InstanceViewStatus) GetTimeAsTime() (*time.Time, error)

func (*InstanceViewStatus) SetTimeAsTime

func (o *InstanceViewStatus) SetTimeAsTime(input time.Time)

type Sku

type Sku struct {
	Capacity *int64  `json:"capacity,omitempty"`
	Name     *string `json:"name,omitempty"`
	Tier     *string `json:"tier,omitempty"`
}

type StatusLevelTypes

type StatusLevelTypes string
const (
	StatusLevelTypesError   StatusLevelTypes = "Error"
	StatusLevelTypesInfo    StatusLevelTypes = "Info"
	StatusLevelTypesWarning StatusLevelTypes = "Warning"
)

func (*StatusLevelTypes) UnmarshalJSON

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

type SubResourceReadOnly

type SubResourceReadOnly struct {
	Id *string `json:"id,omitempty"`
}

type UpdateOperationResponse

type UpdateOperationResponse struct {
	Poller       pollers.Poller
	HttpResponse *http.Response
	OData        *odata.OData
	Model        *CapacityReservation
}

Jump to

Keyboard shortcuts

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