capacityreservationgroups

package
v0.20240903.1111904 Latest Latest
Warning

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

Go to latest
Published: Sep 3, 2024 License: MPL-2.0 Imports: 15 Imported by: 1

README

github.com/hashicorp/go-azure-sdk/resource-manager/compute/2024-07-01/capacityreservationgroups Documentation

The capacityreservationgroups SDK allows for interaction with the Azure Resource Manager Service compute (API Version 2024-07-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/compute/2024-07-01/capacityreservationgroups"

Client Initialization

client := capacityreservationgroups.NewCapacityReservationGroupsClientWithBaseURI("https://management.azure.com")
client.Client.Authorizer = authorizer

Example Usage: CapacityReservationGroupsClient.CreateOrUpdate

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

payload := capacityreservationgroups.CapacityReservationGroup{
	// ...
}


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

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

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: CapacityReservationGroupsClient.Get

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

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

Example Usage: CapacityReservationGroupsClient.ListByResourceGroup

ctx := context.TODO()
id := commonids.NewResourceGroupID("12345678-1234-9876-4563-123456789012", "example-resource-group")

// alternatively `client.ListByResourceGroup(ctx, id, capacityreservationgroups.DefaultListByResourceGroupOperationOptions())` can be used to do batched pagination
items, err := client.ListByResourceGroupComplete(ctx, id, capacityreservationgroups.DefaultListByResourceGroupOperationOptions())
if err != nil {
	// handle the error
}
for _, item := range items {
	// do something
}

Example Usage: CapacityReservationGroupsClient.ListBySubscription

ctx := context.TODO()
id := commonids.NewSubscriptionID("12345678-1234-9876-4563-123456789012")

// alternatively `client.ListBySubscription(ctx, id, capacityreservationgroups.DefaultListBySubscriptionOperationOptions())` can be used to do batched pagination
items, err := client.ListBySubscriptionComplete(ctx, id, capacityreservationgroups.DefaultListBySubscriptionOperationOptions())
if err != nil {
	// handle the error
}
for _, item := range items {
	// do something
}

Example Usage: CapacityReservationGroupsClient.Update

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

payload := capacityreservationgroups.CapacityReservationGroupUpdate{
	// ...
}


read, err := client.Update(ctx, id, payload)
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 PossibleValuesForCapacityReservationGroupInstanceViewTypes

func PossibleValuesForCapacityReservationGroupInstanceViewTypes() []string

func PossibleValuesForExpandTypesForGetCapacityReservationGroups

func PossibleValuesForExpandTypesForGetCapacityReservationGroups() []string

func PossibleValuesForResourceIdOptionsForGetCapacityReservationGroups

func PossibleValuesForResourceIdOptionsForGetCapacityReservationGroups() []string

func PossibleValuesForStatusLevelTypes

func PossibleValuesForStatusLevelTypes() []string

func ValidateCapacityReservationGroupID

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

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

Types

type CapacityReservationGroup

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

type CapacityReservationGroupId

type CapacityReservationGroupId struct {
	SubscriptionId               string
	ResourceGroupName            string
	CapacityReservationGroupName string
}

CapacityReservationGroupId is a struct representing the Resource ID for a Capacity Reservation Group

func NewCapacityReservationGroupID

func NewCapacityReservationGroupID(subscriptionId string, resourceGroupName string, capacityReservationGroupName string) CapacityReservationGroupId

NewCapacityReservationGroupID returns a new CapacityReservationGroupId struct

func ParseCapacityReservationGroupID

func ParseCapacityReservationGroupID(input string) (*CapacityReservationGroupId, error)

ParseCapacityReservationGroupID parses 'input' into a CapacityReservationGroupId

func ParseCapacityReservationGroupIDInsensitively

func ParseCapacityReservationGroupIDInsensitively(input string) (*CapacityReservationGroupId, error)

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

func (*CapacityReservationGroupId) FromParseResult

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

func (CapacityReservationGroupId) ID

ID returns the formatted Capacity Reservation Group ID

func (CapacityReservationGroupId) Segments

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

func (CapacityReservationGroupId) String

func (id CapacityReservationGroupId) String() string

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

type CapacityReservationGroupInstanceView

type CapacityReservationGroupInstanceView struct {
	CapacityReservations  *[]CapacityReservationInstanceViewWithName `json:"capacityReservations,omitempty"`
	SharedSubscriptionIds *[]SubResourceReadOnly                     `json:"sharedSubscriptionIds,omitempty"`
}

type CapacityReservationGroupInstanceViewTypes

type CapacityReservationGroupInstanceViewTypes string
const (
	CapacityReservationGroupInstanceViewTypesInstanceView CapacityReservationGroupInstanceViewTypes = "instanceView"
)

func (*CapacityReservationGroupInstanceViewTypes) UnmarshalJSON

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

type CapacityReservationGroupOperationPredicate

type CapacityReservationGroupOperationPredicate struct {
	Id       *string
	Location *string
	Name     *string
	Type     *string
}

func (CapacityReservationGroupOperationPredicate) Matches

type CapacityReservationGroupProperties

type CapacityReservationGroupProperties struct {
	CapacityReservations      *[]SubResourceReadOnly                `json:"capacityReservations,omitempty"`
	InstanceView              *CapacityReservationGroupInstanceView `json:"instanceView,omitempty"`
	SharingProfile            *ResourceSharingProfile               `json:"sharingProfile,omitempty"`
	VirtualMachinesAssociated *[]SubResourceReadOnly                `json:"virtualMachinesAssociated,omitempty"`
}

type CapacityReservationGroupUpdate

type CapacityReservationGroupUpdate struct {
	Properties *CapacityReservationGroupProperties `json:"properties,omitempty"`
	Tags       *map[string]string                  `json:"tags,omitempty"`
}

type CapacityReservationGroupsClient

type CapacityReservationGroupsClient struct {
	Client *resourcemanager.Client
}

func NewCapacityReservationGroupsClientWithBaseURI

func NewCapacityReservationGroupsClientWithBaseURI(sdkApi sdkEnv.Api) (*CapacityReservationGroupsClient, error)

func (CapacityReservationGroupsClient) CreateOrUpdate

CreateOrUpdate ...

func (CapacityReservationGroupsClient) Delete

Delete ...

func (CapacityReservationGroupsClient) Get

Get ...

func (CapacityReservationGroupsClient) ListByResourceGroup

ListByResourceGroup ...

func (CapacityReservationGroupsClient) ListByResourceGroupComplete

ListByResourceGroupComplete retrieves all the results into a single object

func (CapacityReservationGroupsClient) ListByResourceGroupCompleteMatchingPredicate

ListByResourceGroupCompleteMatchingPredicate retrieves all the results and then applies the predicate

func (CapacityReservationGroupsClient) ListBySubscription

ListBySubscription ...

func (CapacityReservationGroupsClient) ListBySubscriptionComplete

ListBySubscriptionComplete retrieves all the results into a single object

func (CapacityReservationGroupsClient) ListBySubscriptionCompleteMatchingPredicate

ListBySubscriptionCompleteMatchingPredicate retrieves all the results and then applies the predicate

func (CapacityReservationGroupsClient) Update

Update ...

type CapacityReservationInstanceViewWithName

type CapacityReservationInstanceViewWithName struct {
	Name            *string                         `json:"name,omitempty"`
	Statuses        *[]InstanceViewStatus           `json:"statuses,omitempty"`
	UtilizationInfo *CapacityReservationUtilization `json:"utilizationInfo,omitempty"`
}

type CapacityReservationUtilization

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

type CreateOrUpdateOperationResponse

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

type DeleteOperationResponse

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

type ExpandTypesForGetCapacityReservationGroups

type ExpandTypesForGetCapacityReservationGroups string
const (
	ExpandTypesForGetCapacityReservationGroupsVirtualMachineScaleSetVMsRef ExpandTypesForGetCapacityReservationGroups = "virtualMachineScaleSetVMs/$ref"
	ExpandTypesForGetCapacityReservationGroupsVirtualMachinesRef           ExpandTypesForGetCapacityReservationGroups = "virtualMachines/$ref"
)

func (*ExpandTypesForGetCapacityReservationGroups) UnmarshalJSON

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

type GetOperationOptions

type GetOperationOptions struct {
	Expand *CapacityReservationGroupInstanceViewTypes
}

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

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 ListByResourceGroupCompleteResult

type ListByResourceGroupCompleteResult struct {
	LatestHttpResponse *http.Response
	Items              []CapacityReservationGroup
}

type ListByResourceGroupCustomPager

type ListByResourceGroupCustomPager struct {
	NextLink *odata.Link `json:"nextLink"`
}
func (p *ListByResourceGroupCustomPager) NextPageLink() *odata.Link

type ListByResourceGroupOperationOptions

type ListByResourceGroupOperationOptions struct {
	Expand *ExpandTypesForGetCapacityReservationGroups
}

func DefaultListByResourceGroupOperationOptions

func DefaultListByResourceGroupOperationOptions() ListByResourceGroupOperationOptions

func (ListByResourceGroupOperationOptions) ToHeaders

func (ListByResourceGroupOperationOptions) ToOData

func (ListByResourceGroupOperationOptions) ToQuery

type ListByResourceGroupOperationResponse

type ListByResourceGroupOperationResponse struct {
	HttpResponse *http.Response
	OData        *odata.OData
	Model        *[]CapacityReservationGroup
}

type ListBySubscriptionCompleteResult

type ListBySubscriptionCompleteResult struct {
	LatestHttpResponse *http.Response
	Items              []CapacityReservationGroup
}

type ListBySubscriptionCustomPager

type ListBySubscriptionCustomPager struct {
	NextLink *odata.Link `json:"nextLink"`
}
func (p *ListBySubscriptionCustomPager) NextPageLink() *odata.Link

type ListBySubscriptionOperationOptions

type ListBySubscriptionOperationOptions struct {
	Expand          *ExpandTypesForGetCapacityReservationGroups
	ResourceIdsOnly *ResourceIdOptionsForGetCapacityReservationGroups
}

func DefaultListBySubscriptionOperationOptions

func DefaultListBySubscriptionOperationOptions() ListBySubscriptionOperationOptions

func (ListBySubscriptionOperationOptions) ToHeaders

func (ListBySubscriptionOperationOptions) ToOData

func (ListBySubscriptionOperationOptions) ToQuery

type ListBySubscriptionOperationResponse

type ListBySubscriptionOperationResponse struct {
	HttpResponse *http.Response
	OData        *odata.OData
	Model        *[]CapacityReservationGroup
}

type ResourceIdOptionsForGetCapacityReservationGroups

type ResourceIdOptionsForGetCapacityReservationGroups string
const (
	ResourceIdOptionsForGetCapacityReservationGroupsAll                    ResourceIdOptionsForGetCapacityReservationGroups = "All"
	ResourceIdOptionsForGetCapacityReservationGroupsCreatedInSubscription  ResourceIdOptionsForGetCapacityReservationGroups = "CreatedInSubscription"
	ResourceIdOptionsForGetCapacityReservationGroupsSharedWithSubscription ResourceIdOptionsForGetCapacityReservationGroups = "SharedWithSubscription"
)

func (*ResourceIdOptionsForGetCapacityReservationGroups) UnmarshalJSON

type ResourceSharingProfile

type ResourceSharingProfile struct {
	SubscriptionIds *[]SubResource `json:"subscriptionIds,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 SubResource

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

type SubResourceReadOnly

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

type UpdateOperationResponse

type UpdateOperationResponse struct {
	HttpResponse *http.Response
	OData        *odata.OData
	Model        *CapacityReservationGroup
}

Jump to

Keyboard shortcuts

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