armcompute

package module
Version: v1.0.0 Latest Latest
Warning

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

Go to latest
Published: May 16, 2022 License: MIT Imports: 18 Imported by: 31

README

Azure Compute Module for Go

PkgGoDev

The armcompute module provides operations for working with Azure Compute.

Source code

Getting started

Prerequisites

Install the package

This project uses Go modules for versioning and dependency management.

Install the Azure Compute module:

go get github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/compute/armcompute

Authorization

When creating a client, you will need to provide a credential for authenticating with Azure Compute. The azidentity module provides facilities for various ways of authenticating with Azure including client/secret, certificate, managed identity, and more.

cred, err := azidentity.NewDefaultAzureCredential(nil)

For more information on authentication, please see the documentation for azidentity at pkg.go.dev/github.com/Azure/azure-sdk-for-go/sdk/azidentity.

Clients

Azure Compute modules consist of one or more clients. A client groups a set of related APIs, providing access to its functionality within the specified subscription. Create one or more clients to access the APIs you require using your credential.

client, err := armcompute.NewLogAnalyticsClient(<subscription ID>, cred, nil)

You can use ClientOptions in package github.com/Azure/azure-sdk-for-go/sdk/azcore/arm to set endpoint to connect with public and sovereign clouds as well as Azure Stack. For more information, please see the documentation for azcore at pkg.go.dev/github.com/Azure/azure-sdk-for-go/sdk/azcore.

options := arm.ClientOptions {
    ClientOptions: azcore.ClientOptions {
        Cloud: cloud.AzureChina,
    },
}
client, err := armcompute.NewLogAnalyticsClient(<subscription ID>, cred, &options)

More sample code

Provide Feedback

If you encounter bugs or have suggestions, please open an issue and assign the Compute label.

Contributing

This project welcomes contributions and suggestions. Most contributions require you to agree to a Contributor License Agreement (CLA) declaring that you have the right to, and actually do, grant us the rights to use your contribution. For details, visit https://cla.microsoft.com.

When you submit a pull request, a CLA-bot will automatically determine whether you need to provide a CLA and decorate the PR appropriately (e.g., label, comment). Simply follow the instructions provided by the bot. You will only need to do this once across all repos using our CLA.

This project has adopted the Microsoft Open Source Code of Conduct. For more information, see the Code of Conduct FAQ or contact opencode@microsoft.com with any additional questions or comments.

Documentation

Index

Examples

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type APIEntityReference

type APIEntityReference struct {
	// The ARM resource id in the form of /subscriptions/{SubscriptionId}/resourceGroups/{ResourceGroupName}/…
	ID *string `json:"id,omitempty"`
}

APIEntityReference - The API entity reference.

type APIError

type APIError struct {
	// The error code.
	Code *string `json:"code,omitempty"`

	// The Api error details
	Details []*APIErrorBase `json:"details,omitempty"`

	// The Api inner error
	Innererror *InnerError `json:"innererror,omitempty"`

	// The error message.
	Message *string `json:"message,omitempty"`

	// The target of the particular error.
	Target *string `json:"target,omitempty"`
}

APIError - Api error.

func (APIError) MarshalJSON

func (a APIError) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.Marshaller interface for type APIError.

type APIErrorBase

type APIErrorBase struct {
	// The error code.
	Code *string `json:"code,omitempty"`

	// The error message.
	Message *string `json:"message,omitempty"`

	// The target of the particular error.
	Target *string `json:"target,omitempty"`
}

APIErrorBase - Api error base.

type AccessLevel

type AccessLevel string
const (
	AccessLevelNone  AccessLevel = "None"
	AccessLevelRead  AccessLevel = "Read"
	AccessLevelWrite AccessLevel = "Write"
)

func PossibleAccessLevelValues

func PossibleAccessLevelValues() []AccessLevel

PossibleAccessLevelValues returns the possible values for the AccessLevel const type.

type AccessURI

