README ¶
github.com/hashicorp/go-azure-sdk/resource-manager/compute/2024-03-01/capacityreservationgroups
Documentation
The capacityreservationgroups
SDK allows for interaction with the Azure Resource Manager Service compute
(API Version 2024-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-helpers/resourcemanager/commonids"
import "github.com/hashicorp/go-azure-sdk/resource-manager/compute/2024-03-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 ¶
- func PossibleValuesForCapacityReservationGroupInstanceViewTypes() []string
- func PossibleValuesForExpandTypesForGetCapacityReservationGroups() []string
- func PossibleValuesForResourceIdOptionsForGetCapacityReservationGroups() []string
- func PossibleValuesForStatusLevelTypes() []string
- func ValidateCapacityReservationGroupID(input interface{}, key string) (warnings []string, errors []error)
- type CapacityReservationGroup
- type CapacityReservationGroupId
- func NewCapacityReservationGroupID(subscriptionId string, resourceGroupName string, ...) CapacityReservationGroupId
- func ParseCapacityReservationGroupID(input string) (*CapacityReservationGroupId, error)
- func ParseCapacityReservationGroupIDInsensitively(input string) (*CapacityReservationGroupId, error)
- type CapacityReservationGroupInstanceView
- type CapacityReservationGroupInstanceViewTypes
- type CapacityReservationGroupOperationPredicate
- type CapacityReservationGroupProperties
- type CapacityReservationGroupUpdate
- type CapacityReservationGroupsClient
- func (c CapacityReservationGroupsClient) CreateOrUpdate(ctx context.Context, id CapacityReservationGroupId, ...) (result CreateOrUpdateOperationResponse, err error)
- func (c CapacityReservationGroupsClient) Delete(ctx context.Context, id CapacityReservationGroupId) (result DeleteOperationResponse, err error)
- func (c CapacityReservationGroupsClient) Get(ctx context.Context, id CapacityReservationGroupId, ...) (result GetOperationResponse, err error)
- func (c CapacityReservationGroupsClient) ListByResourceGroup(ctx context.Context, id commonids.ResourceGroupId, ...) (result ListByResourceGroupOperationResponse, err error)
- func (c CapacityReservationGroupsClient) ListByResourceGroupComplete(ctx context.Context, id commonids.ResourceGroupId, ...) (ListByResourceGroupCompleteResult, error)
- func (c CapacityReservationGroupsClient) ListByResourceGroupCompleteMatchingPredicate(ctx context.Context, id commonids.ResourceGroupId, ...) (result ListByResourceGroupCompleteResult, err error)
- func (c CapacityReservationGroupsClient) ListBySubscription(ctx context.Context, id commonids.SubscriptionId, ...) (result ListBySubscriptionOperationResponse, err error)
- func (c CapacityReservationGroupsClient) ListBySubscriptionComplete(ctx context.Context, id commonids.SubscriptionId, ...) (ListBySubscriptionCompleteResult, error)
- func (c CapacityReservationGroupsClient) ListBySubscriptionCompleteMatchingPredicate(ctx context.Context, id commonids.SubscriptionId, ...) (result ListBySubscriptionCompleteResult, err error)
- func (c CapacityReservationGroupsClient) Update(ctx context.Context, id CapacityReservationGroupId, ...) (result UpdateOperationResponse, err error)
- type CapacityReservationInstanceViewWithName
- type CapacityReservationUtilization
- type CreateOrUpdateOperationResponse
- type DeleteOperationResponse
- type ExpandTypesForGetCapacityReservationGroups
- type GetOperationOptions
- type GetOperationResponse
- type InstanceViewStatus
- type ListByResourceGroupCompleteResult
- type ListByResourceGroupOperationOptions
- type ListByResourceGroupOperationResponse
- type ListBySubscriptionCompleteResult
- type ListBySubscriptionOperationOptions
- type ListBySubscriptionOperationResponse
- type ResourceIdOptionsForGetCapacityReservationGroups
- type ResourceSharingProfile
- type StatusLevelTypes
- type SubResource
- type SubResourceReadOnly
- type UpdateOperationResponse
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 ¶
func (id CapacityReservationGroupId) ID() string
ID returns the formatted Capacity Reservation Group ID
func (CapacityReservationGroupId) Segments ¶
func (id CapacityReservationGroupId) Segments() []resourceids.Segment
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"` }
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 ¶
func (p CapacityReservationGroupOperationPredicate) Matches(input CapacityReservationGroup) bool
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 ¶
func (c CapacityReservationGroupsClient) CreateOrUpdate(ctx context.Context, id CapacityReservationGroupId, input CapacityReservationGroup) (result CreateOrUpdateOperationResponse, err error)
CreateOrUpdate ...
func (CapacityReservationGroupsClient) Delete ¶
func (c CapacityReservationGroupsClient) Delete(ctx context.Context, id CapacityReservationGroupId) (result DeleteOperationResponse, err error)
Delete ...
func (CapacityReservationGroupsClient) Get ¶
func (c CapacityReservationGroupsClient) Get(ctx context.Context, id CapacityReservationGroupId, options GetOperationOptions) (result GetOperationResponse, err error)
Get ...
func (CapacityReservationGroupsClient) ListByResourceGroup ¶
func (c CapacityReservationGroupsClient) ListByResourceGroup(ctx context.Context, id commonids.ResourceGroupId, options ListByResourceGroupOperationOptions) (result ListByResourceGroupOperationResponse, err error)
ListByResourceGroup ...
func (CapacityReservationGroupsClient) ListByResourceGroupComplete ¶
func (c CapacityReservationGroupsClient) ListByResourceGroupComplete(ctx context.Context, id commonids.ResourceGroupId, options ListByResourceGroupOperationOptions) (ListByResourceGroupCompleteResult, error)
ListByResourceGroupComplete retrieves all the results into a single object
func (CapacityReservationGroupsClient) ListByResourceGroupCompleteMatchingPredicate ¶
func (c CapacityReservationGroupsClient) ListByResourceGroupCompleteMatchingPredicate(ctx context.Context, id commonids.ResourceGroupId, options ListByResourceGroupOperationOptions, predicate CapacityReservationGroupOperationPredicate) (result ListByResourceGroupCompleteResult, err error)
ListByResourceGroupCompleteMatchingPredicate retrieves all the results and then applies the predicate
func (CapacityReservationGroupsClient) ListBySubscription ¶
func (c CapacityReservationGroupsClient) ListBySubscription(ctx context.Context, id commonids.SubscriptionId, options ListBySubscriptionOperationOptions) (result ListBySubscriptionOperationResponse, err error)
ListBySubscription ...
func (CapacityReservationGroupsClient) ListBySubscriptionComplete ¶
func (c CapacityReservationGroupsClient) ListBySubscriptionComplete(ctx context.Context, id commonids.SubscriptionId, options ListBySubscriptionOperationOptions) (ListBySubscriptionCompleteResult, error)
ListBySubscriptionComplete retrieves all the results into a single object
func (CapacityReservationGroupsClient) ListBySubscriptionCompleteMatchingPredicate ¶
func (c CapacityReservationGroupsClient) ListBySubscriptionCompleteMatchingPredicate(ctx context.Context, id commonids.SubscriptionId, options ListBySubscriptionOperationOptions, predicate CapacityReservationGroupOperationPredicate) (result ListBySubscriptionCompleteResult, err error)
ListBySubscriptionCompleteMatchingPredicate retrieves all the results and then applies the predicate
func (CapacityReservationGroupsClient) Update ¶
func (c CapacityReservationGroupsClient) Update(ctx context.Context, id CapacityReservationGroupId, input CapacityReservationGroupUpdate) (result UpdateOperationResponse, err error)
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 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 ListByResourceGroupOperationOptions ¶
type ListByResourceGroupOperationOptions struct {
Expand *ExpandTypesForGetCapacityReservationGroups
}
func DefaultListByResourceGroupOperationOptions ¶
func DefaultListByResourceGroupOperationOptions() ListByResourceGroupOperationOptions
func (ListByResourceGroupOperationOptions) ToHeaders ¶
func (o ListByResourceGroupOperationOptions) ToHeaders() *client.Headers
func (ListByResourceGroupOperationOptions) ToOData ¶
func (o ListByResourceGroupOperationOptions) ToOData() *odata.Query
func (ListByResourceGroupOperationOptions) ToQuery ¶
func (o ListByResourceGroupOperationOptions) ToQuery() *client.QueryParams
type ListByResourceGroupOperationResponse ¶
type ListByResourceGroupOperationResponse struct { HttpResponse *http.Response OData *odata.OData Model *[]CapacityReservationGroup }
type ListBySubscriptionCompleteResult ¶
type ListBySubscriptionCompleteResult struct { LatestHttpResponse *http.Response Items []CapacityReservationGroup }
type ListBySubscriptionOperationOptions ¶
type ListBySubscriptionOperationOptions struct { Expand *ExpandTypesForGetCapacityReservationGroups ResourceIdsOnly *ResourceIdOptionsForGetCapacityReservationGroups }
func DefaultListBySubscriptionOperationOptions ¶
func DefaultListBySubscriptionOperationOptions() ListBySubscriptionOperationOptions
func (ListBySubscriptionOperationOptions) ToHeaders ¶
func (o ListBySubscriptionOperationOptions) ToHeaders() *client.Headers
func (ListBySubscriptionOperationOptions) ToOData ¶
func (o ListBySubscriptionOperationOptions) ToOData() *odata.Query
func (ListBySubscriptionOperationOptions) ToQuery ¶
func (o ListBySubscriptionOperationOptions) ToQuery() *client.QueryParams
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" )
func (*ResourceIdOptionsForGetCapacityReservationGroups) UnmarshalJSON ¶
func (s *ResourceIdOptionsForGetCapacityReservationGroups) UnmarshalJSON(bytes []byte) error
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 }
Source Files ¶
- client.go
- constants.go
- id_capacityreservationgroup.go
- method_createorupdate.go
- method_delete.go
- method_get.go
- method_listbyresourcegroup.go
- method_listbysubscription.go
- method_update.go
- model_capacityreservationgroup.go
- model_capacityreservationgroupinstanceview.go
- model_capacityreservationgroupproperties.go
- model_capacityreservationgroupupdate.go
- model_capacityreservationinstanceviewwithname.go
- model_capacityreservationutilization.go
- model_instanceviewstatus.go
- model_resourcesharingprofile.go
- model_subresource.go
- model_subresourcereadonly.go
- predicates.go
- version.go