README ¶
github.com/hashicorp/go-azure-sdk/resource-manager/compute/2024-03-01/availabilitysets
Documentation
The availabilitysets
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/availabilitysets"
Client Initialization
client := availabilitysets.NewAvailabilitySetsClientWithBaseURI("https://management.azure.com")
client.Client.Authorizer = authorizer
Example Usage: AvailabilitySetsClient.CreateOrUpdate
ctx := context.TODO()
id := commonids.NewAvailabilitySetID("12345678-1234-9876-4563-123456789012", "example-resource-group", "availabilitySetValue")
payload := availabilitysets.AvailabilitySet{
// ...
}
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: AvailabilitySetsClient.Delete
ctx := context.TODO()
id := commonids.NewAvailabilitySetID("12345678-1234-9876-4563-123456789012", "example-resource-group", "availabilitySetValue")
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: AvailabilitySetsClient.Get
ctx := context.TODO()
id := commonids.NewAvailabilitySetID("12345678-1234-9876-4563-123456789012", "example-resource-group", "availabilitySetValue")
read, err := client.Get(ctx, id)
if err != nil {
// handle the error
}
if model := read.Model; model != nil {
// do something with the model/response object
}
Example Usage: AvailabilitySetsClient.List
ctx := context.TODO()
id := commonids.NewResourceGroupID("12345678-1234-9876-4563-123456789012", "example-resource-group")
// alternatively `client.List(ctx, id)` can be used to do batched pagination
items, err := client.ListComplete(ctx, id)
if err != nil {
// handle the error
}
for _, item := range items {
// do something
}
Example Usage: AvailabilitySetsClient.ListAvailableSizes
ctx := context.TODO()
id := commonids.NewAvailabilitySetID("12345678-1234-9876-4563-123456789012", "example-resource-group", "availabilitySetValue")
read, err := client.ListAvailableSizes(ctx, id)
if err != nil {
// handle the error
}
if model := read.Model; model != nil {
// do something with the model/response object
}
Example Usage: AvailabilitySetsClient.ListBySubscription
ctx := context.TODO()
id := commonids.NewSubscriptionID("12345678-1234-9876-4563-123456789012")
// alternatively `client.ListBySubscription(ctx, id, availabilitysets.DefaultListBySubscriptionOperationOptions())` can be used to do batched pagination
items, err := client.ListBySubscriptionComplete(ctx, id, availabilitysets.DefaultListBySubscriptionOperationOptions())
if err != nil {
// handle the error
}
for _, item := range items {
// do something
}
Example Usage: AvailabilitySetsClient.Update
ctx := context.TODO()
id := commonids.NewAvailabilitySetID("12345678-1234-9876-4563-123456789012", "example-resource-group", "availabilitySetValue")
payload := availabilitysets.AvailabilitySetUpdate{
// ...
}
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 PossibleValuesForStatusLevelTypes() []string
- type AvailabilitySet
- type AvailabilitySetOperationPredicate
- type AvailabilitySetProperties
- type AvailabilitySetUpdate
- type AvailabilitySetsClient
- func (c AvailabilitySetsClient) CreateOrUpdate(ctx context.Context, id commonids.AvailabilitySetId, input AvailabilitySet) (result CreateOrUpdateOperationResponse, err error)
- func (c AvailabilitySetsClient) Delete(ctx context.Context, id commonids.AvailabilitySetId) (result DeleteOperationResponse, err error)
- func (c AvailabilitySetsClient) Get(ctx context.Context, id commonids.AvailabilitySetId) (result GetOperationResponse, err error)
- func (c AvailabilitySetsClient) List(ctx context.Context, id commonids.ResourceGroupId) (result ListOperationResponse, err error)
- func (c AvailabilitySetsClient) ListAvailableSizes(ctx context.Context, id commonids.AvailabilitySetId) (result ListAvailableSizesOperationResponse, err error)
- func (c AvailabilitySetsClient) ListBySubscription(ctx context.Context, id commonids.SubscriptionId, ...) (result ListBySubscriptionOperationResponse, err error)
- func (c AvailabilitySetsClient) ListBySubscriptionComplete(ctx context.Context, id commonids.SubscriptionId, ...) (ListBySubscriptionCompleteResult, error)
- func (c AvailabilitySetsClient) ListBySubscriptionCompleteMatchingPredicate(ctx context.Context, id commonids.SubscriptionId, ...) (result ListBySubscriptionCompleteResult, err error)
- func (c AvailabilitySetsClient) ListComplete(ctx context.Context, id commonids.ResourceGroupId) (ListCompleteResult, error)
- func (c AvailabilitySetsClient) ListCompleteMatchingPredicate(ctx context.Context, id commonids.ResourceGroupId, ...) (result ListCompleteResult, err error)
- func (c AvailabilitySetsClient) Update(ctx context.Context, id commonids.AvailabilitySetId, ...) (result UpdateOperationResponse, err error)
- type CreateOrUpdateOperationResponse
- type DeleteOperationResponse
- type GetOperationResponse
- type InstanceViewStatus
- type ListAvailableSizesOperationResponse
- type ListBySubscriptionCompleteResult
- type ListBySubscriptionOperationOptions
- type ListBySubscriptionOperationResponse
- type ListCompleteResult
- type ListOperationResponse
- type Sku
- type StatusLevelTypes
- type SubResource
- type UpdateOperationResponse
- type VirtualMachineSize
- type VirtualMachineSizeListResult
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func PossibleValuesForStatusLevelTypes ¶
func PossibleValuesForStatusLevelTypes() []string
Types ¶
type AvailabilitySet ¶
type AvailabilitySet struct { Id *string `json:"id,omitempty"` Location string `json:"location"` Name *string `json:"name,omitempty"` Properties *AvailabilitySetProperties `json:"properties,omitempty"` Sku *Sku `json:"sku,omitempty"` Tags *map[string]string `json:"tags,omitempty"` Type *string `json:"type,omitempty"` }
type AvailabilitySetOperationPredicate ¶
type AvailabilitySetOperationPredicate struct { Id *string Location *string Name *string Type *string }
func (AvailabilitySetOperationPredicate) Matches ¶
func (p AvailabilitySetOperationPredicate) Matches(input AvailabilitySet) bool
type AvailabilitySetProperties ¶
type AvailabilitySetProperties struct { PlatformFaultDomainCount *int64 `json:"platformFaultDomainCount,omitempty"` PlatformUpdateDomainCount *int64 `json:"platformUpdateDomainCount,omitempty"` ProximityPlacementGroup *SubResource `json:"proximityPlacementGroup,omitempty"` Statuses *[]InstanceViewStatus `json:"statuses,omitempty"` VirtualMachines *[]SubResource `json:"virtualMachines,omitempty"` }
type AvailabilitySetUpdate ¶
type AvailabilitySetUpdate struct { Properties *AvailabilitySetProperties `json:"properties,omitempty"` Sku *Sku `json:"sku,omitempty"` Tags *map[string]string `json:"tags,omitempty"` }
type AvailabilitySetsClient ¶
type AvailabilitySetsClient struct {
Client *resourcemanager.Client
}
func NewAvailabilitySetsClientWithBaseURI ¶
func NewAvailabilitySetsClientWithBaseURI(sdkApi sdkEnv.Api) (*AvailabilitySetsClient, error)
func (AvailabilitySetsClient) CreateOrUpdate ¶
func (c AvailabilitySetsClient) CreateOrUpdate(ctx context.Context, id commonids.AvailabilitySetId, input AvailabilitySet) (result CreateOrUpdateOperationResponse, err error)
CreateOrUpdate ...
func (AvailabilitySetsClient) Delete ¶
func (c AvailabilitySetsClient) Delete(ctx context.Context, id commonids.AvailabilitySetId) (result DeleteOperationResponse, err error)
Delete ...
func (AvailabilitySetsClient) Get ¶
func (c AvailabilitySetsClient) Get(ctx context.Context, id commonids.AvailabilitySetId) (result GetOperationResponse, err error)
Get ...
func (AvailabilitySetsClient) List ¶
func (c AvailabilitySetsClient) List(ctx context.Context, id commonids.ResourceGroupId) (result ListOperationResponse, err error)
List ...
func (AvailabilitySetsClient) ListAvailableSizes ¶
func (c AvailabilitySetsClient) ListAvailableSizes(ctx context.Context, id commonids.AvailabilitySetId) (result ListAvailableSizesOperationResponse, err error)
ListAvailableSizes ...
func (AvailabilitySetsClient) ListBySubscription ¶
func (c AvailabilitySetsClient) ListBySubscription(ctx context.Context, id commonids.SubscriptionId, options ListBySubscriptionOperationOptions) (result ListBySubscriptionOperationResponse, err error)
ListBySubscription ...
func (AvailabilitySetsClient) ListBySubscriptionComplete ¶
func (c AvailabilitySetsClient) ListBySubscriptionComplete(ctx context.Context, id commonids.SubscriptionId, options ListBySubscriptionOperationOptions) (ListBySubscriptionCompleteResult, error)
ListBySubscriptionComplete retrieves all the results into a single object
func (AvailabilitySetsClient) ListBySubscriptionCompleteMatchingPredicate ¶
func (c AvailabilitySetsClient) ListBySubscriptionCompleteMatchingPredicate(ctx context.Context, id commonids.SubscriptionId, options ListBySubscriptionOperationOptions, predicate AvailabilitySetOperationPredicate) (result ListBySubscriptionCompleteResult, err error)
ListBySubscriptionCompleteMatchingPredicate retrieves all the results and then applies the predicate
func (AvailabilitySetsClient) ListComplete ¶
func (c AvailabilitySetsClient) ListComplete(ctx context.Context, id commonids.ResourceGroupId) (ListCompleteResult, error)
ListComplete retrieves all the results into a single object
func (AvailabilitySetsClient) ListCompleteMatchingPredicate ¶
func (c AvailabilitySetsClient) ListCompleteMatchingPredicate(ctx context.Context, id commonids.ResourceGroupId, predicate AvailabilitySetOperationPredicate) (result ListCompleteResult, err error)
ListCompleteMatchingPredicate retrieves all the results and then applies the predicate
func (AvailabilitySetsClient) Update ¶
func (c AvailabilitySetsClient) Update(ctx context.Context, id commonids.AvailabilitySetId, input AvailabilitySetUpdate) (result UpdateOperationResponse, err error)
Update ...
type CreateOrUpdateOperationResponse ¶
type CreateOrUpdateOperationResponse struct { HttpResponse *http.Response OData *odata.OData Model *AvailabilitySet }
type DeleteOperationResponse ¶
type GetOperationResponse ¶
type GetOperationResponse struct { HttpResponse *http.Response OData *odata.OData Model *AvailabilitySet }
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 ListAvailableSizesOperationResponse ¶
type ListAvailableSizesOperationResponse struct { HttpResponse *http.Response OData *odata.OData Model *VirtualMachineSizeListResult }
type ListBySubscriptionCompleteResult ¶
type ListBySubscriptionCompleteResult struct { LatestHttpResponse *http.Response Items []AvailabilitySet }
type ListBySubscriptionOperationOptions ¶
type ListBySubscriptionOperationOptions struct {
Expand *string
}
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 *[]AvailabilitySet }
type ListCompleteResult ¶
type ListCompleteResult struct { LatestHttpResponse *http.Response Items []AvailabilitySet }
type ListOperationResponse ¶
type ListOperationResponse struct { HttpResponse *http.Response OData *odata.OData Model *[]AvailabilitySet }
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 UpdateOperationResponse ¶
type UpdateOperationResponse struct { HttpResponse *http.Response OData *odata.OData Model *AvailabilitySet }
type VirtualMachineSize ¶
type VirtualMachineSize struct { MaxDataDiskCount *int64 `json:"maxDataDiskCount,omitempty"` MemoryInMB *int64 `json:"memoryInMB,omitempty"` Name *string `json:"name,omitempty"` NumberOfCores *int64 `json:"numberOfCores,omitempty"` OsDiskSizeInMB *int64 `json:"osDiskSizeInMB,omitempty"` ResourceDiskSizeInMB *int64 `json:"resourceDiskSizeInMB,omitempty"` }
type VirtualMachineSizeListResult ¶
type VirtualMachineSizeListResult struct {
Value *[]VirtualMachineSize `json:"value,omitempty"`
}
Source Files ¶
- client.go
- constants.go
- method_createorupdate.go
- method_delete.go
- method_get.go
- method_list.go
- method_listavailablesizes.go
- method_listbysubscription.go
- method_update.go
- model_availabilityset.go
- model_availabilitysetproperties.go
- model_availabilitysetupdate.go
- model_instanceviewstatus.go
- model_sku.go
- model_subresource.go
- model_virtualmachinesize.go
- model_virtualmachinesizelistresult.go
- predicates.go
- version.go