type AccessURI struct {
	// READ-ONLY; A SAS uri for accessing a disk.
	AccessSAS *string `json:"accessSAS,omitempty" azure:"ro"`

	// READ-ONLY; A SAS uri for accessing a VM guest state.
	SecurityDataAccessSAS *string `json:"securityDataAccessSAS,omitempty" azure:"ro"`
}

AccessURI - A disk access SAS uri.

type AdditionalCapabilities

type AdditionalCapabilities struct {
	// The flag that enables or disables hibernation capability on the VM.
	HibernationEnabled *bool `json:"hibernationEnabled,omitempty"`

	// The flag that enables or disables a capability to have one or more managed data disks with UltraSSDLRS storage account
	// type on the VM or VMSS. Managed disks with storage account type UltraSSDLRS can
	// be added to a virtual machine or virtual machine scale set only if this property is enabled.
	UltraSSDEnabled *bool `json:"ultraSSDEnabled,omitempty"`
}

AdditionalCapabilities - Enables or disables a capability on the virtual machine or virtual machine scale set.

type AdditionalUnattendContent

type AdditionalUnattendContent struct {
	// The component name. Currently, the only allowable value is Microsoft-Windows-Shell-Setup.
	ComponentName *string `json:"componentName,omitempty"`

	// Specifies the XML formatted content that is added to the unattend.xml file for the specified path and component. The XML
	// must be less than 4KB and must include the root element for the setting or
	// feature that is being inserted.
	Content *string `json:"content,omitempty"`

	// The pass name. Currently, the only allowable value is OobeSystem.
	PassName *string `json:"passName,omitempty"`

	// Specifies the name of the setting to which the content applies. Possible values are: FirstLogonCommands and AutoLogon.
	SettingName *SettingNames `json:"settingName,omitempty"`
}

AdditionalUnattendContent - Specifies additional XML formatted information that can be included in the Unattend.xml file, which is used by Windows Setup. Contents are defined by setting name, component name, and the pass in which the content is applied.

type AggregatedReplicationState

type AggregatedReplicationState string

AggregatedReplicationState - This is the aggregated replication status based on all the regional replication status flags.

const (
	AggregatedReplicationStateCompleted  AggregatedReplicationState = "Completed"
	AggregatedReplicationStateFailed     AggregatedReplicationState = "Failed"
	AggregatedReplicationStateInProgress AggregatedReplicationState = "InProgress"
	AggregatedReplicationStateUnknown    AggregatedReplicationState = "Unknown"
)

func PossibleAggregatedReplicationStateValues

func PossibleAggregatedReplicationStateValues() []AggregatedReplicationState

PossibleAggregatedReplicationStateValues returns the possible values for the AggregatedReplicationState const type.

type ApplicationProfile

type ApplicationProfile struct {
	// Specifies the gallery applications that should be made available to the VM/VMSS
	GalleryApplications []*VMGalleryApplication `json:"galleryApplications,omitempty"`
}

ApplicationProfile - Contains the list of gallery applications that should be made available to the VM/VMSS

func (ApplicationProfile) MarshalJSON

func (a ApplicationProfile) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.Marshaller interface for type ApplicationProfile.

type Architecture added in v0.4.0

type Architecture string

Architecture - The architecture of the image. Applicable to OS disks only.

const (
	ArchitectureArm64 Architecture = "Arm64"
	ArchitectureX64   Architecture = "x64"
)

func PossibleArchitectureValues added in v0.4.0

func PossibleArchitectureValues() []Architecture

PossibleArchitectureValues returns the possible values for the Architecture const type.

type ArchitectureTypes added in v0.4.0

type ArchitectureTypes string

ArchitectureTypes - Specifies the Architecture Type

const (
	ArchitectureTypesArm64 ArchitectureTypes = "Arm64"
	ArchitectureTypesX64   ArchitectureTypes = "x64"
)

func PossibleArchitectureTypesValues added in v0.4.0

func PossibleArchitectureTypesValues() []ArchitectureTypes

PossibleArchitectureTypesValues returns the possible values for the ArchitectureTypes const type.

type AutomaticOSUpgradePolicy

type AutomaticOSUpgradePolicy struct {
	// Whether OS image rollback feature should be disabled. Default value is false.
	DisableAutomaticRollback *bool `json:"disableAutomaticRollback,omitempty"`

	// Indicates whether OS upgrades should automatically be applied to scale set instances in a rolling fashion when a newer
	// version of the OS image becomes available. Default value is false.
	// If this is set to true for Windows based scale sets, enableAutomaticUpdates
	// [https://docs.microsoft.com/dotnet/api/microsoft.azure.management.compute.models.windowsconfiguration.enableautomaticupdates?view=azure-dotnet]
	// is automatically set to false and cannot be set to true.
	EnableAutomaticOSUpgrade *bool `json:"enableAutomaticOSUpgrade,omitempty"`

	// Indicates whether rolling upgrade policy should be used during Auto OS Upgrade. Default value is false. Auto OS Upgrade
	// will fallback to the default policy if no policy is defined on the VMSS.
	UseRollingUpgradePolicy *bool `json:"useRollingUpgradePolicy,omitempty"`
}

AutomaticOSUpgradePolicy - The configuration parameters used for performing automatic OS upgrade.

type AutomaticOSUpgradeProperties

type AutomaticOSUpgradeProperties struct {
	// REQUIRED; Specifies whether automatic OS upgrade is supported on the image.
	AutomaticOSUpgradeSupported *bool `json:"automaticOSUpgradeSupported,omitempty"`
}

AutomaticOSUpgradeProperties - Describes automatic OS upgrade properties on the image.

type AutomaticRepairsPolicy

type AutomaticRepairsPolicy struct {
	// Specifies whether automatic repairs should be enabled on the virtual machine scale set. The default value is false.
	Enabled *bool `json:"enabled,omitempty"`

	// The amount of time for which automatic repairs are suspended due to a state change on VM. The grace time starts after the
	// state change has completed. This helps avoid premature or accidental repairs.
	// The time duration should be specified in ISO 8601 format. The minimum allowed grace period is 10 minutes (PT10M), which
	// is also the default value. The maximum allowed grace period is 90 minutes
	// (PT90M).
	GracePeriod *string `json:"gracePeriod,omitempty"`

	// Type of repair action (replace, restart, reimage) that will be used for repairing unhealthy virtual machines in the scale
	// set. Default value is replace.
	RepairAction *RepairAction `json:"repairAction,omitempty"`
}

AutomaticRepairsPolicy - Specifies the configuration parameters for automatic repairs on the virtual machine scale set.

type AvailabilitySet

type AvailabilitySet struct {
	// REQUIRED; Resource location
	Location *string `json:"location,omitempty"`

	// The instance view of a resource.
	Properties *AvailabilitySetProperties `json:"properties,omitempty"`

	// Sku of the availability set, only name is required to be set. See AvailabilitySetSkuTypes for possible set of values. Use
	// 'Aligned' for virtual machines with managed disks and 'Classic' for virtual
	// machines with unmanaged disks. Default value is 'Classic'.
	SKU *SKU `json:"sku,omitempty"`

	// Resource tags
	Tags map[string]*string `json:"tags,omitempty"`

	// READ-ONLY; Resource Id
	ID *string `json:"id,omitempty" azure:"ro"`

	// READ-ONLY; Resource name
	Name *string `json:"name,omitempty" azure:"ro"`

	// READ-ONLY; Resource type
	Type *string `json:"type,omitempty" azure:"ro"`
}

AvailabilitySet - Specifies information about the availability set that the virtual machine should be assigned to. Virtual machines specified in the same availability set are allocated to different nodes to maximize availability. For more information about availability sets, see Availability sets overview [https://docs.microsoft.com/azure/virtual-machines/availability-set-overview]. For more information on Azure planned maintenance, see Maintenance and updates for Virtual Machines in Azure [https://docs.microsoft.com/azure/virtual-machines/maintenance-and-updates] Currently, a VM can only be added to availability set at creation time. An existing VM cannot be added to an availability set.

func (AvailabilitySet) MarshalJSON

func (a AvailabilitySet) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.Marshaller interface for type AvailabilitySet.

type AvailabilitySetListResult

type AvailabilitySetListResult struct {
	// REQUIRED; The list of availability sets
	Value []*AvailabilitySet `json:"value,omitempty"`

	// The URI to fetch the next page of AvailabilitySets. Call ListNext() with this URI to fetch the next page of AvailabilitySets.
	NextLink *string `json:"nextLink,omitempty"`
}

AvailabilitySetListResult - The List Availability Set operation response.

type AvailabilitySetProperties

type AvailabilitySetProperties struct {
	// Fault Domain count.
	PlatformFaultDomainCount *int32 `json:"platformFaultDomainCount,omitempty"`

	// Update Domain count.
	PlatformUpdateDomainCount *int32 `json:"platformUpdateDomainCount,omitempty"`

	// Specifies information about the proximity placement group that the availability set should be assigned to.
	// Minimum api-version: 2018-04-01.
	ProximityPlacementGroup *SubResource `json:"proximityPlacementGroup,omitempty"`

	// A list of references to all virtual machines in the availability set.
	VirtualMachines []*SubResource `json:"virtualMachines,omitempty"`

	// READ-ONLY; The resource status information.
	Statuses []*InstanceViewStatus `json:"statuses,omitempty" azure:"ro"`
}

AvailabilitySetProperties - The instance view of a resource.

func (AvailabilitySetProperties) MarshalJSON

func (a AvailabilitySetProperties) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.Marshaller interface for type AvailabilitySetProperties.

type AvailabilitySetSKUTypes

type AvailabilitySetSKUTypes string

AvailabilitySetSKUTypes - Specifies the sku of an Availability Set. Use 'Aligned' for virtual machines with managed disks and 'Classic' for virtual machines with unmanaged disks. Default value is 'Classic'.

const (
	AvailabilitySetSKUTypesAligned AvailabilitySetSKUTypes = "Aligned"
	AvailabilitySetSKUTypesClassic AvailabilitySetSKUTypes = "Classic"
)

func PossibleAvailabilitySetSKUTypesValues

func PossibleAvailabilitySetSKUTypesValues() []AvailabilitySetSKUTypes

PossibleAvailabilitySetSKUTypesValues returns the possible values for the AvailabilitySetSKUTypes const type.

type AvailabilitySetUpdate

type AvailabilitySetUpdate struct {
	// The instance view of a resource.
	Properties *AvailabilitySetProperties `json:"properties,omitempty"`

	// Sku of the availability set
	SKU *SKU `json:"sku,omitempty"`

	// Resource tags
	Tags map[string]*string `json:"tags,omitempty"`
}

AvailabilitySetUpdate - Specifies information about the availability set that the virtual machine should be assigned to. Only tags may be updated.

func (AvailabilitySetUpdate) MarshalJSON

func (a AvailabilitySetUpdate) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.Marshaller interface for type AvailabilitySetUpdate.

type AvailabilitySetsClient

type AvailabilitySetsClient struct {
	// contains filtered or unexported fields
}

AvailabilitySetsClient contains the methods for the AvailabilitySets group. Don't use this type directly, use NewAvailabilitySetsClient() instead.

func NewAvailabilitySetsClient

func NewAvailabilitySetsClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*AvailabilitySetsClient, error)

NewAvailabilitySetsClient creates a new instance of AvailabilitySetsClient with the specified values. subscriptionID - Subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms part of the URI for every service call. credential - used to authorize requests. Usually a credential from azidentity. options - pass nil to accept the default values.

func (*AvailabilitySetsClient) CreateOrUpdate

func (client *AvailabilitySetsClient) CreateOrUpdate(ctx context.Context, resourceGroupName string, availabilitySetName string, parameters AvailabilitySet, options *AvailabilitySetsClientCreateOrUpdateOptions) (AvailabilitySetsClientCreateOrUpdateResponse, error)

CreateOrUpdate - Create or update an availability set. If the operation fails it returns an *azcore.ResponseError type. Generated from API version 2022-03-01 resourceGroupName - The name of the resource group. availabilitySetName - The name of the availability set. parameters - Parameters supplied to the Create Availability Set operation. options - AvailabilitySetsClientCreateOrUpdateOptions contains the optional parameters for the AvailabilitySetsClient.CreateOrUpdate method.

Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/compute/resource-manager/Microsoft.Compute/stable/2022-03-01/ComputeRP/examples/availabilitySetExamples/AvailabilitySet_Create.json

package main

import (
	"context"
	"log"

	"github.com/Azure/azure-sdk-for-go/sdk/azcore/to"
	"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
	"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/compute/armcompute"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	client, err := armcompute.NewAvailabilitySetsClient("{subscription-id}", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	res, err := client.CreateOrUpdate(ctx,
		"myResourceGroup",
		"myAvailabilitySet",
		armcompute.AvailabilitySet{
			Location: to.Ptr("westus"),
			Properties: &armcompute.AvailabilitySetProperties{
				PlatformFaultDomainCount:  to.Ptr[int32](2),
				PlatformUpdateDomainCount: to.Ptr[int32](20),
			},
		},
		nil)
	if err != nil {
		log.Fatalf("failed to finish the request: %v", err)
	}
	// TODO: use response item
	_ = res
}
Output:

func (*AvailabilitySetsClient) Delete

func (client *AvailabilitySetsClient) Delete(ctx context.Context, resourceGroupName string, availabilitySetName string, options *AvailabilitySetsClientDeleteOptions) (AvailabilitySetsClientDeleteResponse, error)

Delete - Delete an availability set. If the operation fails it returns an *azcore.ResponseError type. Generated from API version 2022-03-01 resourceGroupName - The name of the resource group. availabilitySetName - The name of the availability set. options - AvailabilitySetsClientDeleteOptions contains the optional parameters for the AvailabilitySetsClient.Delete method.

Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/compute/resource-manager/Microsoft.Compute/stable/2022-03-01/ComputeRP/examples/availabilitySetExamples/AvailabilitySets_Delete_MaximumSet_Gen.json

package main

import (
	"context"
	"log"

	"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
	"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/compute/armcompute"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	client, err := armcompute.NewAvailabilitySetsClient("{subscription-id}", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	_, err = client.Delete(ctx,
		"rgcompute",
		"aaaaaaaaaaaaaaaaaaaa",
		nil)
	if err != nil {
		log.Fatalf("failed to finish the request: %v", err)
	}
}
Output:

func (*AvailabilitySetsClient) Get

func (client *AvailabilitySetsClient) Get(ctx context.Context, resourceGroupName string, availabilitySetName string, options *AvailabilitySetsClientGetOptions) (AvailabilitySetsClientGetResponse, error)

Get - Retrieves information about an availability set. If the operation fails it returns an *azcore.ResponseError type. Generated from API version 2022-03-01 resourceGroupName - The name of the resource group. availabilitySetName - The name of the availability set. options - AvailabilitySetsClientGetOptions contains the optional parameters for the AvailabilitySetsClient.Get method.

Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/compute/resource-manager/Microsoft.Compute/stable/2022-03-01/ComputeRP/examples/availabilitySetExamples/AvailabilitySets_Get_MaximumSet_Gen.json

package main

import (
	"context"
	"log"

	"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
	"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/compute/armcompute"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	client, err := armcompute.NewAvailabilitySetsClient("{subscription-id}", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	res, err := client.Get(ctx,
		"rgcompute",
		"aaaaaaaaaaaa",
		nil)
	if err != nil {
		log.Fatalf("failed to finish the request: %v", err)
	}
	// TODO: use response item
	_ = res
}
Output:

func (*AvailabilitySetsClient) NewListAvailableSizesPager added in v0.7.0

func (client *AvailabilitySetsClient) NewListAvailableSizesPager(resourceGroupName string, availabilitySetName string, options *AvailabilitySetsClientListAvailableSizesOptions) *runtime.Pager[AvailabilitySetsClientListAvailableSizesResponse]

NewListAvailableSizesPager - Lists all available virtual machine sizes that can be used to create a new virtual machine in an existing availability set. If the operation fails it returns an *azcore.ResponseError type. Generated from API version 2022-03-01 resourceGroupName - The name of the resource group. availabilitySetName - The name of the availability set. options - AvailabilitySetsClientListAvailableSizesOptions contains the optional parameters for the AvailabilitySetsClient.ListAvailableSizes method.

Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/compute/resource-manager/Microsoft.Compute/stable/2022-03-01/ComputeRP/examples/availabilitySetExamples/AvailabilitySets_ListAvailableSizes_MaximumSet_Gen.json

package main

import (
	"context"
	"log"

	"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
	"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/compute/armcompute"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	client, err := armcompute.NewAvailabilitySetsClient("{subscription-id}", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	pager := client.NewListAvailableSizesPager("rgcompute",
		"aaaaaaaaaaaaaaaaaaaa",
		nil)
	for pager.More() {
		nextResult, err := pager.NextPage(ctx)
		if err != nil {
			log.Fatalf("failed to advance page: %v", err)
		}
		for _, v := range nextResult.Value {
			// TODO: use page item
			_ = v
		}
	}
}
Output:

func (*AvailabilitySetsClient) NewListBySubscriptionPager added in v0.7.0

NewListBySubscriptionPager - Lists all availability sets in a subscription. If the operation fails it returns an *azcore.ResponseError type. Generated from API version 2022-03-01 options - AvailabilitySetsClientListBySubscriptionOptions contains the optional parameters for the AvailabilitySetsClient.ListBySubscription method.

Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/compute/resource-manager/Microsoft.Compute/stable/2022-03-01/ComputeRP/examples/availabilitySetExamples/AvailabilitySet_ListBySubscription.json

package main

import (
	"context"
	"log"

	"github.com/Azure/azure-sdk-for-go/sdk/azcore/to"
	"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
	"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/compute/armcompute"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	client, err := armcompute.NewAvailabilitySetsClient("{subscriptionId}", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	pager := client.NewListBySubscriptionPager(&armcompute.AvailabilitySetsClientListBySubscriptionOptions{Expand: to.Ptr("virtualMachines\\$ref")})
	for pager.More() {
		nextResult, err := pager.NextPage(ctx)
		if err != nil {
			log.Fatalf("failed to advance page: %v", err)
		}
		for _, v := range nextResult.Value {
			// TODO: use page item
			_ = v
		}
	}
}
Output:

func (*AvailabilitySetsClient) NewListPager added in v0.7.0

NewListPager - Lists all availability sets in a resource group. If the operation fails it returns an *azcore.ResponseError type. Generated from API version 2022-03-01 resourceGroupName - The name of the resource group. options - AvailabilitySetsClientListOptions contains the optional parameters for the AvailabilitySetsClient.List method.

Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/compute/resource-manager/Microsoft.Compute/stable/2022-03-01/ComputeRP/examples/availabilitySetExamples/AvailabilitySets_List_MaximumSet_Gen.json

package main

import (
	"context"
	"log"

	"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
	"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/compute/armcompute"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	client, err := armcompute.NewAvailabilitySetsClient("{subscription-id}", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	pager := client.NewListPager("rgcompute",
		nil)
	for pager.More() {
		nextResult, err := pager.NextPage(ctx)
		if err != nil {
			log.Fatalf("failed to advance page: %v", err)
		}
		for _, v := range nextResult.Value {
			// TODO: use page item
			_ = v
		}
	}
}
Output:

func (*AvailabilitySetsClient) Update

func (client *AvailabilitySetsClient) Update(ctx context.Context, resourceGroupName string, availabilitySetName string, parameters AvailabilitySetUpdate, options *AvailabilitySetsClientUpdateOptions) (AvailabilitySetsClientUpdateResponse, error)

Update - Update an availability set. If the operation fails it returns an *azcore.ResponseError type. Generated from API version 2022-03-01 resourceGroupName - The name of the resource group. availabilitySetName - The name of the availability set. parameters - Parameters supplied to the Update Availability Set operation. options - AvailabilitySetsClientUpdateOptions contains the optional parameters for the AvailabilitySetsClient.Update method.

Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/compute/resource-manager/Microsoft.Compute/stable/2022-03-01/ComputeRP/examples/availabilitySetExamples/AvailabilitySets_Update_MaximumSet_Gen.json

package main

import (
	"context"
	"log"

	"github.com/Azure/azure-sdk-for-go/sdk/azcore/to"
	"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
	"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/compute/armcompute"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	client, err := armcompute.NewAvailabilitySetsClient("{subscription-id}", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	res, err := client.Update(ctx,
		"rgcompute",
		"aaaaaaaaaaaaaaaaaaa",
		armcompute.AvailabilitySetUpdate{
			Tags: map[string]*string{
				"key2574": to.Ptr("aaaaaaaa"),
			},
			Properties: &armcompute.AvailabilitySetProperties{
				PlatformFaultDomainCount:  to.Ptr[int32](2),
				PlatformUpdateDomainCount: to.Ptr[int32](20),
				ProximityPlacementGroup: &armcompute.SubResource{
					ID: to.Ptr("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/availabilitySets/{availabilitySetName}"),
				},
				VirtualMachines: []*armcompute.SubResource{
					{
						ID: to.Ptr("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/availabilitySets/{availabilitySetName}"),
					}},
			},
			SKU: &armcompute.SKU{
				Name:     to.Ptr("DSv3-Type1"),
				Capacity: to.Ptr[int64](7),
				Tier:     to.Ptr("aaa"),
			},
		},
		nil)
	if err != nil {
		log.Fatalf("failed to finish the request: %v", err)
	}
	// TODO: use response item
	_ = res
}
Output:

type AvailabilitySetsClientCreateOrUpdateOptions added in v0.3.0

type AvailabilitySetsClientCreateOrUpdateOptions struct {
}

AvailabilitySetsClientCreateOrUpdateOptions contains the optional parameters for the AvailabilitySetsClient.CreateOrUpdate method.

type AvailabilitySetsClientCreateOrUpdateResponse added in v0.3.0

type AvailabilitySetsClientCreateOrUpdateResponse struct {
	AvailabilitySet
}

AvailabilitySetsClientCreateOrUpdateResponse contains the response from method AvailabilitySetsClient.CreateOrUpdate.

type AvailabilitySetsClientDeleteOptions added in v0.3.0

type AvailabilitySetsClientDeleteOptions struct {
}

AvailabilitySetsClientDeleteOptions contains the optional parameters for the AvailabilitySetsClient.Delete method.

type AvailabilitySetsClientDeleteResponse added in v0.3.0

type AvailabilitySetsClientDeleteResponse struct {
}

AvailabilitySetsClientDeleteResponse contains the response from method AvailabilitySetsClient.Delete.

type AvailabilitySetsClientGetOptions added in v0.3.0

type AvailabilitySetsClientGetOptions struct {
}

AvailabilitySetsClientGetOptions contains the optional parameters for the AvailabilitySetsClient.Get method.

type AvailabilitySetsClientGetResponse added in v0.3.0

type AvailabilitySetsClientGetResponse struct {
	AvailabilitySet
}

AvailabilitySetsClientGetResponse contains the response from method AvailabilitySetsClient.Get.

type AvailabilitySetsClientListAvailableSizesOptions added in v0.3.0

type AvailabilitySetsClientListAvailableSizesOptions struct {
}

AvailabilitySetsClientListAvailableSizesOptions contains the optional parameters for the AvailabilitySetsClient.ListAvailableSizes method.

type AvailabilitySetsClientListAvailableSizesResponse added in v0.3.0

type AvailabilitySetsClientListAvailableSizesResponse struct {
	VirtualMachineSizeListResult
}

AvailabilitySetsClientListAvailableSizesResponse contains the response from method AvailabilitySetsClient.ListAvailableSizes.

type AvailabilitySetsClientListBySubscriptionOptions added in v0.3.0

type AvailabilitySetsClientListBySubscriptionOptions struct {
	// The expand expression to apply to the operation. Allowed values are 'instanceView'.
	Expand *string
}

AvailabilitySetsClientListBySubscriptionOptions contains the optional parameters for the AvailabilitySetsClient.ListBySubscription method.

type AvailabilitySetsClientListBySubscriptionResponse added in v0.3.0

type AvailabilitySetsClientListBySubscriptionResponse struct {
	AvailabilitySetListResult
}

AvailabilitySetsClientListBySubscriptionResponse contains the response from method AvailabilitySetsClient.ListBySubscription.

type AvailabilitySetsClientListOptions added in v0.3.0

type AvailabilitySetsClientListOptions struct {
}

AvailabilitySetsClientListOptions contains the optional parameters for the AvailabilitySetsClient.List method.

type AvailabilitySetsClientListResponse added in v0.3.0

type AvailabilitySetsClientListResponse struct {
	AvailabilitySetListResult
}

AvailabilitySetsClientListResponse contains the response from method AvailabilitySetsClient.List.

type AvailabilitySetsClientUpdateOptions added in v0.3.0

type AvailabilitySetsClientUpdateOptions struct {
}

AvailabilitySetsClientUpdateOptions contains the optional parameters for the AvailabilitySetsClient.Update method.

type AvailabilitySetsClientUpdateResponse added in v0.3.0

type AvailabilitySetsClientUpdateResponse struct {
	AvailabilitySet
}

AvailabilitySetsClientUpdateResponse contains the response from method AvailabilitySetsClient.Update.

type AvailablePatchSummary

type AvailablePatchSummary struct {
	// READ-ONLY; The activity ID of the operation that produced this result. It is used to correlate across CRP and extension
	// logs.
	AssessmentActivityID *string `json:"assessmentActivityId,omitempty" azure:"ro"`

	// READ-ONLY; The number of critical or security patches that have been detected as available and not yet installed.
	CriticalAndSecurityPatchCount *int32 `json:"criticalAndSecurityPatchCount,omitempty" azure:"ro"`

	// READ-ONLY; The errors that were encountered during execution of the operation. The details array contains the list of them.
	Error *APIError `json:"error,omitempty" azure:"ro"`

	// READ-ONLY; The UTC timestamp when the operation began.
	LastModifiedTime *time.Time `json:"lastModifiedTime,omitempty" azure:"ro"`

	// READ-ONLY; The number of all available patches excluding critical and security.
	OtherPatchCount *int32 `json:"otherPatchCount,omitempty" azure:"ro"`

	// READ-ONLY; The overall reboot status of the VM. It will be true when partially installed patches require a reboot to complete
	// installation but the reboot has not yet occurred.
	RebootPending *bool `json:"rebootPending,omitempty" azure:"ro"`

	// READ-ONLY; The UTC timestamp when the operation began.
	StartTime *time.Time `json:"startTime,omitempty" azure:"ro"`