Documentation ¶
Index ¶
- type APIEntityReference
- type APIError
- type APIErrorBase
- type AccessLevel
- type AccessURI
- type AdditionalCapabilities
- type AdditionalUnattendContent
- type AggregatedReplicationState
- type AlternativeOption
- type AlternativeType
- type ApplicationProfile
- type Architecture
- type ArchitectureTypes
- type AttachDetachDataDisksRequest
- type AutomaticOSUpgradePolicy
- type AutomaticOSUpgradeProperties
- type AutomaticRepairsPolicy
- type AvailabilitySet
- type AvailabilitySetListResult
- type AvailabilitySetProperties
- type AvailabilitySetSKUTypes
- type AvailabilitySetUpdate
- type AvailabilitySetsClient
- func (client *AvailabilitySetsClient) CreateOrUpdate(ctx context.Context, resourceGroupName string, availabilitySetName string, ...) (AvailabilitySetsClientCreateOrUpdateResponse, error)
- func (client *AvailabilitySetsClient) Delete(ctx context.Context, resourceGroupName string, availabilitySetName string, ...) (AvailabilitySetsClientDeleteResponse, error)
- func (client *AvailabilitySetsClient) Get(ctx context.Context, resourceGroupName string, availabilitySetName string, ...) (AvailabilitySetsClientGetResponse, error)
- func (client *AvailabilitySetsClient) NewListAvailableSizesPager(resourceGroupName string, availabilitySetName string, ...) *runtime.Pager[AvailabilitySetsClientListAvailableSizesResponse]
- func (client *AvailabilitySetsClient) NewListBySubscriptionPager(options *AvailabilitySetsClientListBySubscriptionOptions) *runtime.Pager[AvailabilitySetsClientListBySubscriptionResponse]
- func (client *AvailabilitySetsClient) NewListPager(resourceGroupName string, options *AvailabilitySetsClientListOptions) *runtime.Pager[AvailabilitySetsClientListResponse]
- func (client *AvailabilitySetsClient) Update(ctx context.Context, resourceGroupName string, availabilitySetName string, ...) (AvailabilitySetsClientUpdateResponse, error)
- type AvailabilitySetsClientCreateOrUpdateOptions
- type AvailabilitySetsClientCreateOrUpdateResponse
- type AvailabilitySetsClientDeleteOptions
- type AvailabilitySetsClientDeleteResponse
- type AvailabilitySetsClientGetOptions
- type AvailabilitySetsClientGetResponse
- type AvailabilitySetsClientListAvailableSizesOptions
- type AvailabilitySetsClientListAvailableSizesResponse
- type AvailabilitySetsClientListBySubscriptionOptions
- type AvailabilitySetsClientListBySubscriptionResponse
- type AvailabilitySetsClientListOptions
- type AvailabilitySetsClientListResponse
- type AvailabilitySetsClientUpdateOptions
- type AvailabilitySetsClientUpdateResponse
- type AvailablePatchSummary
- type BillingProfile
- type BootDiagnostics
- type BootDiagnosticsInstanceView
- type CachingTypes
- type CapacityReservation
- type CapacityReservationGroup
- type CapacityReservationGroupInstanceView
- type CapacityReservationGroupInstanceViewTypes
- type CapacityReservationGroupListResult
- type CapacityReservationGroupProperties
- type CapacityReservationGroupUpdate
- type CapacityReservationGroupsClient
- func (client *CapacityReservationGroupsClient) CreateOrUpdate(ctx context.Context, resourceGroupName string, ...) (CapacityReservationGroupsClientCreateOrUpdateResponse, error)
- func (client *CapacityReservationGroupsClient) Delete(ctx context.Context, resourceGroupName string, ...) (CapacityReservationGroupsClientDeleteResponse, error)
- func (client *CapacityReservationGroupsClient) Get(ctx context.Context, resourceGroupName string, ...) (CapacityReservationGroupsClientGetResponse, error)
- func (client *CapacityReservationGroupsClient) NewListByResourceGroupPager(resourceGroupName string, ...) *runtime.Pager[CapacityReservationGroupsClientListByResourceGroupResponse]
- func (client *CapacityReservationGroupsClient) NewListBySubscriptionPager(options *CapacityReservationGroupsClientListBySubscriptionOptions) *runtime.Pager[CapacityReservationGroupsClientListBySubscriptionResponse]
- func (client *CapacityReservationGroupsClient) Update(ctx context.Context, resourceGroupName string, ...) (CapacityReservationGroupsClientUpdateResponse, error)
- type CapacityReservationGroupsClientCreateOrUpdateOptions
- type CapacityReservationGroupsClientCreateOrUpdateResponse
- type CapacityReservationGroupsClientDeleteOptions
- type CapacityReservationGroupsClientDeleteResponse
- type CapacityReservationGroupsClientGetOptions
- type CapacityReservationGroupsClientGetResponse
- type CapacityReservationGroupsClientListByResourceGroupOptions
- type CapacityReservationGroupsClientListByResourceGroupResponse
- type CapacityReservationGroupsClientListBySubscriptionOptions
- type CapacityReservationGroupsClientListBySubscriptionResponse
- type CapacityReservationGroupsClientUpdateOptions
- type CapacityReservationGroupsClientUpdateResponse
- type CapacityReservationInstanceView
- type CapacityReservationInstanceViewTypes
- type CapacityReservationInstanceViewWithName
- type CapacityReservationListResult
- type CapacityReservationProfile
- type CapacityReservationProperties
- type CapacityReservationUpdate
- type CapacityReservationUtilization
- type CapacityReservationsClient
- func (client *CapacityReservationsClient) BeginCreateOrUpdate(ctx context.Context, resourceGroupName string, ...) (*runtime.Poller[CapacityReservationsClientCreateOrUpdateResponse], error)
- func (client *CapacityReservationsClient) BeginDelete(ctx context.Context, resourceGroupName string, ...) (*runtime.Poller[CapacityReservationsClientDeleteResponse], error)
- func (client *CapacityReservationsClient) BeginUpdate(ctx context.Context, resourceGroupName string, ...) (*runtime.Poller[CapacityReservationsClientUpdateResponse], error)
- func (client *CapacityReservationsClient) Get(ctx context.Context, resourceGroupName string, ...) (CapacityReservationsClientGetResponse, error)
- func (client *CapacityReservationsClient) NewListByCapacityReservationGroupPager(resourceGroupName string, capacityReservationGroupName string, ...) ...
- type CapacityReservationsClientBeginCreateOrUpdateOptions
- type CapacityReservationsClientBeginDeleteOptions
- type CapacityReservationsClientBeginUpdateOptions
- type CapacityReservationsClientCreateOrUpdateResponse
- type CapacityReservationsClientDeleteResponse
- type CapacityReservationsClientGetOptions
- type CapacityReservationsClientGetResponse
- type CapacityReservationsClientListByCapacityReservationGroupOptions
- type CapacityReservationsClientListByCapacityReservationGroupResponse
- type CapacityReservationsClientUpdateResponse
- type ClientFactory
- func (c *ClientFactory) NewAvailabilitySetsClient() *AvailabilitySetsClient
- func (c *ClientFactory) NewCapacityReservationGroupsClient() *CapacityReservationGroupsClient
- func (c *ClientFactory) NewCapacityReservationsClient() *CapacityReservationsClient
- func (c *ClientFactory) NewCloudServiceOperatingSystemsClient() *CloudServiceOperatingSystemsClient
- func (c *ClientFactory) NewCloudServiceRoleInstancesClient() *CloudServiceRoleInstancesClient
- func (c *ClientFactory) NewCloudServiceRolesClient() *CloudServiceRolesClient
- func (c *ClientFactory) NewCloudServicesClient() *CloudServicesClient
- func (c *ClientFactory) NewCloudServicesUpdateDomainClient() *CloudServicesUpdateDomainClient
- func (c *ClientFactory) NewCommunityGalleriesClient() *CommunityGalleriesClient
- func (c *ClientFactory) NewCommunityGalleryImageVersionsClient() *CommunityGalleryImageVersionsClient
- func (c *ClientFactory) NewCommunityGalleryImagesClient() *CommunityGalleryImagesClient
- func (c *ClientFactory) NewDedicatedHostGroupsClient() *DedicatedHostGroupsClient
- func (c *ClientFactory) NewDedicatedHostsClient() *DedicatedHostsClient
- func (c *ClientFactory) NewDiskAccessesClient() *DiskAccessesClient
- func (c *ClientFactory) NewDiskEncryptionSetsClient() *DiskEncryptionSetsClient
- func (c *ClientFactory) NewDiskRestorePointClient() *DiskRestorePointClient
- func (c *ClientFactory) NewDisksClient() *DisksClient
- func (c *ClientFactory) NewGalleriesClient() *GalleriesClient
- func (c *ClientFactory) NewGalleryApplicationVersionsClient() *GalleryApplicationVersionsClient
- func (c *ClientFactory) NewGalleryApplicationsClient() *GalleryApplicationsClient
- func (c *ClientFactory) NewGalleryImageVersionsClient() *GalleryImageVersionsClient
- func (c *ClientFactory) NewGalleryImagesClient() *GalleryImagesClient
- func (c *ClientFactory) NewGallerySharingProfileClient() *GallerySharingProfileClient
- func (c *ClientFactory) NewImagesClient() *ImagesClient
- func (c *ClientFactory) NewLogAnalyticsClient() *LogAnalyticsClient
- func (c *ClientFactory) NewOperationsClient() *OperationsClient
- func (c *ClientFactory) NewProximityPlacementGroupsClient() *ProximityPlacementGroupsClient
- func (c *ClientFactory) NewResourceSKUsClient() *ResourceSKUsClient
- func (c *ClientFactory) NewRestorePointCollectionsClient() *RestorePointCollectionsClient
- func (c *ClientFactory) NewRestorePointsClient() *RestorePointsClient
- func (c *ClientFactory) NewSSHPublicKeysClient() *SSHPublicKeysClient
- func (c *ClientFactory) NewSharedGalleriesClient() *SharedGalleriesClient
- func (c *ClientFactory) NewSharedGalleryImageVersionsClient() *SharedGalleryImageVersionsClient
- func (c *ClientFactory) NewSharedGalleryImagesClient() *SharedGalleryImagesClient
- func (c *ClientFactory) NewSnapshotsClient() *SnapshotsClient
- func (c *ClientFactory) NewUsageClient() *UsageClient
- func (c *ClientFactory) NewVirtualMachineExtensionImagesClient() *VirtualMachineExtensionImagesClient
- func (c *ClientFactory) NewVirtualMachineExtensionsClient() *VirtualMachineExtensionsClient
- func (c *ClientFactory) NewVirtualMachineImagesClient() *VirtualMachineImagesClient
- func (c *ClientFactory) NewVirtualMachineImagesEdgeZoneClient() *VirtualMachineImagesEdgeZoneClient
- func (c *ClientFactory) NewVirtualMachineRunCommandsClient() *VirtualMachineRunCommandsClient
- func (c *ClientFactory) NewVirtualMachineScaleSetExtensionsClient() *VirtualMachineScaleSetExtensionsClient
- func (c *ClientFactory) NewVirtualMachineScaleSetRollingUpgradesClient() *VirtualMachineScaleSetRollingUpgradesClient
- func (c *ClientFactory) NewVirtualMachineScaleSetVMExtensionsClient() *VirtualMachineScaleSetVMExtensionsClient
- func (c *ClientFactory) NewVirtualMachineScaleSetVMRunCommandsClient() *VirtualMachineScaleSetVMRunCommandsClient
- func (c *ClientFactory) NewVirtualMachineScaleSetVMsClient() *VirtualMachineScaleSetVMsClient
- func (c *ClientFactory) NewVirtualMachineScaleSetsClient() *VirtualMachineScaleSetsClient
- func (c *ClientFactory) NewVirtualMachineSizesClient() *VirtualMachineSizesClient
- func (c *ClientFactory) NewVirtualMachinesClient() *VirtualMachinesClient
- type CloudService
- type CloudServiceExtensionProfile
- type CloudServiceExtensionProperties
- type CloudServiceInstanceView
- type CloudServiceListResult
- type CloudServiceNetworkProfile
- type CloudServiceOperatingSystemsClient
- func (client *CloudServiceOperatingSystemsClient) GetOSFamily(ctx context.Context, location string, osFamilyName string, ...) (CloudServiceOperatingSystemsClientGetOSFamilyResponse, error)
- func (client *CloudServiceOperatingSystemsClient) GetOSVersion(ctx context.Context, location string, osVersionName string, ...) (CloudServiceOperatingSystemsClientGetOSVersionResponse, error)
- func (client *CloudServiceOperatingSystemsClient) NewListOSFamiliesPager(location string, ...) *runtime.Pager[CloudServiceOperatingSystemsClientListOSFamiliesResponse]
- func (client *CloudServiceOperatingSystemsClient) NewListOSVersionsPager(location string, ...) *runtime.Pager[CloudServiceOperatingSystemsClientListOSVersionsResponse]
- type CloudServiceOperatingSystemsClientGetOSFamilyOptions
- type CloudServiceOperatingSystemsClientGetOSFamilyResponse
- type CloudServiceOperatingSystemsClientGetOSVersionOptions
- type CloudServiceOperatingSystemsClientGetOSVersionResponse
- type CloudServiceOperatingSystemsClientListOSFamiliesOptions
- type CloudServiceOperatingSystemsClientListOSFamiliesResponse
- type CloudServiceOperatingSystemsClientListOSVersionsOptions
- type CloudServiceOperatingSystemsClientListOSVersionsResponse
- type CloudServiceOsProfile
- type CloudServiceProperties
- type CloudServiceRole
- type CloudServiceRoleInstancesClient
- func (client *CloudServiceRoleInstancesClient) BeginDelete(ctx context.Context, roleInstanceName string, resourceGroupName string, ...) (*runtime.Poller[CloudServiceRoleInstancesClientDeleteResponse], error)
- func (client *CloudServiceRoleInstancesClient) BeginRebuild(ctx context.Context, roleInstanceName string, resourceGroupName string, ...) (*runtime.Poller[CloudServiceRoleInstancesClientRebuildResponse], error)
- func (client *CloudServiceRoleInstancesClient) BeginReimage(ctx context.Context, roleInstanceName string, resourceGroupName string, ...) (*runtime.Poller[CloudServiceRoleInstancesClientReimageResponse], error)
- func (client *CloudServiceRoleInstancesClient) BeginRestart(ctx context.Context, roleInstanceName string, resourceGroupName string, ...) (*runtime.Poller[CloudServiceRoleInstancesClientRestartResponse], error)
- func (client *CloudServiceRoleInstancesClient) Get(ctx context.Context, roleInstanceName string, resourceGroupName string, ...) (CloudServiceRoleInstancesClientGetResponse, error)
- func (client *CloudServiceRoleInstancesClient) GetInstanceView(ctx context.Context, roleInstanceName string, resourceGroupName string, ...) (CloudServiceRoleInstancesClientGetInstanceViewResponse, error)
- func (client *CloudServiceRoleInstancesClient) GetRemoteDesktopFile(ctx context.Context, roleInstanceName string, resourceGroupName string, ...) (CloudServiceRoleInstancesClientGetRemoteDesktopFileResponse, error)
- func (client *CloudServiceRoleInstancesClient) NewListPager(resourceGroupName string, cloudServiceName string, ...) *runtime.Pager[CloudServiceRoleInstancesClientListResponse]
- type CloudServiceRoleInstancesClientBeginDeleteOptions
- type CloudServiceRoleInstancesClientBeginRebuildOptions
- type CloudServiceRoleInstancesClientBeginReimageOptions
- type CloudServiceRoleInstancesClientBeginRestartOptions
- type CloudServiceRoleInstancesClientDeleteResponse
- type CloudServiceRoleInstancesClientGetInstanceViewOptions
- type CloudServiceRoleInstancesClientGetInstanceViewResponse
- type CloudServiceRoleInstancesClientGetOptions
- type CloudServiceRoleInstancesClientGetRemoteDesktopFileOptions
- type CloudServiceRoleInstancesClientGetRemoteDesktopFileResponse
- type CloudServiceRoleInstancesClientGetResponse
- type CloudServiceRoleInstancesClientListOptions
- type CloudServiceRoleInstancesClientListResponse
- type CloudServiceRoleInstancesClientRebuildResponse
- type CloudServiceRoleInstancesClientReimageResponse
- type CloudServiceRoleInstancesClientRestartResponse
- type CloudServiceRoleListResult
- type CloudServiceRoleProfile
- type CloudServiceRoleProfileProperties
- type CloudServiceRoleProperties
- type CloudServiceRoleSKU
- type CloudServiceRolesClient
- func (client *CloudServiceRolesClient) Get(ctx context.Context, roleName string, resourceGroupName string, ...) (CloudServiceRolesClientGetResponse, error)
- func (client *CloudServiceRolesClient) NewListPager(resourceGroupName string, cloudServiceName string, ...) *runtime.Pager[CloudServiceRolesClientListResponse]
- type CloudServiceRolesClientGetOptions
- type CloudServiceRolesClientGetResponse
- type CloudServiceRolesClientListOptions
- type CloudServiceRolesClientListResponse
- type CloudServiceSlotType
- type CloudServiceUpdate
- type CloudServiceUpgradeMode
- type CloudServiceVaultAndSecretReference
- type CloudServiceVaultCertificate
- type CloudServiceVaultSecretGroup
- type CloudServicesClient
- func (client *CloudServicesClient) BeginCreateOrUpdate(ctx context.Context, resourceGroupName string, cloudServiceName string, ...) (*runtime.Poller[CloudServicesClientCreateOrUpdateResponse], error)
- func (client *CloudServicesClient) BeginDelete(ctx context.Context, resourceGroupName string, cloudServiceName string, ...) (*runtime.Poller[CloudServicesClientDeleteResponse], error)
- func (client *CloudServicesClient) BeginDeleteInstances(ctx context.Context, resourceGroupName string, cloudServiceName string, ...) (*runtime.Poller[CloudServicesClientDeleteInstancesResponse], error)
- func (client *CloudServicesClient) BeginPowerOff(ctx context.Context, resourceGroupName string, cloudServiceName string, ...) (*runtime.Poller[CloudServicesClientPowerOffResponse], error)
- func (client *CloudServicesClient) BeginRebuild(ctx context.Context, resourceGroupName string, cloudServiceName string, ...) (*runtime.Poller[CloudServicesClientRebuildResponse], error)
- func (client *CloudServicesClient) BeginReimage(ctx context.Context, resourceGroupName string, cloudServiceName string, ...) (*runtime.Poller[CloudServicesClientReimageResponse], error)
- func (client *CloudServicesClient) BeginRestart(ctx context.Context, resourceGroupName string, cloudServiceName string, ...) (*runtime.Poller[CloudServicesClientRestartResponse], error)
- func (client *CloudServicesClient) BeginStart(ctx context.Context, resourceGroupName string, cloudServiceName string, ...) (*runtime.Poller[CloudServicesClientStartResponse], error)
- func (client *CloudServicesClient) BeginUpdate(ctx context.Context, resourceGroupName string, cloudServiceName string, ...) (*runtime.Poller[CloudServicesClientUpdateResponse], error)
- func (client *CloudServicesClient) Get(ctx context.Context, resourceGroupName string, cloudServiceName string, ...) (CloudServicesClientGetResponse, error)
- func (client *CloudServicesClient) GetInstanceView(ctx context.Context, resourceGroupName string, cloudServiceName string, ...) (CloudServicesClientGetInstanceViewResponse, error)
- func (client *CloudServicesClient) NewListAllPager(options *CloudServicesClientListAllOptions) *runtime.Pager[CloudServicesClientListAllResponse]
- func (client *CloudServicesClient) NewListPager(resourceGroupName string, options *CloudServicesClientListOptions) *runtime.Pager[CloudServicesClientListResponse]
- type CloudServicesClientBeginCreateOrUpdateOptions
- type CloudServicesClientBeginDeleteInstancesOptions
- type CloudServicesClientBeginDeleteOptions
- type CloudServicesClientBeginPowerOffOptions
- type CloudServicesClientBeginRebuildOptions
- type CloudServicesClientBeginReimageOptions
- type CloudServicesClientBeginRestartOptions
- type CloudServicesClientBeginStartOptions
- type CloudServicesClientBeginUpdateOptions
- type CloudServicesClientCreateOrUpdateResponse
- type CloudServicesClientDeleteInstancesResponse
- type CloudServicesClientDeleteResponse
- type CloudServicesClientGetInstanceViewOptions
- type CloudServicesClientGetInstanceViewResponse
- type CloudServicesClientGetOptions
- type CloudServicesClientGetResponse
- type CloudServicesClientListAllOptions
- type CloudServicesClientListAllResponse
- type CloudServicesClientListOptions
- type CloudServicesClientListResponse
- type CloudServicesClientPowerOffResponse
- type CloudServicesClientRebuildResponse
- type CloudServicesClientReimageResponse
- type CloudServicesClientRestartResponse
- type CloudServicesClientStartResponse
- type CloudServicesClientUpdateResponse
- type CloudServicesUpdateDomainClient
- func (client *CloudServicesUpdateDomainClient) BeginWalkUpdateDomain(ctx context.Context, resourceGroupName string, cloudServiceName string, ...) (*runtime.Poller[CloudServicesUpdateDomainClientWalkUpdateDomainResponse], ...)
- func (client *CloudServicesUpdateDomainClient) GetUpdateDomain(ctx context.Context, resourceGroupName string, cloudServiceName string, ...) (CloudServicesUpdateDomainClientGetUpdateDomainResponse, error)
- func (client *CloudServicesUpdateDomainClient) NewListUpdateDomainsPager(resourceGroupName string, cloudServiceName string, ...) *runtime.Pager[CloudServicesUpdateDomainClientListUpdateDomainsResponse]
- type CloudServicesUpdateDomainClientBeginWalkUpdateDomainOptions
- type CloudServicesUpdateDomainClientGetUpdateDomainOptions
- type CloudServicesUpdateDomainClientGetUpdateDomainResponse
- type CloudServicesUpdateDomainClientListUpdateDomainsOptions
- type CloudServicesUpdateDomainClientListUpdateDomainsResponse
- type CloudServicesUpdateDomainClientWalkUpdateDomainResponse
- type CommunityGalleriesClient
- type CommunityGalleriesClientGetOptions
- type CommunityGalleriesClientGetResponse
- type CommunityGallery
- type CommunityGalleryIdentifier
- type CommunityGalleryImage
- type CommunityGalleryImageIdentifier
- type CommunityGalleryImageList
- type CommunityGalleryImageProperties
- type CommunityGalleryImageVersion
- type CommunityGalleryImageVersionList
- type CommunityGalleryImageVersionProperties
- type CommunityGalleryImageVersionsClient
- func (client *CommunityGalleryImageVersionsClient) Get(ctx context.Context, location string, publicGalleryName string, ...) (CommunityGalleryImageVersionsClientGetResponse, error)
- func (client *CommunityGalleryImageVersionsClient) NewListPager(location string, publicGalleryName string, galleryImageName string, ...) *runtime.Pager[CommunityGalleryImageVersionsClientListResponse]
- type CommunityGalleryImageVersionsClientGetOptions
- type CommunityGalleryImageVersionsClientGetResponse
- type CommunityGalleryImageVersionsClientListOptions
- type CommunityGalleryImageVersionsClientListResponse
- type CommunityGalleryImagesClient
- func (client *CommunityGalleryImagesClient) Get(ctx context.Context, location string, publicGalleryName string, ...) (CommunityGalleryImagesClientGetResponse, error)
- func (client *CommunityGalleryImagesClient) NewListPager(location string, publicGalleryName string, ...) *runtime.Pager[CommunityGalleryImagesClientListResponse]
- type CommunityGalleryImagesClientGetOptions
- type CommunityGalleryImagesClientGetResponse
- type CommunityGalleryImagesClientListOptions
- type CommunityGalleryImagesClientListResponse
- type CommunityGalleryInfo
- type CommunityGalleryMetadata
- type CommunityGalleryProperties
- type ConfidentialVMEncryptionType
- type ConsistencyModeTypes
- type CopyCompletionError
- type CopyCompletionErrorReason
- type CreationData
- type DataAccessAuthMode
- type DataDisk
- type DataDiskImage
- type DataDiskImageEncryption
- type DataDisksToAttach
- type DataDisksToDetach
- type DedicatedHost
- type DedicatedHostAllocatableVM
- type DedicatedHostAvailableCapacity
- type DedicatedHostGroup
- type DedicatedHostGroupInstanceView
- type DedicatedHostGroupListResult
- type DedicatedHostGroupProperties
- type DedicatedHostGroupPropertiesAdditionalCapabilities
- type DedicatedHostGroupUpdate
- type DedicatedHostGroupsClient
- func (client *DedicatedHostGroupsClient) CreateOrUpdate(ctx context.Context, resourceGroupName string, hostGroupName string, ...) (DedicatedHostGroupsClientCreateOrUpdateResponse, error)
- func (client *DedicatedHostGroupsClient) Delete(ctx context.Context, resourceGroupName string, hostGroupName string, ...) (DedicatedHostGroupsClientDeleteResponse, error)
- func (client *DedicatedHostGroupsClient) Get(ctx context.Context, resourceGroupName string, hostGroupName string, ...) (DedicatedHostGroupsClientGetResponse, error)
- func (client *DedicatedHostGroupsClient) NewListByResourceGroupPager(resourceGroupName string, ...) *runtime.Pager[DedicatedHostGroupsClientListByResourceGroupResponse]
- func (client *DedicatedHostGroupsClient) NewListBySubscriptionPager(options *DedicatedHostGroupsClientListBySubscriptionOptions) *runtime.Pager[DedicatedHostGroupsClientListBySubscriptionResponse]
- func (client *DedicatedHostGroupsClient) Update(ctx context.Context, resourceGroupName string, hostGroupName string, ...) (DedicatedHostGroupsClientUpdateResponse, error)
- type DedicatedHostGroupsClientCreateOrUpdateOptions
- type DedicatedHostGroupsClientCreateOrUpdateResponse
- type DedicatedHostGroupsClientDeleteOptions
- type DedicatedHostGroupsClientDeleteResponse
- type DedicatedHostGroupsClientGetOptions
- type DedicatedHostGroupsClientGetResponse
- type DedicatedHostGroupsClientListByResourceGroupOptions
- type DedicatedHostGroupsClientListByResourceGroupResponse
- type DedicatedHostGroupsClientListBySubscriptionOptions
- type DedicatedHostGroupsClientListBySubscriptionResponse
- type DedicatedHostGroupsClientUpdateOptions
- type DedicatedHostGroupsClientUpdateResponse
- type DedicatedHostInstanceView
- type DedicatedHostInstanceViewWithName
- type DedicatedHostLicenseTypes
- type DedicatedHostListResult
- type DedicatedHostProperties
- type DedicatedHostSizeListResult
- type DedicatedHostUpdate
- type DedicatedHostsClient
- func (client *DedicatedHostsClient) BeginCreateOrUpdate(ctx context.Context, resourceGroupName string, hostGroupName string, ...) (*runtime.Poller[DedicatedHostsClientCreateOrUpdateResponse], error)
- func (client *DedicatedHostsClient) BeginDelete(ctx context.Context, resourceGroupName string, hostGroupName string, ...) (*runtime.Poller[DedicatedHostsClientDeleteResponse], error)
- func (client *DedicatedHostsClient) BeginRedeploy(ctx context.Context, resourceGroupName string, hostGroupName string, ...) (*runtime.Poller[DedicatedHostsClientRedeployResponse], error)
- func (client *DedicatedHostsClient) BeginRestart(ctx context.Context, resourceGroupName string, hostGroupName string, ...) (*runtime.Poller[DedicatedHostsClientRestartResponse], error)
- func (client *DedicatedHostsClient) BeginUpdate(ctx context.Context, resourceGroupName string, hostGroupName string, ...) (*runtime.Poller[DedicatedHostsClientUpdateResponse], error)
- func (client *DedicatedHostsClient) Get(ctx context.Context, resourceGroupName string, hostGroupName string, ...) (DedicatedHostsClientGetResponse, error)
- func (client *DedicatedHostsClient) NewListAvailableSizesPager(resourceGroupName string, hostGroupName string, hostName string, ...) *runtime.Pager[DedicatedHostsClientListAvailableSizesResponse]
- func (client *DedicatedHostsClient) NewListByHostGroupPager(resourceGroupName string, hostGroupName string, ...) *runtime.Pager[DedicatedHostsClientListByHostGroupResponse]
- type DedicatedHostsClientBeginCreateOrUpdateOptions
- type DedicatedHostsClientBeginDeleteOptions
- type DedicatedHostsClientBeginRedeployOptions
- type DedicatedHostsClientBeginRestartOptions
- type DedicatedHostsClientBeginUpdateOptions
- type DedicatedHostsClientCreateOrUpdateResponse
- type DedicatedHostsClientDeleteResponse
- type DedicatedHostsClientGetOptions
- type DedicatedHostsClientGetResponse
- type DedicatedHostsClientListAvailableSizesOptions
- type DedicatedHostsClientListAvailableSizesResponse
- type DedicatedHostsClientListByHostGroupOptions
- type DedicatedHostsClientListByHostGroupResponse
- type DedicatedHostsClientRedeployResponse
- type DedicatedHostsClientRestartResponse
- type DedicatedHostsClientUpdateResponse
- type DeleteOptions
- type DiagnosticsProfile
- type DiffDiskOptions
- type DiffDiskPlacement
- type DiffDiskSettings
- type Disallowed
- type DisallowedConfiguration
- type Disk
- type DiskAccess
- type DiskAccessList
- type DiskAccessProperties
- type DiskAccessUpdate
- type DiskAccessesClient
- func (client *DiskAccessesClient) BeginCreateOrUpdate(ctx context.Context, resourceGroupName string, diskAccessName string, ...) (*runtime.Poller[DiskAccessesClientCreateOrUpdateResponse], error)
- func (client *DiskAccessesClient) BeginDelete(ctx context.Context, resourceGroupName string, diskAccessName string, ...) (*runtime.Poller[DiskAccessesClientDeleteResponse], error)
- func (client *DiskAccessesClient) BeginDeleteAPrivateEndpointConnection(ctx context.Context, resourceGroupName string, diskAccessName string, ...) (*runtime.Poller[DiskAccessesClientDeleteAPrivateEndpointConnectionResponse], ...)
- func (client *DiskAccessesClient) BeginUpdate(ctx context.Context, resourceGroupName string, diskAccessName string, ...) (*runtime.Poller[DiskAccessesClientUpdateResponse], error)
- func (client *DiskAccessesClient) BeginUpdateAPrivateEndpointConnection(ctx context.Context, resourceGroupName string, diskAccessName string, ...) (*runtime.Poller[DiskAccessesClientUpdateAPrivateEndpointConnectionResponse], ...)
- func (client *DiskAccessesClient) Get(ctx context.Context, resourceGroupName string, diskAccessName string, ...) (DiskAccessesClientGetResponse, error)
- func (client *DiskAccessesClient) GetAPrivateEndpointConnection(ctx context.Context, resourceGroupName string, diskAccessName string, ...) (DiskAccessesClientGetAPrivateEndpointConnectionResponse, error)
- func (client *DiskAccessesClient) GetPrivateLinkResources(ctx context.Context, resourceGroupName string, diskAccessName string, ...) (DiskAccessesClientGetPrivateLinkResourcesResponse, error)
- func (client *DiskAccessesClient) NewListByResourceGroupPager(resourceGroupName string, ...) *runtime.Pager[DiskAccessesClientListByResourceGroupResponse]
- func (client *DiskAccessesClient) NewListPager(options *DiskAccessesClientListOptions) *runtime.Pager[DiskAccessesClientListResponse]
- func (client *DiskAccessesClient) NewListPrivateEndpointConnectionsPager(resourceGroupName string, diskAccessName string, ...) *runtime.Pager[DiskAccessesClientListPrivateEndpointConnectionsResponse]
- type DiskAccessesClientBeginCreateOrUpdateOptions
- type DiskAccessesClientBeginDeleteAPrivateEndpointConnectionOptions
- type DiskAccessesClientBeginDeleteOptions
- type DiskAccessesClientBeginUpdateAPrivateEndpointConnectionOptions
- type DiskAccessesClientBeginUpdateOptions
- type DiskAccessesClientCreateOrUpdateResponse
- type DiskAccessesClientDeleteAPrivateEndpointConnectionResponse
- type DiskAccessesClientDeleteResponse
- type DiskAccessesClientGetAPrivateEndpointConnectionOptions
- type DiskAccessesClientGetAPrivateEndpointConnectionResponse
- type DiskAccessesClientGetOptions
- type DiskAccessesClientGetPrivateLinkResourcesOptions
- type DiskAccessesClientGetPrivateLinkResourcesResponse
- type DiskAccessesClientGetResponse
- type DiskAccessesClientListByResourceGroupOptions
- type DiskAccessesClientListByResourceGroupResponse
- type DiskAccessesClientListOptions
- type DiskAccessesClientListPrivateEndpointConnectionsOptions
- type DiskAccessesClientListPrivateEndpointConnectionsResponse
- type DiskAccessesClientListResponse
- type DiskAccessesClientUpdateAPrivateEndpointConnectionResponse
- type DiskAccessesClientUpdateResponse
- type DiskControllerTypes
- type DiskCreateOption
- type DiskCreateOptionTypes
- type DiskDeleteOptionTypes
- type DiskDetachOptionTypes
- type DiskEncryptionSet
- type DiskEncryptionSetIdentityType
- type DiskEncryptionSetList
- type DiskEncryptionSetParameters
- type DiskEncryptionSetType
- type DiskEncryptionSetUpdate
- type DiskEncryptionSetUpdateProperties
- type DiskEncryptionSetsClient
- func (client *DiskEncryptionSetsClient) BeginCreateOrUpdate(ctx context.Context, resourceGroupName string, diskEncryptionSetName string, ...) (*runtime.Poller[DiskEncryptionSetsClientCreateOrUpdateResponse], error)
- func (client *DiskEncryptionSetsClient) BeginDelete(ctx context.Context, resourceGroupName string, diskEncryptionSetName string, ...) (*runtime.Poller[DiskEncryptionSetsClientDeleteResponse], error)
- func (client *DiskEncryptionSetsClient) BeginUpdate(ctx context.Context, resourceGroupName string, diskEncryptionSetName string, ...) (*runtime.Poller[DiskEncryptionSetsClientUpdateResponse], error)
- func (client *DiskEncryptionSetsClient) Get(ctx context.Context, resourceGroupName string, diskEncryptionSetName string, ...) (DiskEncryptionSetsClientGetResponse, error)
- func (client *DiskEncryptionSetsClient) NewListAssociatedResourcesPager(resourceGroupName string, diskEncryptionSetName string, ...) *runtime.Pager[DiskEncryptionSetsClientListAssociatedResourcesResponse]
- func (client *DiskEncryptionSetsClient) NewListByResourceGroupPager(resourceGroupName string, ...) *runtime.Pager[DiskEncryptionSetsClientListByResourceGroupResponse]
- func (client *DiskEncryptionSetsClient) NewListPager(options *DiskEncryptionSetsClientListOptions) *runtime.Pager[DiskEncryptionSetsClientListResponse]
- type DiskEncryptionSetsClientBeginCreateOrUpdateOptions
- type DiskEncryptionSetsClientBeginDeleteOptions
- type DiskEncryptionSetsClientBeginUpdateOptions
- type DiskEncryptionSetsClientCreateOrUpdateResponse
- type DiskEncryptionSetsClientDeleteResponse
- type DiskEncryptionSetsClientGetOptions
- type DiskEncryptionSetsClientGetResponse
- type DiskEncryptionSetsClientListAssociatedResourcesOptions
- type DiskEncryptionSetsClientListAssociatedResourcesResponse
- type DiskEncryptionSetsClientListByResourceGroupOptions
- type DiskEncryptionSetsClientListByResourceGroupResponse
- type DiskEncryptionSetsClientListOptions
- type DiskEncryptionSetsClientListResponse
- type DiskEncryptionSetsClientUpdateResponse
- type DiskEncryptionSettings
- type DiskImageEncryption
- type DiskInstanceView
- type DiskList
- type DiskProperties
- type DiskPurchasePlan
- type DiskRestorePoint
- type DiskRestorePointAttributes
- type DiskRestorePointClient
- func (client *DiskRestorePointClient) BeginGrantAccess(ctx context.Context, resourceGroupName string, ...) (*runtime.Poller[DiskRestorePointClientGrantAccessResponse], error)
- func (client *DiskRestorePointClient) BeginRevokeAccess(ctx context.Context, resourceGroupName string, ...) (*runtime.Poller[DiskRestorePointClientRevokeAccessResponse], error)
- func (client *DiskRestorePointClient) Get(ctx context.Context, resourceGroupName string, ...) (DiskRestorePointClientGetResponse, error)
- func (client *DiskRestorePointClient) NewListByRestorePointPager(resourceGroupName string, restorePointCollectionName string, ...) *runtime.Pager[DiskRestorePointClientListByRestorePointResponse]
- type DiskRestorePointClientBeginGrantAccessOptions
- type DiskRestorePointClientBeginRevokeAccessOptions
- type DiskRestorePointClientGetOptions
- type DiskRestorePointClientGetResponse
- type DiskRestorePointClientGrantAccessResponse
- type DiskRestorePointClientListByRestorePointOptions
- type DiskRestorePointClientListByRestorePointResponse
- type DiskRestorePointClientRevokeAccessResponse
- type DiskRestorePointInstanceView
- type DiskRestorePointList
- type DiskRestorePointProperties
- type DiskRestorePointReplicationStatus
- type DiskSKU
- type DiskSecurityProfile
- type DiskSecurityTypes
- type DiskState
- type DiskStorageAccountTypes
- type DiskUpdate
- type DiskUpdateProperties
- type DisksClient
- func (client *DisksClient) BeginCreateOrUpdate(ctx context.Context, resourceGroupName string, diskName string, disk Disk, ...) (*runtime.Poller[DisksClientCreateOrUpdateResponse], error)
- func (client *DisksClient) BeginDelete(ctx context.Context, resourceGroupName string, diskName string, ...) (*runtime.Poller[DisksClientDeleteResponse], error)
- func (client *DisksClient) BeginGrantAccess(ctx context.Context, resourceGroupName string, diskName string, ...) (*runtime.Poller[DisksClientGrantAccessResponse], error)
- func (client *DisksClient) BeginRevokeAccess(ctx context.Context, resourceGroupName string, diskName string, ...) (*runtime.Poller[DisksClientRevokeAccessResponse], error)
- func (client *DisksClient) BeginUpdate(ctx context.Context, resourceGroupName string, diskName string, ...) (*runtime.Poller[DisksClientUpdateResponse], error)
- func (client *DisksClient) Get(ctx context.Context, resourceGroupName string, diskName string, ...) (DisksClientGetResponse, error)
- func (client *DisksClient) NewListByResourceGroupPager(resourceGroupName string, options *DisksClientListByResourceGroupOptions) *runtime.Pager[DisksClientListByResourceGroupResponse]
- func (client *DisksClient) NewListPager(options *DisksClientListOptions) *runtime.Pager[DisksClientListResponse]
- type DisksClientBeginCreateOrUpdateOptions
- type DisksClientBeginDeleteOptions
- type DisksClientBeginGrantAccessOptions
- type DisksClientBeginRevokeAccessOptions
- type DisksClientBeginUpdateOptions
- type DisksClientCreateOrUpdateResponse
- type DisksClientDeleteResponse
- type DisksClientGetOptions
- type DisksClientGetResponse
- type DisksClientGrantAccessResponse
- type DisksClientListByResourceGroupOptions
- type DisksClientListByResourceGroupResponse
- type DisksClientListOptions
- type DisksClientListResponse
- type DisksClientRevokeAccessResponse
- type DisksClientUpdateResponse
- type DomainNameLabelScopeTypes
- type EdgeZoneStorageAccountType
- type Encryption
- type EncryptionIdentity
- type EncryptionImages
- type EncryptionSetIdentity
- type EncryptionSetProperties
- type EncryptionSettingsCollection
- type EncryptionSettingsElement
- type EncryptionType
- type EventGridAndResourceGraph
- type ExecutionState
- type ExpandTypeForListVMs
- type ExpandTypesForGetCapacityReservationGroups
- type ExpandTypesForGetVMScaleSets
- type ExpandTypesForListVMs
- type ExtendedLocation
- type ExtendedLocationType
- type ExtendedLocationTypes
- type Extension
- type FileFormat
- type GalleriesClient
- func (client *GalleriesClient) BeginCreateOrUpdate(ctx context.Context, resourceGroupName string, galleryName string, ...) (*runtime.Poller[GalleriesClientCreateOrUpdateResponse], error)
- func (client *GalleriesClient) BeginDelete(ctx context.Context, resourceGroupName string, galleryName string, ...) (*runtime.Poller[GalleriesClientDeleteResponse], error)
- func (client *GalleriesClient) BeginUpdate(ctx context.Context, resourceGroupName string, galleryName string, ...) (*runtime.Poller[GalleriesClientUpdateResponse], error)
- func (client *GalleriesClient) Get(ctx context.Context, resourceGroupName string, galleryName string, ...) (GalleriesClientGetResponse, error)
- func (client *GalleriesClient) NewListByResourceGroupPager(resourceGroupName string, options *GalleriesClientListByResourceGroupOptions) *runtime.Pager[GalleriesClientListByResourceGroupResponse]
- func (client *GalleriesClient) NewListPager(options *GalleriesClientListOptions) *runtime.Pager[GalleriesClientListResponse]
- type GalleriesClientBeginCreateOrUpdateOptions
- type GalleriesClientBeginDeleteOptions
- type GalleriesClientBeginUpdateOptions
- type GalleriesClientCreateOrUpdateResponse
- type GalleriesClientDeleteResponse
- type GalleriesClientGetOptions
- type GalleriesClientGetResponse
- type GalleriesClientListByResourceGroupOptions
- type GalleriesClientListByResourceGroupResponse
- type GalleriesClientListOptions
- type GalleriesClientListResponse
- type GalleriesClientUpdateResponse
- type Gallery
- type GalleryApplication
- type GalleryApplicationCustomAction
- type GalleryApplicationCustomActionParameter
- type GalleryApplicationCustomActionParameterType
- type GalleryApplicationList
- type GalleryApplicationProperties
- type GalleryApplicationUpdate
- type GalleryApplicationVersion
- type GalleryApplicationVersionList
- type GalleryApplicationVersionProperties
- type GalleryApplicationVersionPublishingProfile
- type GalleryApplicationVersionSafetyProfile
- type GalleryApplicationVersionUpdate
- type GalleryApplicationVersionsClient
- func (client *GalleryApplicationVersionsClient) BeginCreateOrUpdate(ctx context.Context, resourceGroupName string, galleryName string, ...) (*runtime.Poller[GalleryApplicationVersionsClientCreateOrUpdateResponse], error)
- func (client *GalleryApplicationVersionsClient) BeginDelete(ctx context.Context, resourceGroupName string, galleryName string, ...) (*runtime.Poller[GalleryApplicationVersionsClientDeleteResponse], error)
- func (client *GalleryApplicationVersionsClient) BeginUpdate(ctx context.Context, resourceGroupName string, galleryName string, ...) (*runtime.Poller[GalleryApplicationVersionsClientUpdateResponse], error)
- func (client *GalleryApplicationVersionsClient) Get(ctx context.Context, resourceGroupName string, galleryName string, ...) (GalleryApplicationVersionsClientGetResponse, error)
- func (client *GalleryApplicationVersionsClient) NewListByGalleryApplicationPager(resourceGroupName string, galleryName string, galleryApplicationName string, ...) ...
- type GalleryApplicationVersionsClientBeginCreateOrUpdateOptions
- type GalleryApplicationVersionsClientBeginDeleteOptions
- type GalleryApplicationVersionsClientBeginUpdateOptions
- type GalleryApplicationVersionsClientCreateOrUpdateResponse
- type GalleryApplicationVersionsClientDeleteResponse
- type GalleryApplicationVersionsClientGetOptions
- type GalleryApplicationVersionsClientGetResponse
- type GalleryApplicationVersionsClientListByGalleryApplicationOptions
- type GalleryApplicationVersionsClientListByGalleryApplicationResponse
- type GalleryApplicationVersionsClientUpdateResponse
- type GalleryApplicationsClient
- func (client *GalleryApplicationsClient) BeginCreateOrUpdate(ctx context.Context, resourceGroupName string, galleryName string, ...) (*runtime.Poller[GalleryApplicationsClientCreateOrUpdateResponse], error)
- func (client *GalleryApplicationsClient) BeginDelete(ctx context.Context, resourceGroupName string, galleryName string, ...) (*runtime.Poller[GalleryApplicationsClientDeleteResponse], error)
- func (client *GalleryApplicationsClient) BeginUpdate(ctx context.Context, resourceGroupName string, galleryName string, ...) (*runtime.Poller[GalleryApplicationsClientUpdateResponse], error)
- func (client *GalleryApplicationsClient) Get(ctx context.Context, resourceGroupName string, galleryName string, ...) (GalleryApplicationsClientGetResponse, error)
- func (client *GalleryApplicationsClient) NewListByGalleryPager(resourceGroupName string, galleryName string, ...) *runtime.Pager[GalleryApplicationsClientListByGalleryResponse]
- type GalleryApplicationsClientBeginCreateOrUpdateOptions
- type GalleryApplicationsClientBeginDeleteOptions
- type GalleryApplicationsClientBeginUpdateOptions
- type GalleryApplicationsClientCreateOrUpdateResponse
- type GalleryApplicationsClientDeleteResponse
- type GalleryApplicationsClientGetOptions
- type GalleryApplicationsClientGetResponse
- type GalleryApplicationsClientListByGalleryOptions
- type GalleryApplicationsClientListByGalleryResponse
- type GalleryApplicationsClientUpdateResponse
- type GalleryArtifactPublishingProfileBase
- type GalleryArtifactSafetyProfileBase
- type GalleryArtifactSource
- type GalleryArtifactVersionFullSource
- type GalleryArtifactVersionSource
- type GalleryDataDiskImage
- type GalleryDiskImage
- type GalleryDiskImageSource
- type GalleryExpandParams
- type GalleryExtendedLocation
- type GalleryExtendedLocationType
- type GalleryIdentifier
- type GalleryImage
- type GalleryImageFeature
- type GalleryImageIdentifier
- type GalleryImageList
- type GalleryImageProperties
- type GalleryImageUpdate
- type GalleryImageVersion
- type GalleryImageVersionList
- type GalleryImageVersionProperties
- type GalleryImageVersionPublishingProfile
- type GalleryImageVersionSafetyProfile
- type GalleryImageVersionStorageProfile
- type GalleryImageVersionUefiSettings
- type GalleryImageVersionUpdate
- type GalleryImageVersionsClient
- func (client *GalleryImageVersionsClient) BeginCreateOrUpdate(ctx context.Context, resourceGroupName string, galleryName string, ...) (*runtime.Poller[GalleryImageVersionsClientCreateOrUpdateResponse], error)
- func (client *GalleryImageVersionsClient) BeginDelete(ctx context.Context, resourceGroupName string, galleryName string, ...) (*runtime.Poller[GalleryImageVersionsClientDeleteResponse], error)
- func (client *GalleryImageVersionsClient) BeginUpdate(ctx context.Context, resourceGroupName string, galleryName string, ...) (*runtime.Poller[GalleryImageVersionsClientUpdateResponse], error)
- func (client *GalleryImageVersionsClient) Get(ctx context.Context, resourceGroupName string, galleryName string, ...) (GalleryImageVersionsClientGetResponse, error)
- func (client *GalleryImageVersionsClient) NewListByGalleryImagePager(resourceGroupName string, galleryName string, galleryImageName string, ...) *runtime.Pager[GalleryImageVersionsClientListByGalleryImageResponse]
- type GalleryImageVersionsClientBeginCreateOrUpdateOptions
- type GalleryImageVersionsClientBeginDeleteOptions
- type GalleryImageVersionsClientBeginUpdateOptions
- type GalleryImageVersionsClientCreateOrUpdateResponse
- type GalleryImageVersionsClientDeleteResponse
- type GalleryImageVersionsClientGetOptions
- type GalleryImageVersionsClientGetResponse
- type GalleryImageVersionsClientListByGalleryImageOptions
- type GalleryImageVersionsClientListByGalleryImageResponse
- type GalleryImageVersionsClientUpdateResponse
- type GalleryImagesClient
- func (client *GalleryImagesClient) BeginCreateOrUpdate(ctx context.Context, resourceGroupName string, galleryName string, ...) (*runtime.Poller[GalleryImagesClientCreateOrUpdateResponse], error)
- func (client *GalleryImagesClient) BeginDelete(ctx context.Context, resourceGroupName string, galleryName string, ...) (*runtime.Poller[GalleryImagesClientDeleteResponse], error)
- func (client *GalleryImagesClient) BeginUpdate(ctx context.Context, resourceGroupName string, galleryName string, ...) (*runtime.Poller[GalleryImagesClientUpdateResponse], error)
- func (client *GalleryImagesClient) Get(ctx context.Context, resourceGroupName string, galleryName string, ...) (GalleryImagesClientGetResponse, error)
- func (client *GalleryImagesClient) NewListByGalleryPager(resourceGroupName string, galleryName string, ...) *runtime.Pager[GalleryImagesClientListByGalleryResponse]
- type GalleryImagesClientBeginCreateOrUpdateOptions
- type GalleryImagesClientBeginDeleteOptions
- type GalleryImagesClientBeginUpdateOptions
- type GalleryImagesClientCreateOrUpdateResponse
- type GalleryImagesClientDeleteResponse
- type GalleryImagesClientGetOptions
- type GalleryImagesClientGetResponse
- type GalleryImagesClientListByGalleryOptions
- type GalleryImagesClientListByGalleryResponse
- type GalleryImagesClientUpdateResponse
- type GalleryList
- type GalleryOSDiskImage
- type GalleryProperties
- type GalleryProvisioningState
- type GallerySharingPermissionTypes
- type GallerySharingProfileClient
- type GallerySharingProfileClientBeginUpdateOptions
- type GallerySharingProfileClientUpdateResponse
- type GalleryTargetExtendedLocation
- type GalleryUpdate
- type GrantAccessData
- type HardwareProfile
- type HostCaching
- type HyperVGeneration
- type HyperVGenerationType
- type HyperVGenerationTypes
- type IPVersion
- type IPVersions
- type Image
- type ImageDataDisk
- type ImageDeprecationStatus
- type ImageDisk
- type ImageDiskReference
- type ImageListResult
- type ImageOSDisk
- type ImageProperties
- type ImagePurchasePlan
- type ImageReference
- type ImageState
- type ImageStorageProfile
- type ImageUpdate
- type ImageVersionSecurityProfile
- type ImagesClient
- func (client *ImagesClient) BeginCreateOrUpdate(ctx context.Context, resourceGroupName string, imageName string, ...) (*runtime.Poller[ImagesClientCreateOrUpdateResponse], error)
- func (client *ImagesClient) BeginDelete(ctx context.Context, resourceGroupName string, imageName string, ...) (*runtime.Poller[ImagesClientDeleteResponse], error)
- func (client *ImagesClient) BeginUpdate(ctx context.Context, resourceGroupName string, imageName string, ...) (*runtime.Poller[ImagesClientUpdateResponse], error)
- func (client *ImagesClient) Get(ctx context.Context, resourceGroupName string, imageName string, ...) (ImagesClientGetResponse, error)
- func (client *ImagesClient) NewListByResourceGroupPager(resourceGroupName string, options *ImagesClientListByResourceGroupOptions) *runtime.Pager[ImagesClientListByResourceGroupResponse]
- func (client *ImagesClient) NewListPager(options *ImagesClientListOptions) *runtime.Pager[ImagesClientListResponse]
- type ImagesClientBeginCreateOrUpdateOptions
- type ImagesClientBeginDeleteOptions
- type ImagesClientBeginUpdateOptions
- type ImagesClientCreateOrUpdateResponse
- type ImagesClientDeleteResponse
- type ImagesClientGetOptions
- type ImagesClientGetResponse
- type ImagesClientListByResourceGroupOptions
- type ImagesClientListByResourceGroupResponse
- type ImagesClientListOptions
- type ImagesClientListResponse
- type ImagesClientUpdateResponse
- type InnerError
- type InstanceSKU
- type InstanceViewStatus
- type InstanceViewStatusesSummary
- type InstanceViewTypes
- type IntervalInMins
- type KeyForDiskEncryptionSet
- type KeyVaultAndKeyReference
- type KeyVaultAndSecretReference
- type KeyVaultKeyReference
- type KeyVaultSecretReference
- type LastPatchInstallationSummary
- type LatestGalleryImageVersion
- type LinuxConfiguration
- type LinuxParameters
- type LinuxPatchAssessmentMode
- type LinuxPatchSettings
- type LinuxVMGuestPatchAutomaticByPlatformRebootSetting
- type LinuxVMGuestPatchAutomaticByPlatformSettings
- type LinuxVMGuestPatchMode
- type ListUsagesResult
- type LoadBalancerConfiguration
- type LoadBalancerConfigurationProperties
- type LoadBalancerFrontendIPConfiguration
- type LoadBalancerFrontendIPConfigurationProperties
- type LogAnalyticsClient
- func (client *LogAnalyticsClient) BeginExportRequestRateByInterval(ctx context.Context, location string, parameters RequestRateByIntervalInput, ...) (*runtime.Poller[LogAnalyticsClientExportRequestRateByIntervalResponse], error)
- func (client *LogAnalyticsClient) BeginExportThrottledRequests(ctx context.Context, location string, parameters ThrottledRequestsInput, ...) (*runtime.Poller[LogAnalyticsClientExportThrottledRequestsResponse], error)
- type LogAnalyticsClientBeginExportRequestRateByIntervalOptions
- type LogAnalyticsClientBeginExportThrottledRequestsOptions
- type LogAnalyticsClientExportRequestRateByIntervalResponse
- type LogAnalyticsClientExportThrottledRequestsResponse
- type LogAnalyticsInputBase
- type LogAnalyticsOperationResult
- type LogAnalyticsOutput
- type MaintenanceOperationResultCodeTypes
- type MaintenanceRedeployStatus
- type ManagedArtifact
- type ManagedDiskParameters
- type Mode
- type NetworkAPIVersion
- type NetworkAccessPolicy
- type NetworkInterfaceAuxiliaryMode
- type NetworkInterfaceAuxiliarySKU
- type NetworkInterfaceReference
- type NetworkInterfaceReferenceProperties
- type NetworkProfile
- type OSDisk
- type OSDiskImage
- type OSDiskImageEncryption
- type OSDiskImageSecurityProfile
- type OSFamily
- type OSFamilyListResult
- type OSFamilyProperties
- type OSImageNotificationProfile
- type OSProfile
- type OSProfileProvisioningData
- type OSVersion
- type OSVersionListResult
- type OSVersionProperties
- type OSVersionPropertiesBase
- type OperatingSystemStateTypes
- type OperatingSystemType
- type OperatingSystemTypes
- type OperationListResult
- type OperationValue
- type OperationValueDisplay
- type OperationsClient
- type OperationsClientListOptions
- type OperationsClientListResponse
- type OrchestrationMode
- type OrchestrationServiceNames
- type OrchestrationServiceState
- type OrchestrationServiceStateAction
- type OrchestrationServiceStateInput
- type OrchestrationServiceSummary
- type PatchAssessmentState
- type PatchInstallationDetail
- type PatchInstallationState
- type PatchOperationStatus
- type PatchSettings
- type PirCommunityGalleryResource
- type PirResource
- type PirSharedGalleryResource
- type Plan
- type PolicyViolation
- type PolicyViolationCategory
- type PriorityMixPolicy
- type PrivateEndpoint
- type PrivateEndpointConnection
- type PrivateEndpointConnectionListResult
- type PrivateEndpointConnectionProperties
- type PrivateEndpointConnectionProvisioningState
- type PrivateEndpointServiceConnectionStatus
- type PrivateLinkResource
- type PrivateLinkResourceListResult
- type PrivateLinkResourceProperties
- type PrivateLinkServiceConnectionState
- type PropertyUpdatesInProgress
- type ProtocolTypes
- type ProvisionedBandwidthCopyOption
- type ProximityPlacementGroup
- type ProximityPlacementGroupListResult
- type ProximityPlacementGroupProperties
- type ProximityPlacementGroupPropertiesIntent
- type ProximityPlacementGroupType
- type ProximityPlacementGroupUpdate
- type ProximityPlacementGroupsClient
- func (client *ProximityPlacementGroupsClient) CreateOrUpdate(ctx context.Context, resourceGroupName string, ...) (ProximityPlacementGroupsClientCreateOrUpdateResponse, error)
- func (client *ProximityPlacementGroupsClient) Delete(ctx context.Context, resourceGroupName string, ...) (ProximityPlacementGroupsClientDeleteResponse, error)
- func (client *ProximityPlacementGroupsClient) Get(ctx context.Context, resourceGroupName string, ...) (ProximityPlacementGroupsClientGetResponse, error)
- func (client *ProximityPlacementGroupsClient) NewListByResourceGroupPager(resourceGroupName string, ...) *runtime.Pager[ProximityPlacementGroupsClientListByResourceGroupResponse]
- func (client *ProximityPlacementGroupsClient) NewListBySubscriptionPager(options *ProximityPlacementGroupsClientListBySubscriptionOptions) *runtime.Pager[ProximityPlacementGroupsClientListBySubscriptionResponse]
- func (client *ProximityPlacementGroupsClient) Update(ctx context.Context, resourceGroupName string, ...) (ProximityPlacementGroupsClientUpdateResponse, error)
- type ProximityPlacementGroupsClientCreateOrUpdateOptions
- type ProximityPlacementGroupsClientCreateOrUpdateResponse
- type ProximityPlacementGroupsClientDeleteOptions
- type ProximityPlacementGroupsClientDeleteResponse
- type ProximityPlacementGroupsClientGetOptions
- type ProximityPlacementGroupsClientGetResponse
- type ProximityPlacementGroupsClientListByResourceGroupOptions
- type ProximityPlacementGroupsClientListByResourceGroupResponse
- type ProximityPlacementGroupsClientListBySubscriptionOptions
- type ProximityPlacementGroupsClientListBySubscriptionResponse
- type ProximityPlacementGroupsClientUpdateOptions
- type ProximityPlacementGroupsClientUpdateResponse
- type ProxyAgentSettings
- type ProxyOnlyResource
- type ProxyResource
- type PublicIPAddressSKU
- type PublicIPAddressSKUName
- type PublicIPAddressSKUTier
- type PublicIPAllocationMethod
- type PublicNetworkAccess
- type PurchasePlan
- type RecommendedMachineConfiguration
- type RecoveryWalkResponse
- type RegionalReplicationStatus
- type RegionalSharingStatus
- type RepairAction
- type ReplicationMode
- type ReplicationState
- type ReplicationStatus
- type ReplicationStatusTypes
- type RequestRateByIntervalInput
- type ResiliencyPolicy
- type ResilientVMCreationPolicy
- type ResilientVMDeletionPolicy
- type Resource
- type ResourceIDOptionsForGetCapacityReservationGroups
- type ResourceIdentityType
- type ResourceInstanceViewStatus
- type ResourceRange
- type ResourceSKU
- type ResourceSKUCapabilities
- type ResourceSKUCapacity
- type ResourceSKUCapacityScaleType
- type ResourceSKUCosts
- type ResourceSKULocationInfo
- type ResourceSKURestrictionInfo
- type ResourceSKURestrictions
- type ResourceSKURestrictionsReasonCode
- type ResourceSKURestrictionsType
- type ResourceSKUZoneDetails
- type ResourceSKUsClient
- type ResourceSKUsClientListOptions
- type ResourceSKUsClientListResponse
- type ResourceSKUsResult
- type ResourceSharingProfile
- type ResourceURIList
- type ResourceWithOptionalLocation
- type RestorePoint
- type RestorePointCollection
- type RestorePointCollectionExpandOptions
- type RestorePointCollectionListResult
- type RestorePointCollectionProperties
- type RestorePointCollectionSourceProperties
- type RestorePointCollectionUpdate
- type RestorePointCollectionsClient
- func (client *RestorePointCollectionsClient) BeginDelete(ctx context.Context, resourceGroupName string, ...) (*runtime.Poller[RestorePointCollectionsClientDeleteResponse], error)
- func (client *RestorePointCollectionsClient) CreateOrUpdate(ctx context.Context, resourceGroupName string, ...) (RestorePointCollectionsClientCreateOrUpdateResponse, error)
- func (client *RestorePointCollectionsClient) Get(ctx context.Context, resourceGroupName string, ...) (RestorePointCollectionsClientGetResponse, error)
- func (client *RestorePointCollectionsClient) NewListAllPager(options *RestorePointCollectionsClientListAllOptions) *runtime.Pager[RestorePointCollectionsClientListAllResponse]
- func (client *RestorePointCollectionsClient) NewListPager(resourceGroupName string, options *RestorePointCollectionsClientListOptions) *runtime.Pager[RestorePointCollectionsClientListResponse]
- func (client *RestorePointCollectionsClient) Update(ctx context.Context, resourceGroupName string, ...) (RestorePointCollectionsClientUpdateResponse, error)
- type RestorePointCollectionsClientBeginDeleteOptions
- type RestorePointCollectionsClientCreateOrUpdateOptions
- type RestorePointCollectionsClientCreateOrUpdateResponse
- type RestorePointCollectionsClientDeleteResponse
- type RestorePointCollectionsClientGetOptions
- type RestorePointCollectionsClientGetResponse
- type RestorePointCollectionsClientListAllOptions
- type RestorePointCollectionsClientListAllResponse
- type RestorePointCollectionsClientListOptions
- type RestorePointCollectionsClientListResponse
- type RestorePointCollectionsClientUpdateOptions
- type RestorePointCollectionsClientUpdateResponse
- type RestorePointEncryption
- type RestorePointEncryptionType
- type RestorePointExpandOptions
- type RestorePointInstanceView
- type RestorePointProperties
- type RestorePointSourceMetadata
- type RestorePointSourceVMDataDisk
- type RestorePointSourceVMOSDisk
- type RestorePointSourceVMStorageProfile
- type RestorePointsClient
- func (client *RestorePointsClient) BeginCreate(ctx context.Context, resourceGroupName string, ...) (*runtime.Poller[RestorePointsClientCreateResponse], error)
- func (client *RestorePointsClient) BeginDelete(ctx context.Context, resourceGroupName string, ...) (*runtime.Poller[RestorePointsClientDeleteResponse], error)
- func (client *RestorePointsClient) Get(ctx context.Context, resourceGroupName string, ...) (RestorePointsClientGetResponse, error)
- type RestorePointsClientBeginCreateOptions
- type RestorePointsClientBeginDeleteOptions
- type RestorePointsClientCreateResponse
- type RestorePointsClientDeleteResponse
- type RestorePointsClientGetOptions
- type RestorePointsClientGetResponse
- type RetrieveBootDiagnosticsDataResult
- type RoleInstance
- type RoleInstanceListResult
- type RoleInstanceNetworkProfile
- type RoleInstanceProperties
- type RoleInstanceView
- type RoleInstances
- type RollbackStatusInfo
- type RollingUpgradeActionType
- type RollingUpgradePolicy
- type RollingUpgradeProgressInfo
- type RollingUpgradeRunningStatus
- type RollingUpgradeStatusCode
- type RollingUpgradeStatusInfo
- type RollingUpgradeStatusInfoProperties
- type RunCommandDocument
- type RunCommandDocumentBase
- type RunCommandInput
- type RunCommandInputParameter
- type RunCommandListResult
- type RunCommandManagedIdentity
- type RunCommandParameterDefinition
- type RunCommandResult
- type SKU
- type SSHConfiguration
- type SSHEncryptionTypes
- type SSHGenerateKeyPairInputParameters
- type SSHPublicKey
- type SSHPublicKeyGenerateKeyPairResult
- type SSHPublicKeyResource
- type SSHPublicKeyResourceProperties
- type SSHPublicKeyUpdateResource
- type SSHPublicKeysClient
- func (client *SSHPublicKeysClient) Create(ctx context.Context, resourceGroupName string, sshPublicKeyName string, ...) (SSHPublicKeysClientCreateResponse, error)
- func (client *SSHPublicKeysClient) Delete(ctx context.Context, resourceGroupName string, sshPublicKeyName string, ...) (SSHPublicKeysClientDeleteResponse, error)
- func (client *SSHPublicKeysClient) GenerateKeyPair(ctx context.Context, resourceGroupName string, sshPublicKeyName string, ...) (SSHPublicKeysClientGenerateKeyPairResponse, error)
- func (client *SSHPublicKeysClient) Get(ctx context.Context, resourceGroupName string, sshPublicKeyName string, ...) (SSHPublicKeysClientGetResponse, error)
- func (client *SSHPublicKeysClient) NewListByResourceGroupPager(resourceGroupName string, ...) *runtime.Pager[SSHPublicKeysClientListByResourceGroupResponse]
- func (client *SSHPublicKeysClient) NewListBySubscriptionPager(options *SSHPublicKeysClientListBySubscriptionOptions) *runtime.Pager[SSHPublicKeysClientListBySubscriptionResponse]
- func (client *SSHPublicKeysClient) Update(ctx context.Context, resourceGroupName string, sshPublicKeyName string, ...) (SSHPublicKeysClientUpdateResponse, error)
- type SSHPublicKeysClientCreateOptions
- type SSHPublicKeysClientCreateResponse
- type SSHPublicKeysClientDeleteOptions
- type SSHPublicKeysClientDeleteResponse
- type SSHPublicKeysClientGenerateKeyPairOptions
- type SSHPublicKeysClientGenerateKeyPairResponse
- type SSHPublicKeysClientGetOptions
- type SSHPublicKeysClientGetResponse
- type SSHPublicKeysClientListByResourceGroupOptions
- type SSHPublicKeysClientListByResourceGroupResponse
- type SSHPublicKeysClientListBySubscriptionOptions
- type SSHPublicKeysClientListBySubscriptionResponse
- type SSHPublicKeysClientUpdateOptions
- type SSHPublicKeysClientUpdateResponse
- type SSHPublicKeysGroupListResult
- type ScaleInPolicy
- type ScheduledEventsAdditionalPublishingTargets
- type ScheduledEventsPolicy
- type ScheduledEventsProfile
- type SecurityEncryptionTypes
- type SecurityPostureReference
- type SecurityProfile
- type SecurityTypes
- type SelectPermissions
- type ServiceArtifactReference
- type SettingNames
- type ShareInfoElement
- type SharedGalleriesClient
- func (client *SharedGalleriesClient) Get(ctx context.Context, location string, galleryUniqueName string, ...) (SharedGalleriesClientGetResponse, error)
- func (client *SharedGalleriesClient) NewListPager(location string, options *SharedGalleriesClientListOptions) *runtime.Pager[SharedGalleriesClientListResponse]
- type SharedGalleriesClientGetOptions
- type SharedGalleriesClientGetResponse
- type SharedGalleriesClientListOptions
- type SharedGalleriesClientListResponse
- type SharedGallery
- type SharedGalleryDataDiskImage
- type SharedGalleryDiskImage
- type SharedGalleryHostCaching
- type SharedGalleryIdentifier
- type SharedGalleryImage
- type SharedGalleryImageList
- type SharedGalleryImageProperties
- type SharedGalleryImageVersion
- type SharedGalleryImageVersionList
- type SharedGalleryImageVersionProperties
- type SharedGalleryImageVersionStorageProfile
- type SharedGalleryImageVersionsClient
- func (client *SharedGalleryImageVersionsClient) Get(ctx context.Context, location string, galleryUniqueName string, ...) (SharedGalleryImageVersionsClientGetResponse, error)
- func (client *SharedGalleryImageVersionsClient) NewListPager(location string, galleryUniqueName string, galleryImageName string, ...) *runtime.Pager[SharedGalleryImageVersionsClientListResponse]
- type SharedGalleryImageVersionsClientGetOptions
- type SharedGalleryImageVersionsClientGetResponse
- type SharedGalleryImageVersionsClientListOptions
- type SharedGalleryImageVersionsClientListResponse
- type SharedGalleryImagesClient
- func (client *SharedGalleryImagesClient) Get(ctx context.Context, location string, galleryUniqueName string, ...) (SharedGalleryImagesClientGetResponse, error)
- func (client *SharedGalleryImagesClient) NewListPager(location string, galleryUniqueName string, ...) *runtime.Pager[SharedGalleryImagesClientListResponse]
- type SharedGalleryImagesClientGetOptions
- type SharedGalleryImagesClientGetResponse
- type SharedGalleryImagesClientListOptions
- type SharedGalleryImagesClientListResponse
- type SharedGalleryList
- type SharedGalleryOSDiskImage
- type SharedGalleryProperties
- type SharedToValues
- type SharingProfile
- type SharingProfileGroup
- type SharingProfileGroupTypes
- type SharingState
- type SharingStatus
- type SharingUpdate
- type SharingUpdateOperationTypes
- type Snapshot
- type SnapshotList
- type SnapshotProperties
- type SnapshotSKU
- type SnapshotStorageAccountTypes
- type SnapshotUpdate
- type SnapshotUpdateProperties
- type SnapshotsClient
- func (client *SnapshotsClient) BeginCreateOrUpdate(ctx context.Context, resourceGroupName string, snapshotName string, ...) (*runtime.Poller[SnapshotsClientCreateOrUpdateResponse], error)
- func (client *SnapshotsClient) BeginDelete(ctx context.Context, resourceGroupName string, snapshotName string, ...) (*runtime.Poller[SnapshotsClientDeleteResponse], error)
- func (client *SnapshotsClient) BeginGrantAccess(ctx context.Context, resourceGroupName string, snapshotName string, ...) (*runtime.Poller[SnapshotsClientGrantAccessResponse], error)
- func (client *SnapshotsClient) BeginRevokeAccess(ctx context.Context, resourceGroupName string, snapshotName string, ...) (*runtime.Poller[SnapshotsClientRevokeAccessResponse], error)
- func (client *SnapshotsClient) BeginUpdate(ctx context.Context, resourceGroupName string, snapshotName string, ...) (*runtime.Poller[SnapshotsClientUpdateResponse], error)
- func (client *SnapshotsClient) Get(ctx context.Context, resourceGroupName string, snapshotName string, ...) (SnapshotsClientGetResponse, error)
- func (client *SnapshotsClient) NewListByResourceGroupPager(resourceGroupName string, options *SnapshotsClientListByResourceGroupOptions) *runtime.Pager[SnapshotsClientListByResourceGroupResponse]
- func (client *SnapshotsClient) NewListPager(options *SnapshotsClientListOptions) *runtime.Pager[SnapshotsClientListResponse]
- type SnapshotsClientBeginCreateOrUpdateOptions
- type SnapshotsClientBeginDeleteOptions
- type SnapshotsClientBeginGrantAccessOptions
- type SnapshotsClientBeginRevokeAccessOptions
- type SnapshotsClientBeginUpdateOptions
- type SnapshotsClientCreateOrUpdateResponse
- type SnapshotsClientDeleteResponse
- type SnapshotsClientGetOptions
- type SnapshotsClientGetResponse
- type SnapshotsClientGrantAccessResponse
- type SnapshotsClientListByResourceGroupOptions
- type SnapshotsClientListByResourceGroupResponse
- type SnapshotsClientListOptions
- type SnapshotsClientListResponse
- type SnapshotsClientRevokeAccessResponse
- type SnapshotsClientUpdateResponse
- type SoftDeletePolicy
- type SourceVault
- type SpotRestorePolicy
- type StatusCodeCount
- type StatusLevelTypes
- type StorageAccountType
- type StorageAccountTypes
- type StorageProfile
- type SubResource
- type SubResourceReadOnly
- type SubResourceWithColocationStatus
- type SupportedCapabilities
- type SystemData
- type TargetRegion
- type TerminateNotificationProfile
- type ThrottledRequestsInput
- type UefiKey
- type UefiKeySignatures
- type UefiKeyType
- type UefiSettings
- type UefiSignatureTemplateName
- type UpdateDomain
- type UpdateDomainListResult
- type UpdateResource
- type UpdateResourceDefinition
- type UpgradeMode
- type UpgradeOperationHistoricalStatusInfo
- type UpgradeOperationHistoricalStatusInfoProperties
- type UpgradeOperationHistoryStatus
- type UpgradeOperationInvoker
- type UpgradePolicy
- type UpgradeState
- type Usage
- type UsageClient
- type UsageClientListOptions
- type UsageClientListResponse
- type UsageName
- type UserArtifactManage
- type UserArtifactSettings
- type UserArtifactSource
- type UserAssignedIdentitiesValue
- type UserInitiatedReboot
- type UserInitiatedRedeploy
- type VMDiskSecurityProfile
- type VMDiskTypes
- type VMGalleryApplication
- type VMGuestPatchClassificationLinux
- type VMGuestPatchClassificationWindows
- type VMGuestPatchRebootBehavior
- type VMGuestPatchRebootSetting
- type VMGuestPatchRebootStatus
- type VMImagesInEdgeZoneListResult
- type VMScaleSetConvertToSinglePlacementGroupInput
- type VMSizeProperties
- type VaultCertificate
- type VaultSecretGroup
- type VirtualHardDisk
- type VirtualMachine
- type VirtualMachineAgentInstanceView
- type VirtualMachineAssessPatchesResult
- type VirtualMachineCaptureParameters
- type VirtualMachineCaptureResult
- type VirtualMachineEvictionPolicyTypes
- type VirtualMachineExtension
- type VirtualMachineExtensionHandlerInstanceView
- type VirtualMachineExtensionImage
- type VirtualMachineExtensionImageProperties
- type VirtualMachineExtensionImagesClient
- func (client *VirtualMachineExtensionImagesClient) Get(ctx context.Context, location string, publisherName string, typeParam string, ...) (VirtualMachineExtensionImagesClientGetResponse, error)
- func (client *VirtualMachineExtensionImagesClient) ListTypes(ctx context.Context, location string, publisherName string, ...) (VirtualMachineExtensionImagesClientListTypesResponse, error)
- func (client *VirtualMachineExtensionImagesClient) ListVersions(ctx context.Context, location string, publisherName string, typeParam string, ...) (VirtualMachineExtensionImagesClientListVersionsResponse, error)
- type VirtualMachineExtensionImagesClientGetOptions
- type VirtualMachineExtensionImagesClientGetResponse
- type VirtualMachineExtensionImagesClientListTypesOptions
- type VirtualMachineExtensionImagesClientListTypesResponse
- type VirtualMachineExtensionImagesClientListVersionsOptions
- type VirtualMachineExtensionImagesClientListVersionsResponse
- type VirtualMachineExtensionInstanceView
- type VirtualMachineExtensionProperties
- type VirtualMachineExtensionUpdate
- type VirtualMachineExtensionUpdateProperties
- type VirtualMachineExtensionsClient
- func (client *VirtualMachineExtensionsClient) BeginCreateOrUpdate(ctx context.Context, resourceGroupName string, vmName string, ...) (*runtime.Poller[VirtualMachineExtensionsClientCreateOrUpdateResponse], error)
- func (client *VirtualMachineExtensionsClient) BeginDelete(ctx context.Context, resourceGroupName string, vmName string, ...) (*runtime.Poller[VirtualMachineExtensionsClientDeleteResponse], error)
- func (client *VirtualMachineExtensionsClient) BeginUpdate(ctx context.Context, resourceGroupName string, vmName string, ...) (*runtime.Poller[VirtualMachineExtensionsClientUpdateResponse], error)
- func (client *VirtualMachineExtensionsClient) Get(ctx context.Context, resourceGroupName string, vmName string, ...) (VirtualMachineExtensionsClientGetResponse, error)
- func (client *VirtualMachineExtensionsClient) List(ctx context.Context, resourceGroupName string, vmName string, ...) (VirtualMachineExtensionsClientListResponse, error)
- type VirtualMachineExtensionsClientBeginCreateOrUpdateOptions
- type VirtualMachineExtensionsClientBeginDeleteOptions
- type VirtualMachineExtensionsClientBeginUpdateOptions
- type VirtualMachineExtensionsClientCreateOrUpdateResponse
- type VirtualMachineExtensionsClientDeleteResponse
- type VirtualMachineExtensionsClientGetOptions
- type VirtualMachineExtensionsClientGetResponse
- type VirtualMachineExtensionsClientListOptions
- type VirtualMachineExtensionsClientListResponse
- type VirtualMachineExtensionsClientUpdateResponse
- type VirtualMachineExtensionsListResult
- type VirtualMachineHealthStatus
- type VirtualMachineIPTag
- type VirtualMachineIdentity
- type VirtualMachineImage
- type VirtualMachineImageFeature
- type VirtualMachineImageProperties
- type VirtualMachineImageResource
- type VirtualMachineImagesClient
- func (client *VirtualMachineImagesClient) Get(ctx context.Context, location string, publisherName string, offer string, ...) (VirtualMachineImagesClientGetResponse, error)
- func (client *VirtualMachineImagesClient) List(ctx context.Context, location string, publisherName string, offer string, ...) (VirtualMachineImagesClientListResponse, error)
- func (client *VirtualMachineImagesClient) ListByEdgeZone(ctx context.Context, location string, edgeZone string, ...) (VirtualMachineImagesClientListByEdgeZoneResponse, error)
- func (client *VirtualMachineImagesClient) ListOffers(ctx context.Context, location string, publisherName string, ...) (VirtualMachineImagesClientListOffersResponse, error)
- func (client *VirtualMachineImagesClient) ListPublishers(ctx context.Context, location string, ...) (VirtualMachineImagesClientListPublishersResponse, error)
- func (client *VirtualMachineImagesClient) ListSKUs(ctx context.Context, location string, publisherName string, offer string, ...) (VirtualMachineImagesClientListSKUsResponse, error)
- type VirtualMachineImagesClientGetOptions
- type VirtualMachineImagesClientGetResponse
- type VirtualMachineImagesClientListByEdgeZoneOptions
- type VirtualMachineImagesClientListByEdgeZoneResponse
- type VirtualMachineImagesClientListOffersOptions
- type VirtualMachineImagesClientListOffersResponse
- type VirtualMachineImagesClientListOptions
- type VirtualMachineImagesClientListPublishersOptions
- type VirtualMachineImagesClientListPublishersResponse
- type VirtualMachineImagesClientListResponse
- type VirtualMachineImagesClientListSKUsOptions
- type VirtualMachineImagesClientListSKUsResponse
- type VirtualMachineImagesEdgeZoneClient
- func (client *VirtualMachineImagesEdgeZoneClient) Get(ctx context.Context, location string, edgeZone string, publisherName string, ...) (VirtualMachineImagesEdgeZoneClientGetResponse, error)
- func (client *VirtualMachineImagesEdgeZoneClient) List(ctx context.Context, location string, edgeZone string, publisherName string, ...) (VirtualMachineImagesEdgeZoneClientListResponse, error)
- func (client *VirtualMachineImagesEdgeZoneClient) ListOffers(ctx context.Context, location string, edgeZone string, publisherName string, ...) (VirtualMachineImagesEdgeZoneClientListOffersResponse, error)
- func (client *VirtualMachineImagesEdgeZoneClient) ListPublishers(ctx context.Context, location string, edgeZone string, ...) (VirtualMachineImagesEdgeZoneClientListPublishersResponse, error)
- func (client *VirtualMachineImagesEdgeZoneClient) ListSKUs(ctx context.Context, location string, edgeZone string, publisherName string, ...) (VirtualMachineImagesEdgeZoneClientListSKUsResponse, error)
- type VirtualMachineImagesEdgeZoneClientGetOptions
- type VirtualMachineImagesEdgeZoneClientGetResponse
- type VirtualMachineImagesEdgeZoneClientListOffersOptions
- type VirtualMachineImagesEdgeZoneClientListOffersResponse
- type VirtualMachineImagesEdgeZoneClientListOptions
- type VirtualMachineImagesEdgeZoneClientListPublishersOptions
- type VirtualMachineImagesEdgeZoneClientListPublishersResponse
- type VirtualMachineImagesEdgeZoneClientListResponse
- type VirtualMachineImagesEdgeZoneClientListSKUsOptions
- type VirtualMachineImagesEdgeZoneClientListSKUsResponse
- type VirtualMachineInstallPatchesParameters
- type VirtualMachineInstallPatchesResult
- type VirtualMachineInstanceView
- type VirtualMachineListResult
- type VirtualMachineNetworkInterfaceConfiguration
- type VirtualMachineNetworkInterfaceConfigurationProperties
- type VirtualMachineNetworkInterfaceDNSSettingsConfiguration
- type VirtualMachineNetworkInterfaceIPConfiguration
- type VirtualMachineNetworkInterfaceIPConfigurationProperties
- type VirtualMachinePatchStatus
- type VirtualMachinePriorityTypes
- type VirtualMachineProperties
- type VirtualMachinePublicIPAddressConfiguration
- type VirtualMachinePublicIPAddressConfigurationProperties
- type VirtualMachinePublicIPAddressDNSSettingsConfiguration
- type VirtualMachineReimageParameters
- type VirtualMachineRunCommand
- type VirtualMachineRunCommandInstanceView
- type VirtualMachineRunCommandProperties
- type VirtualMachineRunCommandScriptSource
- type VirtualMachineRunCommandUpdate
- type VirtualMachineRunCommandsClient
- func (client *VirtualMachineRunCommandsClient) BeginCreateOrUpdate(ctx context.Context, resourceGroupName string, vmName string, ...) (*runtime.Poller[VirtualMachineRunCommandsClientCreateOrUpdateResponse], error)
- func (client *VirtualMachineRunCommandsClient) BeginDelete(ctx context.Context, resourceGroupName string, vmName string, ...) (*runtime.Poller[VirtualMachineRunCommandsClientDeleteResponse], error)
- func (client *VirtualMachineRunCommandsClient) BeginUpdate(ctx context.Context, resourceGroupName string, vmName string, ...) (*runtime.Poller[VirtualMachineRunCommandsClientUpdateResponse], error)
- func (client *VirtualMachineRunCommandsClient) Get(ctx context.Context, location string, commandID string, ...) (VirtualMachineRunCommandsClientGetResponse, error)
- func (client *VirtualMachineRunCommandsClient) GetByVirtualMachine(ctx context.Context, resourceGroupName string, vmName string, ...) (VirtualMachineRunCommandsClientGetByVirtualMachineResponse, error)
- func (client *VirtualMachineRunCommandsClient) NewListByVirtualMachinePager(resourceGroupName string, vmName string, ...) *runtime.Pager[VirtualMachineRunCommandsClientListByVirtualMachineResponse]
- func (client *VirtualMachineRunCommandsClient) NewListPager(location string, options *VirtualMachineRunCommandsClientListOptions) *runtime.Pager[VirtualMachineRunCommandsClientListResponse]
- type VirtualMachineRunCommandsClientBeginCreateOrUpdateOptions
- type VirtualMachineRunCommandsClientBeginDeleteOptions
- type VirtualMachineRunCommandsClientBeginUpdateOptions
- type VirtualMachineRunCommandsClientCreateOrUpdateResponse
- type VirtualMachineRunCommandsClientDeleteResponse
- type VirtualMachineRunCommandsClientGetByVirtualMachineOptions
- type VirtualMachineRunCommandsClientGetByVirtualMachineResponse
- type VirtualMachineRunCommandsClientGetOptions
- type VirtualMachineRunCommandsClientGetResponse
- type VirtualMachineRunCommandsClientListByVirtualMachineOptions
- type VirtualMachineRunCommandsClientListByVirtualMachineResponse
- type VirtualMachineRunCommandsClientListOptions
- type VirtualMachineRunCommandsClientListResponse
- type VirtualMachineRunCommandsClientUpdateResponse
- type VirtualMachineRunCommandsListResult
- type VirtualMachineScaleSet
- type VirtualMachineScaleSetDataDisk
- type VirtualMachineScaleSetExtension
- type VirtualMachineScaleSetExtensionListResult
- type VirtualMachineScaleSetExtensionProfile
- type VirtualMachineScaleSetExtensionProperties
- type VirtualMachineScaleSetExtensionUpdate
- type VirtualMachineScaleSetExtensionsClient
- func (client *VirtualMachineScaleSetExtensionsClient) BeginCreateOrUpdate(ctx context.Context, resourceGroupName string, vmScaleSetName string, ...) (*runtime.Poller[VirtualMachineScaleSetExtensionsClientCreateOrUpdateResponse], ...)
- func (client *VirtualMachineScaleSetExtensionsClient) BeginDelete(ctx context.Context, resourceGroupName string, vmScaleSetName string, ...) (*runtime.Poller[VirtualMachineScaleSetExtensionsClientDeleteResponse], error)
- func (client *VirtualMachineScaleSetExtensionsClient) BeginUpdate(ctx context.Context, resourceGroupName string, vmScaleSetName string, ...) (*runtime.Poller[VirtualMachineScaleSetExtensionsClientUpdateResponse], error)
- func (client *VirtualMachineScaleSetExtensionsClient) Get(ctx context.Context, resourceGroupName string, vmScaleSetName string, ...) (VirtualMachineScaleSetExtensionsClientGetResponse, error)
- func (client *VirtualMachineScaleSetExtensionsClient) NewListPager(resourceGroupName string, vmScaleSetName string, ...) *runtime.Pager[VirtualMachineScaleSetExtensionsClientListResponse]
- type VirtualMachineScaleSetExtensionsClientBeginCreateOrUpdateOptions
- type VirtualMachineScaleSetExtensionsClientBeginDeleteOptions
- type VirtualMachineScaleSetExtensionsClientBeginUpdateOptions
- type VirtualMachineScaleSetExtensionsClientCreateOrUpdateResponse
- type VirtualMachineScaleSetExtensionsClientDeleteResponse
- type VirtualMachineScaleSetExtensionsClientGetOptions
- type VirtualMachineScaleSetExtensionsClientGetResponse
- type VirtualMachineScaleSetExtensionsClientListOptions
- type VirtualMachineScaleSetExtensionsClientListResponse
- type VirtualMachineScaleSetExtensionsClientUpdateResponse
- type VirtualMachineScaleSetHardwareProfile
- type VirtualMachineScaleSetIPConfiguration
- type VirtualMachineScaleSetIPConfigurationProperties
- type VirtualMachineScaleSetIPTag
- type VirtualMachineScaleSetIdentity
- type VirtualMachineScaleSetInstanceView
- type VirtualMachineScaleSetInstanceViewStatusesSummary
- type VirtualMachineScaleSetListOSUpgradeHistory
- type VirtualMachineScaleSetListResult
- type VirtualMachineScaleSetListSKUsResult
- type VirtualMachineScaleSetListWithLinkResult
- type VirtualMachineScaleSetManagedDiskParameters
- type VirtualMachineScaleSetNetworkConfiguration
- type VirtualMachineScaleSetNetworkConfigurationDNSSettings
- type VirtualMachineScaleSetNetworkConfigurationProperties
- type VirtualMachineScaleSetNetworkProfile
- type VirtualMachineScaleSetOSDisk
- type VirtualMachineScaleSetOSProfile
- type VirtualMachineScaleSetProperties
- type VirtualMachineScaleSetPublicIPAddressConfiguration
- type VirtualMachineScaleSetPublicIPAddressConfigurationDNSSettings
- type VirtualMachineScaleSetPublicIPAddressConfigurationProperties
- type VirtualMachineScaleSetReimageParameters
- type VirtualMachineScaleSetRollingUpgradesClient
- func (client *VirtualMachineScaleSetRollingUpgradesClient) BeginCancel(ctx context.Context, resourceGroupName string, vmScaleSetName string, ...) (*runtime.Poller[VirtualMachineScaleSetRollingUpgradesClientCancelResponse], ...)
- func (client *VirtualMachineScaleSetRollingUpgradesClient) BeginStartExtensionUpgrade(ctx context.Context, resourceGroupName string, vmScaleSetName string, ...) (...)
- func (client *VirtualMachineScaleSetRollingUpgradesClient) BeginStartOSUpgrade(ctx context.Context, resourceGroupName string, vmScaleSetName string, ...) (...)
- func (client *VirtualMachineScaleSetRollingUpgradesClient) GetLatest(ctx context.Context, resourceGroupName string, vmScaleSetName string, ...) (VirtualMachineScaleSetRollingUpgradesClientGetLatestResponse, error)
- type VirtualMachineScaleSetRollingUpgradesClientBeginCancelOptions
- type VirtualMachineScaleSetRollingUpgradesClientBeginStartExtensionUpgradeOptions
- type VirtualMachineScaleSetRollingUpgradesClientBeginStartOSUpgradeOptions
- type VirtualMachineScaleSetRollingUpgradesClientCancelResponse
- type VirtualMachineScaleSetRollingUpgradesClientGetLatestOptions
- type VirtualMachineScaleSetRollingUpgradesClientGetLatestResponse
- type VirtualMachineScaleSetRollingUpgradesClientStartExtensionUpgradeResponse
- type VirtualMachineScaleSetRollingUpgradesClientStartOSUpgradeResponse
- type VirtualMachineScaleSetSKU
- type VirtualMachineScaleSetSKUCapacity
- type VirtualMachineScaleSetSKUScaleType
- type VirtualMachineScaleSetScaleInRules
- type VirtualMachineScaleSetStorageProfile
- type VirtualMachineScaleSetUpdate
- type VirtualMachineScaleSetUpdateIPConfiguration
- type VirtualMachineScaleSetUpdateIPConfigurationProperties
- type VirtualMachineScaleSetUpdateNetworkConfiguration
- type VirtualMachineScaleSetUpdateNetworkConfigurationProperties
- type VirtualMachineScaleSetUpdateNetworkProfile
- type VirtualMachineScaleSetUpdateOSDisk
- type VirtualMachineScaleSetUpdateOSProfile
- type VirtualMachineScaleSetUpdateProperties
- type VirtualMachineScaleSetUpdatePublicIPAddressConfiguration
- type VirtualMachineScaleSetUpdatePublicIPAddressConfigurationProperties
- type VirtualMachineScaleSetUpdateStorageProfile
- type VirtualMachineScaleSetUpdateVMProfile
- type VirtualMachineScaleSetVM
- type VirtualMachineScaleSetVMExtension
- type VirtualMachineScaleSetVMExtensionUpdate
- type VirtualMachineScaleSetVMExtensionsClient
- func (client *VirtualMachineScaleSetVMExtensionsClient) BeginCreateOrUpdate(ctx context.Context, resourceGroupName string, vmScaleSetName string, ...) (...)
- func (client *VirtualMachineScaleSetVMExtensionsClient) BeginDelete(ctx context.Context, resourceGroupName string, vmScaleSetName string, ...) (*runtime.Poller[VirtualMachineScaleSetVMExtensionsClientDeleteResponse], error)
- func (client *VirtualMachineScaleSetVMExtensionsClient) BeginUpdate(ctx context.Context, resourceGroupName string, vmScaleSetName string, ...) (*runtime.Poller[VirtualMachineScaleSetVMExtensionsClientUpdateResponse], error)
- func (client *VirtualMachineScaleSetVMExtensionsClient) Get(ctx context.Context, resourceGroupName string, vmScaleSetName string, ...) (VirtualMachineScaleSetVMExtensionsClientGetResponse, error)
- func (client *VirtualMachineScaleSetVMExtensionsClient) List(ctx context.Context, resourceGroupName string, vmScaleSetName string, ...) (VirtualMachineScaleSetVMExtensionsClientListResponse, error)
- type VirtualMachineScaleSetVMExtensionsClientBeginCreateOrUpdateOptions
- type VirtualMachineScaleSetVMExtensionsClientBeginDeleteOptions
- type VirtualMachineScaleSetVMExtensionsClientBeginUpdateOptions
- type VirtualMachineScaleSetVMExtensionsClientCreateOrUpdateResponse
- type VirtualMachineScaleSetVMExtensionsClientDeleteResponse
- type VirtualMachineScaleSetVMExtensionsClientGetOptions
- type VirtualMachineScaleSetVMExtensionsClientGetResponse
- type VirtualMachineScaleSetVMExtensionsClientListOptions
- type VirtualMachineScaleSetVMExtensionsClientListResponse
- type VirtualMachineScaleSetVMExtensionsClientUpdateResponse
- type VirtualMachineScaleSetVMExtensionsListResult
- type VirtualMachineScaleSetVMExtensionsSummary
- type VirtualMachineScaleSetVMInstanceIDs
- type VirtualMachineScaleSetVMInstanceRequiredIDs
- type VirtualMachineScaleSetVMInstanceView
- type VirtualMachineScaleSetVMListResult
- type VirtualMachineScaleSetVMNetworkProfileConfiguration
- type VirtualMachineScaleSetVMProfile
- type VirtualMachineScaleSetVMProperties
- type VirtualMachineScaleSetVMProtectionPolicy
- type VirtualMachineScaleSetVMReimageParameters
- type VirtualMachineScaleSetVMRunCommandsClient
- func (client *VirtualMachineScaleSetVMRunCommandsClient) BeginCreateOrUpdate(ctx context.Context, resourceGroupName string, vmScaleSetName string, ...) (...)
- func (client *VirtualMachineScaleSetVMRunCommandsClient) BeginDelete(ctx context.Context, resourceGroupName string, vmScaleSetName string, ...) (*runtime.Poller[VirtualMachineScaleSetVMRunCommandsClientDeleteResponse], ...)
- func (client *VirtualMachineScaleSetVMRunCommandsClient) BeginUpdate(ctx context.Context, resourceGroupName string, vmScaleSetName string, ...) (*runtime.Poller[VirtualMachineScaleSetVMRunCommandsClientUpdateResponse], ...)
- func (client *VirtualMachineScaleSetVMRunCommandsClient) Get(ctx context.Context, resourceGroupName string, vmScaleSetName string, ...) (VirtualMachineScaleSetVMRunCommandsClientGetResponse, error)
- func (client *VirtualMachineScaleSetVMRunCommandsClient) NewListPager(resourceGroupName string, vmScaleSetName string, instanceID string, ...) *runtime.Pager[VirtualMachineScaleSetVMRunCommandsClientListResponse]
- type VirtualMachineScaleSetVMRunCommandsClientBeginCreateOrUpdateOptions
- type VirtualMachineScaleSetVMRunCommandsClientBeginDeleteOptions
- type VirtualMachineScaleSetVMRunCommandsClientBeginUpdateOptions
- type VirtualMachineScaleSetVMRunCommandsClientCreateOrUpdateResponse
- type VirtualMachineScaleSetVMRunCommandsClientDeleteResponse
- type VirtualMachineScaleSetVMRunCommandsClientGetOptions
- type VirtualMachineScaleSetVMRunCommandsClientGetResponse
- type VirtualMachineScaleSetVMRunCommandsClientListOptions
- type VirtualMachineScaleSetVMRunCommandsClientListResponse
- type VirtualMachineScaleSetVMRunCommandsClientUpdateResponse
- type VirtualMachineScaleSetVMsClient
- func (client *VirtualMachineScaleSetVMsClient) BeginApproveRollingUpgrade(ctx context.Context, resourceGroupName string, vmScaleSetName string, ...) (*runtime.Poller[VirtualMachineScaleSetVMsClientApproveRollingUpgradeResponse], ...)
- func (client *VirtualMachineScaleSetVMsClient) BeginAttachDetachDataDisks(ctx context.Context, resourceGroupName string, vmScaleSetName string, ...) (*runtime.Poller[VirtualMachineScaleSetVMsClientAttachDetachDataDisksResponse], ...)
- func (client *VirtualMachineScaleSetVMsClient) BeginDeallocate(ctx context.Context, resourceGroupName string, vmScaleSetName string, ...) (*runtime.Poller[VirtualMachineScaleSetVMsClientDeallocateResponse], error)
- func (client *VirtualMachineScaleSetVMsClient) BeginDelete(ctx context.Context, resourceGroupName string, vmScaleSetName string, ...) (*runtime.Poller[VirtualMachineScaleSetVMsClientDeleteResponse], error)
- func (client *VirtualMachineScaleSetVMsClient) BeginPerformMaintenance(ctx context.Context, resourceGroupName string, vmScaleSetName string, ...) (*runtime.Poller[VirtualMachineScaleSetVMsClientPerformMaintenanceResponse], ...)
- func (client *VirtualMachineScaleSetVMsClient) BeginPowerOff(ctx context.Context, resourceGroupName string, vmScaleSetName string, ...) (*runtime.Poller[VirtualMachineScaleSetVMsClientPowerOffResponse], error)
- func (client *VirtualMachineScaleSetVMsClient) BeginRedeploy(ctx context.Context, resourceGroupName string, vmScaleSetName string, ...) (*runtime.Poller[VirtualMachineScaleSetVMsClientRedeployResponse], error)
- func (client *VirtualMachineScaleSetVMsClient) BeginReimage(ctx context.Context, resourceGroupName string, vmScaleSetName string, ...) (*runtime.Poller[VirtualMachineScaleSetVMsClientReimageResponse], error)
- func (client *VirtualMachineScaleSetVMsClient) BeginReimageAll(ctx context.Context, resourceGroupName string, vmScaleSetName string, ...) (*runtime.Poller[VirtualMachineScaleSetVMsClientReimageAllResponse], error)
- func (client *VirtualMachineScaleSetVMsClient) BeginRestart(ctx context.Context, resourceGroupName string, vmScaleSetName string, ...) (*runtime.Poller[VirtualMachineScaleSetVMsClientRestartResponse], error)
- func (client *VirtualMachineScaleSetVMsClient) BeginRunCommand(ctx context.Context, resourceGroupName string, vmScaleSetName string, ...) (*runtime.Poller[VirtualMachineScaleSetVMsClientRunCommandResponse], error)
- func (client *VirtualMachineScaleSetVMsClient) BeginStart(ctx context.Context, resourceGroupName string, vmScaleSetName string, ...) (*runtime.Poller[VirtualMachineScaleSetVMsClientStartResponse], error)
- func (client *VirtualMachineScaleSetVMsClient) BeginUpdate(ctx context.Context, resourceGroupName string, vmScaleSetName string, ...) (*runtime.Poller[VirtualMachineScaleSetVMsClientUpdateResponse], error)
- func (client *VirtualMachineScaleSetVMsClient) Get(ctx context.Context, resourceGroupName string, vmScaleSetName string, ...) (VirtualMachineScaleSetVMsClientGetResponse, error)
- func (client *VirtualMachineScaleSetVMsClient) GetInstanceView(ctx context.Context, resourceGroupName string, vmScaleSetName string, ...) (VirtualMachineScaleSetVMsClientGetInstanceViewResponse, error)
- func (client *VirtualMachineScaleSetVMsClient) NewListPager(resourceGroupName string, virtualMachineScaleSetName string, ...) *runtime.Pager[VirtualMachineScaleSetVMsClientListResponse]
- func (client *VirtualMachineScaleSetVMsClient) RetrieveBootDiagnosticsData(ctx context.Context, resourceGroupName string, vmScaleSetName string, ...) (VirtualMachineScaleSetVMsClientRetrieveBootDiagnosticsDataResponse, error)
- func (client *VirtualMachineScaleSetVMsClient) SimulateEviction(ctx context.Context, resourceGroupName string, vmScaleSetName string, ...) (VirtualMachineScaleSetVMsClientSimulateEvictionResponse, error)
- type VirtualMachineScaleSetVMsClientApproveRollingUpgradeResponse
- type VirtualMachineScaleSetVMsClientAttachDetachDataDisksResponse
- type VirtualMachineScaleSetVMsClientBeginApproveRollingUpgradeOptions
- type VirtualMachineScaleSetVMsClientBeginAttachDetachDataDisksOptions
- type VirtualMachineScaleSetVMsClientBeginDeallocateOptions
- type VirtualMachineScaleSetVMsClientBeginDeleteOptions
- type VirtualMachineScaleSetVMsClientBeginPerformMaintenanceOptions
- type VirtualMachineScaleSetVMsClientBeginPowerOffOptions
- type VirtualMachineScaleSetVMsClientBeginRedeployOptions
- type VirtualMachineScaleSetVMsClientBeginReimageAllOptions
- type VirtualMachineScaleSetVMsClientBeginReimageOptions
- type VirtualMachineScaleSetVMsClientBeginRestartOptions
- type VirtualMachineScaleSetVMsClientBeginRunCommandOptions
- type VirtualMachineScaleSetVMsClientBeginStartOptions
- type VirtualMachineScaleSetVMsClientBeginUpdateOptions
- type VirtualMachineScaleSetVMsClientDeallocateResponse
- type VirtualMachineScaleSetVMsClientDeleteResponse
- type VirtualMachineScaleSetVMsClientGetInstanceViewOptions
- type VirtualMachineScaleSetVMsClientGetInstanceViewResponse
- type VirtualMachineScaleSetVMsClientGetOptions
- type VirtualMachineScaleSetVMsClientGetResponse
- type VirtualMachineScaleSetVMsClientListOptions
- type VirtualMachineScaleSetVMsClientListResponse
- type VirtualMachineScaleSetVMsClientPerformMaintenanceResponse
- type VirtualMachineScaleSetVMsClientPowerOffResponse
- type VirtualMachineScaleSetVMsClientRedeployResponse
- type VirtualMachineScaleSetVMsClientReimageAllResponse
- type VirtualMachineScaleSetVMsClientReimageResponse
- type VirtualMachineScaleSetVMsClientRestartResponse
- type VirtualMachineScaleSetVMsClientRetrieveBootDiagnosticsDataOptions
- type VirtualMachineScaleSetVMsClientRetrieveBootDiagnosticsDataResponse
- type VirtualMachineScaleSetVMsClientRunCommandResponse
- type VirtualMachineScaleSetVMsClientSimulateEvictionOptions
- type VirtualMachineScaleSetVMsClientSimulateEvictionResponse
- type VirtualMachineScaleSetVMsClientStartResponse
- type VirtualMachineScaleSetVMsClientUpdateResponse
- type VirtualMachineScaleSetsClient
- func (client *VirtualMachineScaleSetsClient) BeginApproveRollingUpgrade(ctx context.Context, resourceGroupName string, vmScaleSetName string, ...) (*runtime.Poller[VirtualMachineScaleSetsClientApproveRollingUpgradeResponse], ...)
- func (client *VirtualMachineScaleSetsClient) BeginCreateOrUpdate(ctx context.Context, resourceGroupName string, vmScaleSetName string, ...) (*runtime.Poller[VirtualMachineScaleSetsClientCreateOrUpdateResponse], error)
- func (client *VirtualMachineScaleSetsClient) BeginDeallocate(ctx context.Context, resourceGroupName string, vmScaleSetName string, ...) (*runtime.Poller[VirtualMachineScaleSetsClientDeallocateResponse], error)
- func (client *VirtualMachineScaleSetsClient) BeginDelete(ctx context.Context, resourceGroupName string, vmScaleSetName string, ...) (*runtime.Poller[VirtualMachineScaleSetsClientDeleteResponse], error)
- func (client *VirtualMachineScaleSetsClient) BeginDeleteInstances(ctx context.Context, resourceGroupName string, vmScaleSetName string, ...) (*runtime.Poller[VirtualMachineScaleSetsClientDeleteInstancesResponse], error)
- func (client *VirtualMachineScaleSetsClient) BeginPerformMaintenance(ctx context.Context, resourceGroupName string, vmScaleSetName string, ...) (*runtime.Poller[VirtualMachineScaleSetsClientPerformMaintenanceResponse], ...)
- func (client *VirtualMachineScaleSetsClient) BeginPowerOff(ctx context.Context, resourceGroupName string, vmScaleSetName string, ...) (*runtime.Poller[VirtualMachineScaleSetsClientPowerOffResponse], error)
- func (client *VirtualMachineScaleSetsClient) BeginReapply(ctx context.Context, resourceGroupName string, vmScaleSetName string, ...) (*runtime.Poller[VirtualMachineScaleSetsClientReapplyResponse], error)
- func (client *VirtualMachineScaleSetsClient) BeginRedeploy(ctx context.Context, resourceGroupName string, vmScaleSetName string, ...) (*runtime.Poller[VirtualMachineScaleSetsClientRedeployResponse], error)
- func (client *VirtualMachineScaleSetsClient) BeginReimage(ctx context.Context, resourceGroupName string, vmScaleSetName string, ...) (*runtime.Poller[VirtualMachineScaleSetsClientReimageResponse], error)
- func (client *VirtualMachineScaleSetsClient) BeginReimageAll(ctx context.Context, resourceGroupName string, vmScaleSetName string, ...) (*runtime.Poller[VirtualMachineScaleSetsClientReimageAllResponse], error)
- func (client *VirtualMachineScaleSetsClient) BeginRestart(ctx context.Context, resourceGroupName string, vmScaleSetName string, ...) (*runtime.Poller[VirtualMachineScaleSetsClientRestartResponse], error)
- func (client *VirtualMachineScaleSetsClient) BeginSetOrchestrationServiceState(ctx context.Context, resourceGroupName string, vmScaleSetName string, ...) (...)
- func (client *VirtualMachineScaleSetsClient) BeginStart(ctx context.Context, resourceGroupName string, vmScaleSetName string, ...) (*runtime.Poller[VirtualMachineScaleSetsClientStartResponse], error)
- func (client *VirtualMachineScaleSetsClient) BeginUpdate(ctx context.Context, resourceGroupName string, vmScaleSetName string, ...) (*runtime.Poller[VirtualMachineScaleSetsClientUpdateResponse], error)
- func (client *VirtualMachineScaleSetsClient) BeginUpdateInstances(ctx context.Context, resourceGroupName string, vmScaleSetName string, ...) (*runtime.Poller[VirtualMachineScaleSetsClientUpdateInstancesResponse], error)
- func (client *VirtualMachineScaleSetsClient) ConvertToSinglePlacementGroup(ctx context.Context, resourceGroupName string, vmScaleSetName string, ...) (VirtualMachineScaleSetsClientConvertToSinglePlacementGroupResponse, error)
- func (client *VirtualMachineScaleSetsClient) ForceRecoveryServiceFabricPlatformUpdateDomainWalk(ctx context.Context, resourceGroupName string, vmScaleSetName string, ...) (...)
- func (client *VirtualMachineScaleSetsClient) Get(ctx context.Context, resourceGroupName string, vmScaleSetName string, ...) (VirtualMachineScaleSetsClientGetResponse, error)
- func (client *VirtualMachineScaleSetsClient) GetInstanceView(ctx context.Context, resourceGroupName string, vmScaleSetName string, ...) (VirtualMachineScaleSetsClientGetInstanceViewResponse, error)
- func (client *VirtualMachineScaleSetsClient) NewGetOSUpgradeHistoryPager(resourceGroupName string, vmScaleSetName string, ...) *runtime.Pager[VirtualMachineScaleSetsClientGetOSUpgradeHistoryResponse]
- func (client *VirtualMachineScaleSetsClient) NewListAllPager(options *VirtualMachineScaleSetsClientListAllOptions) *runtime.Pager[VirtualMachineScaleSetsClientListAllResponse]
- func (client *VirtualMachineScaleSetsClient) NewListByLocationPager(location string, options *VirtualMachineScaleSetsClientListByLocationOptions) *runtime.Pager[VirtualMachineScaleSetsClientListByLocationResponse]
- func (client *VirtualMachineScaleSetsClient) NewListPager(resourceGroupName string, options *VirtualMachineScaleSetsClientListOptions) *runtime.Pager[VirtualMachineScaleSetsClientListResponse]
- func (client *VirtualMachineScaleSetsClient) NewListSKUsPager(resourceGroupName string, vmScaleSetName string, ...) *runtime.Pager[VirtualMachineScaleSetsClientListSKUsResponse]
- type VirtualMachineScaleSetsClientApproveRollingUpgradeResponse
- type VirtualMachineScaleSetsClientBeginApproveRollingUpgradeOptions
- type VirtualMachineScaleSetsClientBeginCreateOrUpdateOptions
- type VirtualMachineScaleSetsClientBeginDeallocateOptions
- type VirtualMachineScaleSetsClientBeginDeleteInstancesOptions
- type VirtualMachineScaleSetsClientBeginDeleteOptions
- type VirtualMachineScaleSetsClientBeginPerformMaintenanceOptions
- type VirtualMachineScaleSetsClientBeginPowerOffOptions
- type VirtualMachineScaleSetsClientBeginReapplyOptions
- type VirtualMachineScaleSetsClientBeginRedeployOptions
- type VirtualMachineScaleSetsClientBeginReimageAllOptions
- type VirtualMachineScaleSetsClientBeginReimageOptions
- type VirtualMachineScaleSetsClientBeginRestartOptions
- type VirtualMachineScaleSetsClientBeginSetOrchestrationServiceStateOptions
- type VirtualMachineScaleSetsClientBeginStartOptions
- type VirtualMachineScaleSetsClientBeginUpdateInstancesOptions
- type VirtualMachineScaleSetsClientBeginUpdateOptions
- type VirtualMachineScaleSetsClientConvertToSinglePlacementGroupOptions
- type VirtualMachineScaleSetsClientConvertToSinglePlacementGroupResponse
- type VirtualMachineScaleSetsClientCreateOrUpdateResponse
- type VirtualMachineScaleSetsClientDeallocateResponse
- type VirtualMachineScaleSetsClientDeleteInstancesResponse
- type VirtualMachineScaleSetsClientDeleteResponse
- type VirtualMachineScaleSetsClientForceRecoveryServiceFabricPlatformUpdateDomainWalkOptions
- type VirtualMachineScaleSetsClientForceRecoveryServiceFabricPlatformUpdateDomainWalkResponse
- type VirtualMachineScaleSetsClientGetInstanceViewOptions
- type VirtualMachineScaleSetsClientGetInstanceViewResponse
- type VirtualMachineScaleSetsClientGetOSUpgradeHistoryOptions
- type VirtualMachineScaleSetsClientGetOSUpgradeHistoryResponse
- type VirtualMachineScaleSetsClientGetOptions
- type VirtualMachineScaleSetsClientGetResponse
- type VirtualMachineScaleSetsClientListAllOptions
- type VirtualMachineScaleSetsClientListAllResponse
- type VirtualMachineScaleSetsClientListByLocationOptions
- type VirtualMachineScaleSetsClientListByLocationResponse
- type VirtualMachineScaleSetsClientListOptions
- type VirtualMachineScaleSetsClientListResponse
- type VirtualMachineScaleSetsClientListSKUsOptions
- type VirtualMachineScaleSetsClientListSKUsResponse
- type VirtualMachineScaleSetsClientPerformMaintenanceResponse
- type VirtualMachineScaleSetsClientPowerOffResponse
- type VirtualMachineScaleSetsClientReapplyResponse
- type VirtualMachineScaleSetsClientRedeployResponse
- type VirtualMachineScaleSetsClientReimageAllResponse
- type VirtualMachineScaleSetsClientReimageResponse
- type VirtualMachineScaleSetsClientRestartResponse
- type VirtualMachineScaleSetsClientSetOrchestrationServiceStateResponse
- type VirtualMachineScaleSetsClientStartResponse
- type VirtualMachineScaleSetsClientUpdateInstancesResponse
- type VirtualMachineScaleSetsClientUpdateResponse
- type VirtualMachineSize
- type VirtualMachineSizeListResult
- type VirtualMachineSizeTypes
- type VirtualMachineSizesClient
- type VirtualMachineSizesClientListOptions
- type VirtualMachineSizesClientListResponse
- type VirtualMachineSoftwarePatchProperties
- type VirtualMachineStatusCodeCount
- type VirtualMachineUpdate
- type VirtualMachinesClient
- func (client *VirtualMachinesClient) BeginAssessPatches(ctx context.Context, resourceGroupName string, vmName string, ...) (*runtime.Poller[VirtualMachinesClientAssessPatchesResponse], error)
- func (client *VirtualMachinesClient) BeginAttachDetachDataDisks(ctx context.Context, resourceGroupName string, vmName string, ...) (*runtime.Poller[VirtualMachinesClientAttachDetachDataDisksResponse], error)
- func (client *VirtualMachinesClient) BeginCapture(ctx context.Context, resourceGroupName string, vmName string, ...) (*runtime.Poller[VirtualMachinesClientCaptureResponse], error)
- func (client *VirtualMachinesClient) BeginConvertToManagedDisks(ctx context.Context, resourceGroupName string, vmName string, ...) (*runtime.Poller[VirtualMachinesClientConvertToManagedDisksResponse], error)
- func (client *VirtualMachinesClient) BeginCreateOrUpdate(ctx context.Context, resourceGroupName string, vmName string, ...) (*runtime.Poller[VirtualMachinesClientCreateOrUpdateResponse], error)
- func (client *VirtualMachinesClient) BeginDeallocate(ctx context.Context, resourceGroupName string, vmName string, ...) (*runtime.Poller[VirtualMachinesClientDeallocateResponse], error)
- func (client *VirtualMachinesClient) BeginDelete(ctx context.Context, resourceGroupName string, vmName string, ...) (*runtime.Poller[VirtualMachinesClientDeleteResponse], error)
- func (client *VirtualMachinesClient) BeginInstallPatches(ctx context.Context, resourceGroupName string, vmName string, ...) (*runtime.Poller[VirtualMachinesClientInstallPatchesResponse], error)
- func (client *VirtualMachinesClient) BeginPerformMaintenance(ctx context.Context, resourceGroupName string, vmName string, ...) (*runtime.Poller[VirtualMachinesClientPerformMaintenanceResponse], error)
- func (client *VirtualMachinesClient) BeginPowerOff(ctx context.Context, resourceGroupName string, vmName string, ...) (*runtime.Poller[VirtualMachinesClientPowerOffResponse], error)
- func (client *VirtualMachinesClient) BeginReapply(ctx context.Context, resourceGroupName string, vmName string, ...) (*runtime.Poller[VirtualMachinesClientReapplyResponse], error)
- func (client *VirtualMachinesClient) BeginRedeploy(ctx context.Context, resourceGroupName string, vmName string, ...) (*runtime.Poller[VirtualMachinesClientRedeployResponse], error)
- func (client *VirtualMachinesClient) BeginReimage(ctx context.Context, resourceGroupName string, vmName string, ...) (*runtime.Poller[VirtualMachinesClientReimageResponse], error)
- func (client *VirtualMachinesClient) BeginRestart(ctx context.Context, resourceGroupName string, vmName string, ...) (*runtime.Poller[VirtualMachinesClientRestartResponse], error)
- func (client *VirtualMachinesClient) BeginRunCommand(ctx context.Context, resourceGroupName string, vmName string, ...) (*runtime.Poller[VirtualMachinesClientRunCommandResponse], error)
- func (client *VirtualMachinesClient) BeginStart(ctx context.Context, resourceGroupName string, vmName string, ...) (*runtime.Poller[VirtualMachinesClientStartResponse], error)
- func (client *VirtualMachinesClient) BeginUpdate(ctx context.Context, resourceGroupName string, vmName string, ...) (*runtime.Poller[VirtualMachinesClientUpdateResponse], error)
- func (client *VirtualMachinesClient) Generalize(ctx context.Context, resourceGroupName string, vmName string, ...) (VirtualMachinesClientGeneralizeResponse, error)
- func (client *VirtualMachinesClient) Get(ctx context.Context, resourceGroupName string, vmName string, ...) (VirtualMachinesClientGetResponse, error)
- func (client *VirtualMachinesClient) InstanceView(ctx context.Context, resourceGroupName string, vmName string, ...) (VirtualMachinesClientInstanceViewResponse, error)
- func (client *VirtualMachinesClient) NewListAllPager(options *VirtualMachinesClientListAllOptions) *runtime.Pager[VirtualMachinesClientListAllResponse]
- func (client *VirtualMachinesClient) NewListAvailableSizesPager(resourceGroupName string, vmName string, ...) *runtime.Pager[VirtualMachinesClientListAvailableSizesResponse]
- func (client *VirtualMachinesClient) NewListByLocationPager(location string, options *VirtualMachinesClientListByLocationOptions) *runtime.Pager[VirtualMachinesClientListByLocationResponse]
- func (client *VirtualMachinesClient) NewListPager(resourceGroupName string, options *VirtualMachinesClientListOptions) *runtime.Pager[VirtualMachinesClientListResponse]
- func (client *VirtualMachinesClient) RetrieveBootDiagnosticsData(ctx context.Context, resourceGroupName string, vmName string, ...) (VirtualMachinesClientRetrieveBootDiagnosticsDataResponse, error)
- func (client *VirtualMachinesClient) SimulateEviction(ctx context.Context, resourceGroupName string, vmName string, ...) (VirtualMachinesClientSimulateEvictionResponse, error)
- type VirtualMachinesClientAssessPatchesResponse
- type VirtualMachinesClientAttachDetachDataDisksResponse
- type VirtualMachinesClientBeginAssessPatchesOptions
- type VirtualMachinesClientBeginAttachDetachDataDisksOptions
- type VirtualMachinesClientBeginCaptureOptions
- type VirtualMachinesClientBeginConvertToManagedDisksOptions
- type VirtualMachinesClientBeginCreateOrUpdateOptions
- type VirtualMachinesClientBeginDeallocateOptions
- type VirtualMachinesClientBeginDeleteOptions
- type VirtualMachinesClientBeginInstallPatchesOptions
- type VirtualMachinesClientBeginPerformMaintenanceOptions
- type VirtualMachinesClientBeginPowerOffOptions
- type VirtualMachinesClientBeginReapplyOptions
- type VirtualMachinesClientBeginRedeployOptions
- type VirtualMachinesClientBeginReimageOptions
- type VirtualMachinesClientBeginRestartOptions
- type VirtualMachinesClientBeginRunCommandOptions
- type VirtualMachinesClientBeginStartOptions
- type VirtualMachinesClientBeginUpdateOptions
- type VirtualMachinesClientCaptureResponse
- type VirtualMachinesClientConvertToManagedDisksResponse
- type VirtualMachinesClientCreateOrUpdateResponse
- type VirtualMachinesClientDeallocateResponse
- type VirtualMachinesClientDeleteResponse
- type VirtualMachinesClientGeneralizeOptions
- type VirtualMachinesClientGeneralizeResponse
- type VirtualMachinesClientGetOptions
- type VirtualMachinesClientGetResponse
- type VirtualMachinesClientInstallPatchesResponse
- type VirtualMachinesClientInstanceViewOptions
- type VirtualMachinesClientInstanceViewResponse
- type VirtualMachinesClientListAllOptions
- type VirtualMachinesClientListAllResponse
- type VirtualMachinesClientListAvailableSizesOptions
- type VirtualMachinesClientListAvailableSizesResponse
- type VirtualMachinesClientListByLocationOptions
- type VirtualMachinesClientListByLocationResponse
- type VirtualMachinesClientListOptions
- type VirtualMachinesClientListResponse
- type VirtualMachinesClientPerformMaintenanceResponse
- type VirtualMachinesClientPowerOffResponse
- type VirtualMachinesClientReapplyResponse
- type VirtualMachinesClientRedeployResponse
- type VirtualMachinesClientReimageResponse
- type VirtualMachinesClientRestartResponse
- type VirtualMachinesClientRetrieveBootDiagnosticsDataOptions
- type VirtualMachinesClientRetrieveBootDiagnosticsDataResponse
- type VirtualMachinesClientRunCommandResponse
- type VirtualMachinesClientSimulateEvictionOptions
- type VirtualMachinesClientSimulateEvictionResponse
- type VirtualMachinesClientStartResponse
- type VirtualMachinesClientUpdateResponse
- type WinRMConfiguration
- type WinRMListener
- type WindowsConfiguration
- type WindowsParameters
- type WindowsPatchAssessmentMode
- type WindowsVMGuestPatchAutomaticByPlatformRebootSetting
- type WindowsVMGuestPatchAutomaticByPlatformSettings
- type WindowsVMGuestPatchMode
Examples ¶
- AvailabilitySetsClient.CreateOrUpdate
- AvailabilitySetsClient.Delete (AvailabilitySetDeleteMaximumSetGen)
- AvailabilitySetsClient.Delete (AvailabilitySetDeleteMinimumSetGen)
- AvailabilitySetsClient.Get (AvailabilitySetGetMaximumSetGen)
- AvailabilitySetsClient.Get (AvailabilitySetGetMinimumSetGen)
- AvailabilitySetsClient.NewListAvailableSizesPager (AvailabilitySetListAvailableSizesMaximumSetGen)
- AvailabilitySetsClient.NewListAvailableSizesPager (AvailabilitySetListAvailableSizesMinimumSetGen)
- AvailabilitySetsClient.NewListBySubscriptionPager
- AvailabilitySetsClient.NewListPager (AvailabilitySetListMaximumSetGen)
- AvailabilitySetsClient.NewListPager (AvailabilitySetListMinimumSetGen)
- AvailabilitySetsClient.Update (AvailabilitySetUpdateMaximumSetGen)
- AvailabilitySetsClient.Update (AvailabilitySetUpdateMinimumSetGen)
- CapacityReservationGroupsClient.CreateOrUpdate
- CapacityReservationGroupsClient.Delete (CapacityReservationGroupDeleteMaximumSetGen)
- CapacityReservationGroupsClient.Delete (CapacityReservationGroupDeleteMinimumSetGen)
- CapacityReservationGroupsClient.Get
- CapacityReservationGroupsClient.NewListByResourceGroupPager
- CapacityReservationGroupsClient.NewListBySubscriptionPager (ListCapacityReservationGroupsInSubscription)
- CapacityReservationGroupsClient.NewListBySubscriptionPager (ListCapacityReservationGroupsWithResourceIdsOnlyInSubscription)
- CapacityReservationGroupsClient.Update (CapacityReservationGroupUpdateMaximumSetGen)
- CapacityReservationGroupsClient.Update (CapacityReservationGroupUpdateMinimumSetGen)
- CapacityReservationsClient.BeginCreateOrUpdate
- CapacityReservationsClient.BeginDelete (CapacityReservationDeleteMaximumSetGen)
- CapacityReservationsClient.BeginDelete (CapacityReservationDeleteMinimumSetGen)
- CapacityReservationsClient.BeginUpdate (CapacityReservationUpdateMaximumSetGen)
- CapacityReservationsClient.BeginUpdate (CapacityReservationUpdateMinimumSetGen)
- CapacityReservationsClient.Get
- CapacityReservationsClient.NewListByCapacityReservationGroupPager
- CloudServiceOperatingSystemsClient.GetOSFamily
- CloudServiceOperatingSystemsClient.GetOSVersion
- CloudServiceOperatingSystemsClient.NewListOSFamiliesPager
- CloudServiceOperatingSystemsClient.NewListOSVersionsPager
- CloudServiceRoleInstancesClient.BeginDelete
- CloudServiceRoleInstancesClient.BeginRebuild
- CloudServiceRoleInstancesClient.BeginReimage
- CloudServiceRoleInstancesClient.BeginRestart
- CloudServiceRoleInstancesClient.Get
- CloudServiceRoleInstancesClient.GetInstanceView
- CloudServiceRoleInstancesClient.GetRemoteDesktopFile
- CloudServiceRoleInstancesClient.NewListPager
- CloudServiceRolesClient.Get
- CloudServiceRolesClient.NewListPager
- CloudServicesClient.BeginCreateOrUpdate (CreateNewCloudServiceWithMultipleRoles)
- CloudServicesClient.BeginCreateOrUpdate (CreateNewCloudServiceWithMultipleRolesInASpecificAvailabilityZone)
- CloudServicesClient.BeginCreateOrUpdate (CreateNewCloudServiceWithSingleRole)
- CloudServicesClient.BeginCreateOrUpdate (CreateNewCloudServiceWithSingleRoleAndCertificateFromKeyVault)
- CloudServicesClient.BeginCreateOrUpdate (CreateNewCloudServiceWithSingleRoleAndRdpExtension)
- CloudServicesClient.BeginDelete
- CloudServicesClient.BeginDeleteInstances
- CloudServicesClient.BeginPowerOff
- CloudServicesClient.BeginRebuild
- CloudServicesClient.BeginReimage
- CloudServicesClient.BeginRestart
- CloudServicesClient.BeginStart
- CloudServicesClient.BeginUpdate
- CloudServicesClient.Get
- CloudServicesClient.GetInstanceView
- CloudServicesClient.NewListAllPager
- CloudServicesClient.NewListPager
- CloudServicesUpdateDomainClient.BeginWalkUpdateDomain
- CloudServicesUpdateDomainClient.GetUpdateDomain
- CloudServicesUpdateDomainClient.NewListUpdateDomainsPager
- CommunityGalleriesClient.Get
- CommunityGalleryImageVersionsClient.Get
- CommunityGalleryImageVersionsClient.NewListPager
- CommunityGalleryImagesClient.Get
- CommunityGalleryImagesClient.NewListPager
- DedicatedHostGroupsClient.CreateOrUpdate (CreateOrUpdateADedicatedHostGroup)
- DedicatedHostGroupsClient.CreateOrUpdate (CreateOrUpdateADedicatedHostGroupWithUltraSsdSupport)
- DedicatedHostGroupsClient.Delete (DedicatedHostGroupDeleteMaximumSetGen)
- DedicatedHostGroupsClient.Delete (DedicatedHostGroupDeleteMinimumSetGen)
- DedicatedHostGroupsClient.Get (CreateADedicatedHostGroup)
- DedicatedHostGroupsClient.Get (CreateAnUltraSsdEnabledDedicatedHostGroup)
- DedicatedHostGroupsClient.NewListByResourceGroupPager (DedicatedHostGroupListByResourceGroupMaximumSetGen)
- DedicatedHostGroupsClient.NewListByResourceGroupPager (DedicatedHostGroupListByResourceGroupMinimumSetGen)
- DedicatedHostGroupsClient.NewListBySubscriptionPager (DedicatedHostGroupListBySubscriptionMaximumSetGen)
- DedicatedHostGroupsClient.NewListBySubscriptionPager (DedicatedHostGroupListBySubscriptionMinimumSetGen)
- DedicatedHostGroupsClient.Update (DedicatedHostGroupUpdateMaximumSetGen)
- DedicatedHostGroupsClient.Update (DedicatedHostGroupUpdateMinimumSetGen)
- DedicatedHostsClient.BeginCreateOrUpdate
- DedicatedHostsClient.BeginDelete (DedicatedHostDeleteMaximumSetGen)
- DedicatedHostsClient.BeginDelete (DedicatedHostDeleteMinimumSetGen)
- DedicatedHostsClient.BeginRedeploy
- DedicatedHostsClient.BeginRestart
- DedicatedHostsClient.BeginUpdate (DedicatedHostUpdateMaximumSetGen)
- DedicatedHostsClient.BeginUpdate (DedicatedHostUpdateMinimumSetGen)
- DedicatedHostsClient.BeginUpdate (DedicatedHostUpdateResize)
- DedicatedHostsClient.Get
- DedicatedHostsClient.NewListAvailableSizesPager
- DedicatedHostsClient.NewListByHostGroupPager (DedicatedHostListByHostGroupMaximumSetGen)
- DedicatedHostsClient.NewListByHostGroupPager (DedicatedHostListByHostGroupMinimumSetGen)
- DiskAccessesClient.BeginCreateOrUpdate
- DiskAccessesClient.BeginDelete
- DiskAccessesClient.BeginDeleteAPrivateEndpointConnection
- DiskAccessesClient.BeginUpdate
- DiskAccessesClient.BeginUpdateAPrivateEndpointConnection
- DiskAccessesClient.Get (GetInformationAboutADiskAccessResource)
- DiskAccessesClient.Get (GetInformationAboutADiskAccessResourceWithPrivateEndpoints)
- DiskAccessesClient.GetAPrivateEndpointConnection
- DiskAccessesClient.GetPrivateLinkResources
- DiskAccessesClient.NewListByResourceGroupPager
- DiskAccessesClient.NewListPager
- DiskAccessesClient.NewListPrivateEndpointConnectionsPager
- DiskEncryptionSetsClient.BeginCreateOrUpdate (CreateADiskEncryptionSet)
- DiskEncryptionSetsClient.BeginCreateOrUpdate (CreateADiskEncryptionSetWithKeyVaultFromADifferentSubscription)
- DiskEncryptionSetsClient.BeginCreateOrUpdate (CreateADiskEncryptionSetWithKeyVaultFromADifferentTenant)
- DiskEncryptionSetsClient.BeginDelete
- DiskEncryptionSetsClient.BeginUpdate (UpdateADiskEncryptionSet)
- DiskEncryptionSetsClient.BeginUpdate (UpdateADiskEncryptionSetWithRotationToLatestKeyVersionEnabledSetToTrueSucceeded)
- DiskEncryptionSetsClient.BeginUpdate (UpdateADiskEncryptionSetWithRotationToLatestKeyVersionEnabledSetToTrueUpdating)
- DiskEncryptionSetsClient.Get (GetInformationAboutADiskEncryptionSet)
- DiskEncryptionSetsClient.Get (GetInformationAboutADiskEncryptionSetWhenAutoKeyRotationFailed)
- DiskEncryptionSetsClient.NewListAssociatedResourcesPager
- DiskEncryptionSetsClient.NewListByResourceGroupPager
- DiskEncryptionSetsClient.NewListPager
- DiskRestorePointClient.BeginGrantAccess
- DiskRestorePointClient.BeginRevokeAccess
- DiskRestorePointClient.Get (GetAnIncrementalDiskRestorePointResource)
- DiskRestorePointClient.Get (GetAnIncrementalDiskRestorePointWhenSourceResourceIsFromADifferentRegion)
- DiskRestorePointClient.NewListByRestorePointPager
- DisksClient.BeginCreateOrUpdate (CreateAConfidentialVmSupportedDiskEncryptedWithCustomerManagedKey)
- DisksClient.BeginCreateOrUpdate (CreateAManagedDiskAndAssociateWithDiskAccessResource)
- DisksClient.BeginCreateOrUpdate (CreateAManagedDiskAndAssociateWithDiskEncryptionSet)
- DisksClient.BeginCreateOrUpdate (CreateAManagedDiskByCopyingASnapshot)
- DisksClient.BeginCreateOrUpdate (CreateAManagedDiskByImportingAnUnmanagedBlobFromADifferentSubscription)
- DisksClient.BeginCreateOrUpdate (CreateAManagedDiskByImportingAnUnmanagedBlobFromTheSameSubscription)
- DisksClient.BeginCreateOrUpdate (CreateAManagedDiskFromAPlatformImage)
- DisksClient.BeginCreateOrUpdate (CreateAManagedDiskFromAnAzureComputeGalleryCommunityImage)
- DisksClient.BeginCreateOrUpdate (CreateAManagedDiskFromAnAzureComputeGalleryDirectSharedImage)
- DisksClient.BeginCreateOrUpdate (CreateAManagedDiskFromAnAzureComputeGalleryImage)
- DisksClient.BeginCreateOrUpdate (CreateAManagedDiskFromAnExistingManagedDiskInTheSameOrDifferentSubscription)
- DisksClient.BeginCreateOrUpdate (CreateAManagedDiskFromElasticSanVolumeSnapshot)
- DisksClient.BeginCreateOrUpdate (CreateAManagedDiskFromImportSecureCreateOption)
- DisksClient.BeginCreateOrUpdate (CreateAManagedDiskFromUploadPreparedSecureCreateOption)
- DisksClient.BeginCreateOrUpdate (CreateAManagedDiskWithDataAccessAuthMode)
- DisksClient.BeginCreateOrUpdate (CreateAManagedDiskWithOptimizedForFrequentAttach)
- DisksClient.BeginCreateOrUpdate (CreateAManagedDiskWithPerformancePlus)
- DisksClient.BeginCreateOrUpdate (CreateAManagedDiskWithPremiumV2AccountType)
- DisksClient.BeginCreateOrUpdate (CreateAManagedDiskWithSecurityProfile)
- DisksClient.BeginCreateOrUpdate (CreateAManagedDiskWithSsdZrsAccountType)
- DisksClient.BeginCreateOrUpdate (CreateAManagedDiskWithUltraAccountTypeWithReadOnlyPropertySet)
- DisksClient.BeginCreateOrUpdate (CreateAManagedUploadDisk)
- DisksClient.BeginCreateOrUpdate (CreateAnEmptyManagedDisk)
- DisksClient.BeginCreateOrUpdate (CreateAnEmptyManagedDiskInExtendedLocation)
- DisksClient.BeginCreateOrUpdate (CreateAnUltraManagedDiskWithLogicalSectorSize512E)
- DisksClient.BeginDelete
- DisksClient.BeginGrantAccess (GetASasOnAManagedDisk)
- DisksClient.BeginGrantAccess (GetSasOnManagedDiskAndVmGuestState)
- DisksClient.BeginRevokeAccess
- DisksClient.BeginUpdate (CreateOrUpdateABurstingEnabledManagedDisk)
- DisksClient.BeginUpdate (UpdateAManagedDiskToAddAcceleratedNetworking)
- DisksClient.BeginUpdate (UpdateAManagedDiskToAddArchitecture)
- DisksClient.BeginUpdate (UpdateAManagedDiskToAddPurchasePlan)
- DisksClient.BeginUpdate (UpdateAManagedDiskToAddSupportsHibernation)
- DisksClient.BeginUpdate (UpdateAManagedDiskToChangeTier)
- DisksClient.BeginUpdate (UpdateAManagedDiskToDisableBursting)
- DisksClient.BeginUpdate (UpdateAManagedDiskToDisableOptimizedForFrequentAttach)
- DisksClient.BeginUpdate (UpdateAManagedDiskWithDiskControllerTypes)
- DisksClient.BeginUpdate (UpdateManagedDiskToRemoveDiskAccessResourceAssociation)
- DisksClient.Get
- DisksClient.NewListByResourceGroupPager
- DisksClient.NewListPager
- GalleriesClient.BeginCreateOrUpdate (CreateACommunityGallery)
- GalleriesClient.BeginCreateOrUpdate (CreateOrUpdateASimpleGallery)
- GalleriesClient.BeginCreateOrUpdate (CreateOrUpdateASimpleGalleryWithSharingProfile)
- GalleriesClient.BeginCreateOrUpdate (CreateOrUpdateASimpleGalleryWithSoftDeletionEnabled)
- GalleriesClient.BeginDelete
- GalleriesClient.BeginUpdate
- GalleriesClient.Get (GetACommunityGallery)
- GalleriesClient.Get (GetAGallery)
- GalleriesClient.Get (GetAGalleryWithExpandSharingProfileGroups)
- GalleriesClient.Get (GetAGalleryWithSelectPermissions)
- GalleriesClient.NewListByResourceGroupPager
- GalleriesClient.NewListPager
- GalleryApplicationVersionsClient.BeginCreateOrUpdate
- GalleryApplicationVersionsClient.BeginDelete
- GalleryApplicationVersionsClient.BeginUpdate
- GalleryApplicationVersionsClient.Get (GetAGalleryApplicationVersion)
- GalleryApplicationVersionsClient.Get (GetAGalleryApplicationVersionWithReplicationStatus)
- GalleryApplicationVersionsClient.NewListByGalleryApplicationPager
- GalleryApplicationsClient.BeginCreateOrUpdate
- GalleryApplicationsClient.BeginDelete
- GalleryApplicationsClient.BeginUpdate
- GalleryApplicationsClient.Get
- GalleryApplicationsClient.NewListByGalleryPager
- GalleryImageVersionsClient.BeginCreateOrUpdate (CreateOrUpdateASimpleGalleryImageVersionUsingCommunityGalleryImageAsSource)
- GalleryImageVersionsClient.BeginCreateOrUpdate (CreateOrUpdateASimpleGalleryImageVersionUsingManagedImageAsSource)
- GalleryImageVersionsClient.BeginCreateOrUpdate (CreateOrUpdateASimpleGalleryImageVersionUsingMixOfDisksAndSnapshotsAsASource)
- GalleryImageVersionsClient.BeginCreateOrUpdate (CreateOrUpdateASimpleGalleryImageVersionUsingShallowReplicationMode)
- GalleryImageVersionsClient.BeginCreateOrUpdate (CreateOrUpdateASimpleGalleryImageVersionUsingSharedImageAsSource)
- GalleryImageVersionsClient.BeginCreateOrUpdate (CreateOrUpdateASimpleGalleryImageVersionUsingVhdAsASource)
- GalleryImageVersionsClient.BeginCreateOrUpdate (CreateOrUpdateASimpleGalleryImageVersionUsingVhdAsASourceWithCustomUefiKeys)
- GalleryImageVersionsClient.BeginCreateOrUpdate (CreateOrUpdateASimpleGalleryImageVersionUsingVmAsSource)
- GalleryImageVersionsClient.BeginCreateOrUpdate (CreateOrUpdateASimpleGalleryImageVersionWithTargetExtendedLocationsSpecified)
- GalleryImageVersionsClient.BeginDelete
- GalleryImageVersionsClient.BeginUpdate (UpdateASimpleGalleryImageVersionManagedImageAsSource)
- GalleryImageVersionsClient.BeginUpdate (UpdateASimpleGalleryImageVersionWithoutSourceId)
- GalleryImageVersionsClient.Get (GetAGalleryImageVersion)
- GalleryImageVersionsClient.Get (GetAGalleryImageVersionWithReplicationStatus)
- GalleryImageVersionsClient.Get (GetAGalleryImageVersionWithSnapshotsAsASource)
- GalleryImageVersionsClient.Get (GetAGalleryImageVersionWithVhdAsASource)
- GalleryImageVersionsClient.NewListByGalleryImagePager
- GalleryImagesClient.BeginCreateOrUpdate
- GalleryImagesClient.BeginDelete
- GalleryImagesClient.BeginUpdate
- GalleryImagesClient.Get
- GalleryImagesClient.NewListByGalleryPager
- GallerySharingProfileClient.BeginUpdate (AddSharingIdToTheSharingProfileOfAGallery)
- GallerySharingProfileClient.BeginUpdate (ResetSharingProfileOfAGallery)
- GallerySharingProfileClient.BeginUpdate (ShareAGalleryToCommunity)
- ImagesClient.BeginCreateOrUpdate (CreateAVirtualMachineImageFromABlob)
- ImagesClient.BeginCreateOrUpdate (CreateAVirtualMachineImageFromABlobWithDiskEncryptionSetResource)
- ImagesClient.BeginCreateOrUpdate (CreateAVirtualMachineImageFromAManagedDisk)
- ImagesClient.BeginCreateOrUpdate (CreateAVirtualMachineImageFromAManagedDiskWithDiskEncryptionSetResource)
- ImagesClient.BeginCreateOrUpdate (CreateAVirtualMachineImageFromASnapshot)
- ImagesClient.BeginCreateOrUpdate (CreateAVirtualMachineImageFromASnapshotWithDiskEncryptionSetResource)
- ImagesClient.BeginCreateOrUpdate (CreateAVirtualMachineImageFromAnExistingVirtualMachine)
- ImagesClient.BeginCreateOrUpdate (CreateAVirtualMachineImageThatIncludesADataDiskFromABlob)
- ImagesClient.BeginCreateOrUpdate (CreateAVirtualMachineImageThatIncludesADataDiskFromAManagedDisk)
- ImagesClient.BeginCreateOrUpdate (CreateAVirtualMachineImageThatIncludesADataDiskFromASnapshot)
- ImagesClient.BeginDelete (ImageDeleteMaximumSetGen)
- ImagesClient.BeginDelete (ImageDeleteMinimumSetGen)
- ImagesClient.BeginUpdate
- ImagesClient.Get
- ImagesClient.NewListByResourceGroupPager
- ImagesClient.NewListPager
- LogAnalyticsClient.BeginExportRequestRateByInterval
- LogAnalyticsClient.BeginExportThrottledRequests
- OperationsClient.NewListPager (OperationsListMaximumSetGen)
- OperationsClient.NewListPager (OperationsListMinimumSetGen)
- ProximityPlacementGroupsClient.CreateOrUpdate
- ProximityPlacementGroupsClient.Delete
- ProximityPlacementGroupsClient.Get
- ProximityPlacementGroupsClient.NewListByResourceGroupPager
- ProximityPlacementGroupsClient.NewListBySubscriptionPager
- ProximityPlacementGroupsClient.Update
- ResourceSKUsClient.NewListPager (ListsAllAvailableResourceSkUs)
- ResourceSKUsClient.NewListPager (ListsAllAvailableResourceSkUsForTheSpecifiedRegion)
- ResourceSKUsClient.NewListPager (ListsAllAvailableResourceSkUsWithExtendedLocationInformation)
- RestorePointCollectionsClient.BeginDelete (RestorePointCollectionDeleteMaximumSetGen)
- RestorePointCollectionsClient.BeginDelete (RestorePointCollectionDeleteMinimumSetGen)
- RestorePointCollectionsClient.CreateOrUpdate (CreateOrUpdateARestorePointCollection)
- RestorePointCollectionsClient.CreateOrUpdate (CreateOrUpdateARestorePointCollectionForCrossRegionCopy)
- RestorePointCollectionsClient.Get (GetARestorePointCollectionButNotTheRestorePointsContainedInTheRestorePointCollection)
- RestorePointCollectionsClient.Get (GetARestorePointCollectionIncludingTheRestorePointsContainedInTheRestorePointCollection)
- RestorePointCollectionsClient.NewListAllPager
- RestorePointCollectionsClient.NewListPager
- RestorePointCollectionsClient.Update (RestorePointCollectionUpdateMaximumSetGen)
- RestorePointCollectionsClient.Update (RestorePointCollectionUpdateMinimumSetGen)
- RestorePointsClient.BeginCreate (CopyARestorePointToADifferentRegion)
- RestorePointsClient.BeginCreate (CreateARestorePoint)
- RestorePointsClient.BeginDelete (RestorePointDeleteMaximumSetGen)
- RestorePointsClient.BeginDelete (RestorePointDeleteMinimumSetGen)
- RestorePointsClient.Get (GetARestorePoint)
- RestorePointsClient.Get (GetRestorePointWithInstanceView)
- SSHPublicKeysClient.Create
- SSHPublicKeysClient.Delete (SshPublicKeyDeleteMaximumSetGen)
- SSHPublicKeysClient.Delete (SshPublicKeyDeleteMinimumSetGen)
- SSHPublicKeysClient.GenerateKeyPair (GenerateAnSshKeyPair)
- SSHPublicKeysClient.GenerateKeyPair (GenerateAnSshKeyPairWithEd25519Encryption)
- SSHPublicKeysClient.GenerateKeyPair (GenerateAnSshKeyPairWithRsaEncryption)
- SSHPublicKeysClient.Get
- SSHPublicKeysClient.NewListByResourceGroupPager (SshPublicKeyListByResourceGroupMaximumSetGen)
- SSHPublicKeysClient.NewListByResourceGroupPager (SshPublicKeyListByResourceGroupMinimumSetGen)
- SSHPublicKeysClient.NewListBySubscriptionPager (SshPublicKeyListBySubscriptionMaximumSetGen)
- SSHPublicKeysClient.NewListBySubscriptionPager (SshPublicKeyListBySubscriptionMinimumSetGen)
- SSHPublicKeysClient.Update (SshPublicKeyUpdateMaximumSetGen)
- SSHPublicKeysClient.Update (SshPublicKeyUpdateMinimumSetGen)
- SharedGalleriesClient.Get
- SharedGalleriesClient.NewListPager
- SharedGalleryImageVersionsClient.Get
- SharedGalleryImageVersionsClient.NewListPager
- SharedGalleryImagesClient.Get
- SharedGalleryImagesClient.NewListPager
- SnapshotsClient.BeginCreateOrUpdate (CreateASnapshotByImportingAnUnmanagedBlobFromADifferentSubscription)
- SnapshotsClient.BeginCreateOrUpdate (CreateASnapshotByImportingAnUnmanagedBlobFromTheSameSubscription)
- SnapshotsClient.BeginCreateOrUpdate (CreateASnapshotFromAnElasticSanVolumeSnapshot)
- SnapshotsClient.BeginCreateOrUpdate (CreateASnapshotFromAnExistingSnapshotInTheSameOrADifferentSubscription)
- SnapshotsClient.BeginCreateOrUpdate (CreateASnapshotFromAnExistingSnapshotInTheSameOrADifferentSubscriptionInADifferentRegion)
- SnapshotsClient.BeginCreateOrUpdate (CreateASnapshotFromAnExistingSnapshotInTheSameOrADifferentSubscriptionInADifferentRegionWithQuickerCopySpeed)
- SnapshotsClient.BeginDelete
- SnapshotsClient.BeginGrantAccess
- SnapshotsClient.BeginRevokeAccess
- SnapshotsClient.BeginUpdate (UpdateASnapshot)
- SnapshotsClient.BeginUpdate (UpdateASnapshotWithAcceleratedNetworking)
- SnapshotsClient.Get (GetInformationAboutASnapshot)
- SnapshotsClient.Get (GetInformationAboutAnIncrementalSnapshot)
- SnapshotsClient.NewListByResourceGroupPager
- SnapshotsClient.NewListPager
- UsageClient.NewListPager (UsageListMaximumSetGen)
- UsageClient.NewListPager (UsageListMinimumSetGen)
- VirtualMachineExtensionImagesClient.Get (VirtualMachineExtensionImageGetMaximumSetGen)
- VirtualMachineExtensionImagesClient.Get (VirtualMachineExtensionImageGetMinimumSetGen)
- VirtualMachineExtensionImagesClient.ListTypes (VirtualMachineExtensionImageListTypesMaximumSetGen)
- VirtualMachineExtensionImagesClient.ListTypes (VirtualMachineExtensionImageListTypesMinimumSetGen)
- VirtualMachineExtensionImagesClient.ListVersions (VirtualMachineExtensionImageListVersionsMaximumSetGen)
- VirtualMachineExtensionImagesClient.ListVersions (VirtualMachineExtensionImageListVersionsMinimumSetGen)
- VirtualMachineExtensionsClient.BeginCreateOrUpdate (VirtualMachineExtensionCreateOrUpdateMaximumSetGen)
- VirtualMachineExtensionsClient.BeginCreateOrUpdate (VirtualMachineExtensionCreateOrUpdateMinimumSetGen)
- VirtualMachineExtensionsClient.BeginDelete (VirtualMachineExtensionDeleteMaximumSetGen)
- VirtualMachineExtensionsClient.BeginDelete (VirtualMachineExtensionDeleteMinimumSetGen)
- VirtualMachineExtensionsClient.BeginUpdate
- VirtualMachineExtensionsClient.Get (VirtualMachineExtensionGetMaximumSetGen)
- VirtualMachineExtensionsClient.Get (VirtualMachineExtensionGetMinimumSetGen)
- VirtualMachineExtensionsClient.List (VirtualMachineExtensionListMaximumSetGen)
- VirtualMachineExtensionsClient.List (VirtualMachineExtensionListMinimumSetGen)
- VirtualMachineImagesClient.Get (VirtualMachineImageGetMaximumSetGen)
- VirtualMachineImagesClient.Get (VirtualMachineImageGetMinimumSetGen)
- VirtualMachineImagesClient.List (VirtualMachineImageListMaximumSetGen)
- VirtualMachineImagesClient.List (VirtualMachineImageListMinimumSetGen)
- VirtualMachineImagesClient.ListByEdgeZone (VirtualMachineImagesEdgeZoneListByEdgeZoneMaximumSetGen)
- VirtualMachineImagesClient.ListByEdgeZone (VirtualMachineImagesEdgeZoneListByEdgeZoneMinimumSetGen)
- VirtualMachineImagesClient.ListOffers (VirtualMachineImageListOffersMaximumSetGen)
- VirtualMachineImagesClient.ListOffers (VirtualMachineImageListOffersMinimumSetGen)
- VirtualMachineImagesClient.ListPublishers (VirtualMachineImageListPublishersMaximumSetGen)
- VirtualMachineImagesClient.ListPublishers (VirtualMachineImageListPublishersMinimumSetGen)
- VirtualMachineImagesClient.ListSKUs (VirtualMachineImageListSkusMaximumSetGen)
- VirtualMachineImagesClient.ListSKUs (VirtualMachineImageListSkusMinimumSetGen)
- VirtualMachineImagesEdgeZoneClient.Get (VirtualMachineImagesEdgeZoneGetMaximumSetGen)
- VirtualMachineImagesEdgeZoneClient.Get (VirtualMachineImagesEdgeZoneGetMinimumSetGen)
- VirtualMachineImagesEdgeZoneClient.List (VirtualMachineImagesEdgeZoneListMaximumSetGen)
- VirtualMachineImagesEdgeZoneClient.List (VirtualMachineImagesEdgeZoneListMinimumSetGen)
- VirtualMachineImagesEdgeZoneClient.ListOffers (VirtualMachineImagesEdgeZoneListOffersMaximumSetGen)
- VirtualMachineImagesEdgeZoneClient.ListOffers (VirtualMachineImagesEdgeZoneListOffersMinimumSetGen)
- VirtualMachineImagesEdgeZoneClient.ListPublishers (VirtualMachineImagesEdgeZoneListPublishersMaximumSetGen)
- VirtualMachineImagesEdgeZoneClient.ListPublishers (VirtualMachineImagesEdgeZoneListPublishersMinimumSetGen)
- VirtualMachineImagesEdgeZoneClient.ListSKUs (VirtualMachineImagesEdgeZoneListSkusMaximumSetGen)
- VirtualMachineImagesEdgeZoneClient.ListSKUs (VirtualMachineImagesEdgeZoneListSkusMinimumSetGen)
- VirtualMachineRunCommandsClient.BeginCreateOrUpdate
- VirtualMachineRunCommandsClient.BeginDelete
- VirtualMachineRunCommandsClient.BeginUpdate
- VirtualMachineRunCommandsClient.Get
- VirtualMachineRunCommandsClient.GetByVirtualMachine
- VirtualMachineRunCommandsClient.NewListByVirtualMachinePager
- VirtualMachineRunCommandsClient.NewListPager
- VirtualMachineScaleSetExtensionsClient.BeginCreateOrUpdate (VirtualMachineScaleSetExtensionCreateOrUpdateMaximumSetGen)
- VirtualMachineScaleSetExtensionsClient.BeginCreateOrUpdate (VirtualMachineScaleSetExtensionCreateOrUpdateMinimumSetGen)
- VirtualMachineScaleSetExtensionsClient.BeginDelete (VirtualMachineScaleSetExtensionDeleteMaximumSetGen)
- VirtualMachineScaleSetExtensionsClient.BeginDelete (VirtualMachineScaleSetExtensionDeleteMinimumSetGen)
- VirtualMachineScaleSetExtensionsClient.BeginUpdate (VirtualMachineScaleSetExtensionUpdateMaximumSetGen)
- VirtualMachineScaleSetExtensionsClient.BeginUpdate (VirtualMachineScaleSetExtensionUpdateMinimumSetGen)
- VirtualMachineScaleSetExtensionsClient.Get (VirtualMachineScaleSetExtensionGetMaximumSetGen)
- VirtualMachineScaleSetExtensionsClient.Get (VirtualMachineScaleSetExtensionGetMinimumSetGen)
- VirtualMachineScaleSetExtensionsClient.NewListPager (VirtualMachineScaleSetExtensionListMaximumSetGen)
- VirtualMachineScaleSetExtensionsClient.NewListPager (VirtualMachineScaleSetExtensionListMinimumSetGen)
- VirtualMachineScaleSetRollingUpgradesClient.BeginCancel (VirtualMachineScaleSetRollingUpgradeCancelMaximumSetGen)
- VirtualMachineScaleSetRollingUpgradesClient.BeginCancel (VirtualMachineScaleSetRollingUpgradeCancelMinimumSetGen)
- VirtualMachineScaleSetRollingUpgradesClient.BeginStartExtensionUpgrade
- VirtualMachineScaleSetRollingUpgradesClient.BeginStartOSUpgrade (VirtualMachineScaleSetRollingUpgradeStartOsUpgradeMaximumSetGen)
- VirtualMachineScaleSetRollingUpgradesClient.BeginStartOSUpgrade (VirtualMachineScaleSetRollingUpgradeStartOsUpgradeMinimumSetGen)
- VirtualMachineScaleSetRollingUpgradesClient.GetLatest (VirtualMachineScaleSetRollingUpgradeGetLatestMaximumSetGen)
- VirtualMachineScaleSetRollingUpgradesClient.GetLatest (VirtualMachineScaleSetRollingUpgradeGetLatestMinimumSetGen)
- VirtualMachineScaleSetVMExtensionsClient.BeginCreateOrUpdate
- VirtualMachineScaleSetVMExtensionsClient.BeginDelete
- VirtualMachineScaleSetVMExtensionsClient.BeginUpdate
- VirtualMachineScaleSetVMExtensionsClient.Get
- VirtualMachineScaleSetVMExtensionsClient.List
- VirtualMachineScaleSetVMRunCommandsClient.BeginCreateOrUpdate
- VirtualMachineScaleSetVMRunCommandsClient.BeginDelete
- VirtualMachineScaleSetVMRunCommandsClient.BeginUpdate
- VirtualMachineScaleSetVMRunCommandsClient.Get
- VirtualMachineScaleSetVMRunCommandsClient.NewListPager
- VirtualMachineScaleSetVMsClient.BeginApproveRollingUpgrade
- VirtualMachineScaleSetVMsClient.BeginAttachDetachDataDisks (VirtualMachineScaleSetVmAttachDetachDataDisksMaximumSetGen)
- VirtualMachineScaleSetVMsClient.BeginAttachDetachDataDisks (VirtualMachineScaleSetVmAttachDetachDataDisksMinimumSetGen)
- VirtualMachineScaleSetVMsClient.BeginDeallocate (VirtualMachineScaleSetVmDeallocateMaximumSetGen)
- VirtualMachineScaleSetVMsClient.BeginDeallocate (VirtualMachineScaleSetVmDeallocateMinimumSetGen)
- VirtualMachineScaleSetVMsClient.BeginDelete
- VirtualMachineScaleSetVMsClient.BeginPerformMaintenance (VirtualMachineScaleSetVmPerformMaintenanceMaximumSetGen)
- VirtualMachineScaleSetVMsClient.BeginPerformMaintenance (VirtualMachineScaleSetVmPerformMaintenanceMinimumSetGen)
- VirtualMachineScaleSetVMsClient.BeginPowerOff (VirtualMachineScaleSetVmPowerOffMaximumSetGen)
- VirtualMachineScaleSetVMsClient.BeginPowerOff (VirtualMachineScaleSetVmPowerOffMinimumSetGen)
- VirtualMachineScaleSetVMsClient.BeginRedeploy (VirtualMachineScaleSetVmRedeployMaximumSetGen)
- VirtualMachineScaleSetVMsClient.BeginRedeploy (VirtualMachineScaleSetVmRedeployMinimumSetGen)
- VirtualMachineScaleSetVMsClient.BeginReimage (VirtualMachineScaleSetVmReimageMaximumSetGen)
- VirtualMachineScaleSetVMsClient.BeginReimage (VirtualMachineScaleSetVmReimageMinimumSetGen)
- VirtualMachineScaleSetVMsClient.BeginReimageAll (VirtualMachineScaleSetVmReimageAllMaximumSetGen)
- VirtualMachineScaleSetVMsClient.BeginReimageAll (VirtualMachineScaleSetVmReimageAllMinimumSetGen)
- VirtualMachineScaleSetVMsClient.BeginRestart (VirtualMachineScaleSetVmRestartMaximumSetGen)
- VirtualMachineScaleSetVMsClient.BeginRestart (VirtualMachineScaleSetVmRestartMinimumSetGen)
- VirtualMachineScaleSetVMsClient.BeginRunCommand
- VirtualMachineScaleSetVMsClient.BeginStart (VirtualMachineScaleSetVmStartMaximumSetGen)
- VirtualMachineScaleSetVMsClient.BeginStart (VirtualMachineScaleSetVmStartMinimumSetGen)
- VirtualMachineScaleSetVMsClient.BeginUpdate (VirtualMachineScaleSetVmUpdateMaximumSetGen)
- VirtualMachineScaleSetVMsClient.BeginUpdate (VirtualMachineScaleSetVmUpdateMinimumSetGen)
- VirtualMachineScaleSetVMsClient.Get (GetVmScaleSetVmWithUserData)
- VirtualMachineScaleSetVMsClient.Get (GetVmScaleSetVmWithVmSizeProperties)
- VirtualMachineScaleSetVMsClient.GetInstanceView
- VirtualMachineScaleSetVMsClient.NewListPager (VirtualMachineScaleSetVmListMaximumSetGen)
- VirtualMachineScaleSetVMsClient.NewListPager (VirtualMachineScaleSetVmListMinimumSetGen)
- VirtualMachineScaleSetVMsClient.RetrieveBootDiagnosticsData
- VirtualMachineScaleSetVMsClient.SimulateEviction
- VirtualMachineScaleSetsClient.BeginApproveRollingUpgrade
- VirtualMachineScaleSetsClient.BeginCreateOrUpdate (CreateACustomImageScaleSetFromAnUnmanagedGeneralizedOsImage)
- VirtualMachineScaleSetsClient.BeginCreateOrUpdate (CreateAPlatformImageScaleSetWithUnmanagedOsDisks)
- VirtualMachineScaleSetsClient.BeginCreateOrUpdate (CreateAScaleSetFromACustomImage)
- VirtualMachineScaleSetsClient.BeginCreateOrUpdate (CreateAScaleSetFromAGeneralizedSharedImage)
- VirtualMachineScaleSetsClient.BeginCreateOrUpdate (CreateAScaleSetFromASpecializedSharedImage)
- VirtualMachineScaleSetsClient.BeginCreateOrUpdate (CreateAScaleSetWhereNicConfigHasDisableTcpStateTrackingProperty)
- VirtualMachineScaleSetsClient.BeginCreateOrUpdate (CreateAScaleSetWithAMarketplaceImagePlan)
- VirtualMachineScaleSetsClient.BeginCreateOrUpdate (CreateAScaleSetWithAnAzureApplicationGateway)
- VirtualMachineScaleSetsClient.BeginCreateOrUpdate (CreateAScaleSetWithAnAzureLoadBalancer)
- VirtualMachineScaleSetsClient.BeginCreateOrUpdate (CreateAScaleSetWithApplicationProfile)
- VirtualMachineScaleSetsClient.BeginCreateOrUpdate (CreateAScaleSetWithAutomaticRepairsEnabled)
- VirtualMachineScaleSetsClient.BeginCreateOrUpdate (CreateAScaleSetWithBootDiagnostics)
- VirtualMachineScaleSetsClient.BeginCreateOrUpdate (CreateAScaleSetWithDiskControllerType)
- VirtualMachineScaleSetsClient.BeginCreateOrUpdate (CreateAScaleSetWithDiskEncryptionSetResourceInOsDiskAndDataDisk)
- VirtualMachineScaleSetsClient.BeginCreateOrUpdate (CreateAScaleSetWithEmptyDataDisksOnEachVm)
- VirtualMachineScaleSetsClient.BeginCreateOrUpdate (CreateAScaleSetWithEphemeralOsDiskProvisioningInNvmeDiskUsingPlacementProperty)
- VirtualMachineScaleSetsClient.BeginCreateOrUpdate (CreateAScaleSetWithEphemeralOsDisks)
- VirtualMachineScaleSetsClient.BeginCreateOrUpdate (CreateAScaleSetWithEphemeralOsDisksUsingPlacementProperty)
- VirtualMachineScaleSetsClient.BeginCreateOrUpdate (CreateAScaleSetWithExtensionTimeBudget)
- VirtualMachineScaleSetsClient.BeginCreateOrUpdate (CreateAScaleSetWithFpgaNetworkInterfaces)
- VirtualMachineScaleSetsClient.BeginCreateOrUpdate (CreateAScaleSetWithHostEncryptionUsingEncryptionAtHostProperty)
- VirtualMachineScaleSetsClient.BeginCreateOrUpdate (CreateAScaleSetWithManagedBootDiagnostics)
- VirtualMachineScaleSetsClient.BeginCreateOrUpdate (CreateAScaleSetWithNetworkInterfacesWithPublicIpAddressDnsSettings)
- VirtualMachineScaleSetsClient.BeginCreateOrUpdate (CreateAScaleSetWithOsImageScheduledEventsEnabled)
- VirtualMachineScaleSetsClient.BeginCreateOrUpdate (CreateAScaleSetWithPasswordAuthentication)
- VirtualMachineScaleSetsClient.BeginCreateOrUpdate (CreateAScaleSetWithPremiumStorage)
- VirtualMachineScaleSetsClient.BeginCreateOrUpdate (CreateAScaleSetWithPriorityMixPolicy)
- VirtualMachineScaleSetsClient.BeginCreateOrUpdate (CreateAScaleSetWithProxyAgentSettingsOfEnabledAndMode)
- VirtualMachineScaleSetsClient.BeginCreateOrUpdate (CreateAScaleSetWithResilientVmCreationEnabled)
- VirtualMachineScaleSetsClient.BeginCreateOrUpdate (CreateAScaleSetWithResilientVmDeletionEnabled)
- VirtualMachineScaleSetsClient.BeginCreateOrUpdate (CreateAScaleSetWithScaleInPolicy)
- VirtualMachineScaleSetsClient.BeginCreateOrUpdate (CreateAScaleSetWithSecurityPostureReference)
- VirtualMachineScaleSetsClient.BeginCreateOrUpdate (CreateAScaleSetWithSecurityTypeAsConfidentialVm)
- VirtualMachineScaleSetsClient.BeginCreateOrUpdate (CreateAScaleSetWithSecurityTypeAsConfidentialVmAndNonPersistedTpmSecurityEncryptionType)
- VirtualMachineScaleSetsClient.BeginCreateOrUpdate (CreateAScaleSetWithServiceArtifactReference)
- VirtualMachineScaleSetsClient.BeginCreateOrUpdate (CreateAScaleSetWithSpotRestorePolicy)
- VirtualMachineScaleSetsClient.BeginCreateOrUpdate (CreateAScaleSetWithSshAuthentication)
- VirtualMachineScaleSetsClient.BeginCreateOrUpdate (CreateAScaleSetWithTerminateScheduledEventsEnabled)
- VirtualMachineScaleSetsClient.BeginCreateOrUpdate (CreateAScaleSetWithUefiSettingsOfSecureBootAndVTpm)
- VirtualMachineScaleSetsClient.BeginCreateOrUpdate (CreateAScaleSetWithUserData)
- VirtualMachineScaleSetsClient.BeginCreateOrUpdate (CreateAScaleSetWithVirtualMachinesInDifferentZones)
- VirtualMachineScaleSetsClient.BeginCreateOrUpdate (CreateAScaleSetWithVmSizeProperties)
- VirtualMachineScaleSetsClient.BeginCreateOrUpdate (CreateAVmssWithAnExtensionThatHasSuppressFailuresEnabled)
- VirtualMachineScaleSetsClient.BeginCreateOrUpdate (CreateAVmssWithAnExtensionWithProtectedSettingsFromKeyVault)
- VirtualMachineScaleSetsClient.BeginCreateOrUpdate (CreateOrUpdateAScaleSetWithCapacityReservation)
- VirtualMachineScaleSetsClient.BeginDeallocate (VirtualMachineScaleSetDeallocateMaximumSetGen)
- VirtualMachineScaleSetsClient.BeginDeallocate (VirtualMachineScaleSetDeallocateMinimumSetGen)
- VirtualMachineScaleSetsClient.BeginDelete
- VirtualMachineScaleSetsClient.BeginDeleteInstances (VirtualMachineScaleSetDeleteInstancesMaximumSetGen)
- VirtualMachineScaleSetsClient.BeginDeleteInstances (VirtualMachineScaleSetDeleteInstancesMinimumSetGen)
- VirtualMachineScaleSetsClient.BeginPerformMaintenance (VirtualMachineScaleSetPerformMaintenanceMaximumSetGen)
- VirtualMachineScaleSetsClient.BeginPerformMaintenance (VirtualMachineScaleSetPerformMaintenanceMinimumSetGen)
- VirtualMachineScaleSetsClient.BeginPowerOff (VirtualMachineScaleSetPowerOffMaximumSetGen)
- VirtualMachineScaleSetsClient.BeginPowerOff (VirtualMachineScaleSetPowerOffMinimumSetGen)
- VirtualMachineScaleSetsClient.BeginReapply (VirtualMachineScaleSetsReapplyMaximumSetGen)
- VirtualMachineScaleSetsClient.BeginReapply (VirtualMachineScaleSetsReapplyMinimumSetGen)
- VirtualMachineScaleSetsClient.BeginRedeploy (VirtualMachineScaleSetRedeployMaximumSetGen)
- VirtualMachineScaleSetsClient.BeginRedeploy (VirtualMachineScaleSetRedeployMinimumSetGen)
- VirtualMachineScaleSetsClient.BeginReimage (VirtualMachineScaleSetReimageMaximumSetGen)
- VirtualMachineScaleSetsClient.BeginReimage (VirtualMachineScaleSetReimageMinimumSetGen)
- VirtualMachineScaleSetsClient.BeginReimageAll (VirtualMachineScaleSetReimageAllMaximumSetGen)
- VirtualMachineScaleSetsClient.BeginReimageAll (VirtualMachineScaleSetReimageAllMinimumSetGen)
- VirtualMachineScaleSetsClient.BeginRestart (VirtualMachineScaleSetRestartMaximumSetGen)
- VirtualMachineScaleSetsClient.BeginRestart (VirtualMachineScaleSetRestartMinimumSetGen)
- VirtualMachineScaleSetsClient.BeginSetOrchestrationServiceState (VirtualMachineScaleSetSetOrchestrationServiceStateMaximumSetGen)
- VirtualMachineScaleSetsClient.BeginSetOrchestrationServiceState (VirtualMachineScaleSetSetOrchestrationServiceStateMinimumSetGen)
- VirtualMachineScaleSetsClient.BeginStart (VirtualMachineScaleSetStartMaximumSetGen)
- VirtualMachineScaleSetsClient.BeginStart (VirtualMachineScaleSetStartMinimumSetGen)
- VirtualMachineScaleSetsClient.BeginUpdate (VirtualMachineScaleSetUpdateMaximumSetGen)
- VirtualMachineScaleSetsClient.BeginUpdate (VirtualMachineScaleSetUpdateMinimumSetGen)
- VirtualMachineScaleSetsClient.BeginUpdateInstances (VirtualMachineScaleSetUpdateInstancesMaximumSetGen)
- VirtualMachineScaleSetsClient.BeginUpdateInstances (VirtualMachineScaleSetUpdateInstancesMinimumSetGen)
- VirtualMachineScaleSetsClient.ConvertToSinglePlacementGroup (VirtualMachineScaleSetConvertToSinglePlacementGroupMaximumSetGen)
- VirtualMachineScaleSetsClient.ConvertToSinglePlacementGroup (VirtualMachineScaleSetConvertToSinglePlacementGroupMinimumSetGen)
- VirtualMachineScaleSetsClient.ForceRecoveryServiceFabricPlatformUpdateDomainWalk (VirtualMachineScaleSetForceRecoveryServiceFabricPlatformUpdateDomainWalkMaximumSetGen)
- VirtualMachineScaleSetsClient.ForceRecoveryServiceFabricPlatformUpdateDomainWalk (VirtualMachineScaleSetForceRecoveryServiceFabricPlatformUpdateDomainWalkMinimumSetGen)
- VirtualMachineScaleSetsClient.Get (GetAVirtualMachineScaleSet)
- VirtualMachineScaleSetsClient.Get (GetAVirtualMachineScaleSetPlacedOnADedicatedHostGroupThroughAutomaticPlacement)
- VirtualMachineScaleSetsClient.Get (GetAVirtualMachineScaleSetWithUserData)
- VirtualMachineScaleSetsClient.Get (GetVmScaleSetVmWithDiskControllerType)
- VirtualMachineScaleSetsClient.GetInstanceView (VirtualMachineScaleSetGetInstanceViewMaximumSetGen)
- VirtualMachineScaleSetsClient.GetInstanceView (VirtualMachineScaleSetGetInstanceViewMinimumSetGen)
- VirtualMachineScaleSetsClient.NewGetOSUpgradeHistoryPager (VirtualMachineScaleSetGetOsUpgradeHistoryMaximumSetGen)
- VirtualMachineScaleSetsClient.NewGetOSUpgradeHistoryPager (VirtualMachineScaleSetGetOsUpgradeHistoryMinimumSetGen)
- VirtualMachineScaleSetsClient.NewListAllPager (VirtualMachineScaleSetListAllMaximumSetGen)
- VirtualMachineScaleSetsClient.NewListAllPager (VirtualMachineScaleSetListAllMinimumSetGen)
- VirtualMachineScaleSetsClient.NewListByLocationPager
- VirtualMachineScaleSetsClient.NewListPager (VirtualMachineScaleSetListMaximumSetGen)
- VirtualMachineScaleSetsClient.NewListPager (VirtualMachineScaleSetListMinimumSetGen)
- VirtualMachineScaleSetsClient.NewListSKUsPager (VirtualMachineScaleSetListSkusMaximumSetGen)
- VirtualMachineScaleSetsClient.NewListSKUsPager (VirtualMachineScaleSetListSkusMinimumSetGen)
- VirtualMachineSizesClient.NewListPager (VirtualMachineSizesListMaximumSetGen)
- VirtualMachineSizesClient.NewListPager (VirtualMachineSizesListMinimumSetGen)
- VirtualMachinesClient.BeginAssessPatches
- VirtualMachinesClient.BeginAttachDetachDataDisks (VirtualMachineAttachDetachDataDisksMaximumSetGen)
- VirtualMachinesClient.BeginAttachDetachDataDisks (VirtualMachineAttachDetachDataDisksMinimumSetGen)
- VirtualMachinesClient.BeginCapture (VirtualMachineCaptureMaximumSetGen)
- VirtualMachinesClient.BeginCapture (VirtualMachineCaptureMinimumSetGen)
- VirtualMachinesClient.BeginConvertToManagedDisks (VirtualMachineConvertToManagedDisksMaximumSetGen)
- VirtualMachinesClient.BeginConvertToManagedDisks (VirtualMachineConvertToManagedDisksMinimumSetGen)
- VirtualMachinesClient.BeginCreateOrUpdate (CreateACustomImageVmFromAnUnmanagedGeneralizedOsImage)
- VirtualMachinesClient.BeginCreateOrUpdate (CreateALinuxVmWithAPatchSettingAssessmentModeOfImageDefault)
- VirtualMachinesClient.BeginCreateOrUpdate (CreateALinuxVmWithAPatchSettingPatchModeOfAutomaticByPlatformAndAutomaticByPlatformSettings)
- VirtualMachinesClient.BeginCreateOrUpdate (CreateALinuxVmWithAPatchSettingPatchModeOfImageDefault)
- VirtualMachinesClient.BeginCreateOrUpdate (CreateALinuxVmWithAPatchSettingsPatchModeAndAssessmentModeSetToAutomaticByPlatform)
- VirtualMachinesClient.BeginCreateOrUpdate (CreateAPlatformImageVmWithUnmanagedOsAndDataDisks)
- VirtualMachinesClient.BeginCreateOrUpdate (CreateAVmFromACommunityGalleryImage)
- VirtualMachinesClient.BeginCreateOrUpdate (CreateAVmFromACustomImage)
- VirtualMachinesClient.BeginCreateOrUpdate (CreateAVmFromAGeneralizedSharedImage)
- VirtualMachinesClient.BeginCreateOrUpdate (CreateAVmFromASharedGalleryImage)
- VirtualMachinesClient.BeginCreateOrUpdate (CreateAVmFromASpecializedSharedImage)
- VirtualMachinesClient.BeginCreateOrUpdate (CreateAVmInAVirtualMachineScaleSetWithCustomerAssignedPlatformFaultDomain)
- VirtualMachinesClient.BeginCreateOrUpdate (CreateAVmInAnAvailabilitySet)
- VirtualMachinesClient.BeginCreateOrUpdate (CreateAVmWithAMarketplaceImagePlan)
- VirtualMachinesClient.BeginCreateOrUpdate (CreateAVmWithAnExtensionsTimeBudget)
- VirtualMachinesClient.BeginCreateOrUpdate (CreateAVmWithApplicationProfile)
- VirtualMachinesClient.BeginCreateOrUpdate (CreateAVmWithBootDiagnostics)
- VirtualMachinesClient.BeginCreateOrUpdate (CreateAVmWithDataDisksUsingCopyAndRestoreOptions)
- VirtualMachinesClient.BeginCreateOrUpdate (CreateAVmWithDiskControllerType)
- VirtualMachinesClient.BeginCreateOrUpdate (CreateAVmWithDiskEncryptionSetResourceIdInTheOsDiskAndDataDisk)
- VirtualMachinesClient.BeginCreateOrUpdate (CreateAVmWithEmptyDataDisks)
- VirtualMachinesClient.BeginCreateOrUpdate (CreateAVmWithEncryptionIdentity)
- VirtualMachinesClient.BeginCreateOrUpdate (CreateAVmWithEphemeralOsDisk)
- VirtualMachinesClient.BeginCreateOrUpdate (CreateAVmWithEphemeralOsDiskProvisioningInCacheDiskUsingPlacementProperty)
- VirtualMachinesClient.BeginCreateOrUpdate (CreateAVmWithEphemeralOsDiskProvisioningInNvmeDiskUsingPlacementProperty)
- VirtualMachinesClient.BeginCreateOrUpdate (CreateAVmWithEphemeralOsDiskProvisioningInResourceDiskUsingPlacementProperty)
- VirtualMachinesClient.BeginCreateOrUpdate (CreateAVmWithHibernationEnabled)
- VirtualMachinesClient.BeginCreateOrUpdate (CreateAVmWithHostEncryptionUsingEncryptionAtHostProperty)
- VirtualMachinesClient.BeginCreateOrUpdate (CreateAVmWithManagedBootDiagnostics)
- VirtualMachinesClient.BeginCreateOrUpdate (CreateAVmWithNetworkInterfaceConfiguration)
- VirtualMachinesClient.BeginCreateOrUpdate (CreateAVmWithNetworkInterfaceConfigurationWithPublicIpAddressDnsSettings)
- VirtualMachinesClient.BeginCreateOrUpdate (CreateAVmWithPasswordAuthentication)
- VirtualMachinesClient.BeginCreateOrUpdate (CreateAVmWithPremiumStorage)
- VirtualMachinesClient.BeginCreateOrUpdate (CreateAVmWithProxyAgentSettingsOfEnabledAndMode)
- VirtualMachinesClient.BeginCreateOrUpdate (CreateAVmWithScheduledEventsProfile)
- VirtualMachinesClient.BeginCreateOrUpdate (CreateAVmWithSecurityTypeConfidentialVmWithCustomerManagedKeys)
- VirtualMachinesClient.BeginCreateOrUpdate (CreateAVmWithSecurityTypeConfidentialVmWithNonPersistedTpmSecurityEncryptionType)
- VirtualMachinesClient.BeginCreateOrUpdate (CreateAVmWithSecurityTypeConfidentialVmWithPlatformManagedKeys)
- VirtualMachinesClient.BeginCreateOrUpdate (CreateAVmWithSshAuthentication)
- VirtualMachinesClient.BeginCreateOrUpdate (CreateAVmWithUefiSettingsOfSecureBootAndVTpm)
- VirtualMachinesClient.BeginCreateOrUpdate (CreateAVmWithUserData)
- VirtualMachinesClient.BeginCreateOrUpdate (CreateAVmWithVmSizeProperties)
- VirtualMachinesClient.BeginCreateOrUpdate (CreateAWindowsVmWithAPatchSettingAssessmentModeOfImageDefault)
- VirtualMachinesClient.BeginCreateOrUpdate (CreateAWindowsVmWithAPatchSettingPatchModeOfAutomaticByOs)
- VirtualMachinesClient.BeginCreateOrUpdate (CreateAWindowsVmWithAPatchSettingPatchModeOfAutomaticByPlatformAndAutomaticByPlatformSettings)
- VirtualMachinesClient.BeginCreateOrUpdate (CreateAWindowsVmWithAPatchSettingPatchModeOfAutomaticByPlatformAndEnableHotpatchingSetToTrue)
- VirtualMachinesClient.BeginCreateOrUpdate (CreateAWindowsVmWithAPatchSettingPatchModeOfManual)
- VirtualMachinesClient.BeginCreateOrUpdate (CreateAWindowsVmWithPatchSettingsPatchModeAndAssessmentModeSetToAutomaticByPlatform)
- VirtualMachinesClient.BeginCreateOrUpdate (CreateOrUpdateAVmWithCapacityReservation)
- VirtualMachinesClient.BeginDeallocate (VirtualMachineDeallocateMaximumSetGen)
- VirtualMachinesClient.BeginDeallocate (VirtualMachineDeallocateMinimumSetGen)
- VirtualMachinesClient.BeginDelete
- VirtualMachinesClient.BeginInstallPatches
- VirtualMachinesClient.BeginPerformMaintenance (VirtualMachinePerformMaintenanceMaximumSetGen)
- VirtualMachinesClient.BeginPerformMaintenance (VirtualMachinePerformMaintenanceMinimumSetGen)
- VirtualMachinesClient.BeginPowerOff (VirtualMachinePowerOffMaximumSetGen)
- VirtualMachinesClient.BeginPowerOff (VirtualMachinePowerOffMinimumSetGen)
- VirtualMachinesClient.BeginReapply
- VirtualMachinesClient.BeginRedeploy (VirtualMachineRedeployMaximumSetGen)
- VirtualMachinesClient.BeginRedeploy (VirtualMachineRedeployMinimumSetGen)
- VirtualMachinesClient.BeginReimage (ReimageANonEphemeralVirtualMachine)
- VirtualMachinesClient.BeginReimage (ReimageAVirtualMachine)
- VirtualMachinesClient.BeginRestart (VirtualMachineRestartMaximumSetGen)
- VirtualMachinesClient.BeginRestart (VirtualMachineRestartMinimumSetGen)
- VirtualMachinesClient.BeginRunCommand
- VirtualMachinesClient.BeginStart (VirtualMachineStartMaximumSetGen)
- VirtualMachinesClient.BeginStart (VirtualMachineStartMinimumSetGen)
- VirtualMachinesClient.BeginUpdate (UpdateAVmByDetachingDataDisk)
- VirtualMachinesClient.BeginUpdate (UpdateAVmByForceDetachingDataDisk)
- VirtualMachinesClient.Generalize
- VirtualMachinesClient.Get (GetAVirtualMachine)
- VirtualMachinesClient.Get (GetAVirtualMachinePlacedOnADedicatedHostGroupThroughAutomaticPlacement)
- VirtualMachinesClient.Get (GetAVirtualMachineWithDiskControllerTypeProperties)
- VirtualMachinesClient.Get (GetAVirtualMachineWithVmSizeProperties)
- VirtualMachinesClient.InstanceView (GetInstanceViewOfAVirtualMachinePlacedOnADedicatedHostGroupThroughAutomaticPlacement)
- VirtualMachinesClient.InstanceView (GetVirtualMachineInstanceView)
- VirtualMachinesClient.NewListAllPager (VirtualMachineListAllMaximumSetGen)
- VirtualMachinesClient.NewListAllPager (VirtualMachineListAllMinimumSetGen)
- VirtualMachinesClient.NewListAvailableSizesPager
- VirtualMachinesClient.NewListByLocationPager
- VirtualMachinesClient.NewListPager (VirtualMachineListMaximumSetGen)
- VirtualMachinesClient.NewListPager (VirtualMachineListMinimumSetGen)
- VirtualMachinesClient.RetrieveBootDiagnosticsData
- VirtualMachinesClient.SimulateEviction
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 }
APIEntityReference - The API entity reference.
func (APIEntityReference) MarshalJSON ¶
func (a APIEntityReference) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type APIEntityReference.
func (*APIEntityReference) UnmarshalJSON ¶
func (a *APIEntityReference) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type APIEntityReference.
type APIError ¶
type APIError struct { // The error code. Code *string // The Api error details Details []*APIErrorBase // The Api inner error Innererror *InnerError // The error message. Message *string // The target of the particular error. Target *string }
APIError - Api error.
func (APIError) MarshalJSON ¶
MarshalJSON implements the json.Marshaller interface for type APIError.
func (*APIError) UnmarshalJSON ¶
UnmarshalJSON implements the json.Unmarshaller interface for type APIError.
type APIErrorBase ¶
type APIErrorBase struct { // The error code. Code *string // The error message. Message *string // The target of the particular error. Target *string }
APIErrorBase - Api error base.
func (APIErrorBase) MarshalJSON ¶
func (a APIErrorBase) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type APIErrorBase.
func (*APIErrorBase) UnmarshalJSON ¶
func (a *APIErrorBase) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type APIErrorBase.
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 // READ-ONLY; A SAS uri for accessing a VM guest state. SecurityDataAccessSAS *string }
AccessURI - A disk access SAS uri.
func (AccessURI) MarshalJSON ¶
MarshalJSON implements the json.Marshaller interface for type AccessURI.
func (*AccessURI) UnmarshalJSON ¶
UnmarshalJSON implements the json.Unmarshaller interface for type AccessURI.
type AdditionalCapabilities ¶
type AdditionalCapabilities struct { // The flag that enables or disables hibernation capability on the VM. HibernationEnabled *bool // 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 }
AdditionalCapabilities - Enables or disables a capability on the virtual machine or virtual machine scale set.
func (AdditionalCapabilities) MarshalJSON ¶
func (a AdditionalCapabilities) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type AdditionalCapabilities.
func (*AdditionalCapabilities) UnmarshalJSON ¶
func (a *AdditionalCapabilities) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type AdditionalCapabilities.
type AdditionalUnattendContent ¶
type AdditionalUnattendContent struct { // The component name. Currently, the only allowable value is Microsoft-Windows-Shell-Setup. ComponentName *string // 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 // The pass name. Currently, the only allowable value is OobeSystem. PassName *string // Specifies the name of the setting to which the content applies. Possible values are: FirstLogonCommands and AutoLogon. SettingName *SettingNames }
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.
func (AdditionalUnattendContent) MarshalJSON ¶
func (a AdditionalUnattendContent) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type AdditionalUnattendContent.
func (*AdditionalUnattendContent) UnmarshalJSON ¶
func (a *AdditionalUnattendContent) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type AdditionalUnattendContent.
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 AlternativeOption ¶
type AlternativeOption struct { // Describes the type of the alternative option. Type *AlternativeType // Indicates the alternative option value specified by the Publisher. This is the Offer name when the type is Offer or the // Plan name when the type is Plan. Value *string }
AlternativeOption - Describes the alternative option specified by the Publisher for this image when this image is deprecated.
func (AlternativeOption) MarshalJSON ¶
func (a AlternativeOption) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type AlternativeOption.
func (*AlternativeOption) UnmarshalJSON ¶
func (a *AlternativeOption) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type AlternativeOption.
type AlternativeType ¶
type AlternativeType string
AlternativeType - Describes the type of the alternative option.
const ( AlternativeTypeNone AlternativeType = "None" AlternativeTypeOffer AlternativeType = "Offer" AlternativeTypePlan AlternativeType = "Plan" )
func PossibleAlternativeTypeValues ¶
func PossibleAlternativeTypeValues() []AlternativeType
PossibleAlternativeTypeValues returns the possible values for the AlternativeType const type.
type ApplicationProfile ¶
type ApplicationProfile struct { // Specifies the gallery applications that should be made available to the VM/VMSS GalleryApplications []*VMGalleryApplication }
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.
func (*ApplicationProfile) UnmarshalJSON ¶
func (a *ApplicationProfile) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type ApplicationProfile.
type Architecture ¶
type Architecture string
Architecture - The architecture of the image. Applicable to OS disks only.
const ( ArchitectureArm64 Architecture = "Arm64" ArchitectureX64 Architecture = "x64" )
func PossibleArchitectureValues ¶
func PossibleArchitectureValues() []Architecture
PossibleArchitectureValues returns the possible values for the Architecture const type.
type ArchitectureTypes ¶
type ArchitectureTypes string
ArchitectureTypes - Specifies the Architecture Type
const ( ArchitectureTypesArm64 ArchitectureTypes = "Arm64" ArchitectureTypesX64 ArchitectureTypes = "x64" )
func PossibleArchitectureTypesValues ¶
func PossibleArchitectureTypesValues() []ArchitectureTypes
PossibleArchitectureTypesValues returns the possible values for the ArchitectureTypes const type.
type AttachDetachDataDisksRequest ¶ added in v5.4.0
type AttachDetachDataDisksRequest struct { // The list of managed data disks to be attached. DataDisksToAttach []*DataDisksToAttach // The list of managed data disks to be detached. DataDisksToDetach []*DataDisksToDetach }
AttachDetachDataDisksRequest - Specifies the input for attaching and detaching a list of managed data disks.
func (AttachDetachDataDisksRequest) MarshalJSON ¶ added in v5.4.0
func (a AttachDetachDataDisksRequest) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type AttachDetachDataDisksRequest.
func (*AttachDetachDataDisksRequest) UnmarshalJSON ¶ added in v5.4.0
func (a *AttachDetachDataDisksRequest) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type AttachDetachDataDisksRequest.
type AutomaticOSUpgradePolicy ¶
type AutomaticOSUpgradePolicy struct { // Whether OS image rollback feature should be disabled. Default value is false. DisableAutomaticRollback *bool // 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 // Indicates whether Auto OS Upgrade should undergo deferral. Deferred OS upgrades will send advanced notifications on a per-VM // basis that an OS upgrade from rolling upgrades is incoming, via the IMDS // tag 'Platform.PendingOSUpgrade'. The upgrade then defers until the upgrade is approved via an ApproveRollingUpgrade call. OSRollingUpgradeDeferral *bool // 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 }
AutomaticOSUpgradePolicy - The configuration parameters used for performing automatic OS upgrade.
func (AutomaticOSUpgradePolicy) MarshalJSON ¶
func (a AutomaticOSUpgradePolicy) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type AutomaticOSUpgradePolicy.
func (*AutomaticOSUpgradePolicy) UnmarshalJSON ¶
func (a *AutomaticOSUpgradePolicy) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type AutomaticOSUpgradePolicy.
type AutomaticOSUpgradeProperties ¶
type AutomaticOSUpgradeProperties struct { // REQUIRED; Specifies whether automatic OS upgrade is supported on the image. AutomaticOSUpgradeSupported *bool }
AutomaticOSUpgradeProperties - Describes automatic OS upgrade properties on the image.
func (AutomaticOSUpgradeProperties) MarshalJSON ¶
func (a AutomaticOSUpgradeProperties) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type AutomaticOSUpgradeProperties.
func (*AutomaticOSUpgradeProperties) UnmarshalJSON ¶
func (a *AutomaticOSUpgradeProperties) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type AutomaticOSUpgradeProperties.
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 // 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 // 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 }
AutomaticRepairsPolicy - Specifies the configuration parameters for automatic repairs on the virtual machine scale set.
func (AutomaticRepairsPolicy) MarshalJSON ¶
func (a AutomaticRepairsPolicy) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type AutomaticRepairsPolicy.
func (*AutomaticRepairsPolicy) UnmarshalJSON ¶
func (a *AutomaticRepairsPolicy) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type AutomaticRepairsPolicy.
type AvailabilitySet ¶
type AvailabilitySet struct { // REQUIRED; Resource location Location *string // The instance view of a resource. Properties *AvailabilitySetProperties // 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 // Resource tags Tags map[string]*string // READ-ONLY; Resource Id ID *string // READ-ONLY; Resource name Name *string // READ-ONLY; Resource type Type *string }
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 an 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.
func (*AvailabilitySet) UnmarshalJSON ¶
func (a *AvailabilitySet) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type AvailabilitySet.
type AvailabilitySetListResult ¶
type AvailabilitySetListResult struct { // REQUIRED; The list of availability sets Value []*AvailabilitySet // The URI to fetch the next page of AvailabilitySets. Call ListNext() with this URI to fetch the next page of AvailabilitySets. NextLink *string }
AvailabilitySetListResult - The List Availability Set operation response.
func (AvailabilitySetListResult) MarshalJSON ¶
func (a AvailabilitySetListResult) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type AvailabilitySetListResult.
func (*AvailabilitySetListResult) UnmarshalJSON ¶
func (a *AvailabilitySetListResult) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type AvailabilitySetListResult.
type AvailabilitySetProperties ¶
type AvailabilitySetProperties struct { // Fault Domain count. PlatformFaultDomainCount *int32 // Update Domain count. PlatformUpdateDomainCount *int32 // Specifies information about the proximity placement group that the availability set should be assigned to. Minimum api-version: // 2018-04-01. ProximityPlacementGroup *SubResource // A list of references to all virtual machines in the availability set. VirtualMachines []*SubResource // READ-ONLY; The resource status information. Statuses []*InstanceViewStatus }
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.
func (*AvailabilitySetProperties) UnmarshalJSON ¶
func (a *AvailabilitySetProperties) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller 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 // Sku of the availability set SKU *SKU // Resource tags Tags map[string]*string }
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.
func (*AvailabilitySetUpdate) UnmarshalJSON ¶
func (a *AvailabilitySetUpdate) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller 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 2024-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/blob/92de53a5f1e0e03c94b40475d2135d97148ed014/specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-03-01/examples/availabilitySetExamples/AvailabilitySet_Create.json
cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() clientFactory, err := armcompute.NewClientFactory("<subscription-id>", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } res, err := clientFactory.NewAvailabilitySetsClient().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) } // You could use response here. We use blank identifier for just demo purposes. _ = res // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. // res.AvailabilitySet = armcompute.AvailabilitySet{ // Name: to.Ptr("myAvailabilitySet"), // Type: to.Ptr("Microsoft.Compute/availabilitySets"), // ID: to.Ptr("/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/availabilitySets/myAvailabilitySet"), // Location: to.Ptr("westus"), // Properties: &armcompute.AvailabilitySetProperties{ // PlatformFaultDomainCount: to.Ptr[int32](2), // PlatformUpdateDomainCount: to.Ptr[int32](20), // }, // SKU: &armcompute.SKU{ // Name: to.Ptr("Classic"), // }, // }
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 2024-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 (AvailabilitySetDeleteMaximumSetGen) ¶
Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/92de53a5f1e0e03c94b40475d2135d97148ed014/specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-03-01/examples/availabilitySetExamples/AvailabilitySet_Delete_MaximumSet_Gen.json
cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() clientFactory, err := armcompute.NewClientFactory("<subscription-id>", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } _, err = clientFactory.NewAvailabilitySetsClient().Delete(ctx, "rgcompute", "aaaaaaaaaaaaaaaaaaaa", nil) if err != nil { log.Fatalf("failed to finish the request: %v", err) }
Output:
Example (AvailabilitySetDeleteMinimumSetGen) ¶
Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/92de53a5f1e0e03c94b40475d2135d97148ed014/specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-03-01/examples/availabilitySetExamples/AvailabilitySet_Delete_MinimumSet_Gen.json
cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() clientFactory, err := armcompute.NewClientFactory("<subscription-id>", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } _, err = clientFactory.NewAvailabilitySetsClient().Delete(ctx, "rgcompute", "aaaaaaaaaaa", 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 2024-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 (AvailabilitySetGetMaximumSetGen) ¶
Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/92de53a5f1e0e03c94b40475d2135d97148ed014/specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-03-01/examples/availabilitySetExamples/AvailabilitySet_Get_MaximumSet_Gen.json
cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() clientFactory, err := armcompute.NewClientFactory("<subscription-id>", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } res, err := clientFactory.NewAvailabilitySetsClient().Get(ctx, "rgcompute", "aaaaaaaaaaaa", nil) if err != nil { log.Fatalf("failed to finish the request: %v", err) } // You could use response here. We use blank identifier for just demo purposes. _ = res // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. // res.AvailabilitySet = armcompute.AvailabilitySet{ // Name: to.Ptr("myAvailabilitySet"), // Type: to.Ptr("Microsoft.Compute/availabilitySets"), // ID: to.Ptr("/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/availabilitySets/myAvailabilitySet"), // Location: to.Ptr("westus"), // Tags: map[string]*string{ // "key2505": to.Ptr("aa"), // "key9626": to.Ptr("aaaaaaaaaaaaaaaaaaaa"), // }, // 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}"), // }, // Statuses: []*armcompute.InstanceViewStatus{ // { // Code: to.Ptr("aaaaaaaaaaaaaaaaaaaaaaa"), // DisplayStatus: to.Ptr("aaaaaa"), // Level: to.Ptr(armcompute.StatusLevelTypesInfo), // Message: to.Ptr("a"), // Time: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-11-30T12:58:26.522Z"); return t}()), // }}, // VirtualMachines: []*armcompute.SubResource{ // { // ID: to.Ptr("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/availabilitySets/{availabilitySetName}"), // }}, // }, // SKU: &armcompute.SKU{ // Name: to.Ptr("Classic"), // Capacity: to.Ptr[int64](29), // Tier: to.Ptr("aaaaaaaaaaaaaa"), // }, // }
Output:
Example (AvailabilitySetGetMinimumSetGen) ¶
Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/92de53a5f1e0e03c94b40475d2135d97148ed014/specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-03-01/examples/availabilitySetExamples/AvailabilitySet_Get_MinimumSet_Gen.json
cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() clientFactory, err := armcompute.NewClientFactory("<subscription-id>", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } res, err := clientFactory.NewAvailabilitySetsClient().Get(ctx, "rgcompute", "aaaaaaaaaaaaaaaaaaaa", nil) if err != nil { log.Fatalf("failed to finish the request: %v", err) } // You could use response here. We use blank identifier for just demo purposes. _ = res // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. // res.AvailabilitySet = armcompute.AvailabilitySet{ // ID: to.Ptr("/subscriptions/{subscription-id}/resourceGroups/rgcompute/providers/Microsoft.Compute/availabilitySets/myAvailabilitySet"), // Location: to.Ptr("westus"), // }
Output:
func (*AvailabilitySetsClient) NewListAvailableSizesPager ¶
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.
Generated from API version 2024-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.NewListAvailableSizesPager method.
Example (AvailabilitySetListAvailableSizesMaximumSetGen) ¶
Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/92de53a5f1e0e03c94b40475d2135d97148ed014/specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-03-01/examples/availabilitySetExamples/AvailabilitySet_ListAvailableSizes_MaximumSet_Gen.json
cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() clientFactory, err := armcompute.NewClientFactory("<subscription-id>", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } pager := clientFactory.NewAvailabilitySetsClient().NewListAvailableSizesPager("rgcompute", "aaaaaaaaaaaaaaaaaaaa", nil) for pager.More() { page, err := pager.NextPage(ctx) if err != nil { log.Fatalf("failed to advance page: %v", err) } for _, v := range page.Value { // You could use page here. We use blank identifier for just demo purposes. _ = v } // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. // page.VirtualMachineSizeListResult = armcompute.VirtualMachineSizeListResult{ // Value: []*armcompute.VirtualMachineSize{ // { // Name: to.Ptr("Standard_A1_V2"), // MaxDataDiskCount: to.Ptr[int32](2), // MemoryInMB: to.Ptr[int32](2048), // NumberOfCores: to.Ptr[int32](1), // OSDiskSizeInMB: to.Ptr[int32](1047552), // ResourceDiskSizeInMB: to.Ptr[int32](10240), // }, // { // Name: to.Ptr("Standard_A2_V2"), // MaxDataDiskCount: to.Ptr[int32](4), // MemoryInMB: to.Ptr[int32](4096), // NumberOfCores: to.Ptr[int32](2), // OSDiskSizeInMB: to.Ptr[int32](1047552), // ResourceDiskSizeInMB: to.Ptr[int32](20480), // }}, // } }
Output:
Example (AvailabilitySetListAvailableSizesMinimumSetGen) ¶
Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/92de53a5f1e0e03c94b40475d2135d97148ed014/specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-03-01/examples/availabilitySetExamples/AvailabilitySet_ListAvailableSizes_MinimumSet_Gen.json
cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() clientFactory, err := armcompute.NewClientFactory("<subscription-id>", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } pager := clientFactory.NewAvailabilitySetsClient().NewListAvailableSizesPager("rgcompute", "aa", nil) for pager.More() { page, err := pager.NextPage(ctx) if err != nil { log.Fatalf("failed to advance page: %v", err) } for _, v := range page.Value { // You could use page here. We use blank identifier for just demo purposes. _ = v } // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. // page.VirtualMachineSizeListResult = armcompute.VirtualMachineSizeListResult{ // } }
Output:
func (*AvailabilitySetsClient) NewListBySubscriptionPager ¶
func (client *AvailabilitySetsClient) NewListBySubscriptionPager(options *AvailabilitySetsClientListBySubscriptionOptions) *runtime.Pager[AvailabilitySetsClientListBySubscriptionResponse]
NewListBySubscriptionPager - Lists all availability sets in a subscription.
Generated from API version 2024-03-01
- options - AvailabilitySetsClientListBySubscriptionOptions contains the optional parameters for the AvailabilitySetsClient.NewListBySubscriptionPager method.
Example ¶
Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/92de53a5f1e0e03c94b40475d2135d97148ed014/specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-03-01/examples/availabilitySetExamples/AvailabilitySet_ListBySubscription.json
cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() clientFactory, err := armcompute.NewClientFactory("<subscription-id>", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } pager := clientFactory.NewAvailabilitySetsClient().NewListBySubscriptionPager(&armcompute.AvailabilitySetsClientListBySubscriptionOptions{Expand: to.Ptr("virtualMachines\\$ref")}) for pager.More() { page, err := pager.NextPage(ctx) if err != nil { log.Fatalf("failed to advance page: %v", err) } for _, v := range page.Value { // You could use page here. We use blank identifier for just demo purposes. _ = v } // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. // page.AvailabilitySetListResult = armcompute.AvailabilitySetListResult{ // Value: []*armcompute.AvailabilitySet{ // { // Name: to.Ptr("{availabilitySetName}"), // Type: to.Ptr("Microsoft.Compute/availabilitySets"), // ID: to.Ptr("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/availabilitySets/{availabilitySetName}"), // Location: to.Ptr("australiasoutheast"), // Properties: &armcompute.AvailabilitySetProperties{ // PlatformFaultDomainCount: to.Ptr[int32](3), // PlatformUpdateDomainCount: to.Ptr[int32](5), // VirtualMachines: []*armcompute.SubResource{ // { // ID: to.Ptr("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachines/{vmName}"), // }}, // }, // SKU: &armcompute.SKU{ // Name: to.Ptr("Classic"), // }, // }, // { // Name: to.Ptr("{availabilitySetName}"), // Type: to.Ptr("Microsoft.Compute/availabilitySets"), // ID: to.Ptr("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/availabilitySets/{availabilitySetName}"), // Location: to.Ptr("australiasoutheast"), // Properties: &armcompute.AvailabilitySetProperties{ // PlatformFaultDomainCount: to.Ptr[int32](3), // PlatformUpdateDomainCount: to.Ptr[int32](5), // VirtualMachines: []*armcompute.SubResource{ // { // ID: to.Ptr("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachines/{vmName}"), // }}, // }, // SKU: &armcompute.SKU{ // Name: to.Ptr("Classic"), // }, // }, // { // Name: to.Ptr("{availabilitySetName}"), // Type: to.Ptr("Microsoft.Compute/availabilitySets"), // ID: to.Ptr("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/availabilitySets/{availabilitySetName}"), // Location: to.Ptr("westcentralus"), // Tags: map[string]*string{ // "{tagName}": to.Ptr("{tagValue}"), // }, // Properties: &armcompute.AvailabilitySetProperties{ // PlatformFaultDomainCount: to.Ptr[int32](3), // PlatformUpdateDomainCount: to.Ptr[int32](5), // VirtualMachines: []*armcompute.SubResource{ // }, // }, // SKU: &armcompute.SKU{ // Name: to.Ptr("Classic"), // }, // }, // { // Name: to.Ptr("{availabilitySetName}"), // Type: to.Ptr("Microsoft.Compute/availabilitySets"), // ID: to.Ptr("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/availabilitySets/{availabilitySetName}"), // Location: to.Ptr("westcentralus"), // Tags: map[string]*string{ // "{tagName}": to.Ptr("{tagValue}"), // }, // Properties: &armcompute.AvailabilitySetProperties{ // PlatformFaultDomainCount: to.Ptr[int32](3), // PlatformUpdateDomainCount: to.Ptr[int32](5), // VirtualMachines: []*armcompute.SubResource{ // }, // }, // SKU: &armcompute.SKU{ // Name: to.Ptr("Classic"), // }, // }}, // } }
Output:
func (*AvailabilitySetsClient) NewListPager ¶
func (client *AvailabilitySetsClient) NewListPager(resourceGroupName string, options *AvailabilitySetsClientListOptions) *runtime.Pager[AvailabilitySetsClientListResponse]
NewListPager - Lists all availability sets in a resource group.
Generated from API version 2024-03-01
- resourceGroupName - The name of the resource group.
- options - AvailabilitySetsClientListOptions contains the optional parameters for the AvailabilitySetsClient.NewListPager method.
Example (AvailabilitySetListMaximumSetGen) ¶
Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/92de53a5f1e0e03c94b40475d2135d97148ed014/specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-03-01/examples/availabilitySetExamples/AvailabilitySet_List_MaximumSet_Gen.json
cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() clientFactory, err := armcompute.NewClientFactory("<subscription-id>", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } pager := clientFactory.NewAvailabilitySetsClient().NewListPager("rgcompute", nil) for pager.More() { page, err := pager.NextPage(ctx) if err != nil { log.Fatalf("failed to advance page: %v", err) } for _, v := range page.Value { // You could use page here. We use blank identifier for just demo purposes. _ = v } // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. // page.AvailabilitySetListResult = armcompute.AvailabilitySetListResult{ // Value: []*armcompute.AvailabilitySet{ // { // Name: to.Ptr("{availabilitySetName}"), // Type: to.Ptr("Microsoft.Compute/availabilitySets"), // ID: to.Ptr("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/availabilitySets/{availabilitySetName}"), // Location: to.Ptr("australiasoutheast"), // Tags: map[string]*string{ // "key2039": to.Ptr("aaaaaaaaaaaaa"), // }, // Properties: &armcompute.AvailabilitySetProperties{ // PlatformFaultDomainCount: to.Ptr[int32](3), // PlatformUpdateDomainCount: to.Ptr[int32](5), // ProximityPlacementGroup: &armcompute.SubResource{ // ID: to.Ptr("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/availabilitySets/{availabilitySetName}"), // }, // Statuses: []*armcompute.InstanceViewStatus{ // { // Code: to.Ptr("aaaaaaaaaaaaaaa"), // DisplayStatus: to.Ptr("aaaaaaaaaaa"), // Level: to.Ptr(armcompute.StatusLevelTypesInfo), // Message: to.Ptr("aaaaaa"), // Time: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-11-30T13:39:56.427Z"); return t}()), // }}, // VirtualMachines: []*armcompute.SubResource{ // { // ID: to.Ptr("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachines/{vmName}"), // }}, // }, // SKU: &armcompute.SKU{ // Name: to.Ptr("Classic"), // Capacity: to.Ptr[int64](22), // Tier: to.Ptr("aaaaaaaaaaaaaaaaaaaaaaa"), // }, // }, // { // Name: to.Ptr("{availabilitySetName}"), // Type: to.Ptr("Microsoft.Compute/availabilitySets"), // ID: to.Ptr("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/availabilitySets/{availabilitySetName}"), // Location: to.Ptr("australiasoutheast"), // Tags: map[string]*string{ // "key5849": to.Ptr("aaaaaaaaaaaaaaa"), // }, // Properties: &armcompute.AvailabilitySetProperties{ // PlatformFaultDomainCount: to.Ptr[int32](3), // PlatformUpdateDomainCount: to.Ptr[int32](5), // ProximityPlacementGroup: &armcompute.SubResource{ // ID: to.Ptr("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/availabilitySets/{availabilitySetName}"), // }, // Statuses: []*armcompute.InstanceViewStatus{ // { // Code: to.Ptr("aaaaaaaaaaaaaaa"), // DisplayStatus: to.Ptr("aaaaaaaaaaa"), // Level: to.Ptr(armcompute.StatusLevelTypesInfo), // Message: to.Ptr("aaaaaa"), // Time: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-11-30T13:39:56.427Z"); return t}()), // }}, // VirtualMachines: []*armcompute.SubResource{ // { // ID: to.Ptr("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachines/{vmName}"), // }}, // }, // SKU: &armcompute.SKU{ // Name: to.Ptr("Classic"), // Capacity: to.Ptr[int64](23), // Tier: to.Ptr("aaaaaaaaaaaaaaaaaaaaaaaaaaaa"), // }, // }, // { // Name: to.Ptr("{availabilitySetName}"), // Type: to.Ptr("Microsoft.Compute/availabilitySets"), // ID: to.Ptr("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/availabilitySets/{availabilitySetName}"), // Location: to.Ptr("westcentralus"), // Tags: map[string]*string{ // }, // Properties: &armcompute.AvailabilitySetProperties{ // PlatformFaultDomainCount: to.Ptr[int32](3), // PlatformUpdateDomainCount: to.Ptr[int32](5), // ProximityPlacementGroup: &armcompute.SubResource{ // ID: to.Ptr("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/availabilitySets/{availabilitySetName}"), // }, // Statuses: []*armcompute.InstanceViewStatus{ // { // Code: to.Ptr("aaaaaaaaaaaaaaa"), // DisplayStatus: to.Ptr("aaaaaaaaaaa"), // Level: to.Ptr(armcompute.StatusLevelTypesInfo), // Message: to.Ptr("aaaaaa"), // Time: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-11-30T13:39:56.427Z"); return t}()), // }}, // VirtualMachines: []*armcompute.SubResource{ // }, // }, // SKU: &armcompute.SKU{ // Name: to.Ptr("Classic"), // Capacity: to.Ptr[int64](26), // Tier: to.Ptr("aaaaaaaaaaaaaaaaaaaaa"), // }, // }, // { // Name: to.Ptr("{availabilitySetName}"), // Type: to.Ptr("Microsoft.Compute/availabilitySets"), // ID: to.Ptr("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/availabilitySets/{availabilitySetName}"), // Location: to.Ptr("westcentralus"), // Tags: map[string]*string{ // }, // Properties: &armcompute.AvailabilitySetProperties{ // PlatformFaultDomainCount: to.Ptr[int32](3), // PlatformUpdateDomainCount: to.Ptr[int32](5), // ProximityPlacementGroup: &armcompute.SubResource{ // ID: to.Ptr("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/availabilitySets/{availabilitySetName}"), // }, // Statuses: []*armcompute.InstanceViewStatus{ // { // Code: to.Ptr("aaaaaaaaaaaaaaa"), // DisplayStatus: to.Ptr("aaaaaaaaaaa"), // Level: to.Ptr(armcompute.StatusLevelTypesInfo), // Message: to.Ptr("aaaaaa"), // Time: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-11-30T13:39:56.427Z"); return t}()), // }}, // VirtualMachines: []*armcompute.SubResource{ // }, // }, // SKU: &armcompute.SKU{ // Name: to.Ptr("Classic"), // Capacity: to.Ptr[int64](6), // Tier: to.Ptr("aaaaaaaaaaaaaaaaaa"), // }, // }}, // } }
Output:
Example (AvailabilitySetListMinimumSetGen) ¶
Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/92de53a5f1e0e03c94b40475d2135d97148ed014/specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-03-01/examples/availabilitySetExamples/AvailabilitySet_List_MinimumSet_Gen.json
cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() clientFactory, err := armcompute.NewClientFactory("<subscription-id>", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } pager := clientFactory.NewAvailabilitySetsClient().NewListPager("rgcompute", nil) for pager.More() { page, err := pager.NextPage(ctx) if err != nil { log.Fatalf("failed to advance page: %v", err) } for _, v := range page.Value { // You could use page here. We use blank identifier for just demo purposes. _ = v } // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. // page.AvailabilitySetListResult = armcompute.AvailabilitySetListResult{ // Value: []*armcompute.AvailabilitySet{ // { // ID: to.Ptr("/subscriptions/{subscription-id}/resourceGroups/rgcompute/providers/Microsoft.Compute/availabilitySets/myAvailabilitySet1"), // Location: to.Ptr("australiasoutheast"), // }, // { // ID: to.Ptr("/subscriptions/{subscription-id}/resourceGroups/rgcompute/providers/Microsoft.Compute/availabilitySets/myAvailabilitySet2"), // Location: to.Ptr("australiasoutheast"), // }, // { // ID: to.Ptr("/subscriptions/{subscription-id}/resourceGroups/rgcompute/providers/Microsoft.Compute/availabilitySets/myAvailabilitySet3"), // Location: to.Ptr("westcentralus"), // }, // { // ID: to.Ptr("/subscriptions/{subscription-id}/resourceGroups/rgcompute/providers/Microsoft.Compute/availabilitySets/myAvailabilitySet4"), // Location: to.Ptr("westcentralus"), // }}, // } }
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 2024-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 (AvailabilitySetUpdateMaximumSetGen) ¶
Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/92de53a5f1e0e03c94b40475d2135d97148ed014/specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-03-01/examples/availabilitySetExamples/AvailabilitySet_Update_MaximumSet_Gen.json
cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() clientFactory, err := armcompute.NewClientFactory("<subscription-id>", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } res, err := clientFactory.NewAvailabilitySetsClient().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) } // You could use response here. We use blank identifier for just demo purposes. _ = res // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. // res.AvailabilitySet = armcompute.AvailabilitySet{ // Name: to.Ptr("myAvailabilitySet"), // Type: to.Ptr("Microsoft.Compute/availabilitySets"), // ID: to.Ptr("/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/availabilitySets/myAvailabilitySet"), // Location: to.Ptr("westus"), // Tags: map[string]*string{ // "key2505": to.Ptr("aa"), // "key9626": to.Ptr("aaaaaaaaaaaaaaaaaaaa"), // }, // 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}"), // }, // Statuses: []*armcompute.InstanceViewStatus{ // { // Code: to.Ptr("aaaaaaaaaaaaaaaaaaaaaaa"), // DisplayStatus: to.Ptr("aaaaaa"), // Level: to.Ptr(armcompute.StatusLevelTypesInfo), // Message: to.Ptr("a"), // Time: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-11-30T12:58:26.522Z"); return t}()), // }}, // VirtualMachines: []*armcompute.SubResource{ // { // ID: to.Ptr("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/availabilitySets/{availabilitySetName}"), // }}, // }, // SKU: &armcompute.SKU{ // Name: to.Ptr("Classic"), // Capacity: to.Ptr[int64](29), // Tier: to.Ptr("aaaaaaaaaaaaaa"), // }, // }
Output:
Example (AvailabilitySetUpdateMinimumSetGen) ¶
Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/92de53a5f1e0e03c94b40475d2135d97148ed014/specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-03-01/examples/availabilitySetExamples/AvailabilitySet_Update_MinimumSet_Gen.json
cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() clientFactory, err := armcompute.NewClientFactory("<subscription-id>", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } res, err := clientFactory.NewAvailabilitySetsClient().Update(ctx, "rgcompute", "aaaaaaaaaaaaaaaaaaaa", armcompute.AvailabilitySetUpdate{}, nil) if err != nil { log.Fatalf("failed to finish the request: %v", err) } // You could use response here. We use blank identifier for just demo purposes. _ = res // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. // res.AvailabilitySet = armcompute.AvailabilitySet{ // Location: to.Ptr("westus"), // }
Output:
type AvailabilitySetsClientCreateOrUpdateOptions ¶
type AvailabilitySetsClientCreateOrUpdateOptions struct { }
AvailabilitySetsClientCreateOrUpdateOptions contains the optional parameters for the AvailabilitySetsClient.CreateOrUpdate method.
type AvailabilitySetsClientCreateOrUpdateResponse ¶
type AvailabilitySetsClientCreateOrUpdateResponse struct { // 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 an availability set at creation time. An existing VM cannot be added to an availability // set. AvailabilitySet }
AvailabilitySetsClientCreateOrUpdateResponse contains the response from method AvailabilitySetsClient.CreateOrUpdate.
type AvailabilitySetsClientDeleteOptions ¶
type AvailabilitySetsClientDeleteOptions struct { }
AvailabilitySetsClientDeleteOptions contains the optional parameters for the AvailabilitySetsClient.Delete method.
type AvailabilitySetsClientDeleteResponse ¶
type AvailabilitySetsClientDeleteResponse struct { }
AvailabilitySetsClientDeleteResponse contains the response from method AvailabilitySetsClient.Delete.
type AvailabilitySetsClientGetOptions ¶
type AvailabilitySetsClientGetOptions struct { }
AvailabilitySetsClientGetOptions contains the optional parameters for the AvailabilitySetsClient.Get method.
type AvailabilitySetsClientGetResponse ¶
type AvailabilitySetsClientGetResponse struct { // 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 an availability set at creation time. An existing VM cannot be added to an availability // set. AvailabilitySet }
AvailabilitySetsClientGetResponse contains the response from method AvailabilitySetsClient.Get.
type AvailabilitySetsClientListAvailableSizesOptions ¶
type AvailabilitySetsClientListAvailableSizesOptions struct { }
AvailabilitySetsClientListAvailableSizesOptions contains the optional parameters for the AvailabilitySetsClient.NewListAvailableSizesPager method.
type AvailabilitySetsClientListAvailableSizesResponse ¶
type AvailabilitySetsClientListAvailableSizesResponse struct { // The List Virtual Machine operation response. VirtualMachineSizeListResult }
AvailabilitySetsClientListAvailableSizesResponse contains the response from method AvailabilitySetsClient.NewListAvailableSizesPager.
type AvailabilitySetsClientListBySubscriptionOptions ¶
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.NewListBySubscriptionPager method.
type AvailabilitySetsClientListBySubscriptionResponse ¶
type AvailabilitySetsClientListBySubscriptionResponse struct { // The List Availability Set operation response. AvailabilitySetListResult }
AvailabilitySetsClientListBySubscriptionResponse contains the response from method AvailabilitySetsClient.NewListBySubscriptionPager.
type AvailabilitySetsClientListOptions ¶
type AvailabilitySetsClientListOptions struct { }
AvailabilitySetsClientListOptions contains the optional parameters for the AvailabilitySetsClient.NewListPager method.
type AvailabilitySetsClientListResponse ¶
type AvailabilitySetsClientListResponse struct { // The List Availability Set operation response. AvailabilitySetListResult }
AvailabilitySetsClientListResponse contains the response from method AvailabilitySetsClient.NewListPager.
type AvailabilitySetsClientUpdateOptions ¶
type AvailabilitySetsClientUpdateOptions struct { }
AvailabilitySetsClientUpdateOptions contains the optional parameters for the AvailabilitySetsClient.Update method.
type AvailabilitySetsClientUpdateResponse ¶
type AvailabilitySetsClientUpdateResponse struct { // 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 an availability set at creation time. An existing VM cannot be added to an availability // set. 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 // READ-ONLY; The number of critical or security patches that have been detected as available and not yet installed. CriticalAndSecurityPatchCount *int32 // READ-ONLY; The errors that were encountered during execution of the operation. The details array contains the list of them. Error *APIError // READ-ONLY; The UTC timestamp when the operation began. LastModifiedTime *time.Time // READ-ONLY; The number of all available patches excluding critical and security. OtherPatchCount *int32 // 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 // READ-ONLY; The UTC timestamp when the operation began. StartTime *time.Time // READ-ONLY; The overall success or failure status of the operation. It remains "InProgress" until the operation completes. // At that point it will become "Unknown", "Failed", "Succeeded", or // "CompletedWithWarnings." Status *PatchOperationStatus }
AvailablePatchSummary - Describes the properties of an virtual machine instance view for available patch summary.
func (AvailablePatchSummary) MarshalJSON ¶
func (a AvailablePatchSummary) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type AvailablePatchSummary.
func (*AvailablePatchSummary) UnmarshalJSON ¶
func (a *AvailablePatchSummary) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type AvailablePatchSummary.
type BillingProfile ¶
type BillingProfile struct { // Specifies the maximum price you are willing to pay for a Azure Spot VM/VMSS. This price is in US Dollars. // This price will be compared with the current Azure Spot price for the VM size. Also, the prices are compared at the time // of create/update of Azure Spot VM/VMSS and the operation will only succeed if // the maxPrice is greater than the current Azure Spot price. // The maxPrice will also be used for evicting a Azure Spot VM/VMSS if the current Azure Spot price goes beyond the maxPrice // after creation of VM/VMSS. // Possible values are: // - Any decimal value greater than zero. Example: 0.01538 // -1 – indicates default price to be up-to on-demand. // You can set the maxPrice to -1 to indicate that the Azure Spot VM/VMSS should not be evicted for price reasons. Also, the // default max price is -1 if it is not provided by you. // Minimum api-version: 2019-03-01. MaxPrice *float64 }
BillingProfile - Specifies the billing related details of a Azure Spot VM or VMSS. Minimum api-version: 2019-03-01.
func (BillingProfile) MarshalJSON ¶
func (b BillingProfile) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type BillingProfile.
func (*BillingProfile) UnmarshalJSON ¶
func (b *BillingProfile) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type BillingProfile.
type BootDiagnostics ¶
type BootDiagnostics struct { // Whether boot diagnostics should be enabled on the Virtual Machine. Enabled *bool // Uri of the storage account to use for placing the console output and screenshot. If storageUri is not specified while enabling // boot diagnostics, managed storage will be used. StorageURI *string }
BootDiagnostics - Boot Diagnostics is a debugging feature which allows you to view Console Output and Screenshot to diagnose VM status. You can easily view the output of your console log. Azure also enables you to see a screenshot of the VM from the hypervisor.
func (BootDiagnostics) MarshalJSON ¶
func (b BootDiagnostics) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type BootDiagnostics.
func (*BootDiagnostics) UnmarshalJSON ¶
func (b *BootDiagnostics) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type BootDiagnostics.
type BootDiagnosticsInstanceView ¶
type BootDiagnosticsInstanceView struct { // READ-ONLY; The console screenshot blob URI. Note: This will not be set if boot diagnostics is currently enabled with managed // storage. ConsoleScreenshotBlobURI *string // READ-ONLY; The serial console log blob Uri. Note: This will not be set if boot diagnostics is currently enabled with managed // storage. SerialConsoleLogBlobURI *string // READ-ONLY; The boot diagnostics status information for the VM. Note: It will be set only if there are errors encountered // in enabling boot diagnostics. Status *InstanceViewStatus }
BootDiagnosticsInstanceView - The instance view of a virtual machine boot diagnostics.
func (BootDiagnosticsInstanceView) MarshalJSON ¶
func (b BootDiagnosticsInstanceView) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type BootDiagnosticsInstanceView.
func (*BootDiagnosticsInstanceView) UnmarshalJSON ¶
func (b *BootDiagnosticsInstanceView) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type BootDiagnosticsInstanceView.
type CachingTypes ¶
type CachingTypes string
CachingTypes - Specifies the caching requirements. Possible values are: None, ReadOnly, ReadWrite. The default values are: None for Standard storage. ReadOnly for Premium storage
const ( CachingTypesNone CachingTypes = "None" CachingTypesReadOnly CachingTypes = "ReadOnly" CachingTypesReadWrite CachingTypes = "ReadWrite" )
func PossibleCachingTypesValues ¶
func PossibleCachingTypesValues() []CachingTypes
PossibleCachingTypesValues returns the possible values for the CachingTypes const type.
type CapacityReservation ¶
type CapacityReservation struct { // REQUIRED; Resource location Location *string // REQUIRED; SKU of the resource for which capacity needs be reserved. The SKU name and capacity is required to be set. Currently // VM Skus with the capability called 'CapacityReservationSupported' set to true are // supported. Refer to List Microsoft.Compute SKUs in a region (https://docs.microsoft.com/rest/api/compute/resourceskus/list) // for supported values. SKU *SKU // Properties of the Capacity reservation. Properties *CapacityReservationProperties // Resource tags Tags map[string]*string // Availability Zone to use for this capacity reservation. The zone has to be single value and also should be part for the // list of zones specified during the capacity reservation group creation. The zone // can be assigned only during creation. If not provided, the reservation supports only non-zonal deployments. If provided, // enforces VM/VMSS using this capacity reservation to be in same zone. Zones []*string // READ-ONLY; Resource Id ID *string // READ-ONLY; Resource name Name *string // READ-ONLY; Resource type Type *string }
CapacityReservation - Specifies information about the capacity reservation.
func (CapacityReservation) MarshalJSON ¶
func (c CapacityReservation) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type CapacityReservation.
func (*CapacityReservation) UnmarshalJSON ¶
func (c *CapacityReservation) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type CapacityReservation.
type CapacityReservationGroup ¶
type CapacityReservationGroup struct { // REQUIRED; Resource location Location *string // capacity reservation group Properties. Properties *CapacityReservationGroupProperties // Resource tags Tags map[string]*string // Availability Zones to use for this capacity reservation group. The zones can be assigned only during creation. If not provided, // the group supports only regional resources in the region. If provided, // enforces each capacity reservation in the group to be in one of the zones. Zones []*string // READ-ONLY; Resource Id ID *string // READ-ONLY; Resource name Name *string // READ-ONLY; Resource type Type *string }
CapacityReservationGroup - Specifies information about the capacity reservation group that the capacity reservations should be assigned to. Currently, a capacity reservation can only be added to a capacity reservation group at creation time. An existing capacity reservation cannot be added or moved to another capacity reservation group.
func (CapacityReservationGroup) MarshalJSON ¶
func (c CapacityReservationGroup) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type CapacityReservationGroup.
func (*CapacityReservationGroup) UnmarshalJSON ¶
func (c *CapacityReservationGroup) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type CapacityReservationGroup.
type CapacityReservationGroupInstanceView ¶
type CapacityReservationGroupInstanceView struct { // READ-ONLY; List of instance view of the capacity reservations under the capacity reservation group. CapacityReservations []*CapacityReservationInstanceViewWithName // Please refer to https://aka.ms/computereservationsharing for more details. SharedSubscriptionIDs []*SubResourceReadOnly }
func (CapacityReservationGroupInstanceView) MarshalJSON ¶
func (c CapacityReservationGroupInstanceView) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type CapacityReservationGroupInstanceView.
func (*CapacityReservationGroupInstanceView) UnmarshalJSON ¶
func (c *CapacityReservationGroupInstanceView) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type CapacityReservationGroupInstanceView.
type CapacityReservationGroupInstanceViewTypes ¶
type CapacityReservationGroupInstanceViewTypes string
const (
CapacityReservationGroupInstanceViewTypesInstanceView CapacityReservationGroupInstanceViewTypes = "instanceView"
)
func PossibleCapacityReservationGroupInstanceViewTypesValues ¶
func PossibleCapacityReservationGroupInstanceViewTypesValues() []CapacityReservationGroupInstanceViewTypes
PossibleCapacityReservationGroupInstanceViewTypesValues returns the possible values for the CapacityReservationGroupInstanceViewTypes const type.
type CapacityReservationGroupListResult ¶
type CapacityReservationGroupListResult struct { // REQUIRED; The list of capacity reservation groups Value []*CapacityReservationGroup // The URI to fetch the next page of capacity reservation groups. Call ListNext() with this URI to fetch the next page of // capacity reservation groups. NextLink *string }
CapacityReservationGroupListResult - The List capacity reservation group with resource group response.
func (CapacityReservationGroupListResult) MarshalJSON ¶
func (c CapacityReservationGroupListResult) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type CapacityReservationGroupListResult.
func (*CapacityReservationGroupListResult) UnmarshalJSON ¶
func (c *CapacityReservationGroupListResult) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type CapacityReservationGroupListResult.
type CapacityReservationGroupProperties ¶
type CapacityReservationGroupProperties struct { // Specifies the settings to enable sharing across subscriptions for the capacity reservation group resource. Pls. keep in // mind the capacity reservation group resource generally can be shared across // subscriptions belonging to a single azure AAD tenant or cross AAD tenant if there is a trust relationship established between // the AAD tenants. Note: Minimum api-version: 2024-03-01. Please refer to // https://aka.ms/computereservationsharing for more details. SharingProfile *ResourceSharingProfile // READ-ONLY; A list of all capacity reservation resource ids that belong to capacity reservation group. CapacityReservations []*SubResourceReadOnly // READ-ONLY; The capacity reservation group instance view which has the list of instance views for all the capacity reservations // that belong to the capacity reservation group. InstanceView *CapacityReservationGroupInstanceView // READ-ONLY; A list of references to all virtual machines associated to the capacity reservation group. VirtualMachinesAssociated []*SubResourceReadOnly }
CapacityReservationGroupProperties - capacity reservation group Properties.
func (CapacityReservationGroupProperties) MarshalJSON ¶
func (c CapacityReservationGroupProperties) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type CapacityReservationGroupProperties.
func (*CapacityReservationGroupProperties) UnmarshalJSON ¶
func (c *CapacityReservationGroupProperties) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type CapacityReservationGroupProperties.
type CapacityReservationGroupUpdate ¶
type CapacityReservationGroupUpdate struct { // capacity reservation group Properties. Properties *CapacityReservationGroupProperties // Resource tags Tags map[string]*string }
CapacityReservationGroupUpdate - Specifies information about the capacity reservation group. Only tags can be updated.
func (CapacityReservationGroupUpdate) MarshalJSON ¶
func (c CapacityReservationGroupUpdate) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type CapacityReservationGroupUpdate.
func (*CapacityReservationGroupUpdate) UnmarshalJSON ¶
func (c *CapacityReservationGroupUpdate) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type CapacityReservationGroupUpdate.
type CapacityReservationGroupsClient ¶
type CapacityReservationGroupsClient struct {
// contains filtered or unexported fields
}
CapacityReservationGroupsClient contains the methods for the CapacityReservationGroups group. Don't use this type directly, use NewCapacityReservationGroupsClient() instead.
func NewCapacityReservationGroupsClient ¶
func NewCapacityReservationGroupsClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*CapacityReservationGroupsClient, error)
NewCapacityReservationGroupsClient creates a new instance of CapacityReservationGroupsClient 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 (*CapacityReservationGroupsClient) CreateOrUpdate ¶
func (client *CapacityReservationGroupsClient) CreateOrUpdate(ctx context.Context, resourceGroupName string, capacityReservationGroupName string, parameters CapacityReservationGroup, options *CapacityReservationGroupsClientCreateOrUpdateOptions) (CapacityReservationGroupsClientCreateOrUpdateResponse, error)
CreateOrUpdate - The operation to create or update a capacity reservation group. When updating a capacity reservation group, only tags and sharing profile may be modified. Please refer to https://aka.ms/CapacityReservation for more details. If the operation fails it returns an *azcore.ResponseError type.
Generated from API version 2024-03-01
- resourceGroupName - The name of the resource group.
- capacityReservationGroupName - The name of the capacity reservation group.
- parameters - Parameters supplied to the Create capacity reservation Group.
- options - CapacityReservationGroupsClientCreateOrUpdateOptions contains the optional parameters for the CapacityReservationGroupsClient.CreateOrUpdate method.
Example ¶
Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/92de53a5f1e0e03c94b40475d2135d97148ed014/specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-03-01/examples/capacityReservationExamples/CapacityReservationGroup_CreateOrUpdate.json
cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() clientFactory, err := armcompute.NewClientFactory("<subscription-id>", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } res, err := clientFactory.NewCapacityReservationGroupsClient().CreateOrUpdate(ctx, "myResourceGroup", "myCapacityReservationGroup", armcompute.CapacityReservationGroup{ Location: to.Ptr("westus"), Tags: map[string]*string{ "department": to.Ptr("finance"), }, Properties: &armcompute.CapacityReservationGroupProperties{ SharingProfile: &armcompute.ResourceSharingProfile{ SubscriptionIDs: []*armcompute.SubResource{ { ID: to.Ptr("/subscriptions/{subscription-id1}"), }, { ID: to.Ptr("/subscriptions/{subscription-id2}"), }}, }, }, Zones: []*string{ to.Ptr("1"), to.Ptr("2")}, }, nil) if err != nil { log.Fatalf("failed to finish the request: %v", err) } // You could use response here. We use blank identifier for just demo purposes. _ = res // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. // res.CapacityReservationGroup = armcompute.CapacityReservationGroup{ // Name: to.Ptr("myCapacityReservationGroup"), // ID: to.Ptr("/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/CapacityReservationGroups/myCapacityReservationGroup"), // Location: to.Ptr("westus"), // Tags: map[string]*string{ // "department": to.Ptr("finance"), // "owner": to.Ptr("myCompany"), // }, // Properties: &armcompute.CapacityReservationGroupProperties{ // SharingProfile: &armcompute.ResourceSharingProfile{ // SubscriptionIDs: []*armcompute.SubResource{ // { // ID: to.Ptr("/subscriptions/{subscription-id1}"), // }, // { // ID: to.Ptr("/subscriptions/{subscription-id2}"), // }}, // }, // }, // Zones: []*string{ // to.Ptr("1"), // to.Ptr("2")}, // }
Output:
func (*CapacityReservationGroupsClient) Delete ¶
func (client *CapacityReservationGroupsClient) Delete(ctx context.Context, resourceGroupName string, capacityReservationGroupName string, options *CapacityReservationGroupsClientDeleteOptions) (CapacityReservationGroupsClientDeleteResponse, error)
Delete - The operation to delete a capacity reservation group. This operation is allowed only if all the associated resources are disassociated from the reservation group and all capacity reservations under the reservation group have also been deleted. Please refer to https://aka.ms/CapacityReservation for more details. If the operation fails it returns an *azcore.ResponseError type.
Generated from API version 2024-03-01
- resourceGroupName - The name of the resource group.
- capacityReservationGroupName - The name of the capacity reservation group.
- options - CapacityReservationGroupsClientDeleteOptions contains the optional parameters for the CapacityReservationGroupsClient.Delete method.
Example (CapacityReservationGroupDeleteMaximumSetGen) ¶
Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/92de53a5f1e0e03c94b40475d2135d97148ed014/specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-03-01/examples/capacityReservationExamples/CapacityReservationGroup_Delete_MaximumSet_Gen.json
cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() clientFactory, err := armcompute.NewClientFactory("<subscription-id>", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } _, err = clientFactory.NewCapacityReservationGroupsClient().Delete(ctx, "rgcompute", "a", nil) if err != nil { log.Fatalf("failed to finish the request: %v", err) }
Output:
Example (CapacityReservationGroupDeleteMinimumSetGen) ¶
Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/92de53a5f1e0e03c94b40475d2135d97148ed014/specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-03-01/examples/capacityReservationExamples/CapacityReservationGroup_Delete_MinimumSet_Gen.json
cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() clientFactory, err := armcompute.NewClientFactory("<subscription-id>", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } _, err = clientFactory.NewCapacityReservationGroupsClient().Delete(ctx, "rgcompute", "aaaaaaaaaaaaaaaaaaaaaaaaaa", nil) if err != nil { log.Fatalf("failed to finish the request: %v", err) }
Output:
func (*CapacityReservationGroupsClient) Get ¶
func (client *CapacityReservationGroupsClient) Get(ctx context.Context, resourceGroupName string, capacityReservationGroupName string, options *CapacityReservationGroupsClientGetOptions) (CapacityReservationGroupsClientGetResponse, error)
Get - The operation that retrieves information about a capacity reservation group. If the operation fails it returns an *azcore.ResponseError type.
Generated from API version 2024-03-01
- resourceGroupName - The name of the resource group.
- capacityReservationGroupName - The name of the capacity reservation group.
- options - CapacityReservationGroupsClientGetOptions contains the optional parameters for the CapacityReservationGroupsClient.Get method.
Example ¶
Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/92de53a5f1e0e03c94b40475d2135d97148ed014/specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-03-01/examples/capacityReservationExamples/CapacityReservationGroup_Get.json
cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() clientFactory, err := armcompute.NewClientFactory("<subscription-id>", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } res, err := clientFactory.NewCapacityReservationGroupsClient().Get(ctx, "myResourceGroup", "myCapacityReservationGroup", &armcompute.CapacityReservationGroupsClientGetOptions{Expand: to.Ptr(armcompute.CapacityReservationGroupInstanceViewTypesInstanceView)}) if err != nil { log.Fatalf("failed to finish the request: %v", err) } // You could use response here. We use blank identifier for just demo purposes. _ = res // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. // res.CapacityReservationGroup = armcompute.CapacityReservationGroup{ // Name: to.Ptr("myCapacityReservationGroup"), // ID: to.Ptr("/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/CapacityReservationGroups/myCapacityReservationGroup"), // Location: to.Ptr("westus"), // Tags: map[string]*string{ // "{tagName}": to.Ptr("{tagValue}"), // }, // Properties: &armcompute.CapacityReservationGroupProperties{ // CapacityReservations: []*armcompute.SubResourceReadOnly{ // { // ID: to.Ptr("subscriptions/{subscriptionId}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/capacityReservationGroups/myCapacityReservationGroup/capacityReservations/myCapacityReservation1"), // }, // { // ID: to.Ptr("subscriptions/{subscriptionId}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/capacityReservationGroups/myCapacityReservationGroup/capacityReservations/myCapacityReservation2"), // }}, // InstanceView: &armcompute.CapacityReservationGroupInstanceView{ // CapacityReservations: []*armcompute.CapacityReservationInstanceViewWithName{ // { // Statuses: []*armcompute.InstanceViewStatus{ // { // Code: to.Ptr("ProvisioningState/succeeded"), // DisplayStatus: to.Ptr("Provisioning succeeded"), // Level: to.Ptr(armcompute.StatusLevelTypesInfo), // }}, // UtilizationInfo: &armcompute.CapacityReservationUtilization{ // CurrentCapacity: to.Ptr[int32](5), // VirtualMachinesAllocated: []*armcompute.SubResourceReadOnly{ // { // ID: to.Ptr("/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/virtualMachines/myVM1"), // }, // { // ID: to.Ptr("/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/virtualMachines/myVM2"), // }}, // }, // Name: to.Ptr("myCapacityReservation1"), // }, // { // Statuses: []*armcompute.InstanceViewStatus{ // { // Code: to.Ptr("ProvisioningState/succeeded"), // DisplayStatus: to.Ptr("Provisioning succeeded"), // Level: to.Ptr(armcompute.StatusLevelTypesInfo), // }}, // UtilizationInfo: &armcompute.CapacityReservationUtilization{ // CurrentCapacity: to.Ptr[int32](5), // VirtualMachinesAllocated: []*armcompute.SubResourceReadOnly{ // { // ID: to.Ptr("/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/virtualMachines/myVM3"), // }, // { // ID: to.Ptr("/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/virtualMachines/myVM4"), // }}, // }, // Name: to.Ptr("myCapacityReservation2"), // }}, // SharedSubscriptionIDs: []*armcompute.SubResourceReadOnly{ // { // ID: to.Ptr("/subscriptions/{subscription-id1}"), // }, // { // ID: to.Ptr("/subscriptions/{subscription-id2}"), // }}, // }, // SharingProfile: &armcompute.ResourceSharingProfile{ // SubscriptionIDs: []*armcompute.SubResource{ // { // ID: to.Ptr("/subscriptions/{subscription-id1}"), // }, // { // ID: to.Ptr("/subscriptions/{subscription-id2}"), // }}, // }, // }, // Zones: []*string{ // to.Ptr("3"), // to.Ptr("1")}, // }
Output:
func (*CapacityReservationGroupsClient) NewListByResourceGroupPager ¶
func (client *CapacityReservationGroupsClient) NewListByResourceGroupPager(resourceGroupName string, options *CapacityReservationGroupsClientListByResourceGroupOptions) *runtime.Pager[CapacityReservationGroupsClientListByResourceGroupResponse]
NewListByResourceGroupPager - Lists all of the capacity reservation groups in the specified resource group. Use the nextLink property in the response to get the next page of capacity reservation groups.
Generated from API version 2024-03-01
- resourceGroupName - The name of the resource group.
- options - CapacityReservationGroupsClientListByResourceGroupOptions contains the optional parameters for the CapacityReservationGroupsClient.NewListByResourceGroupPager method.
Example ¶
Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/92de53a5f1e0e03c94b40475d2135d97148ed014/specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-03-01/examples/capacityReservationExamples/CapacityReservationGroup_ListByResourceGroup.json
cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() clientFactory, err := armcompute.NewClientFactory("<subscription-id>", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } pager := clientFactory.NewCapacityReservationGroupsClient().NewListByResourceGroupPager("myResourceGroup", &armcompute.CapacityReservationGroupsClientListByResourceGroupOptions{Expand: to.Ptr(armcompute.ExpandTypesForGetCapacityReservationGroupsVirtualMachinesRef)}) for pager.More() { page, err := pager.NextPage(ctx) if err != nil { log.Fatalf("failed to advance page: %v", err) } for _, v := range page.Value { // You could use page here. We use blank identifier for just demo purposes. _ = v } // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. // page.CapacityReservationGroupListResult = armcompute.CapacityReservationGroupListResult{ // Value: []*armcompute.CapacityReservationGroup{ // { // Name: to.Ptr("{capacityReservationGroupName}"), // Type: to.Ptr("Microsoft.Compute/CapacityReservationGroups"), // ID: to.Ptr("/subscriptions/{subscriptionId}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/capacityReservationGroups/{capacityReservationGroupName}"), // Location: to.Ptr("West US"), // Properties: &armcompute.CapacityReservationGroupProperties{ // CapacityReservations: []*armcompute.SubResourceReadOnly{ // { // ID: to.Ptr("subscriptions/{subscriptionId}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/capacityReservationGroups/myCapacityReservationGroup/capacityReservations/myCapacityReservation1"), // }, // { // ID: to.Ptr("subscriptions/{subscriptionId}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/capacityReservationGroups/myCapacityReservationGroup/capacityReservations/myCapacityReservation2"), // }}, // VirtualMachinesAssociated: []*armcompute.SubResourceReadOnly{ // { // ID: to.Ptr("/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/virtualMachines/myVM1"), // }, // { // ID: to.Ptr("/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/virtualMachines/myVM2"), // }}, // }, // }, // { // Name: to.Ptr("{capacityReservationGroupName}"), // Type: to.Ptr("Microsoft.Compute/CapacityReservationGroups"), // ID: to.Ptr("/subscriptions/{subscriptionId}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/capacityReservationGroups/{capacityReservationGroupName}"), // Location: to.Ptr("West US"), // Properties: &armcompute.CapacityReservationGroupProperties{ // CapacityReservations: []*armcompute.SubResourceReadOnly{ // { // ID: to.Ptr("subscriptions/{subscriptionId}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/capacityReservationGroups/myCapacityReservationGroup/capacityReservations/myCapacityReservation3"), // }, // { // ID: to.Ptr("subscriptions/{subscriptionId}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/capacityReservationGroups/myCapacityReservationGroup/capacityReservations/myCapacityReservation4"), // }}, // VirtualMachinesAssociated: []*armcompute.SubResourceReadOnly{ // { // ID: to.Ptr("/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/virtualMachines/myVM3"), // }}, // }, // }}, // } }
Output:
func (*CapacityReservationGroupsClient) NewListBySubscriptionPager ¶
func (client *CapacityReservationGroupsClient) NewListBySubscriptionPager(options *CapacityReservationGroupsClientListBySubscriptionOptions) *runtime.Pager[CapacityReservationGroupsClientListBySubscriptionResponse]
NewListBySubscriptionPager - Lists all of the capacity reservation groups in the subscription. Use the nextLink property in the response to get the next page of capacity reservation groups.
Generated from API version 2024-03-01
- options - CapacityReservationGroupsClientListBySubscriptionOptions contains the optional parameters for the CapacityReservationGroupsClient.NewListBySubscriptionPager method.
Example (ListCapacityReservationGroupsInSubscription) ¶
Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/92de53a5f1e0e03c94b40475d2135d97148ed014/specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-03-01/examples/capacityReservationExamples/CapacityReservationGroup_ListBySubscription.json
cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() clientFactory, err := armcompute.NewClientFactory("<subscription-id>", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } pager := clientFactory.NewCapacityReservationGroupsClient().NewListBySubscriptionPager(&armcompute.CapacityReservationGroupsClientListBySubscriptionOptions{Expand: to.Ptr(armcompute.ExpandTypesForGetCapacityReservationGroupsVirtualMachinesRef), ResourceIDsOnly: nil, }) for pager.More() { page, err := pager.NextPage(ctx) if err != nil { log.Fatalf("failed to advance page: %v", err) } for _, v := range page.Value { // You could use page here. We use blank identifier for just demo purposes. _ = v } // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. // page.CapacityReservationGroupListResult = armcompute.CapacityReservationGroupListResult{ // Value: []*armcompute.CapacityReservationGroup{ // { // Name: to.Ptr("{capacityReservationGroupName}"), // Type: to.Ptr("Microsoft.Compute/CapacityReservationGroups"), // ID: to.Ptr("/subscriptions/{subscriptionId}/resourceGroups/myResourceGroup1/providers/Microsoft.Compute/capacityReservationGroups/{capacityReservationGroupName}"), // Location: to.Ptr("West US"), // Properties: &armcompute.CapacityReservationGroupProperties{ // CapacityReservations: []*armcompute.SubResourceReadOnly{ // { // ID: to.Ptr("subscriptions/{subscriptionId}/resourceGroups/myResourceGroup1/providers/Microsoft.Compute/capacityReservationGroups/myCapacityReservationGroup/capacityReservations/myCapacityReservation1"), // }, // { // ID: to.Ptr("subscriptions/{subscriptionId}/resourceGroups/myResourceGroup1/providers/Microsoft.Compute/capacityReservationGroups/myCapacityReservationGroup/capacityReservations/myCapacityReservation2"), // }}, // VirtualMachinesAssociated: []*armcompute.SubResourceReadOnly{ // { // ID: to.Ptr("/subscriptions/{subscription-id}/resourceGroups/myResourceGroup1/providers/Microsoft.Compute/virtualMachines/myVM1"), // }, // { // ID: to.Ptr("/subscriptions/{subscription-id}/resourceGroups/myResourceGroup1/providers/Microsoft.Compute/virtualMachines/myVM2"), // }}, // }, // }, // { // Name: to.Ptr("{capacityReservationGroupName}"), // Type: to.Ptr("Microsoft.Compute/CapacityReservationGroups"), // ID: to.Ptr("/subscriptions/{subscriptionId}/resourceGroups/myResourceGroup2/providers/Microsoft.Compute/capacityReservationGroups/{capacityReservationGroupName}"), // Location: to.Ptr("West US"), // Properties: &armcompute.CapacityReservationGroupProperties{ // CapacityReservations: []*armcompute.SubResourceReadOnly{ // { // ID: to.Ptr("subscriptions/{subscriptionId}/resourceGroups/myResourceGroup2/providers/Microsoft.Compute/capacityReservationGroups/myCapacityReservationGroup/capacityReservations/myCapacityReservation3"), // }, // { // ID: to.Ptr("subscriptions/{subscriptionId}/resourceGroups/myResourceGroup2/providers/Microsoft.Compute/capacityReservationGroups/myCapacityReservationGroup/capacityReservations/myCapacityReservation4"), // }}, // VirtualMachinesAssociated: []*armcompute.SubResourceReadOnly{ // { // ID: to.Ptr("/subscriptions/{subscription-id}/resourceGroups/myResourceGroup2/providers/Microsoft.Compute/virtualMachines/myVM3"), // }}, // }, // }}, // } }
Output:
Example (ListCapacityReservationGroupsWithResourceIdsOnlyInSubscription) ¶
Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/92de53a5f1e0e03c94b40475d2135d97148ed014/specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-03-01/examples/capacityReservationExamples/CapacityReservationGroup_ListBySubscriptionWithResourceIdsQuery.json
cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() clientFactory, err := armcompute.NewClientFactory("<subscription-id>", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } pager := clientFactory.NewCapacityReservationGroupsClient().NewListBySubscriptionPager(&armcompute.CapacityReservationGroupsClientListBySubscriptionOptions{Expand: nil, ResourceIDsOnly: to.Ptr(armcompute.ResourceIDOptionsForGetCapacityReservationGroupsAll), }) for pager.More() { page, err := pager.NextPage(ctx) if err != nil { log.Fatalf("failed to advance page: %v", err) } for _, v := range page.Value { // You could use page here. We use blank identifier for just demo purposes. _ = v } // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. // page.CapacityReservationGroupListResult = armcompute.CapacityReservationGroupListResult{ // Value: []*armcompute.CapacityReservationGroup{ // { // Type: to.Ptr("Microsoft.Compute/capacityReservationGroups"), // ID: to.Ptr("/subscriptions/{subscriptionId}/resourceGroups/myResourceGroup1/providers/Microsoft.Compute/capacityReservationGroups/{capacityReservationGroupName1}"), // Location: to.Ptr("SouthCentralUSSTG"), // }, // { // Type: to.Ptr("Microsoft.Compute/capacityReservationGroups"), // ID: to.Ptr("/subscriptions/{subscriptionId2}/resourceGroups/myResourceGroup2/providers/Microsoft.Compute/capacityReservationGroups/{capacityReservationGroupName2}"), // Location: to.Ptr("SouthCentralUSSTG"), // }}, // } }
Output:
func (*CapacityReservationGroupsClient) Update ¶
func (client *CapacityReservationGroupsClient) Update(ctx context.Context, resourceGroupName string, capacityReservationGroupName string, parameters CapacityReservationGroupUpdate, options *CapacityReservationGroupsClientUpdateOptions) (CapacityReservationGroupsClientUpdateResponse, error)
Update - The operation to update a capacity reservation group. When updating a capacity reservation group, only tags and sharing profile may be modified. If the operation fails it returns an *azcore.ResponseError type.
Generated from API version 2024-03-01
- resourceGroupName - The name of the resource group.
- capacityReservationGroupName - The name of the capacity reservation group.
- parameters - Parameters supplied to the Update capacity reservation Group operation.
- options - CapacityReservationGroupsClientUpdateOptions contains the optional parameters for the CapacityReservationGroupsClient.Update method.
Example (CapacityReservationGroupUpdateMaximumSetGen) ¶
Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/92de53a5f1e0e03c94b40475d2135d97148ed014/specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-03-01/examples/capacityReservationExamples/CapacityReservationGroup_Update_MaximumSet_Gen.json
cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() clientFactory, err := armcompute.NewClientFactory("<subscription-id>", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } res, err := clientFactory.NewCapacityReservationGroupsClient().Update(ctx, "rgcompute", "aaaaaaaaaaaaaaaaaaaaaa", armcompute.CapacityReservationGroupUpdate{ Tags: map[string]*string{ "key5355": to.Ptr("aaa"), }, Properties: &armcompute.CapacityReservationGroupProperties{ InstanceView: &armcompute.CapacityReservationGroupInstanceView{}, }, }, nil) if err != nil { log.Fatalf("failed to finish the request: %v", err) } // You could use response here. We use blank identifier for just demo purposes. _ = res // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. // res.CapacityReservationGroup = armcompute.CapacityReservationGroup{ // Name: to.Ptr("myCapacityReservationGroup"), // Type: to.Ptr("aaaaaaaaaaaaaaaaaaaaaaaaaaaa"), // ID: to.Ptr("/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/CapacityReservationGroups/myCapacityReservationGroup"), // Location: to.Ptr("westus"), // Tags: map[string]*string{ // }, // Properties: &armcompute.CapacityReservationGroupProperties{ // CapacityReservations: []*armcompute.SubResourceReadOnly{ // { // ID: to.Ptr("aaaa"), // }}, // InstanceView: &armcompute.CapacityReservationGroupInstanceView{ // CapacityReservations: []*armcompute.CapacityReservationInstanceViewWithName{ // { // Statuses: []*armcompute.InstanceViewStatus{ // { // Code: to.Ptr("aaaaaaaaaaaaaaaaaaaaaaa"), // DisplayStatus: to.Ptr("aaaaaa"), // Level: to.Ptr(armcompute.StatusLevelTypesInfo), // Message: to.Ptr("a"), // Time: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-11-30T12:58:26.522Z"); return t}()), // }}, // UtilizationInfo: &armcompute.CapacityReservationUtilization{ // VirtualMachinesAllocated: []*armcompute.SubResourceReadOnly{ // { // ID: to.Ptr("aaaa"), // }}, // }, // Name: to.Ptr("aaaaaaaaaaaaaaaa"), // }}, // }, // VirtualMachinesAssociated: []*armcompute.SubResourceReadOnly{ // { // ID: to.Ptr("aaaa"), // }}, // }, // Zones: []*string{ // to.Ptr("1"), // to.Ptr("2")}, // }
Output:
Example (CapacityReservationGroupUpdateMinimumSetGen) ¶
Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/92de53a5f1e0e03c94b40475d2135d97148ed014/specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-03-01/examples/capacityReservationExamples/CapacityReservationGroup_Update_MinimumSet_Gen.json
cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() clientFactory, err := armcompute.NewClientFactory("<subscription-id>", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } res, err := clientFactory.NewCapacityReservationGroupsClient().Update(ctx, "rgcompute", "aaaaaaaaaaaaaaaaaaaaaa", armcompute.CapacityReservationGroupUpdate{}, nil) if err != nil { log.Fatalf("failed to finish the request: %v", err) } // You could use response here. We use blank identifier for just demo purposes. _ = res // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. // res.CapacityReservationGroup = armcompute.CapacityReservationGroup{ // Location: to.Ptr("westus"), // }
Output:
type CapacityReservationGroupsClientCreateOrUpdateOptions ¶
type CapacityReservationGroupsClientCreateOrUpdateOptions struct { }
CapacityReservationGroupsClientCreateOrUpdateOptions contains the optional parameters for the CapacityReservationGroupsClient.CreateOrUpdate method.
type CapacityReservationGroupsClientCreateOrUpdateResponse ¶
type CapacityReservationGroupsClientCreateOrUpdateResponse struct { // Specifies information about the capacity reservation group that the capacity reservations should be assigned to. Currently, // a capacity reservation can only be added to a capacity reservation group at creation time. An existing capacity reservation // cannot be added or moved to another capacity reservation group. CapacityReservationGroup }
CapacityReservationGroupsClientCreateOrUpdateResponse contains the response from method CapacityReservationGroupsClient.CreateOrUpdate.
type CapacityReservationGroupsClientDeleteOptions ¶
type CapacityReservationGroupsClientDeleteOptions struct { }
CapacityReservationGroupsClientDeleteOptions contains the optional parameters for the CapacityReservationGroupsClient.Delete method.
type CapacityReservationGroupsClientDeleteResponse ¶
type CapacityReservationGroupsClientDeleteResponse struct { }
CapacityReservationGroupsClientDeleteResponse contains the response from method CapacityReservationGroupsClient.Delete.
type CapacityReservationGroupsClientGetOptions ¶
type CapacityReservationGroupsClientGetOptions struct { // The expand expression to apply on the operation. 'InstanceView' will retrieve the list of instance views of the capacity // reservations under the capacity reservation group which is a snapshot of the // runtime properties of a capacity reservation that is managed by the platform and can change outside of control plane operations. Expand *CapacityReservationGroupInstanceViewTypes }
CapacityReservationGroupsClientGetOptions contains the optional parameters for the CapacityReservationGroupsClient.Get method.
type CapacityReservationGroupsClientGetResponse ¶
type CapacityReservationGroupsClientGetResponse struct { // Specifies information about the capacity reservation group that the capacity reservations should be assigned to. Currently, // a capacity reservation can only be added to a capacity reservation group at creation time. An existing capacity reservation // cannot be added or moved to another capacity reservation group. CapacityReservationGroup }
CapacityReservationGroupsClientGetResponse contains the response from method CapacityReservationGroupsClient.Get.
type CapacityReservationGroupsClientListByResourceGroupOptions ¶
type CapacityReservationGroupsClientListByResourceGroupOptions struct { // The expand expression to apply on the operation. Based on the expand param(s) specified we return Virtual Machine or ScaleSet // VM Instance or both resource Ids which are associated to capacity // reservation group in the response. Expand *ExpandTypesForGetCapacityReservationGroups }
CapacityReservationGroupsClientListByResourceGroupOptions contains the optional parameters for the CapacityReservationGroupsClient.NewListByResourceGroupPager method.
type CapacityReservationGroupsClientListByResourceGroupResponse ¶
type CapacityReservationGroupsClientListByResourceGroupResponse struct { // The List capacity reservation group with resource group response. CapacityReservationGroupListResult }
CapacityReservationGroupsClientListByResourceGroupResponse contains the response from method CapacityReservationGroupsClient.NewListByResourceGroupPager.
type CapacityReservationGroupsClientListBySubscriptionOptions ¶
type CapacityReservationGroupsClientListBySubscriptionOptions struct { // The expand expression to apply on the operation. Based on the expand param(s) specified we return Virtual Machine or ScaleSet // VM Instance or both resource Ids which are associated to capacity // reservation group in the response. Expand *ExpandTypesForGetCapacityReservationGroups // The query option to fetch Capacity Reservation Group Resource Ids. // 'CreatedInSubscription' enables fetching Resource Ids for all capacity reservation group resources created in the subscription. // 'SharedWithSubscription' enables fetching Resource Ids for all capacity reservation group resources shared with the subscription. // 'All' enables fetching Resource Ids for all capacity reservation group resources shared with the subscription and created // in the subscription. ResourceIDsOnly *ResourceIDOptionsForGetCapacityReservationGroups }
CapacityReservationGroupsClientListBySubscriptionOptions contains the optional parameters for the CapacityReservationGroupsClient.NewListBySubscriptionPager method.
type CapacityReservationGroupsClientListBySubscriptionResponse ¶
type CapacityReservationGroupsClientListBySubscriptionResponse struct { // The List capacity reservation group with resource group response. CapacityReservationGroupListResult }
CapacityReservationGroupsClientListBySubscriptionResponse contains the response from method CapacityReservationGroupsClient.NewListBySubscriptionPager.
type CapacityReservationGroupsClientUpdateOptions ¶
type CapacityReservationGroupsClientUpdateOptions struct { }
CapacityReservationGroupsClientUpdateOptions contains the optional parameters for the CapacityReservationGroupsClient.Update method.
type CapacityReservationGroupsClientUpdateResponse ¶
type CapacityReservationGroupsClientUpdateResponse struct { // Specifies information about the capacity reservation group that the capacity reservations should be assigned to. Currently, // a capacity reservation can only be added to a capacity reservation group at creation time. An existing capacity reservation // cannot be added or moved to another capacity reservation group. CapacityReservationGroup }
CapacityReservationGroupsClientUpdateResponse contains the response from method CapacityReservationGroupsClient.Update.
type CapacityReservationInstanceView ¶
type CapacityReservationInstanceView struct { // The resource status information. Statuses []*InstanceViewStatus // Unutilized capacity of the capacity reservation. UtilizationInfo *CapacityReservationUtilization }
CapacityReservationInstanceView - The instance view of a capacity reservation that provides as snapshot of the runtime properties of the capacity reservation that is managed by the platform and can change outside of control plane operations.
func (CapacityReservationInstanceView) MarshalJSON ¶
func (c CapacityReservationInstanceView) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type CapacityReservationInstanceView.
func (*CapacityReservationInstanceView) UnmarshalJSON ¶
func (c *CapacityReservationInstanceView) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type CapacityReservationInstanceView.
type CapacityReservationInstanceViewTypes ¶
type CapacityReservationInstanceViewTypes string
const (
CapacityReservationInstanceViewTypesInstanceView CapacityReservationInstanceViewTypes = "instanceView"
)
func PossibleCapacityReservationInstanceViewTypesValues ¶
func PossibleCapacityReservationInstanceViewTypesValues() []CapacityReservationInstanceViewTypes
PossibleCapacityReservationInstanceViewTypesValues returns the possible values for the CapacityReservationInstanceViewTypes const type.
type CapacityReservationInstanceViewWithName ¶
type CapacityReservationInstanceViewWithName struct { // The resource status information. Statuses []*InstanceViewStatus // Unutilized capacity of the capacity reservation. UtilizationInfo *CapacityReservationUtilization // READ-ONLY; The name of the capacity reservation. Name *string }
CapacityReservationInstanceViewWithName - The instance view of a capacity reservation that includes the name of the capacity reservation. It is used for the response to the instance view of a capacity reservation group.
func (CapacityReservationInstanceViewWithName) MarshalJSON ¶
func (c CapacityReservationInstanceViewWithName) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type CapacityReservationInstanceViewWithName.
func (*CapacityReservationInstanceViewWithName) UnmarshalJSON ¶
func (c *CapacityReservationInstanceViewWithName) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type CapacityReservationInstanceViewWithName.
type CapacityReservationListResult ¶
type CapacityReservationListResult struct { // REQUIRED; The list of capacity reservations Value []*CapacityReservation // The URI to fetch the next page of capacity reservations. Call ListNext() with this URI to fetch the next page of capacity // reservations. NextLink *string }
CapacityReservationListResult - The list capacity reservation operation response.
func (CapacityReservationListResult) MarshalJSON ¶
func (c CapacityReservationListResult) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type CapacityReservationListResult.
func (*CapacityReservationListResult) UnmarshalJSON ¶
func (c *CapacityReservationListResult) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type CapacityReservationListResult.
type CapacityReservationProfile ¶
type CapacityReservationProfile struct { // Specifies the capacity reservation group resource id that should be used for allocating the virtual machine or scaleset // vm instances provided enough capacity has been reserved. Please refer to // https://aka.ms/CapacityReservation for more details. CapacityReservationGroup *SubResource }
CapacityReservationProfile - The parameters of a capacity reservation Profile.
func (CapacityReservationProfile) MarshalJSON ¶
func (c CapacityReservationProfile) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type CapacityReservationProfile.
func (*CapacityReservationProfile) UnmarshalJSON ¶
func (c *CapacityReservationProfile) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type CapacityReservationProfile.
type CapacityReservationProperties ¶
type CapacityReservationProperties struct { // READ-ONLY; The Capacity reservation instance view. InstanceView *CapacityReservationInstanceView // READ-ONLY; Specifies the value of fault domain count that Capacity Reservation supports for requested VM size. Note: The // fault domain count specified for a resource (like virtual machines scale set) must be less // than or equal to this value if it deploys using capacity reservation. Minimum api-version: 2022-08-01. PlatformFaultDomainCount *int32 // READ-ONLY; The provisioning state, which only appears in the response. ProvisioningState *string // READ-ONLY; The date time when the capacity reservation was last updated. ProvisioningTime *time.Time // READ-ONLY; A unique id generated and assigned to the capacity reservation by the platform which does not change throughout // the lifetime of the resource. ReservationID *string // READ-ONLY; Specifies the time at which the Capacity Reservation resource was created. Minimum api-version: 2021-11-01. TimeCreated *time.Time // READ-ONLY; A list of all virtual machine resource ids that are associated with the capacity reservation. VirtualMachinesAssociated []*SubResourceReadOnly }
CapacityReservationProperties - Properties of the Capacity reservation.
func (CapacityReservationProperties) MarshalJSON ¶
func (c CapacityReservationProperties) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type CapacityReservationProperties.
func (*CapacityReservationProperties) UnmarshalJSON ¶
func (c *CapacityReservationProperties) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type CapacityReservationProperties.
type CapacityReservationUpdate ¶
type CapacityReservationUpdate struct { // Properties of the Capacity reservation. Properties *CapacityReservationProperties // SKU of the resource for which capacity needs be reserved. The SKU name and capacity is required to be set. Currently VM // Skus with the capability called 'CapacityReservationSupported' set to true are // supported. Refer to List Microsoft.Compute SKUs in a region (https://docs.microsoft.com/rest/api/compute/resourceskus/list) // for supported values. SKU *SKU // Resource tags Tags map[string]*string }
CapacityReservationUpdate - Specifies information about the capacity reservation. Only tags and sku.capacity can be updated.
func (CapacityReservationUpdate) MarshalJSON ¶
func (c CapacityReservationUpdate) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type CapacityReservationUpdate.
func (*CapacityReservationUpdate) UnmarshalJSON ¶
func (c *CapacityReservationUpdate) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type CapacityReservationUpdate.
type CapacityReservationUtilization ¶
type CapacityReservationUtilization struct { // READ-ONLY; The value provides the current capacity of the VM size which was reserved successfully and for which the customer // is getting billed. Minimum api-version: 2022-08-01. CurrentCapacity *int32 // READ-ONLY; A list of all virtual machines resource ids allocated against the capacity reservation. VirtualMachinesAllocated []*SubResourceReadOnly }
CapacityReservationUtilization - Represents the capacity reservation utilization in terms of resources allocated.
func (CapacityReservationUtilization) MarshalJSON ¶
func (c CapacityReservationUtilization) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type CapacityReservationUtilization.
func (*CapacityReservationUtilization) UnmarshalJSON ¶
func (c *CapacityReservationUtilization) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type CapacityReservationUtilization.
type CapacityReservationsClient ¶
type CapacityReservationsClient struct {
// contains filtered or unexported fields
}
CapacityReservationsClient contains the methods for the CapacityReservations group. Don't use this type directly, use NewCapacityReservationsClient() instead.
func NewCapacityReservationsClient ¶
func NewCapacityReservationsClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*CapacityReservationsClient, error)
NewCapacityReservationsClient creates a new instance of CapacityReservationsClient 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 (*CapacityReservationsClient) BeginCreateOrUpdate ¶
func (client *CapacityReservationsClient) BeginCreateOrUpdate(ctx context.Context, resourceGroupName string, capacityReservationGroupName string, capacityReservationName string, parameters CapacityReservation, options *CapacityReservationsClientBeginCreateOrUpdateOptions) (*runtime.Poller[CapacityReservationsClientCreateOrUpdateResponse], error)
BeginCreateOrUpdate - The operation to create or update a capacity reservation. Please note some properties can be set only during capacity reservation creation. Please refer to https://aka.ms/CapacityReservation for more details. If the operation fails it returns an *azcore.ResponseError type.
Generated from API version 2024-03-01
- resourceGroupName - The name of the resource group.
- capacityReservationGroupName - The name of the capacity reservation group.
- capacityReservationName - The name of the capacity reservation.
- parameters - Parameters supplied to the Create capacity reservation.
- options - CapacityReservationsClientBeginCreateOrUpdateOptions contains the optional parameters for the CapacityReservationsClient.BeginCreateOrUpdate method.
Example ¶
Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/92de53a5f1e0e03c94b40475d2135d97148ed014/specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-03-01/examples/capacityReservationExamples/CapacityReservation_CreateOrUpdate.json
cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() clientFactory, err := armcompute.NewClientFactory("<subscription-id>", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } poller, err := clientFactory.NewCapacityReservationsClient().BeginCreateOrUpdate(ctx, "myResourceGroup", "myCapacityReservationGroup", "myCapacityReservation", armcompute.CapacityReservation{ Location: to.Ptr("westus"), Tags: map[string]*string{ "department": to.Ptr("HR"), }, SKU: &armcompute.SKU{ Name: to.Ptr("Standard_DS1_v2"), Capacity: to.Ptr[int64](4), }, Zones: []*string{ to.Ptr("1")}, }, nil) if err != nil { log.Fatalf("failed to finish the request: %v", err) } res, err := poller.PollUntilDone(ctx, nil) if err != nil { log.Fatalf("failed to pull the result: %v", err) } // You could use response here. We use blank identifier for just demo purposes. _ = res // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. // res.CapacityReservation = armcompute.CapacityReservation{ // Name: to.Ptr("myCapacityReservation"), // ID: to.Ptr("/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/capacityReservationGroups/myCapacityReservationGroup/capacityReservations/myCapacityReservation"), // Location: to.Ptr("westus"), // Tags: map[string]*string{ // "department": to.Ptr("HR"), // }, // Properties: &armcompute.CapacityReservationProperties{ // PlatformFaultDomainCount: to.Ptr[int32](3), // ProvisioningState: to.Ptr("Succeeded"), // ProvisioningTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-06-27T01:02:38.313Z"); return t}()), // ReservationID: to.Ptr("{GUID}"), // }, // SKU: &armcompute.SKU{ // Name: to.Ptr("Standard_DS1_v2"), // Capacity: to.Ptr[int64](4), // }, // Zones: []*string{ // to.Ptr("1")}, // }
Output:
func (*CapacityReservationsClient) BeginDelete ¶
func (client *CapacityReservationsClient) BeginDelete(ctx context.Context, resourceGroupName string, capacityReservationGroupName string, capacityReservationName string, options *CapacityReservationsClientBeginDeleteOptions) (*runtime.Poller[CapacityReservationsClientDeleteResponse], error)
BeginDelete - The operation to delete a capacity reservation. This operation is allowed only when all the associated resources are disassociated from the capacity reservation. Please refer to https://aka.ms/CapacityReservation for more details. If the operation fails it returns an *azcore.ResponseError type.
Generated from API version 2024-03-01
- resourceGroupName - The name of the resource group.
- capacityReservationGroupName - The name of the capacity reservation group.
- capacityReservationName - The name of the capacity reservation.
- options - CapacityReservationsClientBeginDeleteOptions contains the optional parameters for the CapacityReservationsClient.BeginDelete method.
Example (CapacityReservationDeleteMaximumSetGen) ¶
Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/92de53a5f1e0e03c94b40475d2135d97148ed014/specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-03-01/examples/capacityReservationExamples/CapacityReservation_Delete_MaximumSet_Gen.json
cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() clientFactory, err := armcompute.NewClientFactory("<subscription-id>", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } poller, err := clientFactory.NewCapacityReservationsClient().BeginDelete(ctx, "rgcompute", "aaaaaaaaaaa", "aaaaaaaaaaaaaaaaaaaaaaaaaaa", nil) if err != nil { log.Fatalf("failed to finish the request: %v", err) } _, err = poller.PollUntilDone(ctx, nil) if err != nil { log.Fatalf("failed to pull the result: %v", err) }
Output:
Example (CapacityReservationDeleteMinimumSetGen) ¶
Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/92de53a5f1e0e03c94b40475d2135d97148ed014/specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-03-01/examples/capacityReservationExamples/CapacityReservation_Delete_MinimumSet_Gen.json
cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() clientFactory, err := armcompute.NewClientFactory("<subscription-id>", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } poller, err := clientFactory.NewCapacityReservationsClient().BeginDelete(ctx, "rgcompute", "aaa", "aaaaaa", nil) if err != nil { log.Fatalf("failed to finish the request: %v", err) } _, err = poller.PollUntilDone(ctx, nil) if err != nil { log.Fatalf("failed to pull the result: %v", err) }
Output:
func (*CapacityReservationsClient) BeginUpdate ¶
func (client *CapacityReservationsClient) BeginUpdate(ctx context.Context, resourceGroupName string, capacityReservationGroupName string, capacityReservationName string, parameters CapacityReservationUpdate, options *CapacityReservationsClientBeginUpdateOptions) (*runtime.Poller[CapacityReservationsClientUpdateResponse], error)
BeginUpdate - The operation to update a capacity reservation. If the operation fails it returns an *azcore.ResponseError type.
Generated from API version 2024-03-01
- resourceGroupName - The name of the resource group.
- capacityReservationGroupName - The name of the capacity reservation group.
- capacityReservationName - The name of the capacity reservation.
- parameters - Parameters supplied to the Update capacity reservation operation.
- options - CapacityReservationsClientBeginUpdateOptions contains the optional parameters for the CapacityReservationsClient.BeginUpdate method.
Example (CapacityReservationUpdateMaximumSetGen) ¶
Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/92de53a5f1e0e03c94b40475d2135d97148ed014/specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-03-01/examples/capacityReservationExamples/CapacityReservation_Update_MaximumSet_Gen.json
cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() clientFactory, err := armcompute.NewClientFactory("<subscription-id>", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } poller, err := clientFactory.NewCapacityReservationsClient().BeginUpdate(ctx, "rgcompute", "aaaaaaaaaa", "aaaaaaaaaaaaaaaaaaa", armcompute.CapacityReservationUpdate{ Tags: map[string]*string{ "key4974": to.Ptr("aaaaaaaaaaaaaaaa"), }, Properties: &armcompute.CapacityReservationProperties{ InstanceView: &armcompute.CapacityReservationInstanceView{ Statuses: []*armcompute.InstanceViewStatus{ { Code: to.Ptr("aaaaaaaaaaaaaaaaaaaaaaa"), DisplayStatus: to.Ptr("aaaaaa"), Level: to.Ptr(armcompute.StatusLevelTypesInfo), Message: to.Ptr("a"), Time: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-11-30T12:58:26.522Z"); return t }()), }}, UtilizationInfo: &armcompute.CapacityReservationUtilization{}, }, }, SKU: &armcompute.SKU{ Name: to.Ptr("Standard_DS1_v2"), Capacity: to.Ptr[int64](7), Tier: to.Ptr("aaa"), }, }, nil) if err != nil { log.Fatalf("failed to finish the request: %v", err) } res, err := poller.PollUntilDone(ctx, nil) if err != nil { log.Fatalf("failed to pull the result: %v", err) } // You could use response here. We use blank identifier for just demo purposes. _ = res // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. // res.CapacityReservation = armcompute.CapacityReservation{ // Name: to.Ptr("myCapacityReservation"), // Type: to.Ptr("aaaaaaaaaaaaaaa"), // ID: to.Ptr("/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/capacityReservationGroups/myCapacityReservationGroup/capacityReservations/myCapacityReservation"), // Location: to.Ptr("westus"), // Tags: map[string]*string{ // }, // Properties: &armcompute.CapacityReservationProperties{ // InstanceView: &armcompute.CapacityReservationInstanceView{ // Statuses: []*armcompute.InstanceViewStatus{ // { // Code: to.Ptr("aaaaaaaaaaaaaaaaaaaaaaa"), // DisplayStatus: to.Ptr("aaaaaa"), // Level: to.Ptr(armcompute.StatusLevelTypesInfo), // Message: to.Ptr("a"), // Time: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-11-30T12:58:26.522Z"); return t}()), // }}, // UtilizationInfo: &armcompute.CapacityReservationUtilization{ // VirtualMachinesAllocated: []*armcompute.SubResourceReadOnly{ // { // ID: to.Ptr("aaaa"), // }}, // }, // }, // PlatformFaultDomainCount: to.Ptr[int32](3), // ProvisioningState: to.Ptr("Succeeded"), // ProvisioningTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-06-27T01:02:38.313Z"); return t}()), // ReservationID: to.Ptr("{GUID}"), // VirtualMachinesAssociated: []*armcompute.SubResourceReadOnly{ // { // ID: to.Ptr("aaaa"), // }}, // }, // SKU: &armcompute.SKU{ // Name: to.Ptr("Standard_DS1_v2"), // Capacity: to.Ptr[int64](4), // Tier: to.Ptr("aaaaaaaaaaaaaaaaaaaaaaaaaa"), // }, // Zones: []*string{ // to.Ptr("1")}, // }
Output:
Example (CapacityReservationUpdateMinimumSetGen) ¶
Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/92de53a5f1e0e03c94b40475d2135d97148ed014/specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-03-01/examples/capacityReservationExamples/CapacityReservation_Update_MinimumSet_Gen.json
cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() clientFactory, err := armcompute.NewClientFactory("<subscription-id>", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } poller, err := clientFactory.NewCapacityReservationsClient().BeginUpdate(ctx, "rgcompute", "aaaaaaaaaaaaaaaaaaaaaaaaaa", "aaa", armcompute.CapacityReservationUpdate{}, nil) if err != nil { log.Fatalf("failed to finish the request: %v", err) } res, err := poller.PollUntilDone(ctx, nil) if err != nil { log.Fatalf("failed to pull the result: %v", err) } // You could use response here. We use blank identifier for just demo purposes. _ = res // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. // res.CapacityReservation = armcompute.CapacityReservation{ // Location: to.Ptr("westus"), // SKU: &armcompute.SKU{ // }, // }
Output:
func (*CapacityReservationsClient) Get ¶
func (client *CapacityReservationsClient) Get(ctx context.Context, resourceGroupName string, capacityReservationGroupName string, capacityReservationName string, options *CapacityReservationsClientGetOptions) (CapacityReservationsClientGetResponse, error)
Get - The operation that retrieves information about the capacity reservation. If the operation fails it returns an *azcore.ResponseError type.
Generated from API version 2024-03-01
- resourceGroupName - The name of the resource group.
- capacityReservationGroupName - The name of the capacity reservation group.
- capacityReservationName - The name of the capacity reservation.
- options - CapacityReservationsClientGetOptions contains the optional parameters for the CapacityReservationsClient.Get method.
Example ¶
Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/92de53a5f1e0e03c94b40475d2135d97148ed014/specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-03-01/examples/capacityReservationExamples/CapacityReservation_Get.json
cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() clientFactory, err := armcompute.NewClientFactory("<subscription-id>", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } res, err := clientFactory.NewCapacityReservationsClient().Get(ctx, "myResourceGroup", "myCapacityReservationGroup", "myCapacityReservation", &armcompute.CapacityReservationsClientGetOptions{Expand: to.Ptr(armcompute.CapacityReservationInstanceViewTypesInstanceView)}) if err != nil { log.Fatalf("failed to finish the request: %v", err) } // You could use response here. We use blank identifier for just demo purposes. _ = res // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. // res.CapacityReservation = armcompute.CapacityReservation{ // Name: to.Ptr("myCapacityReservation"), // ID: to.Ptr("/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/capacityReservationGroups/myCapacityReservationGroup/capacityReservations/myCapacityReservation"), // Location: to.Ptr("westus"), // Tags: map[string]*string{ // "department": to.Ptr("HR"), // }, // Properties: &armcompute.CapacityReservationProperties{ // InstanceView: &armcompute.CapacityReservationInstanceView{ // Statuses: []*armcompute.InstanceViewStatus{ // { // Code: to.Ptr("ProvisioningState/succeeded"), // DisplayStatus: to.Ptr("Provisioning succeeded"), // Level: to.Ptr(armcompute.StatusLevelTypesInfo), // }}, // UtilizationInfo: &armcompute.CapacityReservationUtilization{ // CurrentCapacity: to.Ptr[int32](5), // VirtualMachinesAllocated: []*armcompute.SubResourceReadOnly{ // { // ID: to.Ptr("/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/virtualMachines/myVM1"), // }, // { // ID: to.Ptr("/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/virtualMachines/myVM2"), // }}, // }, // }, // PlatformFaultDomainCount: to.Ptr[int32](3), // ProvisioningState: to.Ptr("Succeeded"), // ProvisioningTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-06-27T01:02:38.313Z"); return t}()), // ReservationID: to.Ptr("{GUID}"), // TimeCreated: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-06-27T01:02:38.313Z"); return t}()), // VirtualMachinesAssociated: []*armcompute.SubResourceReadOnly{ // { // ID: to.Ptr("/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/virtualMachines/myVM1"), // }, // { // ID: to.Ptr("/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/virtualMachines/myVM2"), // }, // { // ID: to.Ptr("/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/virtualMachines/myVM3"), // }}, // }, // SKU: &armcompute.SKU{ // Name: to.Ptr("Standard_DS1_v2"), // Capacity: to.Ptr[int64](4), // }, // Zones: []*string{ // to.Ptr("1")}, // }
Output:
func (*CapacityReservationsClient) NewListByCapacityReservationGroupPager ¶
func (client *CapacityReservationsClient) NewListByCapacityReservationGroupPager(resourceGroupName string, capacityReservationGroupName string, options *CapacityReservationsClientListByCapacityReservationGroupOptions) *runtime.Pager[CapacityReservationsClientListByCapacityReservationGroupResponse]
NewListByCapacityReservationGroupPager - Lists all of the capacity reservations in the specified capacity reservation group. Use the nextLink property in the response to get the next page of capacity reservations.
Generated from API version 2024-03-01
- resourceGroupName - The name of the resource group.
- capacityReservationGroupName - The name of the capacity reservation group.
- options - CapacityReservationsClientListByCapacityReservationGroupOptions contains the optional parameters for the CapacityReservationsClient.NewListByCapacityReservationGroupPager method.
Example ¶
Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/92de53a5f1e0e03c94b40475d2135d97148ed014/specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-03-01/examples/capacityReservationExamples/CapacityReservation_ListByReservationGroup.json
cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() clientFactory, err := armcompute.NewClientFactory("<subscription-id>", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } pager := clientFactory.NewCapacityReservationsClient().NewListByCapacityReservationGroupPager("myResourceGroup", "myCapacityReservationGroup", nil) for pager.More() { page, err := pager.NextPage(ctx) if err != nil { log.Fatalf("failed to advance page: %v", err) } for _, v := range page.Value { // You could use page here. We use blank identifier for just demo purposes. _ = v } // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. // page.CapacityReservationListResult = armcompute.CapacityReservationListResult{ // Value: []*armcompute.CapacityReservation{ // { // Name: to.Ptr("{capacityReservationName}"), // Type: to.Ptr("Microsoft.Compute/CapacityReservations"), // ID: to.Ptr("/subscriptions/{subscriptionId}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/capacityReservationGroups/{capacityReservationGroupName}/CapacityReservation/{capacityReservationName}"), // Location: to.Ptr("West US"), // Tags: map[string]*string{ // "department": to.Ptr("HR"), // }, // Properties: &armcompute.CapacityReservationProperties{ // PlatformFaultDomainCount: to.Ptr[int32](3), // ProvisioningState: to.Ptr("Succeeded"), // ProvisioningTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-06-27T01:02:38.313Z"); return t}()), // ReservationID: to.Ptr("{GUID}"), // VirtualMachinesAssociated: []*armcompute.SubResourceReadOnly{ // { // ID: to.Ptr("/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/virtualMachines/myVM1"), // }, // { // ID: to.Ptr("/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/virtualMachines/myVM2"), // }, // { // ID: to.Ptr("/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/virtualMachines/myVM3"), // }}, // }, // SKU: &armcompute.SKU{ // Name: to.Ptr("Standard_DS1_v2"), // Capacity: to.Ptr[int64](4), // }, // Zones: []*string{ // to.Ptr("1")}, // }, // { // Name: to.Ptr("{capacityReservationName}"), // Type: to.Ptr("Microsoft.Compute/CapacityReservations"), // ID: to.Ptr("/subscriptions/{subscriptionId}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/capacityReservationGroups/{capacityReservationGroupName}/CapacityReservation/{capacityReservationName}"), // Location: to.Ptr("West US"), // Tags: map[string]*string{ // "department": to.Ptr("HR"), // }, // Properties: &armcompute.CapacityReservationProperties{ // PlatformFaultDomainCount: to.Ptr[int32](3), // ProvisioningState: to.Ptr("Succeeded"), // ProvisioningTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-06-27T01:02:38.313Z"); return t}()), // ReservationID: to.Ptr("{GUID}"), // VirtualMachinesAssociated: []*armcompute.SubResourceReadOnly{ // { // ID: to.Ptr("/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/virtualMachines/myVM4"), // }}, // }, // SKU: &armcompute.SKU{ // Name: to.Ptr("Standard_A1_v2"), // Capacity: to.Ptr[int64](4), // }, // Zones: []*string{ // to.Ptr("1")}, // }}, // } }
Output:
type CapacityReservationsClientBeginCreateOrUpdateOptions ¶
type CapacityReservationsClientBeginCreateOrUpdateOptions struct { // Resumes the LRO from the provided token. ResumeToken string }
CapacityReservationsClientBeginCreateOrUpdateOptions contains the optional parameters for the CapacityReservationsClient.BeginCreateOrUpdate method.
type CapacityReservationsClientBeginDeleteOptions ¶
type CapacityReservationsClientBeginDeleteOptions struct { // Resumes the LRO from the provided token. ResumeToken string }
CapacityReservationsClientBeginDeleteOptions contains the optional parameters for the CapacityReservationsClient.BeginDelete method.
type CapacityReservationsClientBeginUpdateOptions ¶
type CapacityReservationsClientBeginUpdateOptions struct { // Resumes the LRO from the provided token. ResumeToken string }
CapacityReservationsClientBeginUpdateOptions contains the optional parameters for the CapacityReservationsClient.BeginUpdate method.
type CapacityReservationsClientCreateOrUpdateResponse ¶
type CapacityReservationsClientCreateOrUpdateResponse struct { // Specifies information about the capacity reservation. CapacityReservation }
CapacityReservationsClientCreateOrUpdateResponse contains the response from method CapacityReservationsClient.BeginCreateOrUpdate.
type CapacityReservationsClientDeleteResponse ¶
type CapacityReservationsClientDeleteResponse struct { }
CapacityReservationsClientDeleteResponse contains the response from method CapacityReservationsClient.BeginDelete.
type CapacityReservationsClientGetOptions ¶
type CapacityReservationsClientGetOptions struct { // The expand expression to apply on the operation. 'InstanceView' retrieves a snapshot of the runtime properties of the capacity // reservation that is managed by the platform and can change outside of // control plane operations. Expand *CapacityReservationInstanceViewTypes }
CapacityReservationsClientGetOptions contains the optional parameters for the CapacityReservationsClient.Get method.
type CapacityReservationsClientGetResponse ¶
type CapacityReservationsClientGetResponse struct { // Specifies information about the capacity reservation. CapacityReservation }
CapacityReservationsClientGetResponse contains the response from method CapacityReservationsClient.Get.
type CapacityReservationsClientListByCapacityReservationGroupOptions ¶
type CapacityReservationsClientListByCapacityReservationGroupOptions struct { }
CapacityReservationsClientListByCapacityReservationGroupOptions contains the optional parameters for the CapacityReservationsClient.NewListByCapacityReservationGroupPager method.
type CapacityReservationsClientListByCapacityReservationGroupResponse ¶
type CapacityReservationsClientListByCapacityReservationGroupResponse struct { // The list capacity reservation operation response. CapacityReservationListResult }
CapacityReservationsClientListByCapacityReservationGroupResponse contains the response from method CapacityReservationsClient.NewListByCapacityReservationGroupPager.
type CapacityReservationsClientUpdateResponse ¶
type CapacityReservationsClientUpdateResponse struct { // Specifies information about the capacity reservation. CapacityReservation }
CapacityReservationsClientUpdateResponse contains the response from method CapacityReservationsClient.BeginUpdate.
type ClientFactory ¶
type ClientFactory struct {
// contains filtered or unexported fields
}
ClientFactory is a client factory used to create any client in this module. Don't use this type directly, use NewClientFactory instead.
func NewClientFactory ¶
func NewClientFactory(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*ClientFactory, error)
NewClientFactory creates a new instance of ClientFactory with the specified values. The parameter values will be propagated to any client created from this factory.
- 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 (*ClientFactory) NewAvailabilitySetsClient ¶
func (c *ClientFactory) NewAvailabilitySetsClient() *AvailabilitySetsClient
NewAvailabilitySetsClient creates a new instance of AvailabilitySetsClient.
func (*ClientFactory) NewCapacityReservationGroupsClient ¶
func (c *ClientFactory) NewCapacityReservationGroupsClient() *CapacityReservationGroupsClient
NewCapacityReservationGroupsClient creates a new instance of CapacityReservationGroupsClient.
func (*ClientFactory) NewCapacityReservationsClient ¶
func (c *ClientFactory) NewCapacityReservationsClient() *CapacityReservationsClient
NewCapacityReservationsClient creates a new instance of CapacityReservationsClient.
func (*ClientFactory) NewCloudServiceOperatingSystemsClient ¶
func (c *ClientFactory) NewCloudServiceOperatingSystemsClient() *CloudServiceOperatingSystemsClient
NewCloudServiceOperatingSystemsClient creates a new instance of CloudServiceOperatingSystemsClient.
func (*ClientFactory) NewCloudServiceRoleInstancesClient ¶
func (c *ClientFactory) NewCloudServiceRoleInstancesClient() *CloudServiceRoleInstancesClient
NewCloudServiceRoleInstancesClient creates a new instance of CloudServiceRoleInstancesClient.
func (*ClientFactory) NewCloudServiceRolesClient ¶
func (c *ClientFactory) NewCloudServiceRolesClient() *CloudServiceRolesClient
NewCloudServiceRolesClient creates a new instance of CloudServiceRolesClient.
func (*ClientFactory) NewCloudServicesClient ¶
func (c *ClientFactory) NewCloudServicesClient() *CloudServicesClient
NewCloudServicesClient creates a new instance of CloudServicesClient.
func (*ClientFactory) NewCloudServicesUpdateDomainClient ¶
func (c *ClientFactory) NewCloudServicesUpdateDomainClient() *CloudServicesUpdateDomainClient
NewCloudServicesUpdateDomainClient creates a new instance of CloudServicesUpdateDomainClient.
func (*ClientFactory) NewCommunityGalleriesClient ¶
func (c *ClientFactory) NewCommunityGalleriesClient() *CommunityGalleriesClient
NewCommunityGalleriesClient creates a new instance of CommunityGalleriesClient.
func (*ClientFactory) NewCommunityGalleryImageVersionsClient ¶
func (c *ClientFactory) NewCommunityGalleryImageVersionsClient() *CommunityGalleryImageVersionsClient
NewCommunityGalleryImageVersionsClient creates a new instance of CommunityGalleryImageVersionsClient.
func (*ClientFactory) NewCommunityGalleryImagesClient ¶
func (c *ClientFactory) NewCommunityGalleryImagesClient() *CommunityGalleryImagesClient
NewCommunityGalleryImagesClient creates a new instance of CommunityGalleryImagesClient.
func (*ClientFactory) NewDedicatedHostGroupsClient ¶
func (c *ClientFactory) NewDedicatedHostGroupsClient() *DedicatedHostGroupsClient
NewDedicatedHostGroupsClient creates a new instance of DedicatedHostGroupsClient.
func (*ClientFactory) NewDedicatedHostsClient ¶
func (c *ClientFactory) NewDedicatedHostsClient() *DedicatedHostsClient
NewDedicatedHostsClient creates a new instance of DedicatedHostsClient.
func (*ClientFactory) NewDiskAccessesClient ¶
func (c *ClientFactory) NewDiskAccessesClient() *DiskAccessesClient
NewDiskAccessesClient creates a new instance of DiskAccessesClient.
func (*ClientFactory) NewDiskEncryptionSetsClient ¶
func (c *ClientFactory) NewDiskEncryptionSetsClient() *DiskEncryptionSetsClient
NewDiskEncryptionSetsClient creates a new instance of DiskEncryptionSetsClient.
func (*ClientFactory) NewDiskRestorePointClient ¶
func (c *ClientFactory) NewDiskRestorePointClient() *DiskRestorePointClient
NewDiskRestorePointClient creates a new instance of DiskRestorePointClient.
func (*ClientFactory) NewDisksClient ¶
func (c *ClientFactory) NewDisksClient() *DisksClient
NewDisksClient creates a new instance of DisksClient.
func (*ClientFactory) NewGalleriesClient ¶
func (c *ClientFactory) NewGalleriesClient() *GalleriesClient
NewGalleriesClient creates a new instance of GalleriesClient.
func (*ClientFactory) NewGalleryApplicationVersionsClient ¶
func (c *ClientFactory) NewGalleryApplicationVersionsClient() *GalleryApplicationVersionsClient
NewGalleryApplicationVersionsClient creates a new instance of GalleryApplicationVersionsClient.
func (*ClientFactory) NewGalleryApplicationsClient ¶
func (c *ClientFactory) NewGalleryApplicationsClient() *GalleryApplicationsClient
NewGalleryApplicationsClient creates a new instance of GalleryApplicationsClient.
func (*ClientFactory) NewGalleryImageVersionsClient ¶
func (c *ClientFactory) NewGalleryImageVersionsClient() *GalleryImageVersionsClient
NewGalleryImageVersionsClient creates a new instance of GalleryImageVersionsClient.
func (*ClientFactory) NewGalleryImagesClient ¶
func (c *ClientFactory) NewGalleryImagesClient() *GalleryImagesClient
NewGalleryImagesClient creates a new instance of GalleryImagesClient.
func (*ClientFactory) NewGallerySharingProfileClient ¶
func (c *ClientFactory) NewGallerySharingProfileClient() *GallerySharingProfileClient
NewGallerySharingProfileClient creates a new instance of GallerySharingProfileClient.
func (*ClientFactory) NewImagesClient ¶
func (c *ClientFactory) NewImagesClient() *ImagesClient
NewImagesClient creates a new instance of ImagesClient.
func (*ClientFactory) NewLogAnalyticsClient ¶
func (c *ClientFactory) NewLogAnalyticsClient() *LogAnalyticsClient
NewLogAnalyticsClient creates a new instance of LogAnalyticsClient.
func (*ClientFactory) NewOperationsClient ¶
func (c *ClientFactory) NewOperationsClient() *OperationsClient
NewOperationsClient creates a new instance of OperationsClient.
func (*ClientFactory) NewProximityPlacementGroupsClient ¶
func (c *ClientFactory) NewProximityPlacementGroupsClient() *ProximityPlacementGroupsClient
NewProximityPlacementGroupsClient creates a new instance of ProximityPlacementGroupsClient.
func (*ClientFactory) NewResourceSKUsClient ¶
func (c *ClientFactory) NewResourceSKUsClient() *ResourceSKUsClient
NewResourceSKUsClient creates a new instance of ResourceSKUsClient.
func (*ClientFactory) NewRestorePointCollectionsClient ¶
func (c *ClientFactory) NewRestorePointCollectionsClient() *RestorePointCollectionsClient
NewRestorePointCollectionsClient creates a new instance of RestorePointCollectionsClient.
func (*ClientFactory) NewRestorePointsClient ¶
func (c *ClientFactory) NewRestorePointsClient() *RestorePointsClient
NewRestorePointsClient creates a new instance of RestorePointsClient.
func (*ClientFactory) NewSSHPublicKeysClient ¶
func (c *ClientFactory) NewSSHPublicKeysClient() *SSHPublicKeysClient
NewSSHPublicKeysClient creates a new instance of SSHPublicKeysClient.
func (*ClientFactory) NewSharedGalleriesClient ¶
func (c *ClientFactory) NewSharedGalleriesClient() *SharedGalleriesClient
NewSharedGalleriesClient creates a new instance of SharedGalleriesClient.
func (*ClientFactory) NewSharedGalleryImageVersionsClient ¶
func (c *ClientFactory) NewSharedGalleryImageVersionsClient() *SharedGalleryImageVersionsClient
NewSharedGalleryImageVersionsClient creates a new instance of SharedGalleryImageVersionsClient.
func (*ClientFactory) NewSharedGalleryImagesClient ¶
func (c *ClientFactory) NewSharedGalleryImagesClient() *SharedGalleryImagesClient
NewSharedGalleryImagesClient creates a new instance of SharedGalleryImagesClient.
func (*ClientFactory) NewSnapshotsClient ¶
func (c *ClientFactory) NewSnapshotsClient() *SnapshotsClient
NewSnapshotsClient creates a new instance of SnapshotsClient.
func (*ClientFactory) NewUsageClient ¶
func (c *ClientFactory) NewUsageClient() *UsageClient
NewUsageClient creates a new instance of UsageClient.
func (*ClientFactory) NewVirtualMachineExtensionImagesClient ¶
func (c *ClientFactory) NewVirtualMachineExtensionImagesClient() *VirtualMachineExtensionImagesClient
NewVirtualMachineExtensionImagesClient creates a new instance of VirtualMachineExtensionImagesClient.
func (*ClientFactory) NewVirtualMachineExtensionsClient ¶
func (c *ClientFactory) NewVirtualMachineExtensionsClient() *VirtualMachineExtensionsClient
NewVirtualMachineExtensionsClient creates a new instance of VirtualMachineExtensionsClient.
func (*ClientFactory) NewVirtualMachineImagesClient ¶
func (c *ClientFactory) NewVirtualMachineImagesClient() *VirtualMachineImagesClient
NewVirtualMachineImagesClient creates a new instance of VirtualMachineImagesClient.
func (*ClientFactory) NewVirtualMachineImagesEdgeZoneClient ¶
func (c *ClientFactory) NewVirtualMachineImagesEdgeZoneClient() *VirtualMachineImagesEdgeZoneClient
NewVirtualMachineImagesEdgeZoneClient creates a new instance of VirtualMachineImagesEdgeZoneClient.
func (*ClientFactory) NewVirtualMachineRunCommandsClient ¶
func (c *ClientFactory) NewVirtualMachineRunCommandsClient() *VirtualMachineRunCommandsClient
NewVirtualMachineRunCommandsClient creates a new instance of VirtualMachineRunCommandsClient.
func (*ClientFactory) NewVirtualMachineScaleSetExtensionsClient ¶
func (c *ClientFactory) NewVirtualMachineScaleSetExtensionsClient() *VirtualMachineScaleSetExtensionsClient
NewVirtualMachineScaleSetExtensionsClient creates a new instance of VirtualMachineScaleSetExtensionsClient.
func (*ClientFactory) NewVirtualMachineScaleSetRollingUpgradesClient ¶
func (c *ClientFactory) NewVirtualMachineScaleSetRollingUpgradesClient() *VirtualMachineScaleSetRollingUpgradesClient
NewVirtualMachineScaleSetRollingUpgradesClient creates a new instance of VirtualMachineScaleSetRollingUpgradesClient.
func (*ClientFactory) NewVirtualMachineScaleSetVMExtensionsClient ¶
func (c *ClientFactory) NewVirtualMachineScaleSetVMExtensionsClient() *VirtualMachineScaleSetVMExtensionsClient
NewVirtualMachineScaleSetVMExtensionsClient creates a new instance of VirtualMachineScaleSetVMExtensionsClient.
func (*ClientFactory) NewVirtualMachineScaleSetVMRunCommandsClient ¶
func (c *ClientFactory) NewVirtualMachineScaleSetVMRunCommandsClient() *VirtualMachineScaleSetVMRunCommandsClient
NewVirtualMachineScaleSetVMRunCommandsClient creates a new instance of VirtualMachineScaleSetVMRunCommandsClient.
func (*ClientFactory) NewVirtualMachineScaleSetVMsClient ¶
func (c *ClientFactory) NewVirtualMachineScaleSetVMsClient() *VirtualMachineScaleSetVMsClient
NewVirtualMachineScaleSetVMsClient creates a new instance of VirtualMachineScaleSetVMsClient.
func (*ClientFactory) NewVirtualMachineScaleSetsClient ¶
func (c *ClientFactory) NewVirtualMachineScaleSetsClient() *VirtualMachineScaleSetsClient
NewVirtualMachineScaleSetsClient creates a new instance of VirtualMachineScaleSetsClient.
func (*ClientFactory) NewVirtualMachineSizesClient ¶
func (c *ClientFactory) NewVirtualMachineSizesClient() *VirtualMachineSizesClient
NewVirtualMachineSizesClient creates a new instance of VirtualMachineSizesClient.
func (*ClientFactory) NewVirtualMachinesClient ¶
func (c *ClientFactory) NewVirtualMachinesClient() *VirtualMachinesClient
NewVirtualMachinesClient creates a new instance of VirtualMachinesClient.
type CloudService ¶
type CloudService struct { // REQUIRED; Resource location. Location *string // Cloud service properties Properties *CloudServiceProperties // The system meta data relating to this resource. SystemData *SystemData // Resource tags. Tags map[string]*string // List of logical availability zone of the resource. List should contain only 1 zone where cloud service should be provisioned. // This field is optional. Zones []*string // READ-ONLY; Resource Id. ID *string // READ-ONLY; Resource name. Name *string // READ-ONLY; Resource type. Type *string }
CloudService - Describes the cloud service.
func (CloudService) MarshalJSON ¶
func (c CloudService) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type CloudService.
func (*CloudService) UnmarshalJSON ¶
func (c *CloudService) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type CloudService.
type CloudServiceExtensionProfile ¶
type CloudServiceExtensionProfile struct { // List of extensions for the cloud service. Extensions []*Extension }
CloudServiceExtensionProfile - Describes a cloud service extension profile.
func (CloudServiceExtensionProfile) MarshalJSON ¶
func (c CloudServiceExtensionProfile) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type CloudServiceExtensionProfile.
func (*CloudServiceExtensionProfile) UnmarshalJSON ¶
func (c *CloudServiceExtensionProfile) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type CloudServiceExtensionProfile.
type CloudServiceExtensionProperties ¶
type CloudServiceExtensionProperties struct { // Explicitly specify whether platform can automatically upgrade typeHandlerVersion to higher minor versions when they become // available. AutoUpgradeMinorVersion *bool // Tag to force apply the provided public and protected settings. Changing the tag value allows for re-running the extension // without changing any of the public or protected settings. If forceUpdateTag is // not changed, updates to public or protected settings would still be applied by the handler. If neither forceUpdateTag nor // any of public or protected settings change, extension would flow to the role // instance with the same sequence-number, and it is up to handler implementation whether to re-run it or not ForceUpdateTag *string // Protected settings for the extension which are encrypted before sent to the role instance. ProtectedSettings any // Protected settings for the extension, referenced using KeyVault which are encrypted before sent to the role instance. ProtectedSettingsFromKeyVault *CloudServiceVaultAndSecretReference // The name of the extension handler publisher. Publisher *string // Optional list of roles to apply this extension. If property is not specified or '*' is specified, extension is applied // to all roles in the cloud service. RolesAppliedTo []*string // Public settings for the extension. For JSON extensions, this is the JSON settings for the extension. For XML Extension // (like RDP), this is the XML setting for the extension. Settings any // Specifies the type of the extension. Type *string // Specifies the version of the extension. Specifies the version of the extension. If this element is not specified or an // asterisk (*) is used as the value, the latest version of the extension is used. // If the value is specified with a major version number and an asterisk as the minor version number (X.), the latest minor // version of the specified major version is selected. If a major version number // and a minor version number are specified (X.Y), the specific extension version is selected. If a version is specified, // an auto-upgrade is performed on the role instance. TypeHandlerVersion *string // READ-ONLY; The provisioning state, which only appears in the response. ProvisioningState *string }
CloudServiceExtensionProperties - Extension Properties.
func (CloudServiceExtensionProperties) MarshalJSON ¶
func (c CloudServiceExtensionProperties) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type CloudServiceExtensionProperties.
func (*CloudServiceExtensionProperties) UnmarshalJSON ¶
func (c *CloudServiceExtensionProperties) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type CloudServiceExtensionProperties.
type CloudServiceInstanceView ¶
type CloudServiceInstanceView struct { // Instance view statuses. RoleInstance *InstanceViewStatusesSummary // READ-ONLY; Specifies a list of unique identifiers generated internally for the cloud service. // NOTE: If you are using Azure Diagnostics extension, this property can be used as 'DeploymentId' for querying details. PrivateIDs []*string // READ-ONLY; The version of the SDK that was used to generate the package for the cloud service. SdkVersion *string // READ-ONLY Statuses []*ResourceInstanceViewStatus }
CloudServiceInstanceView - InstanceView of CloudService as a whole
func (CloudServiceInstanceView) MarshalJSON ¶
func (c CloudServiceInstanceView) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type CloudServiceInstanceView.
func (*CloudServiceInstanceView) UnmarshalJSON ¶
func (c *CloudServiceInstanceView) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type CloudServiceInstanceView.
type CloudServiceListResult ¶
type CloudServiceListResult struct { // REQUIRED; The list of resources. Value []*CloudService // The URI to fetch the next page of resources. Use this to get the next page of resources. Do this till nextLink is null // to fetch all the resources. NextLink *string }
CloudServiceListResult - The list operation result.
func (CloudServiceListResult) MarshalJSON ¶
func (c CloudServiceListResult) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type CloudServiceListResult.
func (*CloudServiceListResult) UnmarshalJSON ¶
func (c *CloudServiceListResult) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type CloudServiceListResult.
type CloudServiceNetworkProfile ¶
type CloudServiceNetworkProfile struct { // List of Load balancer configurations. Cloud service can have up to two load balancer configurations, corresponding to a // Public Load Balancer and an Internal Load Balancer. LoadBalancerConfigurations []*LoadBalancerConfiguration // Slot type for the cloud service. Possible values are // Production // Staging // If not specified, the default value is Production. SlotType *CloudServiceSlotType // The id reference of the cloud service containing the target IP with which the subject cloud service can perform a swap. // This property cannot be updated once it is set. The swappable cloud service // referred by this id must be present otherwise an error will be thrown. SwappableCloudService *SubResource }
CloudServiceNetworkProfile - Network Profile for the cloud service.
func (CloudServiceNetworkProfile) MarshalJSON ¶
func (c CloudServiceNetworkProfile) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type CloudServiceNetworkProfile.
func (*CloudServiceNetworkProfile) UnmarshalJSON ¶
func (c *CloudServiceNetworkProfile) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type CloudServiceNetworkProfile.
type CloudServiceOperatingSystemsClient ¶
type CloudServiceOperatingSystemsClient struct {
// contains filtered or unexported fields
}
CloudServiceOperatingSystemsClient contains the methods for the CloudServiceOperatingSystems group. Don't use this type directly, use NewCloudServiceOperatingSystemsClient() instead.
func NewCloudServiceOperatingSystemsClient ¶
func NewCloudServiceOperatingSystemsClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*CloudServiceOperatingSystemsClient, error)
NewCloudServiceOperatingSystemsClient creates a new instance of CloudServiceOperatingSystemsClient 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 (*CloudServiceOperatingSystemsClient) GetOSFamily ¶
func (client *CloudServiceOperatingSystemsClient) GetOSFamily(ctx context.Context, location string, osFamilyName string, options *CloudServiceOperatingSystemsClientGetOSFamilyOptions) (CloudServiceOperatingSystemsClientGetOSFamilyResponse, error)
GetOSFamily - Gets properties of a guest operating system family that can be specified in the XML service configuration (.cscfg) for a cloud service. If the operation fails it returns an *azcore.ResponseError type.
Generated from API version 2022-09-04
- location - Name of the location that the OS family pertains to.
- osFamilyName - Name of the OS family.
- options - CloudServiceOperatingSystemsClientGetOSFamilyOptions contains the optional parameters for the CloudServiceOperatingSystemsClient.GetOSFamily method.
Example ¶
Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/92de53a5f1e0e03c94b40475d2135d97148ed014/specification/compute/resource-manager/Microsoft.Compute/CloudserviceRP/stable/2022-09-04/examples/CloudServiceOSFamily_Get.json
cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() clientFactory, err := armcompute.NewClientFactory("<subscription-id>", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } res, err := clientFactory.NewCloudServiceOperatingSystemsClient().GetOSFamily(ctx, "westus2", "3", nil) if err != nil { log.Fatalf("failed to finish the request: %v", err) } // You could use response here. We use blank identifier for just demo purposes. _ = res // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. // res.OSFamily = armcompute.OSFamily{ // Name: to.Ptr("3"), // Type: to.Ptr("Microsoft.Compute/locations/cloudServiceOsFamilies"), // ID: to.Ptr("/subscriptions/{subscription-id}/providers/Microsoft.Compute/locations/westus2/cloudServiceOSFamilies/3"), // Location: to.Ptr("westus2"), // Properties: &armcompute.OSFamilyProperties{ // Name: to.Ptr("3"), // Label: to.Ptr("Windows Server 2012"), // Versions: []*armcompute.OSVersionPropertiesBase{ // { // IsActive: to.Ptr(true), // IsDefault: to.Ptr(true), // Label: to.Ptr("Windows Azure Guest OS 3.90 (Release 202010-02)"), // Version: to.Ptr("WA-GUEST-OS-3.90_202010-02"), // }}, // }, // }
Output:
func (*CloudServiceOperatingSystemsClient) GetOSVersion ¶
func (client *CloudServiceOperatingSystemsClient) GetOSVersion(ctx context.Context, location string, osVersionName string, options *CloudServiceOperatingSystemsClientGetOSVersionOptions) (CloudServiceOperatingSystemsClientGetOSVersionResponse, error)
GetOSVersion - Gets properties of a guest operating system version that can be specified in the XML service configuration (.cscfg) for a cloud service. If the operation fails it returns an *azcore.ResponseError type.
Generated from API version 2022-09-04
- location - Name of the location that the OS version pertains to.
- osVersionName - Name of the OS version.
- options - CloudServiceOperatingSystemsClientGetOSVersionOptions contains the optional parameters for the CloudServiceOperatingSystemsClient.GetOSVersion method.
Example ¶
Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/92de53a5f1e0e03c94b40475d2135d97148ed014/specification/compute/resource-manager/Microsoft.Compute/CloudserviceRP/stable/2022-09-04/examples/CloudServiceOSVersion_Get.json
cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() clientFactory, err := armcompute.NewClientFactory("<subscription-id>", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } res, err := clientFactory.NewCloudServiceOperatingSystemsClient().GetOSVersion(ctx, "westus2", "WA-GUEST-OS-3.90_202010-02", nil) if err != nil { log.Fatalf("failed to finish the request: %v", err) } // You could use response here. We use blank identifier for just demo purposes. _ = res // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. // res.OSVersion = armcompute.OSVersion{ // Name: to.Ptr("WA-GUEST-OS-3.90_202010-02"), // Type: to.Ptr("Microsoft.Compute/locations/cloudServiceOsVersions"), // ID: to.Ptr("/subscriptions/{subscription-id}/providers/Microsoft.Compute/locations/westus2/cloudServiceOSVersions/WA-GUEST-OS-3.90_202010-02"), // Location: to.Ptr("westus2"), // Properties: &armcompute.OSVersionProperties{ // Family: to.Ptr("3"), // FamilyLabel: to.Ptr("Windows Server 2012"), // IsActive: to.Ptr(true), // IsDefault: to.Ptr(true), // Label: to.Ptr("Windows Azure Guest OS 3.90 (Release 202010-02)"), // Version: to.Ptr("WA-GUEST-OS-3.90_202010-02"), // }, // }
Output:
func (*CloudServiceOperatingSystemsClient) NewListOSFamiliesPager ¶
func (client *CloudServiceOperatingSystemsClient) NewListOSFamiliesPager(location string, options *CloudServiceOperatingSystemsClientListOSFamiliesOptions) *runtime.Pager[CloudServiceOperatingSystemsClientListOSFamiliesResponse]
NewListOSFamiliesPager - Gets a list of all guest operating system families available to be specified in the XML service configuration (.cscfg) for a cloud service. Use nextLink property in the response to get the next page of OS Families. Do this till nextLink is null to fetch all the OS Families.
Generated from API version 2022-09-04
- location - Name of the location that the OS families pertain to.
- options - CloudServiceOperatingSystemsClientListOSFamiliesOptions contains the optional parameters for the CloudServiceOperatingSystemsClient.NewListOSFamiliesPager method.
Example ¶
Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/92de53a5f1e0e03c94b40475d2135d97148ed014/specification/compute/resource-manager/Microsoft.Compute/CloudserviceRP/stable/2022-09-04/examples/CloudServiceOSFamilies_List.json
cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() clientFactory, err := armcompute.NewClientFactory("<subscription-id>", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } pager := clientFactory.NewCloudServiceOperatingSystemsClient().NewListOSFamiliesPager("westus2", nil) for pager.More() { page, err := pager.NextPage(ctx) if err != nil { log.Fatalf("failed to advance page: %v", err) } for _, v := range page.Value { // You could use page here. We use blank identifier for just demo purposes. _ = v } // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. // page.OSFamilyListResult = armcompute.OSFamilyListResult{ // Value: []*armcompute.OSFamily{ // { // Name: to.Ptr("3"), // Type: to.Ptr("Microsoft.Compute/locations/cloudServiceOsFamilies"), // ID: to.Ptr("/subscriptions/{subscription-id}/providers/Microsoft.Compute/locations/westus2/cloudServiceOSFamilies/3"), // Location: to.Ptr("westus2"), // Properties: &armcompute.OSFamilyProperties{ // Name: to.Ptr("3"), // Label: to.Ptr("Windows Server 2012"), // Versions: []*armcompute.OSVersionPropertiesBase{ // { // IsActive: to.Ptr(true), // IsDefault: to.Ptr(true), // Label: to.Ptr("Windows Azure Guest OS 3.90 (Release 202010-02)"), // Version: to.Ptr("WA-GUEST-OS-3.90_202010-02"), // }}, // }, // }, // { // Name: to.Ptr("4"), // Type: to.Ptr("Microsoft.Compute/locations/cloudServiceOsFamilies"), // ID: to.Ptr("/subscriptions/{subscription-id}/providers/Microsoft.Compute/locations/westus2/cloudServiceOSFamilies/4"), // Location: to.Ptr("westus2"), // Properties: &armcompute.OSFamilyProperties{ // Name: to.Ptr("4"), // Label: to.Ptr("Windows Server 2012 R2"), // Versions: []*armcompute.OSVersionPropertiesBase{ // { // IsActive: to.Ptr(true), // IsDefault: to.Ptr(true), // Label: to.Ptr("Windows Azure Guest OS 4.83 (Release 202010-02)"), // Version: to.Ptr("WA-GUEST-OS-4.83_202010-02"), // }}, // }, // }}, // } }
Output:
func (*CloudServiceOperatingSystemsClient) NewListOSVersionsPager ¶
func (client *CloudServiceOperatingSystemsClient) NewListOSVersionsPager(location string, options *CloudServiceOperatingSystemsClientListOSVersionsOptions) *runtime.Pager[CloudServiceOperatingSystemsClientListOSVersionsResponse]
NewListOSVersionsPager - Gets a list of all guest operating system versions available to be specified in the XML service configuration (.cscfg) for a cloud service. Use nextLink property in the response to get the next page of OS versions. Do this till nextLink is null to fetch all the OS versions.
Generated from API version 2022-09-04
- location - Name of the location that the OS versions pertain to.
- options - CloudServiceOperatingSystemsClientListOSVersionsOptions contains the optional parameters for the CloudServiceOperatingSystemsClient.NewListOSVersionsPager method.
Example ¶
Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/92de53a5f1e0e03c94b40475d2135d97148ed014/specification/compute/resource-manager/Microsoft.Compute/CloudserviceRP/stable/2022-09-04/examples/CloudServiceOSVersion_List.json
cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() clientFactory, err := armcompute.NewClientFactory("<subscription-id>", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } pager := clientFactory.NewCloudServiceOperatingSystemsClient().NewListOSVersionsPager("westus2", nil) for pager.More() { page, err := pager.NextPage(ctx) if err != nil { log.Fatalf("failed to advance page: %v", err) } for _, v := range page.Value { // You could use page here. We use blank identifier for just demo purposes. _ = v } // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. // page.OSVersionListResult = armcompute.OSVersionListResult{ // Value: []*armcompute.OSVersion{ // { // Name: to.Ptr("WA-GUEST-OS-3.90_202010-02"), // Type: to.Ptr("Microsoft.Compute/locations/cloudServiceOsVersions"), // ID: to.Ptr("/subscriptions/{subscription-id}/providers/Microsoft.Compute/locations/westus2/cloudServiceOSVersions/WA-GUEST-OS-3.90_202010-02"), // Location: to.Ptr("westus2"), // Properties: &armcompute.OSVersionProperties{ // Family: to.Ptr("3"), // FamilyLabel: to.Ptr("Windows Server 2012"), // IsActive: to.Ptr(true), // IsDefault: to.Ptr(true), // Label: to.Ptr("Windows Azure Guest OS 3.90 (Release 202010-02)"), // Version: to.Ptr("WA-GUEST-OS-3.90_202010-02"), // }, // }, // { // Name: to.Ptr("WA-GUEST-OS-4.83_202010-02"), // Type: to.Ptr("Microsoft.Compute/locations/cloudServiceOsVersions"), // ID: to.Ptr("/subscriptions/{subscription-id}/providers/Microsoft.Compute/locations/westus2/cloudServiceOSVersions/WA-GUEST-OS-4.83_202010-02"), // Location: to.Ptr("westus2"), // Properties: &armcompute.OSVersionProperties{ // Family: to.Ptr("4"), // FamilyLabel: to.Ptr("Windows Server 2012 R2"), // IsActive: to.Ptr(true), // IsDefault: to.Ptr(true), // Label: to.Ptr("Windows Azure Guest OS 4.83 (Release 202010-02)"), // Version: to.Ptr("WA-GUEST-OS-4.83_202010-02"), // }, // }}, // } }
Output:
type CloudServiceOperatingSystemsClientGetOSFamilyOptions ¶
type CloudServiceOperatingSystemsClientGetOSFamilyOptions struct { }
CloudServiceOperatingSystemsClientGetOSFamilyOptions contains the optional parameters for the CloudServiceOperatingSystemsClient.GetOSFamily method.
type CloudServiceOperatingSystemsClientGetOSFamilyResponse ¶
type CloudServiceOperatingSystemsClientGetOSFamilyResponse struct { // Describes a cloud service OS family. OSFamily }
CloudServiceOperatingSystemsClientGetOSFamilyResponse contains the response from method CloudServiceOperatingSystemsClient.GetOSFamily.
type CloudServiceOperatingSystemsClientGetOSVersionOptions ¶
type CloudServiceOperatingSystemsClientGetOSVersionOptions struct { }
CloudServiceOperatingSystemsClientGetOSVersionOptions contains the optional parameters for the CloudServiceOperatingSystemsClient.GetOSVersion method.
type CloudServiceOperatingSystemsClientGetOSVersionResponse ¶
type CloudServiceOperatingSystemsClientGetOSVersionResponse struct { // Describes a cloud service OS version. OSVersion }
CloudServiceOperatingSystemsClientGetOSVersionResponse contains the response from method CloudServiceOperatingSystemsClient.GetOSVersion.
type CloudServiceOperatingSystemsClientListOSFamiliesOptions ¶
type CloudServiceOperatingSystemsClientListOSFamiliesOptions struct { }
CloudServiceOperatingSystemsClientListOSFamiliesOptions contains the optional parameters for the CloudServiceOperatingSystemsClient.NewListOSFamiliesPager method.
type CloudServiceOperatingSystemsClientListOSFamiliesResponse ¶
type CloudServiceOperatingSystemsClientListOSFamiliesResponse struct { // The list operation result. OSFamilyListResult }
CloudServiceOperatingSystemsClientListOSFamiliesResponse contains the response from method CloudServiceOperatingSystemsClient.NewListOSFamiliesPager.
type CloudServiceOperatingSystemsClientListOSVersionsOptions ¶
type CloudServiceOperatingSystemsClientListOSVersionsOptions struct { }
CloudServiceOperatingSystemsClientListOSVersionsOptions contains the optional parameters for the CloudServiceOperatingSystemsClient.NewListOSVersionsPager method.
type CloudServiceOperatingSystemsClientListOSVersionsResponse ¶
type CloudServiceOperatingSystemsClientListOSVersionsResponse struct { // The list operation result. OSVersionListResult }
CloudServiceOperatingSystemsClientListOSVersionsResponse contains the response from method CloudServiceOperatingSystemsClient.NewListOSVersionsPager.
type CloudServiceOsProfile ¶
type CloudServiceOsProfile struct { // Specifies set of certificates that should be installed onto the role instances. Secrets []*CloudServiceVaultSecretGroup }
CloudServiceOsProfile - Describes the OS profile for the cloud service.
func (CloudServiceOsProfile) MarshalJSON ¶
func (c CloudServiceOsProfile) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type CloudServiceOsProfile.
func (*CloudServiceOsProfile) UnmarshalJSON ¶
func (c *CloudServiceOsProfile) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type CloudServiceOsProfile.
type CloudServiceProperties ¶
type CloudServiceProperties struct { // (Optional) Indicates whether the role sku properties (roleProfile.roles.sku) specified in the model/template should override // the role instance count and vm size specified in the .cscfg and .csdef // respectively. The default value is false. AllowModelOverride *bool // Specifies the XML service configuration (.cscfg) for the cloud service. Configuration *string // Specifies a URL that refers to the location of the service configuration in the Blob service. The service package URL can // be Shared Access Signature (SAS) URI from any storage account. This is a // write-only property and is not returned in GET calls. ConfigurationURL *string // Describes a cloud service extension profile. ExtensionProfile *CloudServiceExtensionProfile // Network Profile for the cloud service. NetworkProfile *CloudServiceNetworkProfile // Describes the OS profile for the cloud service. OSProfile *CloudServiceOsProfile // Specifies a URL that refers to the location of the service package in the Blob service. The service package URL can be // Shared Access Signature (SAS) URI from any storage account. This is a write-only // property and is not returned in GET calls. PackageURL *string // Describes the role profile for the cloud service. RoleProfile *CloudServiceRoleProfile // (Optional) Indicates whether to start the cloud service immediately after it is created. The default value is true. If // false, the service model is still deployed, but the code is not run immediately. // Instead, the service is PoweredOff until you call Start, at which time the service will be started. A deployed service // still incurs charges, even if it is poweredoff. StartCloudService *bool // Update mode for the cloud service. Role instances are allocated to update domains when the service is deployed. Updates // can be initiated manually in each update domain or initiated automatically in // all update domains. Possible Values are // Auto // Manual // Simultaneous // If not specified, the default value is Auto. If set to Manual, PUT UpdateDomain must be called to apply the update. If // set to Auto, the update is automatically applied to each update domain in // sequence. UpgradeMode *CloudServiceUpgradeMode // READ-ONLY; The provisioning state, which only appears in the response. ProvisioningState *string // READ-ONLY; The unique identifier for the cloud service. UniqueID *string }
CloudServiceProperties - Cloud service properties
func (CloudServiceProperties) MarshalJSON ¶
func (c CloudServiceProperties) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type CloudServiceProperties.
func (*CloudServiceProperties) UnmarshalJSON ¶
func (c *CloudServiceProperties) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type CloudServiceProperties.
type CloudServiceRole ¶
type CloudServiceRole struct { // The cloud service role properties. Properties *CloudServiceRoleProperties // Describes the cloud service role sku. SKU *CloudServiceRoleSKU // READ-ONLY; Resource id ID *string // READ-ONLY; Resource location Location *string // READ-ONLY; Resource name Name *string // READ-ONLY; Resource type Type *string }
CloudServiceRole - Describes a role of the cloud service.
func (CloudServiceRole) MarshalJSON ¶
func (c CloudServiceRole) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type CloudServiceRole.
func (*CloudServiceRole) UnmarshalJSON ¶
func (c *CloudServiceRole) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type CloudServiceRole.
type CloudServiceRoleInstancesClient ¶
type CloudServiceRoleInstancesClient struct {
// contains filtered or unexported fields
}
CloudServiceRoleInstancesClient contains the methods for the CloudServiceRoleInstances group. Don't use this type directly, use NewCloudServiceRoleInstancesClient() instead.
func NewCloudServiceRoleInstancesClient ¶
func NewCloudServiceRoleInstancesClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*CloudServiceRoleInstancesClient, error)
NewCloudServiceRoleInstancesClient creates a new instance of CloudServiceRoleInstancesClient 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 (*CloudServiceRoleInstancesClient) BeginDelete ¶
func (client *CloudServiceRoleInstancesClient) BeginDelete(ctx context.Context, roleInstanceName string, resourceGroupName string, cloudServiceName string, options *CloudServiceRoleInstancesClientBeginDeleteOptions) (*runtime.Poller[CloudServiceRoleInstancesClientDeleteResponse], error)
BeginDelete - Deletes a role instance from a cloud service. If the operation fails it returns an *azcore.ResponseError type.
Generated from API version 2022-09-04
- roleInstanceName - Name of the role instance.
- resourceGroupName - Name of the resource group.
- cloudServiceName - Name of the cloud service.
- options - CloudServiceRoleInstancesClientBeginDeleteOptions contains the optional parameters for the CloudServiceRoleInstancesClient.BeginDelete method.
Example ¶
Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/92de53a5f1e0e03c94b40475d2135d97148ed014/specification/compute/resource-manager/Microsoft.Compute/CloudserviceRP/stable/2022-09-04/examples/CloudServiceRoleInstance_Delete.json
cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() clientFactory, err := armcompute.NewClientFactory("<subscription-id>", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } poller, err := clientFactory.NewCloudServiceRoleInstancesClient().BeginDelete(ctx, "{roleInstance-name}", "ConstosoRG", "{cs-name}", nil) if err != nil { log.Fatalf("failed to finish the request: %v", err) } _, err = poller.PollUntilDone(ctx, nil) if err != nil { log.Fatalf("failed to pull the result: %v", err) }
Output:
func (*CloudServiceRoleInstancesClient) BeginRebuild ¶
func (client *CloudServiceRoleInstancesClient) BeginRebuild(ctx context.Context, roleInstanceName string, resourceGroupName string, cloudServiceName string, options *CloudServiceRoleInstancesClientBeginRebuildOptions) (*runtime.Poller[CloudServiceRoleInstancesClientRebuildResponse], error)
BeginRebuild - The Rebuild Role Instance asynchronous operation reinstalls the operating system on instances of web roles or worker roles and initializes the storage resources that are used by them. If you do not want to initialize storage resources, you can use Reimage Role Instance. If the operation fails it returns an *azcore.ResponseError type.
Generated from API version 2022-09-04
- roleInstanceName - Name of the role instance.
- resourceGroupName - Name of the resource group.
- cloudServiceName - Name of the cloud service.
- options - CloudServiceRoleInstancesClientBeginRebuildOptions contains the optional parameters for the CloudServiceRoleInstancesClient.BeginRebuild method.
Example ¶
Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/92de53a5f1e0e03c94b40475d2135d97148ed014/specification/compute/resource-manager/Microsoft.Compute/CloudserviceRP/stable/2022-09-04/examples/CloudServiceRoleInstance_Rebuild.json
cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() clientFactory, err := armcompute.NewClientFactory("<subscription-id>", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } poller, err := clientFactory.NewCloudServiceRoleInstancesClient().BeginRebuild(ctx, "{roleInstance-name}", "ConstosoRG", "{cs-name}", nil) if err != nil { log.Fatalf("failed to finish the request: %v", err) } _, err = poller.PollUntilDone(ctx, nil) if err != nil { log.Fatalf("failed to pull the result: %v", err) }
Output:
func (*CloudServiceRoleInstancesClient) BeginReimage ¶
func (client *CloudServiceRoleInstancesClient) BeginReimage(ctx context.Context, roleInstanceName string, resourceGroupName string, cloudServiceName string, options *CloudServiceRoleInstancesClientBeginReimageOptions) (*runtime.Poller[CloudServiceRoleInstancesClientReimageResponse], error)
BeginReimage - The Reimage Role Instance asynchronous operation reinstalls the operating system on instances of web roles or worker roles. If the operation fails it returns an *azcore.ResponseError type.
Generated from API version 2022-09-04
- roleInstanceName - Name of the role instance.
- resourceGroupName - Name of the resource group.
- cloudServiceName - Name of the cloud service.
- options - CloudServiceRoleInstancesClientBeginReimageOptions contains the optional parameters for the CloudServiceRoleInstancesClient.BeginReimage method.
Example ¶
Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/92de53a5f1e0e03c94b40475d2135d97148ed014/specification/compute/resource-manager/Microsoft.Compute/CloudserviceRP/stable/2022-09-04/examples/CloudServiceRoleInstance_Reimage.json
cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() clientFactory, err := armcompute.NewClientFactory("<subscription-id>", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } poller, err := clientFactory.NewCloudServiceRoleInstancesClient().BeginReimage(ctx, "{roleInstance-name}", "ConstosoRG", "{cs-name}", nil) if err != nil { log.Fatalf("failed to finish the request: %v", err) } _, err = poller.PollUntilDone(ctx, nil) if err != nil { log.Fatalf("failed to pull the result: %v", err) }
Output:
func (*CloudServiceRoleInstancesClient) BeginRestart ¶
func (client *CloudServiceRoleInstancesClient) BeginRestart(ctx context.Context, roleInstanceName string, resourceGroupName string, cloudServiceName string, options *CloudServiceRoleInstancesClientBeginRestartOptions) (*runtime.Poller[CloudServiceRoleInstancesClientRestartResponse], error)
BeginRestart - The Reboot Role Instance asynchronous operation requests a reboot of a role instance in the cloud service. If the operation fails it returns an *azcore.ResponseError type.
Generated from API version 2022-09-04
- roleInstanceName - Name of the role instance.
- resourceGroupName - Name of the resource group.
- cloudServiceName - Name of the cloud service.
- options - CloudServiceRoleInstancesClientBeginRestartOptions contains the optional parameters for the CloudServiceRoleInstancesClient.BeginRestart method.
Example ¶
Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/92de53a5f1e0e03c94b40475d2135d97148ed014/specification/compute/resource-manager/Microsoft.Compute/CloudserviceRP/stable/2022-09-04/examples/CloudServiceRoleInstance_Restart.json
cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() clientFactory, err := armcompute.NewClientFactory("<subscription-id>", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } poller, err := clientFactory.NewCloudServiceRoleInstancesClient().BeginRestart(ctx, "{roleInstance-name}", "ConstosoRG", "{cs-name}", nil) if err != nil { log.Fatalf("failed to finish the request: %v", err) } _, err = poller.PollUntilDone(ctx, nil) if err != nil { log.Fatalf("failed to pull the result: %v", err) }
Output:
func (*CloudServiceRoleInstancesClient) Get ¶
func (client *CloudServiceRoleInstancesClient) Get(ctx context.Context, roleInstanceName string, resourceGroupName string, cloudServiceName string, options *CloudServiceRoleInstancesClientGetOptions) (CloudServiceRoleInstancesClientGetResponse, error)
Get - Gets a role instance from a cloud service. If the operation fails it returns an *azcore.ResponseError type.
Generated from API version 2022-09-04
- roleInstanceName - Name of the role instance.
- resourceGroupName - Name of the resource group.
- cloudServiceName - Name of the cloud service.
- options - CloudServiceRoleInstancesClientGetOptions contains the optional parameters for the CloudServiceRoleInstancesClient.Get method.
Example ¶
Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/92de53a5f1e0e03c94b40475d2135d97148ed014/specification/compute/resource-manager/Microsoft.Compute/CloudserviceRP/stable/2022-09-04/examples/CloudServiceRoleInstance_Get.json
cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() clientFactory, err := armcompute.NewClientFactory("<subscription-id>", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } res, err := clientFactory.NewCloudServiceRoleInstancesClient().Get(ctx, "{roleInstance-name}", "ConstosoRG", "{cs-name}", &armcompute.CloudServiceRoleInstancesClientGetOptions{Expand: nil}) if err != nil { log.Fatalf("failed to finish the request: %v", err) } // You could use response here. We use blank identifier for just demo purposes. _ = res // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. // res.RoleInstance = armcompute.RoleInstance{ // Name: to.Ptr("{roleInstance-name}"), // Type: to.Ptr("Microsoft.Compute/cloudServices/roleInstances"), // ID: to.Ptr("/subscriptions/{subscription-id}/resourceGroups/ConstosoRG/providers/Microsoft.Compute/cloudServices/{cs-name}/roleInstances/{roleInstance-name}"), // Location: to.Ptr("eastus2euap"), // Properties: &armcompute.RoleInstanceProperties{ // NetworkProfile: &armcompute.RoleInstanceNetworkProfile{ // NetworkInterfaces: []*armcompute.SubResource{ // { // ID: to.Ptr("/subscriptions/{subscription-id}/resourceGroups/ConstosoRG/providers/Microsoft.Compute/cloudServices/{cs-name}/roleInstances/{roleInstance-name}/networkInterfaces/nic1"), // }}, // }, // }, // SKU: &armcompute.InstanceSKU{ // Name: to.Ptr("Standard_D1_v2"), // Tier: to.Ptr("Standard"), // }, // }
Output:
func (*CloudServiceRoleInstancesClient) GetInstanceView ¶
func (client *CloudServiceRoleInstancesClient) GetInstanceView(ctx context.Context, roleInstanceName string, resourceGroupName string, cloudServiceName string, options *CloudServiceRoleInstancesClientGetInstanceViewOptions) (CloudServiceRoleInstancesClientGetInstanceViewResponse, error)
GetInstanceView - Retrieves information about the run-time state of a role instance in a cloud service. If the operation fails it returns an *azcore.ResponseError type.
Generated from API version 2022-09-04
- roleInstanceName - Name of the role instance.
- resourceGroupName - Name of the resource group.
- cloudServiceName - Name of the cloud service.
- options - CloudServiceRoleInstancesClientGetInstanceViewOptions contains the optional parameters for the CloudServiceRoleInstancesClient.GetInstanceView method.
Example ¶
Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/92de53a5f1e0e03c94b40475d2135d97148ed014/specification/compute/resource-manager/Microsoft.Compute/CloudserviceRP/stable/2022-09-04/examples/CloudServiceRoleInstance_Get_InstanceView.json
cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() clientFactory, err := armcompute.NewClientFactory("<subscription-id>", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } res, err := clientFactory.NewCloudServiceRoleInstancesClient().GetInstanceView(ctx, "{roleInstance-name}", "ConstosoRG", "{cs-name}", nil) if err != nil { log.Fatalf("failed to finish the request: %v", err) } // You could use response here. We use blank identifier for just demo purposes. _ = res // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. // res.RoleInstanceView = armcompute.RoleInstanceView{ // PlatformFaultDomain: to.Ptr[int32](0), // PlatformUpdateDomain: to.Ptr[int32](0), // PrivateID: to.Ptr("3491bc0c-1f6c-444f-b1d0-ec0751a74e3e"), // Statuses: []*armcompute.ResourceInstanceViewStatus{ // { // Code: to.Ptr("RoleState/RoleStateStarted"), // DisplayStatus: to.Ptr("RoleStateStarted"), // Level: to.Ptr(armcompute.StatusLevelTypesInfo), // Message: to.Ptr(""), // }}, // }
Output:
func (*CloudServiceRoleInstancesClient) GetRemoteDesktopFile ¶
func (client *CloudServiceRoleInstancesClient) GetRemoteDesktopFile(ctx context.Context, roleInstanceName string, resourceGroupName string, cloudServiceName string, options *CloudServiceRoleInstancesClientGetRemoteDesktopFileOptions) (CloudServiceRoleInstancesClientGetRemoteDesktopFileResponse, error)
GetRemoteDesktopFile - Gets a remote desktop file for a role instance in a cloud service. If the operation fails it returns an *azcore.ResponseError type.
Generated from API version 2022-09-04
- roleInstanceName - Name of the role instance.
- resourceGroupName - Name of the resource group.
- cloudServiceName - Name of the cloud service.
- options - CloudServiceRoleInstancesClientGetRemoteDesktopFileOptions contains the optional parameters for the CloudServiceRoleInstancesClient.GetRemoteDesktopFile method.
Example ¶
Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/92de53a5f1e0e03c94b40475d2135d97148ed014/specification/compute/resource-manager/Microsoft.Compute/CloudserviceRP/stable/2022-09-04/examples/CloudServiceRoleInstance_Get_RemoteDesktopFile.json
cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() clientFactory, err := armcompute.NewClientFactory("<subscription-id>", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } _, err = clientFactory.NewCloudServiceRoleInstancesClient().GetRemoteDesktopFile(ctx, "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "rgcloudService", "aaaa", nil) if err != nil { log.Fatalf("failed to finish the request: %v", err) }
Output:
func (*CloudServiceRoleInstancesClient) NewListPager ¶
func (client *CloudServiceRoleInstancesClient) NewListPager(resourceGroupName string, cloudServiceName string, options *CloudServiceRoleInstancesClientListOptions) *runtime.Pager[CloudServiceRoleInstancesClientListResponse]
NewListPager - Gets the list of all role instances in a cloud service. Use nextLink property in the response to get the next page of role instances. Do this till nextLink is null to fetch all the role instances.
Generated from API version 2022-09-04
- resourceGroupName - Name of the resource group.
- cloudServiceName - Name of the cloud service.
- options - CloudServiceRoleInstancesClientListOptions contains the optional parameters for the CloudServiceRoleInstancesClient.NewListPager method.
Example ¶
Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/92de53a5f1e0e03c94b40475d2135d97148ed014/specification/compute/resource-manager/Microsoft.Compute/CloudserviceRP/stable/2022-09-04/examples/CloudServiceRolesInstance_List.json
cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() clientFactory, err := armcompute.NewClientFactory("<subscription-id>", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } pager := clientFactory.NewCloudServiceRoleInstancesClient().NewListPager("ConstosoRG", "{cs-name}", &armcompute.CloudServiceRoleInstancesClientListOptions{Expand: nil}) for pager.More() { page, err := pager.NextPage(ctx) if err != nil { log.Fatalf("failed to advance page: %v", err) } for _, v := range page.Value { // You could use page here. We use blank identifier for just demo purposes. _ = v } // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. // page.RoleInstanceListResult = armcompute.RoleInstanceListResult{ // Value: []*armcompute.RoleInstance{ // { // Name: to.Ptr("ContosoFrontend_IN_0"), // Type: to.Ptr("Microsoft.Compute/cloudServices/roleInstances"), // ID: to.Ptr("/subscriptions/{subscription-id}/resourceGroups/ConstosoRG/providers/Microsoft.Compute/cloudServices/{cs-name}/roleInstances/ContosoFrontend_IN_0"), // Location: to.Ptr("eastus2euap"), // Properties: &armcompute.RoleInstanceProperties{ // NetworkProfile: &armcompute.RoleInstanceNetworkProfile{ // NetworkInterfaces: []*armcompute.SubResource{ // { // ID: to.Ptr("/subscriptions/{subscription-id}/resourceGroups/ConstosoRG/providers/Microsoft.Compute/cloudServices/{cs-name}/roleInstances/ContosoFrontend_IN_0/networkInterfaces/nic1"), // }}, // }, // }, // SKU: &armcompute.InstanceSKU{ // Name: to.Ptr("Standard_D1_v2"), // Tier: to.Ptr("Standard"), // }, // }, // { // Name: to.Ptr("ContosoFrontend_IN_1"), // Type: to.Ptr("Microsoft.Compute/cloudServices/roleInstances"), // ID: to.Ptr("/subscriptions/{subscription-id}/resourceGroups/ConstosoRG/providers/Microsoft.Compute/cloudServices/{cs-name}/roleInstances/ContosoFrontend_IN_1"), // Location: to.Ptr("eastus2euap"), // Properties: &armcompute.RoleInstanceProperties{ // NetworkProfile: &armcompute.RoleInstanceNetworkProfile{ // NetworkInterfaces: []*armcompute.SubResource{ // { // ID: to.Ptr("/subscriptions/{subscription-id}/resourceGroups/ConstosoRG/providers/Microsoft.Compute/cloudServices/{cs-name}/roleInstances/ContosoFrontend_IN_1/networkInterfaces/nic1"), // }}, // }, // }, // SKU: &armcompute.InstanceSKU{ // Name: to.Ptr("Standard_D1_v2"), // Tier: to.Ptr("Standard"), // }, // }, // { // Name: to.Ptr("ContosoBackend_IN_0"), // Type: to.Ptr("Microsoft.Compute/cloudServices/roleInstances"), // ID: to.Ptr("/subscriptions/{subscription-id}/resourceGroups/ConstosoRG/providers/Microsoft.Compute/cloudServices/{cs-name}/roleInstances/ContosoBackend_IN_0"), // Location: to.Ptr("eastus2euap"), // Properties: &armcompute.RoleInstanceProperties{ // NetworkProfile: &armcompute.RoleInstanceNetworkProfile{ // NetworkInterfaces: []*armcompute.SubResource{ // { // ID: to.Ptr("/subscriptions/{subscription-id}/resourceGroups/ConstosoRG/providers/Microsoft.Compute/cloudServices/{cs-name}/roleInstances/ContosoBackend_IN_0/networkInterfaces/nic1"), // }}, // }, // }, // SKU: &armcompute.InstanceSKU{ // Name: to.Ptr("Standard_D1_v2"), // Tier: to.Ptr("Standard"), // }, // }, // { // Name: to.Ptr("ContosoBackend_IN_1"), // Type: to.Ptr("Microsoft.Compute/cloudServices/roleInstances"), // ID: to.Ptr("/subscriptions/{subscription-id}/resourceGroups/ConstosoRG/providers/Microsoft.Compute/cloudServices/{cs-name}/roleInstances/ContosoBackend_IN_1"), // Location: to.Ptr("eastus2euap"), // Properties: &armcompute.RoleInstanceProperties{ // NetworkProfile: &armcompute.RoleInstanceNetworkProfile{ // NetworkInterfaces: []*armcompute.SubResource{ // { // ID: to.Ptr("/subscriptions/{subscription-id}/resourceGroups/ConstosoRG/providers/Microsoft.Compute/cloudServices/{cs-name}/roleInstances/ContosoBackend_IN_1/networkInterfaces/nic1"), // }}, // }, // }, // SKU: &armcompute.InstanceSKU{ // Name: to.Ptr("Standard_D1_v2"), // Tier: to.Ptr("Standard"), // }, // }}, // } }
Output:
type CloudServiceRoleInstancesClientBeginDeleteOptions ¶
type CloudServiceRoleInstancesClientBeginDeleteOptions struct { // Resumes the LRO from the provided token. ResumeToken string }
CloudServiceRoleInstancesClientBeginDeleteOptions contains the optional parameters for the CloudServiceRoleInstancesClient.BeginDelete method.
type CloudServiceRoleInstancesClientBeginRebuildOptions ¶
type CloudServiceRoleInstancesClientBeginRebuildOptions struct { // Resumes the LRO from the provided token. ResumeToken string }
CloudServiceRoleInstancesClientBeginRebuildOptions contains the optional parameters for the CloudServiceRoleInstancesClient.BeginRebuild method.
type CloudServiceRoleInstancesClientBeginReimageOptions ¶
type CloudServiceRoleInstancesClientBeginReimageOptions struct { // Resumes the LRO from the provided token. ResumeToken string }
CloudServiceRoleInstancesClientBeginReimageOptions contains the optional parameters for the CloudServiceRoleInstancesClient.BeginReimage method.
type CloudServiceRoleInstancesClientBeginRestartOptions ¶
type CloudServiceRoleInstancesClientBeginRestartOptions struct { // Resumes the LRO from the provided token. ResumeToken string }
CloudServiceRoleInstancesClientBeginRestartOptions contains the optional parameters for the CloudServiceRoleInstancesClient.BeginRestart method.
type CloudServiceRoleInstancesClientDeleteResponse ¶
type CloudServiceRoleInstancesClientDeleteResponse struct { }
CloudServiceRoleInstancesClientDeleteResponse contains the response from method CloudServiceRoleInstancesClient.BeginDelete.
type CloudServiceRoleInstancesClientGetInstanceViewOptions ¶
type CloudServiceRoleInstancesClientGetInstanceViewOptions struct { }
CloudServiceRoleInstancesClientGetInstanceViewOptions contains the optional parameters for the CloudServiceRoleInstancesClient.GetInstanceView method.
type CloudServiceRoleInstancesClientGetInstanceViewResponse ¶
type CloudServiceRoleInstancesClientGetInstanceViewResponse struct { // The instance view of the role instance. RoleInstanceView }
CloudServiceRoleInstancesClientGetInstanceViewResponse contains the response from method CloudServiceRoleInstancesClient.GetInstanceView.
type CloudServiceRoleInstancesClientGetOptions ¶
type CloudServiceRoleInstancesClientGetOptions struct { // The expand expression to apply to the operation. 'UserData' is not supported for cloud services. Expand *InstanceViewTypes }
CloudServiceRoleInstancesClientGetOptions contains the optional parameters for the CloudServiceRoleInstancesClient.Get method.
type CloudServiceRoleInstancesClientGetRemoteDesktopFileOptions ¶
type CloudServiceRoleInstancesClientGetRemoteDesktopFileOptions struct { }
CloudServiceRoleInstancesClientGetRemoteDesktopFileOptions contains the optional parameters for the CloudServiceRoleInstancesClient.GetRemoteDesktopFile method.
type CloudServiceRoleInstancesClientGetRemoteDesktopFileResponse ¶
type CloudServiceRoleInstancesClientGetRemoteDesktopFileResponse struct { // Body contains the streaming response. Body io.ReadCloser }
CloudServiceRoleInstancesClientGetRemoteDesktopFileResponse contains the response from method CloudServiceRoleInstancesClient.GetRemoteDesktopFile.
type CloudServiceRoleInstancesClientGetResponse ¶
type CloudServiceRoleInstancesClientGetResponse struct { // Describes the cloud service role instance. RoleInstance }
CloudServiceRoleInstancesClientGetResponse contains the response from method CloudServiceRoleInstancesClient.Get.
type CloudServiceRoleInstancesClientListOptions ¶
type CloudServiceRoleInstancesClientListOptions struct { // The expand expression to apply to the operation. 'UserData' is not supported for cloud services. Expand *InstanceViewTypes }
CloudServiceRoleInstancesClientListOptions contains the optional parameters for the CloudServiceRoleInstancesClient.NewListPager method.
type CloudServiceRoleInstancesClientListResponse ¶
type CloudServiceRoleInstancesClientListResponse struct { // The list operation result. RoleInstanceListResult }
CloudServiceRoleInstancesClientListResponse contains the response from method CloudServiceRoleInstancesClient.NewListPager.
type CloudServiceRoleInstancesClientRebuildResponse ¶
type CloudServiceRoleInstancesClientRebuildResponse struct { }
CloudServiceRoleInstancesClientRebuildResponse contains the response from method CloudServiceRoleInstancesClient.BeginRebuild.
type CloudServiceRoleInstancesClientReimageResponse ¶
type CloudServiceRoleInstancesClientReimageResponse struct { }
CloudServiceRoleInstancesClientReimageResponse contains the response from method CloudServiceRoleInstancesClient.BeginReimage.
type CloudServiceRoleInstancesClientRestartResponse ¶
type CloudServiceRoleInstancesClientRestartResponse struct { }
CloudServiceRoleInstancesClientRestartResponse contains the response from method CloudServiceRoleInstancesClient.BeginRestart.
type CloudServiceRoleListResult ¶
type CloudServiceRoleListResult struct { // REQUIRED; The list of resources. Value []*CloudServiceRole // The URI to fetch the next page of resources. Use this to get the next page of resources. Do this till nextLink is null // to fetch all the resources. NextLink *string }
CloudServiceRoleListResult - The list operation result.
func (CloudServiceRoleListResult) MarshalJSON ¶
func (c CloudServiceRoleListResult) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type CloudServiceRoleListResult.
func (*CloudServiceRoleListResult) UnmarshalJSON ¶
func (c *CloudServiceRoleListResult) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type CloudServiceRoleListResult.
type CloudServiceRoleProfile ¶
type CloudServiceRoleProfile struct { // List of roles for the cloud service. Roles []*CloudServiceRoleProfileProperties }
CloudServiceRoleProfile - Describes the role profile for the cloud service.
func (CloudServiceRoleProfile) MarshalJSON ¶
func (c CloudServiceRoleProfile) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type CloudServiceRoleProfile.
func (*CloudServiceRoleProfile) UnmarshalJSON ¶
func (c *CloudServiceRoleProfile) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type CloudServiceRoleProfile.
type CloudServiceRoleProfileProperties ¶
type CloudServiceRoleProfileProperties struct { // Resource name. Name *string // Describes the cloud service role sku. SKU *CloudServiceRoleSKU }
CloudServiceRoleProfileProperties - Describes the role properties.
func (CloudServiceRoleProfileProperties) MarshalJSON ¶
func (c CloudServiceRoleProfileProperties) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type CloudServiceRoleProfileProperties.
func (*CloudServiceRoleProfileProperties) UnmarshalJSON ¶
func (c *CloudServiceRoleProfileProperties) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type CloudServiceRoleProfileProperties.
type CloudServiceRoleProperties ¶
type CloudServiceRoleProperties struct { // READ-ONLY; Specifies the ID which uniquely identifies a cloud service role. UniqueID *string }
CloudServiceRoleProperties - The cloud service role properties.
func (CloudServiceRoleProperties) MarshalJSON ¶
func (c CloudServiceRoleProperties) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type CloudServiceRoleProperties.
func (*CloudServiceRoleProperties) UnmarshalJSON ¶
func (c *CloudServiceRoleProperties) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type CloudServiceRoleProperties.
type CloudServiceRoleSKU ¶
type CloudServiceRoleSKU struct { // Specifies the number of role instances in the cloud service. Capacity *int64 // The sku name. NOTE: If the new SKU is not supported on the hardware the cloud service is currently on, you need to delete // and recreate the cloud service or move back to the old sku. Name *string // Specifies the tier of the cloud service. Possible Values are // Standard // Basic Tier *string }
CloudServiceRoleSKU - Describes the cloud service role sku.
func (CloudServiceRoleSKU) MarshalJSON ¶
func (c CloudServiceRoleSKU) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type CloudServiceRoleSKU.
func (*CloudServiceRoleSKU) UnmarshalJSON ¶
func (c *CloudServiceRoleSKU) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type CloudServiceRoleSKU.
type CloudServiceRolesClient ¶
type CloudServiceRolesClient struct {
// contains filtered or unexported fields
}
CloudServiceRolesClient contains the methods for the CloudServiceRoles group. Don't use this type directly, use NewCloudServiceRolesClient() instead.
func NewCloudServiceRolesClient ¶
func NewCloudServiceRolesClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*CloudServiceRolesClient, error)
NewCloudServiceRolesClient creates a new instance of CloudServiceRolesClient 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 (*CloudServiceRolesClient) Get ¶
func (client *CloudServiceRolesClient) Get(ctx context.Context, roleName string, resourceGroupName string, cloudServiceName string, options *CloudServiceRolesClientGetOptions) (CloudServiceRolesClientGetResponse, error)
Get - Gets a role from a cloud service. If the operation fails it returns an *azcore.ResponseError type.
Generated from API version 2022-09-04
- roleName - Name of the role.
- resourceGroupName - Name of the resource group.
- cloudServiceName - Name of the cloud service.
- options - CloudServiceRolesClientGetOptions contains the optional parameters for the CloudServiceRolesClient.Get method.
Example ¶
Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/92de53a5f1e0e03c94b40475d2135d97148ed014/specification/compute/resource-manager/Microsoft.Compute/CloudserviceRP/stable/2022-09-04/examples/CloudServiceRole_Get.json
cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() clientFactory, err := armcompute.NewClientFactory("<subscription-id>", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } res, err := clientFactory.NewCloudServiceRolesClient().Get(ctx, "{role-name}", "ConstosoRG", "{cs-name}", nil) if err != nil { log.Fatalf("failed to finish the request: %v", err) } // You could use response here. We use blank identifier for just demo purposes. _ = res // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. // res.CloudServiceRole = armcompute.CloudServiceRole{ // Name: to.Ptr("{role-name}"), // Type: to.Ptr("Microsoft.Compute/cloudServices/roles"), // ID: to.Ptr("/subscriptions/{subscription-id}/resourceGroups/ConstosoRG/providers/Microsoft.Compute/cloudServices/{cs-name}/roles/{role-name}"), // Location: to.Ptr("eastus2euap"), // Properties: &armcompute.CloudServiceRoleProperties{ // UniqueID: to.Ptr("b03bc269-766b-4921-b91a-7dffaae4d03b:{role-name}"), // }, // SKU: &armcompute.CloudServiceRoleSKU{ // Name: to.Ptr("Standard_D1_v2"), // Capacity: to.Ptr[int64](2), // Tier: to.Ptr("Standard"), // }, // }
Output:
func (*CloudServiceRolesClient) NewListPager ¶
func (client *CloudServiceRolesClient) NewListPager(resourceGroupName string, cloudServiceName string, options *CloudServiceRolesClientListOptions) *runtime.Pager[CloudServiceRolesClientListResponse]
NewListPager - Gets a list of all roles in a cloud service. Use nextLink property in the response to get the next page of roles. Do this till nextLink is null to fetch all the roles.
Generated from API version 2022-09-04
- resourceGroupName - Name of the resource group.
- cloudServiceName - Name of the cloud service.
- options - CloudServiceRolesClientListOptions contains the optional parameters for the CloudServiceRolesClient.NewListPager method.
Example ¶
Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/92de53a5f1e0e03c94b40475d2135d97148ed014/specification/compute/resource-manager/Microsoft.Compute/CloudserviceRP/stable/2022-09-04/examples/CloudServiceRole_List.json
cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() clientFactory, err := armcompute.NewClientFactory("<subscription-id>", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } pager := clientFactory.NewCloudServiceRolesClient().NewListPager("ConstosoRG", "{cs-name}", nil) for pager.More() { page, err := pager.NextPage(ctx) if err != nil { log.Fatalf("failed to advance page: %v", err) } for _, v := range page.Value { // You could use page here. We use blank identifier for just demo purposes. _ = v } // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. // page.CloudServiceRoleListResult = armcompute.CloudServiceRoleListResult{ // Value: []*armcompute.CloudServiceRole{ // { // Name: to.Ptr("ContosoFrontend"), // Type: to.Ptr("Microsoft.Compute/cloudServices/roles"), // ID: to.Ptr("/subscriptions/{subscription-id}/resourceGroups/ConstosoRG/providers/Microsoft.Compute/cloudServices/{cs-name}/roles/ContosoFrontend"), // Location: to.Ptr("eastus2euap"), // Properties: &armcompute.CloudServiceRoleProperties{ // UniqueID: to.Ptr("b03bc269-766b-4921-b91a-7dffaae4d03b:ContosoFrontend"), // }, // SKU: &armcompute.CloudServiceRoleSKU{ // Name: to.Ptr("Standard_D1_v2"), // Capacity: to.Ptr[int64](2), // Tier: to.Ptr("Standard"), // }, // }, // { // Name: to.Ptr("ContosoBackend"), // Type: to.Ptr("Microsoft.Compute/cloudServices/roles"), // ID: to.Ptr("/subscriptions/{subscription-id}/resourceGroups/ConstosoRG/providers/Microsoft.Compute/cloudServices/{cs-name}/roles/ContosoBackend"), // Location: to.Ptr("eastus2euap"), // Properties: &armcompute.CloudServiceRoleProperties{ // UniqueID: to.Ptr("b03bc269-766b-4921-b91a-7dffaae4d03b:ContosoBackend"), // }, // SKU: &armcompute.CloudServiceRoleSKU{ // Name: to.Ptr("Standard_D1_v2"), // Capacity: to.Ptr[int64](2), // Tier: to.Ptr("Standard"), // }, // }}, // } }
Output:
type CloudServiceRolesClientGetOptions ¶
type CloudServiceRolesClientGetOptions struct { }
CloudServiceRolesClientGetOptions contains the optional parameters for the CloudServiceRolesClient.Get method.
type CloudServiceRolesClientGetResponse ¶
type CloudServiceRolesClientGetResponse struct { // Describes a role of the cloud service. CloudServiceRole }
CloudServiceRolesClientGetResponse contains the response from method CloudServiceRolesClient.Get.
type CloudServiceRolesClientListOptions ¶
type CloudServiceRolesClientListOptions struct { }
CloudServiceRolesClientListOptions contains the optional parameters for the CloudServiceRolesClient.NewListPager method.
type CloudServiceRolesClientListResponse ¶
type CloudServiceRolesClientListResponse struct { // The list operation result. CloudServiceRoleListResult }
CloudServiceRolesClientListResponse contains the response from method CloudServiceRolesClient.NewListPager.
type CloudServiceSlotType ¶
type CloudServiceSlotType string
CloudServiceSlotType - Slot type for the cloud service. Possible values are Production Staging If not specified, the default value is Production.
const ( CloudServiceSlotTypeProduction CloudServiceSlotType = "Production" CloudServiceSlotTypeStaging CloudServiceSlotType = "Staging" )
func PossibleCloudServiceSlotTypeValues ¶
func PossibleCloudServiceSlotTypeValues() []CloudServiceSlotType
PossibleCloudServiceSlotTypeValues returns the possible values for the CloudServiceSlotType const type.
type CloudServiceUpdate ¶
func (CloudServiceUpdate) MarshalJSON ¶
func (c CloudServiceUpdate) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type CloudServiceUpdate.
func (*CloudServiceUpdate) UnmarshalJSON ¶
func (c *CloudServiceUpdate) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type CloudServiceUpdate.
type CloudServiceUpgradeMode ¶
type CloudServiceUpgradeMode string
CloudServiceUpgradeMode - Update mode for the cloud service. Role instances are allocated to update domains when the service is deployed. Updates can be initiated manually in each update domain or initiated automatically in all update domains. Possible Values are Auto Manual Simultaneous If not specified, the default value is Auto. If set to Manual, PUT UpdateDomain must be called to apply the update. If set to Auto, the update is automatically applied to each update domain in sequence.
const ( CloudServiceUpgradeModeAuto CloudServiceUpgradeMode = "Auto" CloudServiceUpgradeModeManual CloudServiceUpgradeMode = "Manual" CloudServiceUpgradeModeSimultaneous CloudServiceUpgradeMode = "Simultaneous" )
func PossibleCloudServiceUpgradeModeValues ¶
func PossibleCloudServiceUpgradeModeValues() []CloudServiceUpgradeMode
PossibleCloudServiceUpgradeModeValues returns the possible values for the CloudServiceUpgradeMode const type.
type CloudServiceVaultAndSecretReference ¶
type CloudServiceVaultAndSecretReference struct { // Secret URL which contains the protected settings of the extension SecretURL *string // The ARM Resource ID of the Key Vault SourceVault *SubResource }
CloudServiceVaultAndSecretReference - Protected settings for the extension, referenced using KeyVault which are encrypted before sent to the role instance.
func (CloudServiceVaultAndSecretReference) MarshalJSON ¶
func (c CloudServiceVaultAndSecretReference) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type CloudServiceVaultAndSecretReference.
func (*CloudServiceVaultAndSecretReference) UnmarshalJSON ¶
func (c *CloudServiceVaultAndSecretReference) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type CloudServiceVaultAndSecretReference.
type CloudServiceVaultCertificate ¶
type CloudServiceVaultCertificate struct { // This is the URL of a certificate that has been uploaded to Key Vault as a secret. CertificateURL *string }
CloudServiceVaultCertificate - Describes a single certificate reference in a Key Vault, and where the certificate should reside on the role instance.
func (CloudServiceVaultCertificate) MarshalJSON ¶
func (c CloudServiceVaultCertificate) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type CloudServiceVaultCertificate.
func (*CloudServiceVaultCertificate) UnmarshalJSON ¶
func (c *CloudServiceVaultCertificate) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type CloudServiceVaultCertificate.
type CloudServiceVaultSecretGroup ¶
type CloudServiceVaultSecretGroup struct { // The relative URL of the Key Vault containing all of the certificates in VaultCertificates. SourceVault *SubResource // The list of key vault references in SourceVault which contain certificates. VaultCertificates []*CloudServiceVaultCertificate }
CloudServiceVaultSecretGroup - Describes a set of certificates which are all in the same Key Vault.
func (CloudServiceVaultSecretGroup) MarshalJSON ¶
func (c CloudServiceVaultSecretGroup) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type CloudServiceVaultSecretGroup.
func (*CloudServiceVaultSecretGroup) UnmarshalJSON ¶
func (c *CloudServiceVaultSecretGroup) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type CloudServiceVaultSecretGroup.
type CloudServicesClient ¶
type CloudServicesClient struct {
// contains filtered or unexported fields
}
CloudServicesClient contains the methods for the CloudServices group. Don't use this type directly, use NewCloudServicesClient() instead.
func NewCloudServicesClient ¶
func NewCloudServicesClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*CloudServicesClient, error)
NewCloudServicesClient creates a new instance of CloudServicesClient 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 (*CloudServicesClient) BeginCreateOrUpdate ¶
func (client *CloudServicesClient) BeginCreateOrUpdate(ctx context.Context, resourceGroupName string, cloudServiceName string, parameters CloudService, options *CloudServicesClientBeginCreateOrUpdateOptions) (*runtime.Poller[CloudServicesClientCreateOrUpdateResponse], error)
BeginCreateOrUpdate - Create or update a cloud service. Please note some properties can be set only during cloud service creation. If the operation fails it returns an *azcore.ResponseError type.
Generated from API version 2022-09-04
- resourceGroupName - Name of the resource group.
- cloudServiceName - Name of the cloud service.
- parameters - The cloud service object.
- options - CloudServicesClientBeginCreateOrUpdateOptions contains the optional parameters for the CloudServicesClient.BeginCreateOrUpdate method.
Example (CreateNewCloudServiceWithMultipleRoles) ¶
Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/92de53a5f1e0e03c94b40475d2135d97148ed014/specification/compute/resource-manager/Microsoft.Compute/CloudserviceRP/stable/2022-09-04/examples/CloudService_Create_WithMultiRole.json
cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() clientFactory, err := armcompute.NewClientFactory("<subscription-id>", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } poller, err := clientFactory.NewCloudServicesClient().BeginCreateOrUpdate(ctx, "ConstosoRG", "{cs-name}", armcompute.CloudService{ Location: to.Ptr("westus"), Properties: &armcompute.CloudServiceProperties{ Configuration: to.Ptr("{ServiceConfiguration}"), NetworkProfile: &armcompute.CloudServiceNetworkProfile{ LoadBalancerConfigurations: []*armcompute.LoadBalancerConfiguration{ { Name: to.Ptr("contosolb"), Properties: &armcompute.LoadBalancerConfigurationProperties{ FrontendIPConfigurations: []*armcompute.LoadBalancerFrontendIPConfiguration{ { Name: to.Ptr("contosofe"), Properties: &armcompute.LoadBalancerFrontendIPConfigurationProperties{ PublicIPAddress: &armcompute.SubResource{ ID: to.Ptr("/subscriptions/{subscription-id}/resourceGroups/ConstosoRG/providers/Microsoft.Network/publicIPAddresses/contosopublicip"), }, }, }}, }, }}, }, PackageURL: to.Ptr("{PackageUrl}"), RoleProfile: &armcompute.CloudServiceRoleProfile{ Roles: []*armcompute.CloudServiceRoleProfileProperties{ { Name: to.Ptr("ContosoFrontend"), SKU: &armcompute.CloudServiceRoleSKU{ Name: to.Ptr("Standard_D1_v2"), Capacity: to.Ptr[int64](1), Tier: to.Ptr("Standard"), }, }, { Name: to.Ptr("ContosoBackend"), SKU: &armcompute.CloudServiceRoleSKU{ Name: to.Ptr("Standard_D1_v2"), Capacity: to.Ptr[int64](1), Tier: to.Ptr("Standard"), }, }}, }, UpgradeMode: to.Ptr(armcompute.CloudServiceUpgradeModeAuto), }, }, nil) if err != nil { log.Fatalf("failed to finish the request: %v", err) } res, err := poller.PollUntilDone(ctx, nil) if err != nil { log.Fatalf("failed to pull the result: %v", err) } // You could use response here. We use blank identifier for just demo purposes. _ = res // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. // res.CloudService = armcompute.CloudService{ // Name: to.Ptr("{cs-name}"), // Type: to.Ptr("Microsoft.Compute/cloudServices"), // ID: to.Ptr("/subscriptions/{subscription-id}/resourceGroups/ConstosoRG/providers/Microsoft.Compute/cloudServices/{cs-name}"), // Location: to.Ptr("westus"), // Properties: &armcompute.CloudServiceProperties{ // Configuration: to.Ptr("{ServiceConfiguration}"), // NetworkProfile: &armcompute.CloudServiceNetworkProfile{ // LoadBalancerConfigurations: []*armcompute.LoadBalancerConfiguration{ // { // Name: to.Ptr("contosolb"), // Properties: &armcompute.LoadBalancerConfigurationProperties{ // FrontendIPConfigurations: []*armcompute.LoadBalancerFrontendIPConfiguration{ // { // Name: to.Ptr("contosofe"), // Properties: &armcompute.LoadBalancerFrontendIPConfigurationProperties{ // PublicIPAddress: &armcompute.SubResource{ // ID: to.Ptr("/subscriptions/{subscription-id}/resourceGroups/ConstosoRG/providers/Microsoft.Network/publicIPAddresses/contosopublicip"), // }, // }, // }}, // }, // }}, // }, // OSProfile: &armcompute.CloudServiceOsProfile{ // Secrets: []*armcompute.CloudServiceVaultSecretGroup{ // }, // }, // PackageURL: to.Ptr("{PackageUrl}"), // ProvisioningState: to.Ptr("Succeeded"), // RoleProfile: &armcompute.CloudServiceRoleProfile{ // Roles: []*armcompute.CloudServiceRoleProfileProperties{ // { // Name: to.Ptr("ContosoFrontend"), // SKU: &armcompute.CloudServiceRoleSKU{ // Name: to.Ptr("Standard_D1_v2"), // Capacity: to.Ptr[int64](1), // Tier: to.Ptr("Standard"), // }, // }, // { // Name: to.Ptr("ContosoBackend"), // SKU: &armcompute.CloudServiceRoleSKU{ // Name: to.Ptr("Standard_D1_v2"), // Capacity: to.Ptr[int64](1), // Tier: to.Ptr("Standard"), // }, // }}, // }, // UniqueID: to.Ptr("7f3edf91-cb34-4a3e-971a-177dc3dd43cb"), // UpgradeMode: to.Ptr(armcompute.CloudServiceUpgradeModeAuto), // }, // SystemData: &armcompute.SystemData{ // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-01-01T17:18:19.123Z"); return t}()), // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-01-01T17:18:19.123Z"); return t}()), // }, // }
Output:
Example (CreateNewCloudServiceWithMultipleRolesInASpecificAvailabilityZone) ¶
Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/92de53a5f1e0e03c94b40475d2135d97148ed014/specification/compute/resource-manager/Microsoft.Compute/CloudserviceRP/stable/2022-09-04/examples/CloudService_Create_WithMultiRole_WithZones.json
cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() clientFactory, err := armcompute.NewClientFactory("<subscription-id>", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } poller, err := clientFactory.NewCloudServicesClient().BeginCreateOrUpdate(ctx, "ConstosoRG", "{cs-name}", armcompute.CloudService{ Location: to.Ptr("westus"), Properties: &armcompute.CloudServiceProperties{ Configuration: to.Ptr("{ServiceConfiguration}"), NetworkProfile: &armcompute.CloudServiceNetworkProfile{ LoadBalancerConfigurations: []*armcompute.LoadBalancerConfiguration{ { Name: to.Ptr("contosolb"), Properties: &armcompute.LoadBalancerConfigurationProperties{ FrontendIPConfigurations: []*armcompute.LoadBalancerFrontendIPConfiguration{ { Name: to.Ptr("contosofe"), Properties: &armcompute.LoadBalancerFrontendIPConfigurationProperties{ PublicIPAddress: &armcompute.SubResource{ ID: to.Ptr("/subscriptions/{subscription-id}/resourceGroups/ConstosoRG/providers/Microsoft.Network/publicIPAddresses/contosopublicip"), }, }, }}, }, }}, }, PackageURL: to.Ptr("{PackageUrl}"), RoleProfile: &armcompute.CloudServiceRoleProfile{ Roles: []*armcompute.CloudServiceRoleProfileProperties{ { Name: to.Ptr("ContosoFrontend"), SKU: &armcompute.CloudServiceRoleSKU{ Name: to.Ptr("Standard_D1_v2"), Capacity: to.Ptr[int64](1), Tier: to.Ptr("Standard"), }, }, { Name: to.Ptr("ContosoBackend"), SKU: &armcompute.CloudServiceRoleSKU{ Name: to.Ptr("Standard_D1_v2"), Capacity: to.Ptr[int64](1), Tier: to.Ptr("Standard"), }, }}, }, UpgradeMode: to.Ptr(armcompute.CloudServiceUpgradeModeAuto), }, Zones: []*string{ to.Ptr("1")}, }, nil) if err != nil { log.Fatalf("failed to finish the request: %v", err) } res, err := poller.PollUntilDone(ctx, nil) if err != nil { log.Fatalf("failed to pull the result: %v", err) } // You could use response here. We use blank identifier for just demo purposes. _ = res // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. // res.CloudService = armcompute.CloudService{ // Name: to.Ptr("{cs-name}"), // Type: to.Ptr("Microsoft.Compute/cloudServices"), // ID: to.Ptr("/subscriptions/{subscription-id}/resourceGroups/ConstosoRG/providers/Microsoft.Compute/cloudServices/{cs-name}"), // Location: to.Ptr("westus"), // Properties: &armcompute.CloudServiceProperties{ // Configuration: to.Ptr("{ServiceConfiguration}"), // NetworkProfile: &armcompute.CloudServiceNetworkProfile{ // LoadBalancerConfigurations: []*armcompute.LoadBalancerConfiguration{ // { // Name: to.Ptr("contosolb"), // Properties: &armcompute.LoadBalancerConfigurationProperties{ // FrontendIPConfigurations: []*armcompute.LoadBalancerFrontendIPConfiguration{ // { // Name: to.Ptr("contosofe"), // Properties: &armcompute.LoadBalancerFrontendIPConfigurationProperties{ // PublicIPAddress: &armcompute.SubResource{ // ID: to.Ptr("/subscriptions/{subscription-id}/resourceGroups/ConstosoRG/providers/Microsoft.Network/publicIPAddresses/contosopublicip"), // }, // }, // }}, // }, // }}, // }, // OSProfile: &armcompute.CloudServiceOsProfile{ // Secrets: []*armcompute.CloudServiceVaultSecretGroup{ // }, // }, // PackageURL: to.Ptr("{PackageUrl}"), // ProvisioningState: to.Ptr("Succeeded"), // RoleProfile: &armcompute.CloudServiceRoleProfile{ // Roles: []*armcompute.CloudServiceRoleProfileProperties{ // { // Name: to.Ptr("ContosoFrontend"), // SKU: &armcompute.CloudServiceRoleSKU{ // Name: to.Ptr("Standard_D1_v2"), // Capacity: to.Ptr[int64](1), // Tier: to.Ptr("Standard"), // }, // }, // { // Name: to.Ptr("ContosoBackend"), // SKU: &armcompute.CloudServiceRoleSKU{ // Name: to.Ptr("Standard_D1_v2"), // Capacity: to.Ptr[int64](1), // Tier: to.Ptr("Standard"), // }, // }}, // }, // UniqueID: to.Ptr("7f3edf91-cb34-4a3e-971a-177dc3dd43cb"), // UpgradeMode: to.Ptr(armcompute.CloudServiceUpgradeModeAuto), // }, // SystemData: &armcompute.SystemData{ // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-01-01T17:18:19.123Z"); return t}()), // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-01-01T17:18:19.123Z"); return t}()), // }, // Zones: []*string{ // to.Ptr("1")}, // }
Output:
Example (CreateNewCloudServiceWithSingleRole) ¶
Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/92de53a5f1e0e03c94b40475d2135d97148ed014/specification/compute/resource-manager/Microsoft.Compute/CloudserviceRP/stable/2022-09-04/examples/CloudService_Create_WithSingleRole.json
cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() clientFactory, err := armcompute.NewClientFactory("<subscription-id>", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } poller, err := clientFactory.NewCloudServicesClient().BeginCreateOrUpdate(ctx, "ConstosoRG", "{cs-name}", armcompute.CloudService{ Location: to.Ptr("westus"), Properties: &armcompute.CloudServiceProperties{ Configuration: to.Ptr("{ServiceConfiguration}"), NetworkProfile: &armcompute.CloudServiceNetworkProfile{ LoadBalancerConfigurations: []*armcompute.LoadBalancerConfiguration{ { Name: to.Ptr("myLoadBalancer"), Properties: &armcompute.LoadBalancerConfigurationProperties{ FrontendIPConfigurations: []*armcompute.LoadBalancerFrontendIPConfiguration{ { Name: to.Ptr("myfe"), Properties: &armcompute.LoadBalancerFrontendIPConfigurationProperties{ PublicIPAddress: &armcompute.SubResource{ ID: to.Ptr("/subscriptions/{subscription-id}/resourceGroups/ConstosoRG/providers/Microsoft.Network/publicIPAddresses/myPublicIP"), }, }, }}, }, }}, }, PackageURL: to.Ptr("{PackageUrl}"), RoleProfile: &armcompute.CloudServiceRoleProfile{ Roles: []*armcompute.CloudServiceRoleProfileProperties{ { Name: to.Ptr("ContosoFrontend"), SKU: &armcompute.CloudServiceRoleSKU{ Name: to.Ptr("Standard_D1_v2"), Capacity: to.Ptr[int64](1), Tier: to.Ptr("Standard"), }, }}, }, UpgradeMode: to.Ptr(armcompute.CloudServiceUpgradeModeAuto), }, }, nil) if err != nil { log.Fatalf("failed to finish the request: %v", err) } res, err := poller.PollUntilDone(ctx, nil) if err != nil { log.Fatalf("failed to pull the result: %v", err) } // You could use response here. We use blank identifier for just demo purposes. _ = res // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. // res.CloudService = armcompute.CloudService{ // Name: to.Ptr("{cs-name}"), // Type: to.Ptr("Microsoft.Compute/cloudServices"), // ID: to.Ptr("/subscriptions/5393f919-a68a-43d0-9063-4b2bda6bffdf/resourceGroups/ConstosoRG/providers/Microsoft.Compute/cloudServices/{cs-name}"), // Location: to.Ptr("westus"), // Properties: &armcompute.CloudServiceProperties{ // Configuration: to.Ptr("{ServiceConfiguration}"), // NetworkProfile: &armcompute.CloudServiceNetworkProfile{ // LoadBalancerConfigurations: []*armcompute.LoadBalancerConfiguration{ // { // Name: to.Ptr("myLoadBalancer"), // Properties: &armcompute.LoadBalancerConfigurationProperties{ // FrontendIPConfigurations: []*armcompute.LoadBalancerFrontendIPConfiguration{ // { // Name: to.Ptr("myfe"), // Properties: &armcompute.LoadBalancerFrontendIPConfigurationProperties{ // PublicIPAddress: &armcompute.SubResource{ // ID: to.Ptr("/subscriptions/{subscription-id}/resourceGroups/ConstosoRG/providers/Microsoft.Network/publicIPAddresses/myPublicIP"), // }, // }, // }}, // }, // }}, // }, // OSProfile: &armcompute.CloudServiceOsProfile{ // Secrets: []*armcompute.CloudServiceVaultSecretGroup{ // }, // }, // PackageURL: to.Ptr("{PackageUrl}"), // ProvisioningState: to.Ptr("Succeeded"), // RoleProfile: &armcompute.CloudServiceRoleProfile{ // Roles: []*armcompute.CloudServiceRoleProfileProperties{ // { // Name: to.Ptr("ContosoFrontend"), // SKU: &armcompute.CloudServiceRoleSKU{ // Name: to.Ptr("Standard_D1_v2"), // Capacity: to.Ptr[int64](1), // Tier: to.Ptr("Standard"), // }, // }}, // }, // UniqueID: to.Ptr("14d10b45-ced7-42ef-a406-50a3df2cea7d"), // UpgradeMode: to.Ptr(armcompute.CloudServiceUpgradeModeAuto), // }, // SystemData: &armcompute.SystemData{ // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-01-01T17:18:19.123Z"); return t}()), // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-01-01T17:18:19.123Z"); return t}()), // }, // }
Output:
Example (CreateNewCloudServiceWithSingleRoleAndCertificateFromKeyVault) ¶
Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/92de53a5f1e0e03c94b40475d2135d97148ed014/specification/compute/resource-manager/Microsoft.Compute/CloudserviceRP/stable/2022-09-04/examples/CloudService_Create_WithSingleRoleAndCertificate.json
cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() clientFactory, err := armcompute.NewClientFactory("<subscription-id>", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } poller, err := clientFactory.NewCloudServicesClient().BeginCreateOrUpdate(ctx, "ConstosoRG", "{cs-name}", armcompute.CloudService{ Location: to.Ptr("westus"), Properties: &armcompute.CloudServiceProperties{ Configuration: to.Ptr("{ServiceConfiguration}"), NetworkProfile: &armcompute.CloudServiceNetworkProfile{ LoadBalancerConfigurations: []*armcompute.LoadBalancerConfiguration{ { Name: to.Ptr("contosolb"), Properties: &armcompute.LoadBalancerConfigurationProperties{ FrontendIPConfigurations: []*armcompute.LoadBalancerFrontendIPConfiguration{ { Name: to.Ptr("contosofe"), Properties: &armcompute.LoadBalancerFrontendIPConfigurationProperties{ PublicIPAddress: &armcompute.SubResource{ ID: to.Ptr("/subscriptions/{subscription-id}/resourceGroups/ConstosoRG/providers/Microsoft.Network/publicIPAddresses/contosopublicip"), }, }, }}, }, }}, }, OSProfile: &armcompute.CloudServiceOsProfile{ Secrets: []*armcompute.CloudServiceVaultSecretGroup{ { SourceVault: &armcompute.SubResource{ ID: to.Ptr("/subscriptions/{subscription-id}/resourceGroups/ConstosoRG/providers/Microsoft.KeyVault/vaults/{keyvault-name}"), }, VaultCertificates: []*armcompute.CloudServiceVaultCertificate{ { CertificateURL: to.Ptr("https://{keyvault-name}.vault.azure.net:443/secrets/ContosoCertificate/{secret-id}"), }}, }}, }, PackageURL: to.Ptr("{PackageUrl}"), RoleProfile: &armcompute.CloudServiceRoleProfile{ Roles: []*armcompute.CloudServiceRoleProfileProperties{ { Name: to.Ptr("ContosoFrontend"), SKU: &armcompute.CloudServiceRoleSKU{ Name: to.Ptr("Standard_D1_v2"), Capacity: to.Ptr[int64](1), Tier: to.Ptr("Standard"), }, }}, }, UpgradeMode: to.Ptr(armcompute.CloudServiceUpgradeModeAuto), }, }, nil) if err != nil { log.Fatalf("failed to finish the request: %v", err) } res, err := poller.PollUntilDone(ctx, nil) if err != nil { log.Fatalf("failed to pull the result: %v", err) } // You could use response here. We use blank identifier for just demo purposes. _ = res // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. // res.CloudService = armcompute.CloudService{ // Name: to.Ptr("{cs-name}"), // Type: to.Ptr("Microsoft.Compute/cloudServices"), // ID: to.Ptr("/subscriptions/{subscription-id}/resourceGroups/ConstosoRG/providers/Microsoft.Compute/cloudServices/{cs-name}"), // Location: to.Ptr("westus"), // Properties: &armcompute.CloudServiceProperties{ // Configuration: to.Ptr("{ServiceConfiguration}"), // NetworkProfile: &armcompute.CloudServiceNetworkProfile{ // LoadBalancerConfigurations: []*armcompute.LoadBalancerConfiguration{ // { // Name: to.Ptr("contosolb"), // Properties: &armcompute.LoadBalancerConfigurationProperties{ // FrontendIPConfigurations: []*armcompute.LoadBalancerFrontendIPConfiguration{ // { // Name: to.Ptr("contosofe"), // Properties: &armcompute.LoadBalancerFrontendIPConfigurationProperties{ // PublicIPAddress: &armcompute.SubResource{ // ID: to.Ptr("/subscriptions/{subscription-id}/resourceGroups/ConstosoRG/providers/Microsoft.Network/publicIPAddresses/contosopublicip"), // }, // }, // }}, // }, // }}, // }, // OSProfile: &armcompute.CloudServiceOsProfile{ // Secrets: []*armcompute.CloudServiceVaultSecretGroup{ // { // SourceVault: &armcompute.SubResource{ // ID: to.Ptr("/subscriptions/{subscription-id}/resourceGroups/ConstosoRG/providers/Microsoft.KeyVault/vaults/{keyvault-name}"), // }, // VaultCertificates: []*armcompute.CloudServiceVaultCertificate{ // { // CertificateURL: to.Ptr("https://{keyvault-name}.vault.azure.net:443/secrets/ContosoCertificate/{secret-id}"), // }}, // }}, // }, // PackageURL: to.Ptr("{PackageUrl}"), // ProvisioningState: to.Ptr("Succeeded"), // RoleProfile: &armcompute.CloudServiceRoleProfile{ // Roles: []*armcompute.CloudServiceRoleProfileProperties{ // { // Name: to.Ptr("ContosoFrontend"), // SKU: &armcompute.CloudServiceRoleSKU{ // Name: to.Ptr("Standard_D1_v2"), // Capacity: to.Ptr[int64](1), // Tier: to.Ptr("Standard"), // }, // }}, // }, // UniqueID: to.Ptr("60b6cd59-600b-4e02-b717-521b07aa94bf"), // UpgradeMode: to.Ptr(armcompute.CloudServiceUpgradeModeAuto), // }, // SystemData: &armcompute.SystemData{ // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-01-01T17:18:19.123Z"); return t}()), // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-01-01T17:18:19.123Z"); return t}()), // }, // }
Output:
Example (CreateNewCloudServiceWithSingleRoleAndRdpExtension) ¶
Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/92de53a5f1e0e03c94b40475d2135d97148ed014/specification/compute/resource-manager/Microsoft.Compute/CloudserviceRP/stable/2022-09-04/examples/CloudService_Create_WithSingleRoleAndRDP.json
cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() clientFactory, err := armcompute.NewClientFactory("<subscription-id>", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } poller, err := clientFactory.NewCloudServicesClient().BeginCreateOrUpdate(ctx, "ConstosoRG", "{cs-name}", armcompute.CloudService{ Location: to.Ptr("westus"), Properties: &armcompute.CloudServiceProperties{ Configuration: to.Ptr("{ServiceConfiguration}"), ExtensionProfile: &armcompute.CloudServiceExtensionProfile{ Extensions: []*armcompute.Extension{ { Name: to.Ptr("RDPExtension"), Properties: &armcompute.CloudServiceExtensionProperties{ Type: to.Ptr("RDP"), AutoUpgradeMinorVersion: to.Ptr(false), ProtectedSettings: "<PrivateConfig><Password>{password}</Password></PrivateConfig>", Publisher: to.Ptr("Microsoft.Windows.Azure.Extensions"), Settings: "<PublicConfig><UserName>UserAzure</UserName><Expiration>10/22/2021 15:05:45</Expiration></PublicConfig>", TypeHandlerVersion: to.Ptr("1.2"), }, }}, }, NetworkProfile: &armcompute.CloudServiceNetworkProfile{ LoadBalancerConfigurations: []*armcompute.LoadBalancerConfiguration{ { Name: to.Ptr("contosolb"), Properties: &armcompute.LoadBalancerConfigurationProperties{ FrontendIPConfigurations: []*armcompute.LoadBalancerFrontendIPConfiguration{ { Name: to.Ptr("contosofe"), Properties: &armcompute.LoadBalancerFrontendIPConfigurationProperties{ PublicIPAddress: &armcompute.SubResource{ ID: to.Ptr("/subscriptions/{subscription-id}/resourceGroups/ConstosoRG/providers/Microsoft.Network/publicIPAddresses/contosopublicip"), }, }, }}, }, }}, }, PackageURL: to.Ptr("{PackageUrl}"), RoleProfile: &armcompute.CloudServiceRoleProfile{ Roles: []*armcompute.CloudServiceRoleProfileProperties{ { Name: to.Ptr("ContosoFrontend"), SKU: &armcompute.CloudServiceRoleSKU{ Name: to.Ptr("Standard_D1_v2"), Capacity: to.Ptr[int64](1), Tier: to.Ptr("Standard"), }, }}, }, UpgradeMode: to.Ptr(armcompute.CloudServiceUpgradeModeAuto), }, }, nil) if err != nil { log.Fatalf("failed to finish the request: %v", err) } res, err := poller.PollUntilDone(ctx, nil) if err != nil { log.Fatalf("failed to pull the result: %v", err) } // You could use response here. We use blank identifier for just demo purposes. _ = res // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. // res.CloudService = armcompute.CloudService{ // Name: to.Ptr("{cs-name}"), // Type: to.Ptr("Microsoft.Compute/cloudServices"), // ID: to.Ptr("/subscriptions/{subscription-id}/resourceGroups/ConstosoRG/providers/Microsoft.Compute/cloudServices/{cs-name}"), // Location: to.Ptr("westus"), // Properties: &armcompute.CloudServiceProperties{ // Configuration: to.Ptr("{ServiceConfiguration}"), // ExtensionProfile: &armcompute.CloudServiceExtensionProfile{ // Extensions: []*armcompute.Extension{ // { // Name: to.Ptr("RDPExtension"), // Properties: &armcompute.CloudServiceExtensionProperties{ // Type: to.Ptr("RDP"), // AutoUpgradeMinorVersion: to.Ptr(false), // ProvisioningState: to.Ptr("Succeeded"), // Publisher: to.Ptr("Microsoft.Windows.Azure.Extensions"), // RolesAppliedTo: []*string{ // to.Ptr("*")}, // Settings: "<PublicConfig><UserName>UserAzure</UserName><Expiration>10/22/2021 15:05:45</Expiration></PublicConfig>", // TypeHandlerVersion: to.Ptr("1.2"), // }, // }}, // }, // NetworkProfile: &armcompute.CloudServiceNetworkProfile{ // LoadBalancerConfigurations: []*armcompute.LoadBalancerConfiguration{ // { // Name: to.Ptr("contosolb"), // Properties: &armcompute.LoadBalancerConfigurationProperties{ // FrontendIPConfigurations: []*armcompute.LoadBalancerFrontendIPConfiguration{ // { // Name: to.Ptr("contosofe"), // Properties: &armcompute.LoadBalancerFrontendIPConfigurationProperties{ // PublicIPAddress: &armcompute.SubResource{ // ID: to.Ptr("/subscriptions/{subscription-id}/resourceGroups/ConstosoRG/providers/Microsoft.Network/publicIPAddresses/contosopublicip"), // }, // }, // }}, // }, // }}, // }, // OSProfile: &armcompute.CloudServiceOsProfile{ // Secrets: []*armcompute.CloudServiceVaultSecretGroup{ // }, // }, // PackageURL: to.Ptr("{PackageUrl}"), // ProvisioningState: to.Ptr("Succeeded"), // RoleProfile: &armcompute.CloudServiceRoleProfile{ // Roles: []*armcompute.CloudServiceRoleProfileProperties{ // { // Name: to.Ptr("ContosoFrontend"), // SKU: &armcompute.CloudServiceRoleSKU{ // Name: to.Ptr("Standard_D1_v2"), // Capacity: to.Ptr[int64](1), // Tier: to.Ptr("Standard"), // }, // }}, // }, // UniqueID: to.Ptr("c948cccb-bbfa-4516-a250-c28abc4d0c15"), // UpgradeMode: to.Ptr(armcompute.CloudServiceUpgradeModeAuto), // }, // SystemData: &armcompute.SystemData{ // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-01-01T17:18:19.123Z"); return t}()), // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-01-01T17:18:19.123Z"); return t}()), // }, // }
Output:
func (*CloudServicesClient) BeginDelete ¶
func (client *CloudServicesClient) BeginDelete(ctx context.Context, resourceGroupName string, cloudServiceName string, options *CloudServicesClientBeginDeleteOptions) (*runtime.Poller[CloudServicesClientDeleteResponse], error)
BeginDelete - Deletes a cloud service. If the operation fails it returns an *azcore.ResponseError type.
Generated from API version 2022-09-04
- resourceGroupName - Name of the resource group.
- cloudServiceName - Name of the cloud service.
- options - CloudServicesClientBeginDeleteOptions contains the optional parameters for the CloudServicesClient.BeginDelete method.
Example ¶
Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/92de53a5f1e0e03c94b40475d2135d97148ed014/specification/compute/resource-manager/Microsoft.Compute/CloudserviceRP/stable/2022-09-04/examples/CloudService_Delete.json
cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() clientFactory, err := armcompute.NewClientFactory("<subscription-id>", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } poller, err := clientFactory.NewCloudServicesClient().BeginDelete(ctx, "ConstosoRG", "{cs-name}", nil) if err != nil { log.Fatalf("failed to finish the request: %v", err) } _, err = poller.PollUntilDone(ctx, nil) if err != nil { log.Fatalf("failed to pull the result: %v", err) }
Output:
func (*CloudServicesClient) BeginDeleteInstances ¶
func (client *CloudServicesClient) BeginDeleteInstances(ctx context.Context, resourceGroupName string, cloudServiceName string, options *CloudServicesClientBeginDeleteInstancesOptions) (*runtime.Poller[CloudServicesClientDeleteInstancesResponse], error)
BeginDeleteInstances - Deletes role instances in a cloud service. If the operation fails it returns an *azcore.ResponseError type.
Generated from API version 2022-09-04
- resourceGroupName - Name of the resource group.
- cloudServiceName - Name of the cloud service.
- options - CloudServicesClientBeginDeleteInstancesOptions contains the optional parameters for the CloudServicesClient.BeginDeleteInstances method.
Example ¶
Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/92de53a5f1e0e03c94b40475d2135d97148ed014/specification/compute/resource-manager/Microsoft.Compute/CloudserviceRP/stable/2022-09-04/examples/CloudServiceRoleInstance_Delete_ByCloudService.json
cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() clientFactory, err := armcompute.NewClientFactory("<subscription-id>", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } poller, err := clientFactory.NewCloudServicesClient().BeginDeleteInstances(ctx, "ConstosoRG", "{cs-name}", &armcompute.CloudServicesClientBeginDeleteInstancesOptions{Parameters: &armcompute.RoleInstances{ RoleInstances: []*string{ to.Ptr("ContosoFrontend_IN_0"), to.Ptr("ContosoBackend_IN_1")}, }, }) if err != nil { log.Fatalf("failed to finish the request: %v", err) } _, err = poller.PollUntilDone(ctx, nil) if err != nil { log.Fatalf("failed to pull the result: %v", err) }
Output:
func (*CloudServicesClient) BeginPowerOff ¶
func (client *CloudServicesClient) BeginPowerOff(ctx context.Context, resourceGroupName string, cloudServiceName string, options *CloudServicesClientBeginPowerOffOptions) (*runtime.Poller[CloudServicesClientPowerOffResponse], error)
BeginPowerOff - Power off the cloud service. Note that resources are still attached and you are getting charged for the resources. If the operation fails it returns an *azcore.ResponseError type.
Generated from API version 2022-09-04
- resourceGroupName - Name of the resource group.
- cloudServiceName - Name of the cloud service.
- options - CloudServicesClientBeginPowerOffOptions contains the optional parameters for the CloudServicesClient.BeginPowerOff method.
Example ¶
Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/92de53a5f1e0e03c94b40475d2135d97148ed014/specification/compute/resource-manager/Microsoft.Compute/CloudserviceRP/stable/2022-09-04/examples/CloudService_PowerOff.json
cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() clientFactory, err := armcompute.NewClientFactory("<subscription-id>", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } poller, err := clientFactory.NewCloudServicesClient().BeginPowerOff(ctx, "ConstosoRG", "{cs-name}", nil) if err != nil { log.Fatalf("failed to finish the request: %v", err) } _, err = poller.PollUntilDone(ctx, nil) if err != nil { log.Fatalf("failed to pull the result: %v", err) }
Output:
func (*CloudServicesClient) BeginRebuild ¶
func (client *CloudServicesClient) BeginRebuild(ctx context.Context, resourceGroupName string, cloudServiceName string, options *CloudServicesClientBeginRebuildOptions) (*runtime.Poller[CloudServicesClientRebuildResponse], error)
BeginRebuild - Rebuild Role Instances reinstalls the operating system on instances of web roles or worker roles and initializes the storage resources that are used by them. If you do not want to initialize storage resources, you can use Reimage Role Instances. If the operation fails it returns an *azcore.ResponseError type.
Generated from API version 2022-09-04
- resourceGroupName - Name of the resource group.
- cloudServiceName - Name of the cloud service.
- options - CloudServicesClientBeginRebuildOptions contains the optional parameters for the CloudServicesClient.BeginRebuild method.
Example ¶
Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/92de53a5f1e0e03c94b40475d2135d97148ed014/specification/compute/resource-manager/Microsoft.Compute/CloudserviceRP/stable/2022-09-04/examples/CloudServiceRoleInstance_Rebuild_ByCloudService.json
cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() clientFactory, err := armcompute.NewClientFactory("<subscription-id>", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } poller, err := clientFactory.NewCloudServicesClient().BeginRebuild(ctx, "ConstosoRG", "{cs-name}", &armcompute.CloudServicesClientBeginRebuildOptions{Parameters: &armcompute.RoleInstances{ RoleInstances: []*string{ to.Ptr("ContosoFrontend_IN_0"), to.Ptr("ContosoBackend_IN_1")}, }, }) if err != nil { log.Fatalf("failed to finish the request: %v", err) } _, err = poller.PollUntilDone(ctx, nil) if err != nil { log.Fatalf("failed to pull the result: %v", err) }
Output:
func (*CloudServicesClient) BeginReimage ¶
func (client *CloudServicesClient) BeginReimage(ctx context.Context, resourceGroupName string, cloudServiceName string, options *CloudServicesClientBeginReimageOptions) (*runtime.Poller[CloudServicesClientReimageResponse], error)
BeginReimage - Reimage asynchronous operation reinstalls the operating system on instances of web roles or worker roles. If the operation fails it returns an *azcore.ResponseError type.
Generated from API version 2022-09-04
- resourceGroupName - Name of the resource group.
- cloudServiceName - Name of the cloud service.
- options - CloudServicesClientBeginReimageOptions contains the optional parameters for the CloudServicesClient.BeginReimage method.
Example ¶
Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/92de53a5f1e0e03c94b40475d2135d97148ed014/specification/compute/resource-manager/Microsoft.Compute/CloudserviceRP/stable/2022-09-04/examples/CloudServiceRoleInstance_Reimage_ByCloudService.json
cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() clientFactory, err := armcompute.NewClientFactory("<subscription-id>", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } poller, err := clientFactory.NewCloudServicesClient().BeginReimage(ctx, "ConstosoRG", "{cs-name}", &armcompute.CloudServicesClientBeginReimageOptions{Parameters: &armcompute.RoleInstances{ RoleInstances: []*string{ to.Ptr("ContosoFrontend_IN_0"), to.Ptr("ContosoBackend_IN_1")}, }, }) if err != nil { log.Fatalf("failed to finish the request: %v", err) } _, err = poller.PollUntilDone(ctx, nil) if err != nil { log.Fatalf("failed to pull the result: %v", err) }
Output:
func (*CloudServicesClient) BeginRestart ¶
func (client *CloudServicesClient) BeginRestart(ctx context.Context, resourceGroupName string, cloudServiceName string, options *CloudServicesClientBeginRestartOptions) (*runtime.Poller[CloudServicesClientRestartResponse], error)
BeginRestart - Restarts one or more role instances in a cloud service. If the operation fails it returns an *azcore.ResponseError type.
Generated from API version 2022-09-04
- resourceGroupName - Name of the resource group.
- cloudServiceName - Name of the cloud service.
- options - CloudServicesClientBeginRestartOptions contains the optional parameters for the CloudServicesClient.BeginRestart method.
Example ¶
Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/92de53a5f1e0e03c94b40475d2135d97148ed014/specification/compute/resource-manager/Microsoft.Compute/CloudserviceRP/stable/2022-09-04/examples/CloudServiceRoleInstance_Restart_ByCloudService.json
cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() clientFactory, err := armcompute.NewClientFactory("<subscription-id>", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } poller, err := clientFactory.NewCloudServicesClient().BeginRestart(ctx, "ConstosoRG", "{cs-name}", &armcompute.CloudServicesClientBeginRestartOptions{Parameters: &armcompute.RoleInstances{ RoleInstances: []*string{ to.Ptr("ContosoFrontend_IN_0"), to.Ptr("ContosoBackend_IN_1")}, }, }) if err != nil { log.Fatalf("failed to finish the request: %v", err) } _, err = poller.PollUntilDone(ctx, nil) if err != nil { log.Fatalf("failed to pull the result: %v", err) }
Output:
func (*CloudServicesClient) BeginStart ¶
func (client *CloudServicesClient) BeginStart(ctx context.Context, resourceGroupName string, cloudServiceName string, options *CloudServicesClientBeginStartOptions) (*runtime.Poller[CloudServicesClientStartResponse], error)
BeginStart - Starts the cloud service. If the operation fails it returns an *azcore.ResponseError type.
Generated from API version 2022-09-04
- resourceGroupName - Name of the resource group.
- cloudServiceName - Name of the cloud service.
- options - CloudServicesClientBeginStartOptions contains the optional parameters for the CloudServicesClient.BeginStart method.
Example ¶
Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/92de53a5f1e0e03c94b40475d2135d97148ed014/specification/compute/resource-manager/Microsoft.Compute/CloudserviceRP/stable/2022-09-04/examples/CloudService_Start.json
cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() clientFactory, err := armcompute.NewClientFactory("<subscription-id>", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } poller, err := clientFactory.NewCloudServicesClient().BeginStart(ctx, "ConstosoRG", "{cs-name}", nil) if err != nil { log.Fatalf("failed to finish the request: %v", err) } _, err = poller.PollUntilDone(ctx, nil) if err != nil { log.Fatalf("failed to pull the result: %v", err) }
Output:
func (*CloudServicesClient) BeginUpdate ¶
func (client *CloudServicesClient) BeginUpdate(ctx context.Context, resourceGroupName string, cloudServiceName string, parameters CloudServiceUpdate, options *CloudServicesClientBeginUpdateOptions) (*runtime.Poller[CloudServicesClientUpdateResponse], error)
BeginUpdate - Update a cloud service. If the operation fails it returns an *azcore.ResponseError type.
Generated from API version 2022-09-04
- resourceGroupName - Name of the resource group.
- cloudServiceName - Name of the cloud service.
- parameters - The cloud service object.
- options - CloudServicesClientBeginUpdateOptions contains the optional parameters for the CloudServicesClient.BeginUpdate method.
Example ¶
Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/92de53a5f1e0e03c94b40475d2135d97148ed014/specification/compute/resource-manager/Microsoft.Compute/CloudserviceRP/stable/2022-09-04/examples/CloudService_Update_ToIncludeTags.json
cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() clientFactory, err := armcompute.NewClientFactory("<subscription-id>", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } poller, err := clientFactory.NewCloudServicesClient().BeginUpdate(ctx, "ConstosoRG", "{cs-name}", armcompute.CloudServiceUpdate{ Tags: map[string]*string{ "Documentation": to.Ptr("RestAPI"), }, }, nil) if err != nil { log.Fatalf("failed to finish the request: %v", err) } res, err := poller.PollUntilDone(ctx, nil) if err != nil { log.Fatalf("failed to pull the result: %v", err) } // You could use response here. We use blank identifier for just demo purposes. _ = res // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. // res.CloudService = armcompute.CloudService{ // Name: to.Ptr("{cs-name}"), // Type: to.Ptr("Microsoft.Compute/cloudServices"), // ID: to.Ptr("/subscriptions/{subscription-id}/resourceGroups/ConstosoRG/providers/Microsoft.Compute/cloudServices/{cs-name}"), // Location: to.Ptr("eastus2euap"), // Properties: &armcompute.CloudServiceProperties{ // Configuration: to.Ptr("{ServiceConfiguration}"), // NetworkProfile: &armcompute.CloudServiceNetworkProfile{ // LoadBalancerConfigurations: []*armcompute.LoadBalancerConfiguration{ // { // Name: to.Ptr("contosolb"), // Properties: &armcompute.LoadBalancerConfigurationProperties{ // FrontendIPConfigurations: []*armcompute.LoadBalancerFrontendIPConfiguration{ // { // Name: to.Ptr("contosofe"), // Properties: &armcompute.LoadBalancerFrontendIPConfigurationProperties{ // PublicIPAddress: &armcompute.SubResource{ // ID: to.Ptr("/subscriptions/{subscription-id}/resourceGroups/ConstosoRG/providers/Microsoft.Network/publicIPAddresses/contosopublicip"), // }, // }, // }}, // }, // }}, // }, // OSProfile: &armcompute.CloudServiceOsProfile{ // Secrets: []*armcompute.CloudServiceVaultSecretGroup{ // }, // }, // ProvisioningState: to.Ptr("Succeeded"), // RoleProfile: &armcompute.CloudServiceRoleProfile{ // Roles: []*armcompute.CloudServiceRoleProfileProperties{ // { // Name: to.Ptr("ContosoFrontend"), // SKU: &armcompute.CloudServiceRoleSKU{ // Name: to.Ptr("Standard_D1_v2"), // Capacity: to.Ptr[int64](2), // Tier: to.Ptr("Standard"), // }, // }, // { // Name: to.Ptr("ContosoBackend"), // SKU: &armcompute.CloudServiceRoleSKU{ // Name: to.Ptr("Standard_D1_v2"), // Capacity: to.Ptr[int64](2), // Tier: to.Ptr("Standard"), // }, // }}, // }, // UniqueID: to.Ptr("4ccb4323-4740-4545-bb81-780b27375947"), // UpgradeMode: to.Ptr(armcompute.CloudServiceUpgradeModeAuto), // }, // Tags: map[string]*string{ // "Documentation": to.Ptr("RestAPI"), // }, // }
Output:
func (*CloudServicesClient) Get ¶
func (client *CloudServicesClient) Get(ctx context.Context, resourceGroupName string, cloudServiceName string, options *CloudServicesClientGetOptions) (CloudServicesClientGetResponse, error)
Get - Display information about a cloud service. If the operation fails it returns an *azcore.ResponseError type.
Generated from API version 2022-09-04
- resourceGroupName - Name of the resource group.
- cloudServiceName - Name of the cloud service.
- options - CloudServicesClientGetOptions contains the optional parameters for the CloudServicesClient.Get method.
Example ¶
Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/92de53a5f1e0e03c94b40475d2135d97148ed014/specification/compute/resource-manager/Microsoft.Compute/CloudserviceRP/stable/2022-09-04/examples/CloudService_Get_WithMultiRoleAndRDP.json
cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() clientFactory, err := armcompute.NewClientFactory("<subscription-id>", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } res, err := clientFactory.NewCloudServicesClient().Get(ctx, "ConstosoRG", "{cs-name}", nil) if err != nil { log.Fatalf("failed to finish the request: %v", err) } // You could use response here. We use blank identifier for just demo purposes. _ = res // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. // res.CloudService = armcompute.CloudService{ // Name: to.Ptr("{cs-name}"), // Type: to.Ptr("Microsoft.Compute/cloudServices"), // ID: to.Ptr("/subscriptions/{subscription-id}/resourceGroups/ConstosoRG/providers/Microsoft.Compute/cloudServices/{cs-name}"), // Location: to.Ptr("eastus2euap"), // Properties: &armcompute.CloudServiceProperties{ // Configuration: to.Ptr("{ServiceConfiguration}"), // ExtensionProfile: &armcompute.CloudServiceExtensionProfile{ // Extensions: []*armcompute.Extension{ // { // Name: to.Ptr("RDPExtension"), // Properties: &armcompute.CloudServiceExtensionProperties{ // Type: to.Ptr("RDP"), // AutoUpgradeMinorVersion: to.Ptr(false), // ProvisioningState: to.Ptr("Succeeded"), // Publisher: to.Ptr("Microsoft.Windows.Azure.Extensions"), // RolesAppliedTo: []*string{ // to.Ptr("*")}, // Settings: "<PublicConfig><UserName>userazure</UserName><Expiration>01/12/2022 16:29:02</Expiration></PublicConfig>", // TypeHandlerVersion: to.Ptr("1.2"), // }, // }}, // }, // NetworkProfile: &armcompute.CloudServiceNetworkProfile{ // LoadBalancerConfigurations: []*armcompute.LoadBalancerConfiguration{ // { // Name: to.Ptr("contosolb"), // Properties: &armcompute.LoadBalancerConfigurationProperties{ // FrontendIPConfigurations: []*armcompute.LoadBalancerFrontendIPConfiguration{ // { // Name: to.Ptr("contosofe"), // Properties: &armcompute.LoadBalancerFrontendIPConfigurationProperties{ // PublicIPAddress: &armcompute.SubResource{ // ID: to.Ptr("/subscriptions/{subscription-id}/resourceGroups/ConstosoRG/providers/Microsoft.Network/publicIPAddresses/contosopublicip"), // }, // }, // }}, // }, // }}, // }, // OSProfile: &armcompute.CloudServiceOsProfile{ // Secrets: []*armcompute.CloudServiceVaultSecretGroup{ // }, // }, // ProvisioningState: to.Ptr("Succeeded"), // RoleProfile: &armcompute.CloudServiceRoleProfile{ // Roles: []*armcompute.CloudServiceRoleProfileProperties{ // { // Name: to.Ptr("ContosoFrontend"), // SKU: &armcompute.CloudServiceRoleSKU{ // Name: to.Ptr("Standard_D1_v2"), // Capacity: to.Ptr[int64](2), // Tier: to.Ptr("Standard"), // }, // }, // { // Name: to.Ptr("ContosoBackend"), // SKU: &armcompute.CloudServiceRoleSKU{ // Name: to.Ptr("Standard_D1_v2"), // Capacity: to.Ptr[int64](2), // Tier: to.Ptr("Standard"), // }, // }}, // }, // UniqueID: to.Ptr("4ccb4323-4740-4545-bb81-780b27375947"), // UpgradeMode: to.Ptr(armcompute.CloudServiceUpgradeModeAuto), // }, // SystemData: &armcompute.SystemData{ // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-01-01T17:18:19.123Z"); return t}()), // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-01-01T17:18:19.123Z"); return t}()), // }, // }
Output:
func (*CloudServicesClient) GetInstanceView ¶
func (client *CloudServicesClient) GetInstanceView(ctx context.Context, resourceGroupName string, cloudServiceName string, options *CloudServicesClientGetInstanceViewOptions) (CloudServicesClientGetInstanceViewResponse, error)
GetInstanceView - Gets the status of a cloud service. If the operation fails it returns an *azcore.ResponseError type.
Generated from API version 2022-09-04
- resourceGroupName - Name of the resource group.
- cloudServiceName - Name of the cloud service.
- options - CloudServicesClientGetInstanceViewOptions contains the optional parameters for the CloudServicesClient.GetInstanceView method.
Example ¶
Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/92de53a5f1e0e03c94b40475d2135d97148ed014/specification/compute/resource-manager/Microsoft.Compute/CloudserviceRP/stable/2022-09-04/examples/CloudService_Get_InstanceViewWithMultiRole.json
cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() clientFactory, err := armcompute.NewClientFactory("<subscription-id>", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } res, err := clientFactory.NewCloudServicesClient().GetInstanceView(ctx, "ConstosoRG", "{cs-name}", nil) if err != nil { log.Fatalf("failed to finish the request: %v", err) } // You could use response here. We use blank identifier for just demo purposes. _ = res // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. // res.CloudServiceInstanceView = armcompute.CloudServiceInstanceView{ // PrivateIDs: []*string{ // to.Ptr("3491bc0c-1f6c-444f-b1d0-ec0751a74e3e")}, // RoleInstance: &armcompute.InstanceViewStatusesSummary{ // StatusesSummary: []*armcompute.StatusCodeCount{ // { // Code: to.Ptr("ProvisioningState/succeeded"), // Count: to.Ptr[int32](4), // }, // { // Code: to.Ptr("PowerState/started"), // Count: to.Ptr[int32](4), // }, // { // Code: to.Ptr("RoleState/RoleStateStarted"), // Count: to.Ptr[int32](4), // }}, // }, // SdkVersion: to.Ptr("2.9.6496.3"), // Statuses: []*armcompute.ResourceInstanceViewStatus{ // { // Code: to.Ptr("ProvisioningState/succeeded"), // DisplayStatus: to.Ptr("Provisioning succeeded"), // Level: to.Ptr(armcompute.StatusLevelTypesInfo), // Time: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-01-12T11:20:07.095Z"); return t}()), // }, // { // Code: to.Ptr("PowerState/started"), // DisplayStatus: to.Ptr("Started"), // Level: to.Ptr(armcompute.StatusLevelTypesInfo), // Time: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-01-12T11:20:07.095Z"); return t}()), // }, // { // Code: to.Ptr("CurrentUpgradeDomain/-1"), // DisplayStatus: to.Ptr("Current Upgrade Domain of cloud service is -1."), // Level: to.Ptr(armcompute.StatusLevelTypesInfo), // }, // { // Code: to.Ptr("MaxUpgradeDomain/1"), // DisplayStatus: to.Ptr("Max Upgrade Domain of cloud service is 1."), // Level: to.Ptr(armcompute.StatusLevelTypesInfo), // }}, // }
Output:
func (*CloudServicesClient) NewListAllPager ¶
func (client *CloudServicesClient) NewListAllPager(options *CloudServicesClientListAllOptions) *runtime.Pager[CloudServicesClientListAllResponse]
NewListAllPager - Gets a list of all cloud services in the subscription, regardless of the associated resource group. Use nextLink property in the response to get the next page of Cloud Services. Do this till nextLink is null to fetch all the Cloud Services.
Generated from API version 2022-09-04
- options - CloudServicesClientListAllOptions contains the optional parameters for the CloudServicesClient.NewListAllPager method.
Example ¶
Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/92de53a5f1e0e03c94b40475d2135d97148ed014/specification/compute/resource-manager/Microsoft.Compute/CloudserviceRP/stable/2022-09-04/examples/CloudService_List_BySubscription.json
cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() clientFactory, err := armcompute.NewClientFactory("<subscription-id>", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } pager := clientFactory.NewCloudServicesClient().NewListAllPager(nil) for pager.More() { page, err := pager.NextPage(ctx) if err != nil { log.Fatalf("failed to advance page: %v", err) } for _, v := range page.Value { // You could use page here. We use blank identifier for just demo purposes. _ = v } // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. // page.CloudServiceListResult = armcompute.CloudServiceListResult{ // Value: []*armcompute.CloudService{ // { // Name: to.Ptr("{cs-name}"), // Type: to.Ptr("Microsoft.Compute/cloudServices"), // ID: to.Ptr("/subscriptions/{subscription-id}/resourceGroups/ConstosoRG/providers/Microsoft.Compute/cloudServices/{cs-name}"), // Location: to.Ptr("eastus2euap"), // Properties: &armcompute.CloudServiceProperties{ // Configuration: to.Ptr("{ServiceConfiguration}"), // ExtensionProfile: &armcompute.CloudServiceExtensionProfile{ // Extensions: []*armcompute.Extension{ // { // Name: to.Ptr("RDPExtension"), // Properties: &armcompute.CloudServiceExtensionProperties{ // Type: to.Ptr("RDP"), // AutoUpgradeMinorVersion: to.Ptr(false), // ProvisioningState: to.Ptr("Succeeded"), // Publisher: to.Ptr("Microsoft.Windows.Azure.Extensions"), // RolesAppliedTo: []*string{ // to.Ptr("*")}, // Settings: "<PublicConfig><UserName>userazure</UserName><Expiration>01/12/2022 16:29:02</Expiration></PublicConfig>", // TypeHandlerVersion: to.Ptr("1.2"), // }, // }}, // }, // NetworkProfile: &armcompute.CloudServiceNetworkProfile{ // LoadBalancerConfigurations: []*armcompute.LoadBalancerConfiguration{ // { // Name: to.Ptr("contosolb"), // Properties: &armcompute.LoadBalancerConfigurationProperties{ // FrontendIPConfigurations: []*armcompute.LoadBalancerFrontendIPConfiguration{ // { // Name: to.Ptr("contosofe"), // Properties: &armcompute.LoadBalancerFrontendIPConfigurationProperties{ // PublicIPAddress: &armcompute.SubResource{ // ID: to.Ptr("/subscriptions/{subscription-id}/resourceGroups/ConstosoRG/providers/Microsoft.Network/publicIPAddresses/contosopublicip"), // }, // }, // }}, // }, // }}, // }, // OSProfile: &armcompute.CloudServiceOsProfile{ // Secrets: []*armcompute.CloudServiceVaultSecretGroup{ // }, // }, // ProvisioningState: to.Ptr("Succeeded"), // RoleProfile: &armcompute.CloudServiceRoleProfile{ // Roles: []*armcompute.CloudServiceRoleProfileProperties{ // { // Name: to.Ptr("ContosoFrontend"), // SKU: &armcompute.CloudServiceRoleSKU{ // Name: to.Ptr("Standard_D1_v2"), // Capacity: to.Ptr[int64](2), // Tier: to.Ptr("Standard"), // }, // }, // { // Name: to.Ptr("ContosoBackend"), // SKU: &armcompute.CloudServiceRoleSKU{ // Name: to.Ptr("Standard_D1_v2"), // Capacity: to.Ptr[int64](2), // Tier: to.Ptr("Standard"), // }, // }}, // }, // UniqueID: to.Ptr("4ccb4323-4740-4545-bb81-780b27375947"), // UpgradeMode: to.Ptr(armcompute.CloudServiceUpgradeModeAuto), // }, // }}, // } }
Output:
func (*CloudServicesClient) NewListPager ¶
func (client *CloudServicesClient) NewListPager(resourceGroupName string, options *CloudServicesClientListOptions) *runtime.Pager[CloudServicesClientListResponse]
NewListPager - Gets a list of all cloud services under a resource group. Use nextLink property in the response to get the next page of Cloud Services. Do this till nextLink is null to fetch all the Cloud Services.
Generated from API version 2022-09-04
- resourceGroupName - Name of the resource group.
- options - CloudServicesClientListOptions contains the optional parameters for the CloudServicesClient.NewListPager method.
Example ¶
Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/92de53a5f1e0e03c94b40475d2135d97148ed014/specification/compute/resource-manager/Microsoft.Compute/CloudserviceRP/stable/2022-09-04/examples/CloudService_List_ByResourceGroup.json
cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() clientFactory, err := armcompute.NewClientFactory("<subscription-id>", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } pager := clientFactory.NewCloudServicesClient().NewListPager("ConstosoRG", nil) for pager.More() { page, err := pager.NextPage(ctx) if err != nil { log.Fatalf("failed to advance page: %v", err) } for _, v := range page.Value { // You could use page here. We use blank identifier for just demo purposes. _ = v } // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. // page.CloudServiceListResult = armcompute.CloudServiceListResult{ // Value: []*armcompute.CloudService{ // { // Name: to.Ptr("{cs-name}"), // Type: to.Ptr("Microsoft.Compute/cloudServices"), // ID: to.Ptr("/subscriptions/{subscription-id}/resourceGroups/ConstosoRG/providers/Microsoft.Compute/cloudServices/{cs-name}"), // Location: to.Ptr("eastus2euap"), // Properties: &armcompute.CloudServiceProperties{ // Configuration: to.Ptr("{ServiceConfiguration}"), // ExtensionProfile: &armcompute.CloudServiceExtensionProfile{ // Extensions: []*armcompute.Extension{ // { // Name: to.Ptr("RDPExtension"), // Properties: &armcompute.CloudServiceExtensionProperties{ // Type: to.Ptr("RDP"), // AutoUpgradeMinorVersion: to.Ptr(false), // ProvisioningState: to.Ptr("Succeeded"), // Publisher: to.Ptr("Microsoft.Windows.Azure.Extensions"), // RolesAppliedTo: []*string{ // to.Ptr("*")}, // Settings: "<PublicConfig><UserName>userazure</UserName><Expiration>01/12/2022 16:29:02</Expiration></PublicConfig>", // TypeHandlerVersion: to.Ptr("1.2"), // }, // }}, // }, // NetworkProfile: &armcompute.CloudServiceNetworkProfile{ // LoadBalancerConfigurations: []*armcompute.LoadBalancerConfiguration{ // { // Name: to.Ptr("contosolb"), // Properties: &armcompute.LoadBalancerConfigurationProperties{ // FrontendIPConfigurations: []*armcompute.LoadBalancerFrontendIPConfiguration{ // { // Name: to.Ptr("contosofe"), // Properties: &armcompute.LoadBalancerFrontendIPConfigurationProperties{ // PublicIPAddress: &armcompute.SubResource{ // ID: to.Ptr("/subscriptions/{subscription-id}/resourceGroups/ConstosoRG/providers/Microsoft.Network/publicIPAddresses/contosopublicip"), // }, // }, // }}, // }, // }}, // }, // OSProfile: &armcompute.CloudServiceOsProfile{ // Secrets: []*armcompute.CloudServiceVaultSecretGroup{ // }, // }, // ProvisioningState: to.Ptr("Succeeded"), // RoleProfile: &armcompute.CloudServiceRoleProfile{ // Roles: []*armcompute.CloudServiceRoleProfileProperties{ // { // Name: to.Ptr("ContosoFrontend"), // SKU: &armcompute.CloudServiceRoleSKU{ // Name: to.Ptr("Standard_D1_v2"), // Capacity: to.Ptr[int64](2), // Tier: to.Ptr("Standard"), // }, // }, // { // Name: to.Ptr("ContosoBackend"), // SKU: &armcompute.CloudServiceRoleSKU{ // Name: to.Ptr("Standard_D1_v2"), // Capacity: to.Ptr[int64](2), // Tier: to.Ptr("Standard"), // }, // }}, // }, // UniqueID: to.Ptr("4ccb4323-4740-4545-bb81-780b27375947"), // UpgradeMode: to.Ptr(armcompute.CloudServiceUpgradeModeAuto), // }, // }}, // } }
Output:
type CloudServicesClientBeginCreateOrUpdateOptions ¶
type CloudServicesClientBeginCreateOrUpdateOptions struct { // Resumes the LRO from the provided token. ResumeToken string }
CloudServicesClientBeginCreateOrUpdateOptions contains the optional parameters for the CloudServicesClient.BeginCreateOrUpdate method.
type CloudServicesClientBeginDeleteInstancesOptions ¶
type CloudServicesClientBeginDeleteInstancesOptions struct { // List of cloud service role instance names. Parameters *RoleInstances // Resumes the LRO from the provided token. ResumeToken string }
CloudServicesClientBeginDeleteInstancesOptions contains the optional parameters for the CloudServicesClient.BeginDeleteInstances method.
type CloudServicesClientBeginDeleteOptions ¶
type CloudServicesClientBeginDeleteOptions struct { // Resumes the LRO from the provided token. ResumeToken string }
CloudServicesClientBeginDeleteOptions contains the optional parameters for the CloudServicesClient.BeginDelete method.
type CloudServicesClientBeginPowerOffOptions ¶
type CloudServicesClientBeginPowerOffOptions struct { // Resumes the LRO from the provided token. ResumeToken string }
CloudServicesClientBeginPowerOffOptions contains the optional parameters for the CloudServicesClient.BeginPowerOff method.
type CloudServicesClientBeginRebuildOptions ¶
type CloudServicesClientBeginRebuildOptions struct { // List of cloud service role instance names. Parameters *RoleInstances // Resumes the LRO from the provided token. ResumeToken string }
CloudServicesClientBeginRebuildOptions contains the optional parameters for the CloudServicesClient.BeginRebuild method.
type CloudServicesClientBeginReimageOptions ¶
type CloudServicesClientBeginReimageOptions struct { // List of cloud service role instance names. Parameters *RoleInstances // Resumes the LRO from the provided token. ResumeToken string }
CloudServicesClientBeginReimageOptions contains the optional parameters for the CloudServicesClient.BeginReimage method.
type CloudServicesClientBeginRestartOptions ¶
type CloudServicesClientBeginRestartOptions struct { // List of cloud service role instance names. Parameters *RoleInstances // Resumes the LRO from the provided token. ResumeToken string }
CloudServicesClientBeginRestartOptions contains the optional parameters for the CloudServicesClient.BeginRestart method.
type CloudServicesClientBeginStartOptions ¶
type CloudServicesClientBeginStartOptions struct { // Resumes the LRO from the provided token. ResumeToken string }
CloudServicesClientBeginStartOptions contains the optional parameters for the CloudServicesClient.BeginStart method.
type CloudServicesClientBeginUpdateOptions ¶
type CloudServicesClientBeginUpdateOptions struct { // Resumes the LRO from the provided token. ResumeToken string }
CloudServicesClientBeginUpdateOptions contains the optional parameters for the CloudServicesClient.BeginUpdate method.
type CloudServicesClientCreateOrUpdateResponse ¶
type CloudServicesClientCreateOrUpdateResponse struct { // Describes the cloud service. CloudService }
CloudServicesClientCreateOrUpdateResponse contains the response from method CloudServicesClient.BeginCreateOrUpdate.
type CloudServicesClientDeleteInstancesResponse ¶
type CloudServicesClientDeleteInstancesResponse struct { }
CloudServicesClientDeleteInstancesResponse contains the response from method CloudServicesClient.BeginDeleteInstances.
type CloudServicesClientDeleteResponse ¶
type CloudServicesClientDeleteResponse struct { }
CloudServicesClientDeleteResponse contains the response from method CloudServicesClient.BeginDelete.
type CloudServicesClientGetInstanceViewOptions ¶
type CloudServicesClientGetInstanceViewOptions struct { }
CloudServicesClientGetInstanceViewOptions contains the optional parameters for the CloudServicesClient.GetInstanceView method.
type CloudServicesClientGetInstanceViewResponse ¶
type CloudServicesClientGetInstanceViewResponse struct { // InstanceView of CloudService as a whole CloudServiceInstanceView }
CloudServicesClientGetInstanceViewResponse contains the response from method CloudServicesClient.GetInstanceView.
type CloudServicesClientGetOptions ¶
type CloudServicesClientGetOptions struct { }
CloudServicesClientGetOptions contains the optional parameters for the CloudServicesClient.Get method.
type CloudServicesClientGetResponse ¶
type CloudServicesClientGetResponse struct { // Describes the cloud service. CloudService }
CloudServicesClientGetResponse contains the response from method CloudServicesClient.Get.
type CloudServicesClientListAllOptions ¶
type CloudServicesClientListAllOptions struct { }
CloudServicesClientListAllOptions contains the optional parameters for the CloudServicesClient.NewListAllPager method.
type CloudServicesClientListAllResponse ¶
type CloudServicesClientListAllResponse struct { // The list operation result. CloudServiceListResult }
CloudServicesClientListAllResponse contains the response from method CloudServicesClient.NewListAllPager.
type CloudServicesClientListOptions ¶
type CloudServicesClientListOptions struct { }
CloudServicesClientListOptions contains the optional parameters for the CloudServicesClient.NewListPager method.
type CloudServicesClientListResponse ¶
type CloudServicesClientListResponse struct { // The list operation result. CloudServiceListResult }
CloudServicesClientListResponse contains the response from method CloudServicesClient.NewListPager.
type CloudServicesClientPowerOffResponse ¶
type CloudServicesClientPowerOffResponse struct { }
CloudServicesClientPowerOffResponse contains the response from method CloudServicesClient.BeginPowerOff.
type CloudServicesClientRebuildResponse ¶
type CloudServicesClientRebuildResponse struct { }
CloudServicesClientRebuildResponse contains the response from method CloudServicesClient.BeginRebuild.
type CloudServicesClientReimageResponse ¶
type CloudServicesClientReimageResponse struct { }
CloudServicesClientReimageResponse contains the response from method CloudServicesClient.BeginReimage.
type CloudServicesClientRestartResponse ¶
type CloudServicesClientRestartResponse struct { }
CloudServicesClientRestartResponse contains the response from method CloudServicesClient.BeginRestart.
type CloudServicesClientStartResponse ¶
type CloudServicesClientStartResponse struct { }
CloudServicesClientStartResponse contains the response from method CloudServicesClient.BeginStart.
type CloudServicesClientUpdateResponse ¶
type CloudServicesClientUpdateResponse struct { // Describes the cloud service. CloudService }
CloudServicesClientUpdateResponse contains the response from method CloudServicesClient.BeginUpdate.
type CloudServicesUpdateDomainClient ¶
type CloudServicesUpdateDomainClient struct {
// contains filtered or unexported fields
}
CloudServicesUpdateDomainClient contains the methods for the CloudServicesUpdateDomain group. Don't use this type directly, use NewCloudServicesUpdateDomainClient() instead.
func NewCloudServicesUpdateDomainClient ¶
func NewCloudServicesUpdateDomainClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*CloudServicesUpdateDomainClient, error)
NewCloudServicesUpdateDomainClient creates a new instance of CloudServicesUpdateDomainClient 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 (*CloudServicesUpdateDomainClient) BeginWalkUpdateDomain ¶
func (client *CloudServicesUpdateDomainClient) BeginWalkUpdateDomain(ctx context.Context, resourceGroupName string, cloudServiceName string, updateDomain int32, parameters UpdateDomain, options *CloudServicesUpdateDomainClientBeginWalkUpdateDomainOptions) (*runtime.Poller[CloudServicesUpdateDomainClientWalkUpdateDomainResponse], error)
BeginWalkUpdateDomain - Updates the role instances in the specified update domain. If the operation fails it returns an *azcore.ResponseError type.
Generated from API version 2022-09-04
- resourceGroupName - Name of the resource group.
- cloudServiceName - Name of the cloud service.
- updateDomain - Specifies an integer value that identifies the update domain. Update domains are identified with a zero-based index: the first update domain has an ID of 0, the second has an ID of 1, and so on.
- parameters - The update domain object.
- options - CloudServicesUpdateDomainClientBeginWalkUpdateDomainOptions contains the optional parameters for the CloudServicesUpdateDomainClient.BeginWalkUpdateDomain method.
Example ¶
Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/92de53a5f1e0e03c94b40475d2135d97148ed014/specification/compute/resource-manager/Microsoft.Compute/CloudserviceRP/stable/2022-09-04/examples/CloudServiceUpdateDomain_Update.json
cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() clientFactory, err := armcompute.NewClientFactory("<subscription-id>", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } poller, err := clientFactory.NewCloudServicesUpdateDomainClient().BeginWalkUpdateDomain(ctx, "ConstosoRG", "{cs-name}", 1, armcompute.UpdateDomain{}, nil) if err != nil { log.Fatalf("failed to finish the request: %v", err) } _, err = poller.PollUntilDone(ctx, nil) if err != nil { log.Fatalf("failed to pull the result: %v", err) }
Output:
func (*CloudServicesUpdateDomainClient) GetUpdateDomain ¶
func (client *CloudServicesUpdateDomainClient) GetUpdateDomain(ctx context.Context, resourceGroupName string, cloudServiceName string, updateDomain int32, options *CloudServicesUpdateDomainClientGetUpdateDomainOptions) (CloudServicesUpdateDomainClientGetUpdateDomainResponse, error)
GetUpdateDomain - Gets the specified update domain of a cloud service. Use nextLink property in the response to get the next page of update domains. Do this till nextLink is null to fetch all the update domains. If the operation fails it returns an *azcore.ResponseError type.
Generated from API version 2022-09-04
- resourceGroupName - Name of the resource group.
- cloudServiceName - Name of the cloud service.
- updateDomain - Specifies an integer value that identifies the update domain. Update domains are identified with a zero-based index: the first update domain has an ID of 0, the second has an ID of 1, and so on.
- options - CloudServicesUpdateDomainClientGetUpdateDomainOptions contains the optional parameters for the CloudServicesUpdateDomainClient.GetUpdateDomain method.
Example ¶
Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/92de53a5f1e0e03c94b40475d2135d97148ed014/specification/compute/resource-manager/Microsoft.Compute/CloudserviceRP/stable/2022-09-04/examples/CloudServiceUpdateDomain_Get.json
cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() clientFactory, err := armcompute.NewClientFactory("<subscription-id>", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } res, err := clientFactory.NewCloudServicesUpdateDomainClient().GetUpdateDomain(ctx, "ConstosoRG", "{cs-name}", 1, nil) if err != nil { log.Fatalf("failed to finish the request: %v", err) } // You could use response here. We use blank identifier for just demo purposes. _ = res // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. // res.UpdateDomain = armcompute.UpdateDomain{ // Name: to.Ptr("1"), // ID: to.Ptr("/subscriptions/{subscription-id}/resourceGroups/ConstosoRG/providers/Microsoft.Compute/cloudServices/{cs-name}/updateDomains/1"), // }
Output:
func (*CloudServicesUpdateDomainClient) NewListUpdateDomainsPager ¶
func (client *CloudServicesUpdateDomainClient) NewListUpdateDomainsPager(resourceGroupName string, cloudServiceName string, options *CloudServicesUpdateDomainClientListUpdateDomainsOptions) *runtime.Pager[CloudServicesUpdateDomainClientListUpdateDomainsResponse]
NewListUpdateDomainsPager - Gets a list of all update domains in a cloud service.
Generated from API version 2022-09-04
- resourceGroupName - Name of the resource group.
- cloudServiceName - Name of the cloud service.
- options - CloudServicesUpdateDomainClientListUpdateDomainsOptions contains the optional parameters for the CloudServicesUpdateDomainClient.NewListUpdateDomainsPager method.
Example ¶
Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/92de53a5f1e0e03c94b40475d2135d97148ed014/specification/compute/resource-manager/Microsoft.Compute/CloudserviceRP/stable/2022-09-04/examples/CloudServiceUpdateDomain_List.json
cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() clientFactory, err := armcompute.NewClientFactory("<subscription-id>", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } pager := clientFactory.NewCloudServicesUpdateDomainClient().NewListUpdateDomainsPager("ConstosoRG", "{cs-name}", nil) for pager.More() { page, err := pager.NextPage(ctx) if err != nil { log.Fatalf("failed to advance page: %v", err) } for _, v := range page.Value { // You could use page here. We use blank identifier for just demo purposes. _ = v } // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. // page.UpdateDomainListResult = armcompute.UpdateDomainListResult{ // Value: []*armcompute.UpdateDomain{ // { // Name: to.Ptr("0"), // ID: to.Ptr("/subscriptions/{subscription-id}/resourceGroups/ConstosoRG/providers/Microsoft.Compute/cloudServices/{cs-name}/updateDomains/0"), // }, // { // Name: to.Ptr("1"), // ID: to.Ptr("/subscriptions/{subscription-id}/resourceGroups/ConstosoRG/providers/Microsoft.Compute/cloudServices/{cs-name}/updateDomains/1"), // }}, // } }
Output:
type CloudServicesUpdateDomainClientBeginWalkUpdateDomainOptions ¶
type CloudServicesUpdateDomainClientBeginWalkUpdateDomainOptions struct { // Resumes the LRO from the provided token. ResumeToken string }
CloudServicesUpdateDomainClientBeginWalkUpdateDomainOptions contains the optional parameters for the CloudServicesUpdateDomainClient.BeginWalkUpdateDomain method.
type CloudServicesUpdateDomainClientGetUpdateDomainOptions ¶
type CloudServicesUpdateDomainClientGetUpdateDomainOptions struct { }
CloudServicesUpdateDomainClientGetUpdateDomainOptions contains the optional parameters for the CloudServicesUpdateDomainClient.GetUpdateDomain method.
type CloudServicesUpdateDomainClientGetUpdateDomainResponse ¶
type CloudServicesUpdateDomainClientGetUpdateDomainResponse struct { // Defines an update domain for the cloud service. UpdateDomain }
CloudServicesUpdateDomainClientGetUpdateDomainResponse contains the response from method CloudServicesUpdateDomainClient.GetUpdateDomain.
type CloudServicesUpdateDomainClientListUpdateDomainsOptions ¶
type CloudServicesUpdateDomainClientListUpdateDomainsOptions struct { }
CloudServicesUpdateDomainClientListUpdateDomainsOptions contains the optional parameters for the CloudServicesUpdateDomainClient.NewListUpdateDomainsPager method.
type CloudServicesUpdateDomainClientListUpdateDomainsResponse ¶
type CloudServicesUpdateDomainClientListUpdateDomainsResponse struct { // The list operation result. UpdateDomainListResult }
CloudServicesUpdateDomainClientListUpdateDomainsResponse contains the response from method CloudServicesUpdateDomainClient.NewListUpdateDomainsPager.
type CloudServicesUpdateDomainClientWalkUpdateDomainResponse ¶
type CloudServicesUpdateDomainClientWalkUpdateDomainResponse struct { }
CloudServicesUpdateDomainClientWalkUpdateDomainResponse contains the response from method CloudServicesUpdateDomainClient.BeginWalkUpdateDomain.
type CommunityGalleriesClient ¶
type CommunityGalleriesClient struct {
// contains filtered or unexported fields
}
CommunityGalleriesClient contains the methods for the CommunityGalleries group. Don't use this type directly, use NewCommunityGalleriesClient() instead.
func NewCommunityGalleriesClient ¶
func NewCommunityGalleriesClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*CommunityGalleriesClient, error)
NewCommunityGalleriesClient creates a new instance of CommunityGalleriesClient 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 (*CommunityGalleriesClient) Get ¶
func (client *CommunityGalleriesClient) Get(ctx context.Context, location string, publicGalleryName string, options *CommunityGalleriesClientGetOptions) (CommunityGalleriesClientGetResponse, error)
Get - Get a community gallery by gallery public name. If the operation fails it returns an *azcore.ResponseError type.
Generated from API version 2023-07-03
- location - Resource location.
- publicGalleryName - The public name of the community gallery.
- options - CommunityGalleriesClientGetOptions contains the optional parameters for the CommunityGalleriesClient.Get method.
Example ¶
Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/92de53a5f1e0e03c94b40475d2135d97148ed014/specification/compute/resource-manager/Microsoft.Compute/GalleryRP/stable/2023-07-03/examples/communityGalleryExamples/CommunityGallery_Get.json
cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() clientFactory, err := armcompute.NewClientFactory("<subscription-id>", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } res, err := clientFactory.NewCommunityGalleriesClient().Get(ctx, "myLocation", "publicGalleryName", nil) if err != nil { log.Fatalf("failed to finish the request: %v", err) } // You could use response here. We use blank identifier for just demo purposes. _ = res // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. // res.CommunityGallery = armcompute.CommunityGallery{ // Name: to.Ptr("publicGalleryName"), // Type: to.Ptr("Microsoft.Compute/locations/communityGallery"), // Identifier: &armcompute.CommunityGalleryIdentifier{ // UniqueID: to.Ptr("/CommunityGalleries/publicGalleryName"), // }, // Location: to.Ptr("myLocation"), // Properties: &armcompute.CommunityGalleryProperties{ // ArtifactTags: map[string]*string{ // "ShareTag-CommunityGallery": to.Ptr("CommunityGallery"), // }, // CommunityMetadata: &armcompute.CommunityGalleryMetadata{ // Eula: to.Ptr("https://test-uri.com"), // PrivacyStatementURI: to.Ptr("https://test-uri.com"), // PublicNames: []*string{ // to.Ptr("prefix-xxxxx")}, // PublisherContact: to.Ptr("sameple@email.com"), // PublisherURI: to.Ptr("https://test-uri.com"), // }, // Disclaimer: to.Ptr("https://test-uri.com"), // }, // }
Output:
type CommunityGalleriesClientGetOptions ¶
type CommunityGalleriesClientGetOptions struct { }
CommunityGalleriesClientGetOptions contains the optional parameters for the CommunityGalleriesClient.Get method.
type CommunityGalleriesClientGetResponse ¶
type CommunityGalleriesClientGetResponse struct { // Specifies information about the Community Gallery that you want to create or update. CommunityGallery }
CommunityGalleriesClientGetResponse contains the response from method CommunityGalleriesClient.Get.
type CommunityGallery ¶
type CommunityGallery struct { // The identifier information of community gallery. Identifier *CommunityGalleryIdentifier // Describes the properties of a community gallery. Properties *CommunityGalleryProperties // READ-ONLY; Resource location Location *string // READ-ONLY; Resource name Name *string // READ-ONLY; Resource type Type *string }
CommunityGallery - Specifies information about the Community Gallery that you want to create or update.
func (CommunityGallery) MarshalJSON ¶
func (c CommunityGallery) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type CommunityGallery.
func (*CommunityGallery) UnmarshalJSON ¶
func (c *CommunityGallery) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type CommunityGallery.
type CommunityGalleryIdentifier ¶
type CommunityGalleryIdentifier struct { // The unique id of this community gallery. UniqueID *string }
CommunityGalleryIdentifier - The identifier information of community gallery.
func (CommunityGalleryIdentifier) MarshalJSON ¶
func (c CommunityGalleryIdentifier) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type CommunityGalleryIdentifier.
func (*CommunityGalleryIdentifier) UnmarshalJSON ¶
func (c *CommunityGalleryIdentifier) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type CommunityGalleryIdentifier.
type CommunityGalleryImage ¶
type CommunityGalleryImage struct { // The identifier information of community gallery. Identifier *CommunityGalleryIdentifier // Describes the properties of a gallery image definition. Properties *CommunityGalleryImageProperties // READ-ONLY; Resource location Location *string // READ-ONLY; Resource name Name *string // READ-ONLY; Resource type Type *string }
CommunityGalleryImage - Specifies information about the gallery image definition that you want to create or update.
func (CommunityGalleryImage) MarshalJSON ¶
func (c CommunityGalleryImage) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type CommunityGalleryImage.
func (*CommunityGalleryImage) UnmarshalJSON ¶
func (c *CommunityGalleryImage) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type CommunityGalleryImage.
type CommunityGalleryImageIdentifier ¶
type CommunityGalleryImageIdentifier struct { // The name of the gallery image definition offer. Offer *string // The name of the gallery image definition publisher. Publisher *string // The name of the gallery image definition SKU. SKU *string }
CommunityGalleryImageIdentifier - This is the community gallery image definition identifier.
func (CommunityGalleryImageIdentifier) MarshalJSON ¶
func (c CommunityGalleryImageIdentifier) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type CommunityGalleryImageIdentifier.
func (*CommunityGalleryImageIdentifier) UnmarshalJSON ¶
func (c *CommunityGalleryImageIdentifier) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type CommunityGalleryImageIdentifier.
type CommunityGalleryImageList ¶
type CommunityGalleryImageList struct { // REQUIRED; A list of community gallery images. Value []*CommunityGalleryImage // The URI to fetch the next page of community gallery images. Call ListNext() with this to fetch the next page of community // gallery images. NextLink *string }
CommunityGalleryImageList - The List Community Gallery Images operation response.
func (CommunityGalleryImageList) MarshalJSON ¶
func (c CommunityGalleryImageList) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type CommunityGalleryImageList.
func (*CommunityGalleryImageList) UnmarshalJSON ¶
func (c *CommunityGalleryImageList) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type CommunityGalleryImageList.
type CommunityGalleryImageProperties ¶
type CommunityGalleryImageProperties struct { // REQUIRED; This is the community gallery image definition identifier. Identifier *CommunityGalleryImageIdentifier // REQUIRED; This property allows the user to specify whether the virtual machines created under this image are 'Generalized' // or 'Specialized'. OSState *OperatingSystemStateTypes // REQUIRED; This property allows you to specify the type of the OS that is included in the disk when creating a VM from a // managed image. Possible values are: Windows, Linux. OSType *OperatingSystemTypes // The architecture of the image. Applicable to OS disks only. Architecture *Architecture // The artifact tags of a community gallery resource. ArtifactTags map[string]*string // Describes the disallowed disk types. Disallowed *Disallowed // The disclaimer for a community gallery resource. Disclaimer *string // The end of life date of the gallery image definition. This property can be used for decommissioning purposes. This property // is updatable. EndOfLifeDate *time.Time // The end-user license agreement for the current community gallery image. Eula *string // A list of gallery image features. Features []*GalleryImageFeature // The hypervisor generation of the Virtual Machine. Applicable to OS disks only. HyperVGeneration *HyperVGeneration // Privacy statement URI for the current community gallery image. PrivacyStatementURI *string // Describes the gallery image definition purchase plan. This is used by marketplace images. PurchasePlan *ImagePurchasePlan // The properties describe the recommended machine configuration for this Image Definition. These properties are updatable. Recommended *RecommendedMachineConfiguration }
CommunityGalleryImageProperties - Describes the properties of a gallery image definition.
func (CommunityGalleryImageProperties) MarshalJSON ¶
func (c CommunityGalleryImageProperties) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type CommunityGalleryImageProperties.
func (*CommunityGalleryImageProperties) UnmarshalJSON ¶
func (c *CommunityGalleryImageProperties) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type CommunityGalleryImageProperties.
type CommunityGalleryImageVersion ¶
type CommunityGalleryImageVersion struct { // The identifier information of community gallery. Identifier *CommunityGalleryIdentifier // Describes the properties of a gallery image version. Properties *CommunityGalleryImageVersionProperties // READ-ONLY; Resource location Location *string // READ-ONLY; Resource name Name *string // READ-ONLY; Resource type Type *string }
CommunityGalleryImageVersion - Specifies information about the gallery image version that you want to create or update.
func (CommunityGalleryImageVersion) MarshalJSON ¶
func (c CommunityGalleryImageVersion) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type CommunityGalleryImageVersion.
func (*CommunityGalleryImageVersion) UnmarshalJSON ¶
func (c *CommunityGalleryImageVersion) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type CommunityGalleryImageVersion.
type CommunityGalleryImageVersionList ¶
type CommunityGalleryImageVersionList struct { // REQUIRED; A list of community gallery image versions. Value []*CommunityGalleryImageVersion // The URI to fetch the next page of community gallery image versions. Call ListNext() with this to fetch the next page of // community gallery image versions. NextLink *string }
CommunityGalleryImageVersionList - The List Community Gallery Image versions operation response.
func (CommunityGalleryImageVersionList) MarshalJSON ¶
func (c CommunityGalleryImageVersionList) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type CommunityGalleryImageVersionList.
func (*CommunityGalleryImageVersionList) UnmarshalJSON ¶
func (c *CommunityGalleryImageVersionList) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type CommunityGalleryImageVersionList.
type CommunityGalleryImageVersionProperties ¶
type CommunityGalleryImageVersionProperties struct { // The artifact tags of a community gallery resource. ArtifactTags map[string]*string // The disclaimer for a community gallery resource. Disclaimer *string // The end of life date of the gallery image version Definition. This property can be used for decommissioning purposes. This // property is updatable. EndOfLifeDate *time.Time // If set to true, Virtual Machines deployed from the latest version of the Image Definition won't use this Image Version. ExcludeFromLatest *bool // The published date of the gallery image version Definition. This property can be used for decommissioning purposes. This // property is updatable. PublishedDate *time.Time // Describes the storage profile of the image version. StorageProfile *SharedGalleryImageVersionStorageProfile }
CommunityGalleryImageVersionProperties - Describes the properties of a gallery image version.
func (CommunityGalleryImageVersionProperties) MarshalJSON ¶
func (c CommunityGalleryImageVersionProperties) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type CommunityGalleryImageVersionProperties.
func (*CommunityGalleryImageVersionProperties) UnmarshalJSON ¶
func (c *CommunityGalleryImageVersionProperties) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type CommunityGalleryImageVersionProperties.
type CommunityGalleryImageVersionsClient ¶
type CommunityGalleryImageVersionsClient struct {
// contains filtered or unexported fields
}
CommunityGalleryImageVersionsClient contains the methods for the CommunityGalleryImageVersions group. Don't use this type directly, use NewCommunityGalleryImageVersionsClient() instead.
func NewCommunityGalleryImageVersionsClient ¶
func NewCommunityGalleryImageVersionsClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*CommunityGalleryImageVersionsClient, error)
NewCommunityGalleryImageVersionsClient creates a new instance of CommunityGalleryImageVersionsClient 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 (*CommunityGalleryImageVersionsClient) Get ¶
func (client *CommunityGalleryImageVersionsClient) Get(ctx context.Context, location string, publicGalleryName string, galleryImageName string, galleryImageVersionName string, options *CommunityGalleryImageVersionsClientGetOptions) (CommunityGalleryImageVersionsClientGetResponse, error)
Get - Get a community gallery image version. If the operation fails it returns an *azcore.ResponseError type.
Generated from API version 2023-07-03
- location - Resource location.
- publicGalleryName - The public name of the community gallery.
- galleryImageName - The name of the community gallery image definition.
- galleryImageVersionName - The name of the community gallery image version. Needs to follow semantic version name pattern: The allowed characters are digit and period. Digits must be within the range of a 32-bit integer. Format: ..
- options - CommunityGalleryImageVersionsClientGetOptions contains the optional parameters for the CommunityGalleryImageVersionsClient.Get method.
Example ¶
Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/92de53a5f1e0e03c94b40475d2135d97148ed014/specification/compute/resource-manager/Microsoft.Compute/GalleryRP/stable/2023-07-03/examples/communityGalleryExamples/CommunityGalleryImageVersion_Get.json
cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() clientFactory, err := armcompute.NewClientFactory("<subscription-id>", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } res, err := clientFactory.NewCommunityGalleryImageVersionsClient().Get(ctx, "myLocation", "publicGalleryName", "myGalleryImageName", "myGalleryImageVersionName", nil) if err != nil { log.Fatalf("failed to finish the request: %v", err) } // You could use response here. We use blank identifier for just demo purposes. _ = res // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. // res.CommunityGalleryImageVersion = armcompute.CommunityGalleryImageVersion{ // Name: to.Ptr("myGalleryImageVersionName"), // Type: to.Ptr("Microsoft.Compute/locations/communityGalleryImageVersion"), // Identifier: &armcompute.CommunityGalleryIdentifier{ // UniqueID: to.Ptr("/CommunityGalleries/publicGalleryName/Images/myGalleryImageName/Versions/myGalleryImageVersionName"), // }, // Location: to.Ptr("myLocation"), // Properties: &armcompute.CommunityGalleryImageVersionProperties{ // ArtifactTags: map[string]*string{ // "ShareTag-CommunityGallery": to.Ptr("CommunityGallery"), // }, // Disclaimer: to.Ptr("https://test-uri.com"), // EndOfLifeDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2022-03-20T09:12:28.000Z"); return t}()), // ExcludeFromLatest: to.Ptr(false), // PublishedDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2018-03-20T09:12:28.000Z"); return t}()), // StorageProfile: &armcompute.SharedGalleryImageVersionStorageProfile{ // OSDiskImage: &armcompute.SharedGalleryOSDiskImage{ // DiskSizeGB: to.Ptr[int32](29), // HostCaching: to.Ptr(armcompute.SharedGalleryHostCachingNone), // }, // }, // }, // }
Output:
func (*CommunityGalleryImageVersionsClient) NewListPager ¶
func (client *CommunityGalleryImageVersionsClient) NewListPager(location string, publicGalleryName string, galleryImageName string, options *CommunityGalleryImageVersionsClientListOptions) *runtime.Pager[CommunityGalleryImageVersionsClientListResponse]
NewListPager - List community gallery image versions inside an image.
Generated from API version 2023-07-03
- location - Resource location.
- publicGalleryName - The public name of the community gallery.
- galleryImageName - The name of the community gallery image definition.
- options - CommunityGalleryImageVersionsClientListOptions contains the optional parameters for the CommunityGalleryImageVersionsClient.NewListPager method.
Example ¶
Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/92de53a5f1e0e03c94b40475d2135d97148ed014/specification/compute/resource-manager/Microsoft.Compute/GalleryRP/stable/2023-07-03/examples/communityGalleryExamples/CommunityGalleryImageVersion_List.json
cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() clientFactory, err := armcompute.NewClientFactory("<subscription-id>", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } pager := clientFactory.NewCommunityGalleryImageVersionsClient().NewListPager("myLocation", "publicGalleryName", "myGalleryImageName", nil) for pager.More() { page, err := pager.NextPage(ctx) if err != nil { log.Fatalf("failed to advance page: %v", err) } for _, v := range page.Value { // You could use page here. We use blank identifier for just demo purposes. _ = v } // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. // page.CommunityGalleryImageVersionList = armcompute.CommunityGalleryImageVersionList{ // Value: []*armcompute.CommunityGalleryImageVersion{ // { // Name: to.Ptr("myGalleryImageVersionName"), // Identifier: &armcompute.CommunityGalleryIdentifier{ // UniqueID: to.Ptr("/CommunityGalleries/publicGalleryName/Images/myGalleryImageName/Versions/myGalleryImageVersionName"), // }, // Location: to.Ptr("myLocation"), // Properties: &armcompute.CommunityGalleryImageVersionProperties{ // ArtifactTags: map[string]*string{ // "ShareTag-CommunityGallery": to.Ptr("CommunityGallery"), // }, // Disclaimer: to.Ptr("https://test-uri.com"), // EndOfLifeDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2022-03-20T09:12:28.000Z"); return t}()), // ExcludeFromLatest: to.Ptr(false), // PublishedDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2018-03-20T09:12:28.000Z"); return t}()), // StorageProfile: &armcompute.SharedGalleryImageVersionStorageProfile{ // OSDiskImage: &armcompute.SharedGalleryOSDiskImage{ // DiskSizeGB: to.Ptr[int32](29), // HostCaching: to.Ptr(armcompute.SharedGalleryHostCachingNone), // }, // }, // }, // }}, // } }
Output:
type CommunityGalleryImageVersionsClientGetOptions ¶
type CommunityGalleryImageVersionsClientGetOptions struct { }
CommunityGalleryImageVersionsClientGetOptions contains the optional parameters for the CommunityGalleryImageVersionsClient.Get method.
type CommunityGalleryImageVersionsClientGetResponse ¶
type CommunityGalleryImageVersionsClientGetResponse struct { // Specifies information about the gallery image version that you want to create or update. CommunityGalleryImageVersion }
CommunityGalleryImageVersionsClientGetResponse contains the response from method CommunityGalleryImageVersionsClient.Get.
type CommunityGalleryImageVersionsClientListOptions ¶
type CommunityGalleryImageVersionsClientListOptions struct { }
CommunityGalleryImageVersionsClientListOptions contains the optional parameters for the CommunityGalleryImageVersionsClient.NewListPager method.
type CommunityGalleryImageVersionsClientListResponse ¶
type CommunityGalleryImageVersionsClientListResponse struct { // The List Community Gallery Image versions operation response. CommunityGalleryImageVersionList }
CommunityGalleryImageVersionsClientListResponse contains the response from method CommunityGalleryImageVersionsClient.NewListPager.
type CommunityGalleryImagesClient ¶
type CommunityGalleryImagesClient struct {
// contains filtered or unexported fields
}
CommunityGalleryImagesClient contains the methods for the CommunityGalleryImages group. Don't use this type directly, use NewCommunityGalleryImagesClient() instead.
func NewCommunityGalleryImagesClient ¶
func NewCommunityGalleryImagesClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*CommunityGalleryImagesClient, error)
NewCommunityGalleryImagesClient creates a new instance of CommunityGalleryImagesClient 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 (*CommunityGalleryImagesClient) Get ¶
func (client *CommunityGalleryImagesClient) Get(ctx context.Context, location string, publicGalleryName string, galleryImageName string, options *CommunityGalleryImagesClientGetOptions) (CommunityGalleryImagesClientGetResponse, error)
Get - Get a community gallery image. If the operation fails it returns an *azcore.ResponseError type.
Generated from API version 2023-07-03
- location - Resource location.
- publicGalleryName - The public name of the community gallery.
- galleryImageName - The name of the community gallery image definition.
- options - CommunityGalleryImagesClientGetOptions contains the optional parameters for the CommunityGalleryImagesClient.Get method.
Example ¶
Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/92de53a5f1e0e03c94b40475d2135d97148ed014/specification/compute/resource-manager/Microsoft.Compute/GalleryRP/stable/2023-07-03/examples/communityGalleryExamples/CommunityGalleryImage_Get.json
cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() clientFactory, err := armcompute.NewClientFactory("<subscription-id>", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } res, err := clientFactory.NewCommunityGalleryImagesClient().Get(ctx, "myLocation", "publicGalleryName", "myGalleryImageName", nil) if err != nil { log.Fatalf("failed to finish the request: %v", err) } // You could use response here. We use blank identifier for just demo purposes. _ = res // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. // res.CommunityGalleryImage = armcompute.CommunityGalleryImage{ // Name: to.Ptr("myGalleryImageName"), // Type: to.Ptr("Microsoft.Compute/locations/communityGalleryImage"), // Identifier: &armcompute.CommunityGalleryIdentifier{ // UniqueID: to.Ptr("/CommunityGalleries/publicGalleryName/Images/myGalleryImageName"), // }, // Location: to.Ptr("myLocation"), // Properties: &armcompute.CommunityGalleryImageProperties{ // ArtifactTags: map[string]*string{ // "ShareTag-CommunityGallery": to.Ptr("CommunityGallery"), // }, // Disclaimer: to.Ptr("https://test-uri.com"), // Eula: to.Ptr("https://test-uri.com"), // HyperVGeneration: to.Ptr(armcompute.HyperVGenerationV1), // Identifier: &armcompute.CommunityGalleryImageIdentifier{ // Offer: to.Ptr("myOfferName"), // Publisher: to.Ptr("myPublisherName"), // SKU: to.Ptr("mySkuName"), // }, // OSState: to.Ptr(armcompute.OperatingSystemStateTypesGeneralized), // OSType: to.Ptr(armcompute.OperatingSystemTypesWindows), // PrivacyStatementURI: to.Ptr("https://test-uri.com"), // }, // }
Output:
func (*CommunityGalleryImagesClient) NewListPager ¶
func (client *CommunityGalleryImagesClient) NewListPager(location string, publicGalleryName string, options *CommunityGalleryImagesClientListOptions) *runtime.Pager[CommunityGalleryImagesClientListResponse]
NewListPager - List community gallery images inside a gallery.
Generated from API version 2023-07-03
- location - Resource location.
- publicGalleryName - The public name of the community gallery.
- options - CommunityGalleryImagesClientListOptions contains the optional parameters for the CommunityGalleryImagesClient.NewListPager method.
Example ¶
Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/92de53a5f1e0e03c94b40475d2135d97148ed014/specification/compute/resource-manager/Microsoft.Compute/GalleryRP/stable/2023-07-03/examples/communityGalleryExamples/CommunityGalleryImage_List.json
cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() clientFactory, err := armcompute.NewClientFactory("<subscription-id>", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } pager := clientFactory.NewCommunityGalleryImagesClient().NewListPager("myLocation", "publicGalleryName", nil) for pager.More() { page, err := pager.NextPage(ctx) if err != nil { log.Fatalf("failed to advance page: %v", err) } for _, v := range page.Value { // You could use page here. We use blank identifier for just demo purposes. _ = v } // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. // page.CommunityGalleryImageList = armcompute.CommunityGalleryImageList{ // Value: []*armcompute.CommunityGalleryImage{ // { // Name: to.Ptr("myGalleryImageName"), // Identifier: &armcompute.CommunityGalleryIdentifier{ // UniqueID: to.Ptr("/CommunityGalleries/publicGalleryName/Images/myGalleryImageName"), // }, // Location: to.Ptr("myLocation"), // Properties: &armcompute.CommunityGalleryImageProperties{ // ArtifactTags: map[string]*string{ // "ShareTag-CommunityGallery": to.Ptr("CommunityGallery"), // }, // Disclaimer: to.Ptr("https://test-uri.com"), // HyperVGeneration: to.Ptr(armcompute.HyperVGenerationV1), // Identifier: &armcompute.CommunityGalleryImageIdentifier{ // Offer: to.Ptr("myOfferName"), // Publisher: to.Ptr("myPublisherName"), // SKU: to.Ptr("mySkuName"), // }, // OSState: to.Ptr(armcompute.OperatingSystemStateTypesGeneralized), // OSType: to.Ptr(armcompute.OperatingSystemTypesWindows), // }, // }}, // } }
Output:
type CommunityGalleryImagesClientGetOptions ¶
type CommunityGalleryImagesClientGetOptions struct { }
CommunityGalleryImagesClientGetOptions contains the optional parameters for the CommunityGalleryImagesClient.Get method.
type CommunityGalleryImagesClientGetResponse ¶
type CommunityGalleryImagesClientGetResponse struct { // Specifies information about the gallery image definition that you want to create or update. CommunityGalleryImage }
CommunityGalleryImagesClientGetResponse contains the response from method CommunityGalleryImagesClient.Get.
type CommunityGalleryImagesClientListOptions ¶
type CommunityGalleryImagesClientListOptions struct { }
CommunityGalleryImagesClientListOptions contains the optional parameters for the CommunityGalleryImagesClient.NewListPager method.
type CommunityGalleryImagesClientListResponse ¶
type CommunityGalleryImagesClientListResponse struct { // The List Community Gallery Images operation response. CommunityGalleryImageList }
CommunityGalleryImagesClientListResponse contains the response from method CommunityGalleryImagesClient.NewListPager.
type CommunityGalleryInfo ¶
type CommunityGalleryInfo struct { // End-user license agreement for community gallery image. Eula *string // The prefix of the gallery name that will be displayed publicly. Visible to all users. PublicNamePrefix *string // Community gallery publisher support email. The email address of the publisher. Visible to all users. PublisherContact *string // The link to the publisher website. Visible to all users. PublisherURI *string // READ-ONLY; Contains info about whether community gallery sharing is enabled. CommunityGalleryEnabled *bool // READ-ONLY; Community gallery public name list. PublicNames []*string }
CommunityGalleryInfo - Information of community gallery if current gallery is shared to community
func (CommunityGalleryInfo) MarshalJSON ¶
func (c CommunityGalleryInfo) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type CommunityGalleryInfo.
func (*CommunityGalleryInfo) UnmarshalJSON ¶
func (c *CommunityGalleryInfo) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type CommunityGalleryInfo.
type CommunityGalleryMetadata ¶ added in v5.4.0
type CommunityGalleryMetadata struct { // REQUIRED; A list of public names the gallery has. PublicNames []*string // REQUIRED; The publisher email id of this community gallery. PublisherContact *string // The end-user license agreement for this community gallery. Eula *string // The link for the privacy statement of this community gallery from the gallery publisher. PrivacyStatementURI *string // The publisher URI of this community gallery. PublisherURI *string }
CommunityGalleryMetadata - The metadata of community gallery.
func (CommunityGalleryMetadata) MarshalJSON ¶ added in v5.4.0
func (c CommunityGalleryMetadata) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type CommunityGalleryMetadata.
func (*CommunityGalleryMetadata) UnmarshalJSON ¶ added in v5.4.0
func (c *CommunityGalleryMetadata) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type CommunityGalleryMetadata.
type CommunityGalleryProperties ¶ added in v5.4.0
type CommunityGalleryProperties struct { // The artifact tags of a community gallery resource. ArtifactTags map[string]*string // The metadata of community gallery. CommunityMetadata *CommunityGalleryMetadata // The disclaimer for a community gallery resource. Disclaimer *string }
CommunityGalleryProperties - Describes the properties of a community gallery.
func (CommunityGalleryProperties) MarshalJSON ¶ added in v5.4.0
func (c CommunityGalleryProperties) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type CommunityGalleryProperties.
func (*CommunityGalleryProperties) UnmarshalJSON ¶ added in v5.4.0
func (c *CommunityGalleryProperties) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type CommunityGalleryProperties.
type ConfidentialVMEncryptionType ¶
type ConfidentialVMEncryptionType string
ConfidentialVMEncryptionType - confidential VM encryption types
const ( ConfidentialVMEncryptionTypeEncryptedVMGuestStateOnlyWithPmk ConfidentialVMEncryptionType = "EncryptedVMGuestStateOnlyWithPmk" ConfidentialVMEncryptionTypeEncryptedWithCmk ConfidentialVMEncryptionType = "EncryptedWithCmk" ConfidentialVMEncryptionTypeEncryptedWithPmk ConfidentialVMEncryptionType = "EncryptedWithPmk" ConfidentialVMEncryptionTypeNonPersistedTPM ConfidentialVMEncryptionType = "NonPersistedTPM" )
func PossibleConfidentialVMEncryptionTypeValues ¶
func PossibleConfidentialVMEncryptionTypeValues() []ConfidentialVMEncryptionType
PossibleConfidentialVMEncryptionTypeValues returns the possible values for the ConfidentialVMEncryptionType const type.
type ConsistencyModeTypes ¶
type ConsistencyModeTypes string
ConsistencyModeTypes - ConsistencyMode of the RestorePoint. Can be specified in the input while creating a restore point. For now, only CrashConsistent is accepted as a valid input. Please refer to https://aka.ms/RestorePoints for more details.
const ( ConsistencyModeTypesApplicationConsistent ConsistencyModeTypes = "ApplicationConsistent" ConsistencyModeTypesCrashConsistent ConsistencyModeTypes = "CrashConsistent" ConsistencyModeTypesFileSystemConsistent ConsistencyModeTypes = "FileSystemConsistent" )
func PossibleConsistencyModeTypesValues ¶
func PossibleConsistencyModeTypesValues() []ConsistencyModeTypes
PossibleConsistencyModeTypesValues returns the possible values for the ConsistencyModeTypes const type.
type CopyCompletionError ¶
type CopyCompletionError struct { // REQUIRED; Indicates the error code if the background copy of a resource created via the CopyStart operation fails. ErrorCode *CopyCompletionErrorReason // REQUIRED; Indicates the error message if the background copy of a resource created via the CopyStart operation fails. ErrorMessage *string }
CopyCompletionError - Indicates the error details if the background copy of a resource created via the CopyStart operation fails.
func (CopyCompletionError) MarshalJSON ¶
func (c CopyCompletionError) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type CopyCompletionError.
func (*CopyCompletionError) UnmarshalJSON ¶
func (c *CopyCompletionError) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type CopyCompletionError.
type CopyCompletionErrorReason ¶
type CopyCompletionErrorReason string
CopyCompletionErrorReason - Indicates the error code if the background copy of a resource created via the CopyStart operation fails.
const ( // CopyCompletionErrorReasonCopySourceNotFound - Indicates that the source snapshot was deleted while the background copy // of the resource created via CopyStart operation was in progress. CopyCompletionErrorReasonCopySourceNotFound CopyCompletionErrorReason = "CopySourceNotFound" )
func PossibleCopyCompletionErrorReasonValues ¶
func PossibleCopyCompletionErrorReasonValues() []CopyCompletionErrorReason
PossibleCopyCompletionErrorReasonValues returns the possible values for the CopyCompletionErrorReason const type.
type CreationData ¶
type CreationData struct { // REQUIRED; This enumerates the possible sources of a disk's creation. CreateOption *DiskCreateOption // Required if createOption is CopyFromSanSnapshot. This is the ARM id of the source elastic san volume snapshot. ElasticSanResourceID *string // Required if creating from a Gallery Image. The id/sharedGalleryImageId/communityGalleryImageId of the ImageDiskReference // will be the ARM id of the shared galley image version from which to create a // disk. GalleryImageReference *ImageDiskReference // Disk source information for PIR or user images. ImageReference *ImageDiskReference // Logical sector size in bytes for Ultra disks. Supported values are 512 ad 4096. 4096 is the default. LogicalSectorSize *int32 // Set this flag to true to get a boost on the performance target of the disk deployed, see here on the respective performance // target. This flag can only be set on disk creation time and cannot be // disabled after enabled. PerformancePlus *bool // If this field is set on a snapshot and createOption is CopyStart, the snapshot will be copied at a quicker speed. ProvisionedBandwidthCopySpeed *ProvisionedBandwidthCopyOption // If createOption is ImportSecure, this is the URI of a blob to be imported into VM guest state. SecurityDataURI *string // If createOption is Copy, this is the ARM id of the source snapshot or disk. SourceResourceID *string // If createOption is Import, this is the URI of a blob to be imported into a managed disk. SourceURI *string // Required if createOption is Import. The Azure Resource Manager identifier of the storage account containing the blob to // import as a disk. StorageAccountID *string // If createOption is Upload, this is the size of the contents of the upload including the VHD footer. This value should be // between 20972032 (20 MiB + 512 bytes for the VHD footer) and 35183298347520 // bytes (32 TiB + 512 bytes for the VHD footer). UploadSizeBytes *int64 // READ-ONLY; If this field is set, this is the unique id identifying the source of this resource. SourceUniqueID *string }
CreationData - Data used when creating a disk.
func (CreationData) MarshalJSON ¶
func (c CreationData) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type CreationData.
func (*CreationData) UnmarshalJSON ¶
func (c *CreationData) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type CreationData.
type DataAccessAuthMode ¶
type DataAccessAuthMode string
DataAccessAuthMode - Additional authentication requirements when exporting or uploading to a disk or snapshot.
const ( // DataAccessAuthModeAzureActiveDirectory - When export/upload URL is used, the system checks if the user has an identity // in Azure Active Directory and has necessary permissions to export/upload the data. Please refer to aka.ms/DisksAzureADAuth. DataAccessAuthModeAzureActiveDirectory DataAccessAuthMode = "AzureActiveDirectory" // DataAccessAuthModeNone - No additional authentication would be performed when accessing export/upload URL. DataAccessAuthModeNone DataAccessAuthMode = "None" )
func PossibleDataAccessAuthModeValues ¶
func PossibleDataAccessAuthModeValues() []DataAccessAuthMode
PossibleDataAccessAuthModeValues returns the possible values for the DataAccessAuthMode const type.
type DataDisk ¶
type DataDisk struct { // REQUIRED; Specifies how the virtual machine disk should be created. Possible values are Attach: This value is used when // you are using a specialized disk to create the virtual machine. FromImage: This value is // used when you are using an image to create the virtual machine data disk. If you are using a platform image, you should // also use the imageReference element described above. If you are using a // marketplace image, you should also use the plan element previously described. Empty: This value is used when creating an // empty data disk. Copy: This value is used to create a data disk from a snapshot // or another disk. Restore: This value is used to create a data disk from a disk restore point. CreateOption *DiskCreateOptionTypes // REQUIRED; Specifies the logical unit number of the data disk. This value is used to identify data disks within the VM and // therefore must be unique for each data disk attached to a VM. Lun *int32 // Specifies the caching requirements. Possible values are: None, ReadOnly, ReadWrite. The defaulting behavior is: None for // Standard storage. ReadOnly for Premium storage. Caching *CachingTypes // Specifies whether data disk should be deleted or detached upon VM deletion. Possible values are: Delete. If this value // is used, the data disk is deleted when VM is deleted. Detach. If this value is // used, the data disk is retained after VM is deleted. The default value is set to Detach. DeleteOption *DiskDeleteOptionTypes // Specifies the detach behavior to be used while detaching a disk or which is already in the process of detachment from the // virtual machine. Supported values: ForceDetach. detachOption: ForceDetach is // applicable only for managed data disks. If a previous detachment attempt of the data disk did not complete due to an unexpected // failure from the virtual machine and the disk is still not released then // use force-detach as a last resort option to detach the disk forcibly from the VM. All writes might not have been flushed // when using this detach behavior. This feature is still in preview mode and is // not supported for VirtualMachineScaleSet. To force-detach a data disk update toBeDetached to 'true' along with setting // detachOption: 'ForceDetach'. DetachOption *DiskDetachOptionTypes // Specifies the size of an empty data disk in gigabytes. This element can be used to overwrite the size of the disk in a // virtual machine image. The property 'diskSizeGB' is the number of bytes x 1024^3 // for the disk and the value cannot be larger than 1023. DiskSizeGB *int32 // The source user image virtual hard disk. The virtual hard disk will be copied before being attached to the virtual machine. // If SourceImage is provided, the destination virtual hard drive must not // exist. Image *VirtualHardDisk // The managed disk parameters. ManagedDisk *ManagedDiskParameters // The disk name. Name *string // The source resource identifier. It can be a snapshot, or disk restore point from which to create a disk. SourceResource *APIEntityReference // Specifies whether the data disk is in process of detachment from the VirtualMachine/VirtualMachineScaleset ToBeDetached *bool // The virtual hard disk. Vhd *VirtualHardDisk // Specifies whether writeAccelerator should be enabled or disabled on the disk. WriteAcceleratorEnabled *bool // READ-ONLY; Specifies the Read-Write IOPS for the managed disk when StorageAccountType is UltraSSD_LRS. Returned only for // VirtualMachine ScaleSet VM disks. Can be updated only via updates to the VirtualMachine // Scale Set. DiskIOPSReadWrite *int64 // READ-ONLY; Specifies the bandwidth in MB per second for the managed disk when StorageAccountType is UltraSSD_LRS. Returned // only for VirtualMachine ScaleSet VM disks. Can be updated only via updates to the // VirtualMachine Scale Set. DiskMBpsReadWrite *int64 }
DataDisk - Describes a data disk.
func (DataDisk) MarshalJSON ¶
MarshalJSON implements the json.Marshaller interface for type DataDisk.
func (*DataDisk) UnmarshalJSON ¶
UnmarshalJSON implements the json.Unmarshaller interface for type DataDisk.
type DataDiskImage ¶
type DataDiskImage struct { // READ-ONLY; Specifies the logical unit number of the data disk. This value is used to identify data disks within the VM // and therefore must be unique for each data disk attached to a VM. Lun *int32 }
DataDiskImage - Contains the data disk images information.
func (DataDiskImage) MarshalJSON ¶
func (d DataDiskImage) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type DataDiskImage.
func (*DataDiskImage) UnmarshalJSON ¶
func (d *DataDiskImage) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type DataDiskImage.
type DataDiskImageEncryption ¶
type DataDiskImageEncryption struct { // REQUIRED; This property specifies the logical unit number of the data disk. This value is used to identify data disks within // the Virtual Machine and therefore must be unique for each data disk attached to the // Virtual Machine. Lun *int32 // A relative URI containing the resource ID of the disk encryption set. DiskEncryptionSetID *string }
DataDiskImageEncryption - Contains encryption settings for a data disk image.
func (DataDiskImageEncryption) MarshalJSON ¶
func (d DataDiskImageEncryption) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type DataDiskImageEncryption.
func (*DataDiskImageEncryption) UnmarshalJSON ¶
func (d *DataDiskImageEncryption) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type DataDiskImageEncryption.
type DataDisksToAttach ¶ added in v5.4.0
type DataDisksToAttach struct { // REQUIRED; ID of the managed data disk. DiskID *string // Specifies the caching requirements. Possible values are: None, ReadOnly, ReadWrite. The defaulting behavior is: None for // Standard storage. ReadOnly for Premium storage. Caching *CachingTypes // Specifies whether data disk should be deleted or detached upon VM deletion. Possible values are: Delete. If this value // is used, the data disk is deleted when VM is deleted. Detach. If this value is // used, the data disk is retained after VM is deleted. The default value is set to Detach. DeleteOption *DiskDeleteOptionTypes // Specifies the customer managed disk encryption set resource id for the managed disk. DiskEncryptionSet *DiskEncryptionSetParameters // The logical unit number of the data disk. This value is used to identify data disks within the VM and therefore must be // unique for each data disk attached to a VM. If not specified, lun would be auto // assigned. Lun *int32 // Specifies whether writeAccelerator should be enabled or disabled on the disk. WriteAcceleratorEnabled *bool }
DataDisksToAttach - Describes the data disk to be attached.
func (DataDisksToAttach) MarshalJSON ¶ added in v5.4.0
func (d DataDisksToAttach) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type DataDisksToAttach.
func (*DataDisksToAttach) UnmarshalJSON ¶ added in v5.4.0
func (d *DataDisksToAttach) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type DataDisksToAttach.
type DataDisksToDetach ¶ added in v5.4.0
type DataDisksToDetach struct { // REQUIRED; ID of the managed data disk. DiskID *string // Supported options available for Detach of a disk from a VM. Refer to DetachOption object reference for more details. DetachOption *DiskDetachOptionTypes }
DataDisksToDetach - Describes the data disk to be detached.
func (DataDisksToDetach) MarshalJSON ¶ added in v5.4.0
func (d DataDisksToDetach) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type DataDisksToDetach.
func (*DataDisksToDetach) UnmarshalJSON ¶ added in v5.4.0
func (d *DataDisksToDetach) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type DataDisksToDetach.
type DedicatedHost ¶
type DedicatedHost struct { // REQUIRED; Resource location Location *string // REQUIRED; SKU of the dedicated host for Hardware Generation and VM family. Only name is required to be set. List Microsoft.Compute // SKUs for a list of possible values. SKU *SKU // Properties of the dedicated host. Properties *DedicatedHostProperties // Resource tags Tags map[string]*string // READ-ONLY; Resource Id ID *string // READ-ONLY; Resource name Name *string // READ-ONLY; Resource type Type *string }
DedicatedHost - Specifies information about the Dedicated host.
func (DedicatedHost) MarshalJSON ¶
func (d DedicatedHost) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type DedicatedHost.
func (*DedicatedHost) UnmarshalJSON ¶
func (d *DedicatedHost) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type DedicatedHost.
type DedicatedHostAllocatableVM ¶
type DedicatedHostAllocatableVM struct { // Maximum number of VMs of size vmSize that can fit in the dedicated host's remaining capacity. Count *float64 // VM size in terms of which the unutilized capacity is represented. VMSize *string }
DedicatedHostAllocatableVM - Represents the dedicated host unutilized capacity in terms of a specific VM size.
func (DedicatedHostAllocatableVM) MarshalJSON ¶
func (d DedicatedHostAllocatableVM) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type DedicatedHostAllocatableVM.
func (*DedicatedHostAllocatableVM) UnmarshalJSON ¶
func (d *DedicatedHostAllocatableVM) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type DedicatedHostAllocatableVM.
type DedicatedHostAvailableCapacity ¶
type DedicatedHostAvailableCapacity struct { // The unutilized capacity of the dedicated host represented in terms of each VM size that is allowed to be deployed to the // dedicated host. AllocatableVMs []*DedicatedHostAllocatableVM }
DedicatedHostAvailableCapacity - Dedicated host unutilized capacity.
func (DedicatedHostAvailableCapacity) MarshalJSON ¶
func (d DedicatedHostAvailableCapacity) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type DedicatedHostAvailableCapacity.
func (*DedicatedHostAvailableCapacity) UnmarshalJSON ¶
func (d *DedicatedHostAvailableCapacity) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type DedicatedHostAvailableCapacity.
type DedicatedHostGroup ¶
type DedicatedHostGroup struct { // REQUIRED; Resource location Location *string // Dedicated Host Group Properties. Properties *DedicatedHostGroupProperties // Resource tags Tags map[string]*string // Availability Zone to use for this host group. Only single zone is supported. The zone can be assigned only during creation. // If not provided, the group supports all zones in the region. If provided, // enforces each host in the group to be in the same zone. Zones []*string // READ-ONLY; Resource Id ID *string // READ-ONLY; Resource name Name *string // READ-ONLY; Resource type Type *string }
DedicatedHostGroup - Specifies information about the dedicated host group that the dedicated hosts should be assigned to. Currently, a dedicated host can only be added to a dedicated host group at creation time. An existing dedicated host cannot be added to another dedicated host group.
func (DedicatedHostGroup) MarshalJSON ¶
func (d DedicatedHostGroup) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type DedicatedHostGroup.
func (*DedicatedHostGroup) UnmarshalJSON ¶
func (d *DedicatedHostGroup) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type DedicatedHostGroup.
type DedicatedHostGroupInstanceView ¶
type DedicatedHostGroupInstanceView struct { // List of instance view of the dedicated hosts under the dedicated host group. Hosts []*DedicatedHostInstanceViewWithName }
func (DedicatedHostGroupInstanceView) MarshalJSON ¶
func (d DedicatedHostGroupInstanceView) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type DedicatedHostGroupInstanceView.
func (*DedicatedHostGroupInstanceView) UnmarshalJSON ¶
func (d *DedicatedHostGroupInstanceView) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type DedicatedHostGroupInstanceView.
type DedicatedHostGroupListResult ¶
type DedicatedHostGroupListResult struct { // REQUIRED; The list of dedicated host groups Value []*DedicatedHostGroup // The URI to fetch the next page of Dedicated Host Groups. Call ListNext() with this URI to fetch the next page of Dedicated // Host Groups. NextLink *string }
DedicatedHostGroupListResult - The List Dedicated Host Group with resource group response.
func (DedicatedHostGroupListResult) MarshalJSON ¶
func (d DedicatedHostGroupListResult) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type DedicatedHostGroupListResult.
func (*DedicatedHostGroupListResult) UnmarshalJSON ¶
func (d *DedicatedHostGroupListResult) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type DedicatedHostGroupListResult.
type DedicatedHostGroupProperties ¶
type DedicatedHostGroupProperties struct { // REQUIRED; Number of fault domains that the host group can span. PlatformFaultDomainCount *int32 // Enables or disables a capability on the dedicated host group. Minimum api-version: 2022-03-01. AdditionalCapabilities *DedicatedHostGroupPropertiesAdditionalCapabilities // Specifies whether virtual machines or virtual machine scale sets can be placed automatically on the dedicated host group. // Automatic placement means resources are allocated on dedicated hosts, that are // chosen by Azure, under the dedicated host group. The value is defaulted to 'false' when not provided. Minimum api-version: // 2020-06-01. SupportAutomaticPlacement *bool // READ-ONLY; A list of references to all dedicated hosts in the dedicated host group. Hosts []*SubResourceReadOnly // READ-ONLY; The dedicated host group instance view, which has the list of instance view of the dedicated hosts under the // dedicated host group. InstanceView *DedicatedHostGroupInstanceView }
DedicatedHostGroupProperties - Dedicated Host Group Properties.
func (DedicatedHostGroupProperties) MarshalJSON ¶
func (d DedicatedHostGroupProperties) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type DedicatedHostGroupProperties.
func (*DedicatedHostGroupProperties) UnmarshalJSON ¶
func (d *DedicatedHostGroupProperties) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type DedicatedHostGroupProperties.
type DedicatedHostGroupPropertiesAdditionalCapabilities ¶
type DedicatedHostGroupPropertiesAdditionalCapabilities struct { // The flag that enables or disables a capability to have UltraSSD Enabled Virtual Machines on Dedicated Hosts of the Dedicated // Host Group. For the Virtual Machines to be UltraSSD Enabled, // UltraSSDEnabled flag for the resource needs to be set true as well. The value is defaulted to 'false' when not provided. // Please refer to // https://docs.microsoft.com/en-us/azure/virtual-machines/disks-enable-ultra-ssd for more details on Ultra SSD feature. Note: // The ultraSSDEnabled setting can only be enabled for Host Groups that are // created as zonal. Minimum api-version: 2022-03-01. UltraSSDEnabled *bool }
DedicatedHostGroupPropertiesAdditionalCapabilities - Enables or disables a capability on the dedicated host group. Minimum api-version: 2022-03-01.
func (DedicatedHostGroupPropertiesAdditionalCapabilities) MarshalJSON ¶
func (d DedicatedHostGroupPropertiesAdditionalCapabilities) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type DedicatedHostGroupPropertiesAdditionalCapabilities.
func (*DedicatedHostGroupPropertiesAdditionalCapabilities) UnmarshalJSON ¶
func (d *DedicatedHostGroupPropertiesAdditionalCapabilities) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type DedicatedHostGroupPropertiesAdditionalCapabilities.
type DedicatedHostGroupUpdate ¶
type DedicatedHostGroupUpdate struct { // Dedicated Host Group Properties. Properties *DedicatedHostGroupProperties // Resource tags Tags map[string]*string // Availability Zone to use for this host group. Only single zone is supported. The zone can be assigned only during creation. // If not provided, the group supports all zones in the region. If provided, // enforces each host in the group to be in the same zone. Zones []*string }
DedicatedHostGroupUpdate - Specifies information about the dedicated host group that the dedicated host should be assigned to. Only tags may be updated.
func (DedicatedHostGroupUpdate) MarshalJSON ¶
func (d DedicatedHostGroupUpdate) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type DedicatedHostGroupUpdate.
func (*DedicatedHostGroupUpdate) UnmarshalJSON ¶
func (d *DedicatedHostGroupUpdate) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type DedicatedHostGroupUpdate.
type DedicatedHostGroupsClient ¶
type DedicatedHostGroupsClient struct {
// contains filtered or unexported fields
}
DedicatedHostGroupsClient contains the methods for the DedicatedHostGroups group. Don't use this type directly, use NewDedicatedHostGroupsClient() instead.
func NewDedicatedHostGroupsClient ¶
func NewDedicatedHostGroupsClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*DedicatedHostGroupsClient, error)
NewDedicatedHostGroupsClient creates a new instance of DedicatedHostGroupsClient 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 (*DedicatedHostGroupsClient) CreateOrUpdate ¶
func (client *DedicatedHostGroupsClient) CreateOrUpdate(ctx context.Context, resourceGroupName string, hostGroupName string, parameters DedicatedHostGroup, options *DedicatedHostGroupsClientCreateOrUpdateOptions) (DedicatedHostGroupsClientCreateOrUpdateResponse, error)
CreateOrUpdate - Create or update a dedicated host group. For details of Dedicated Host and Dedicated Host Groups please see Dedicated Host Documentation [https://go.microsoft.com/fwlink/?linkid=2082596] If the operation fails it returns an *azcore.ResponseError type.
Generated from API version 2024-03-01
- resourceGroupName - The name of the resource group.
- hostGroupName - The name of the dedicated host group.
- parameters - Parameters supplied to the Create Dedicated Host Group.
- options - DedicatedHostGroupsClientCreateOrUpdateOptions contains the optional parameters for the DedicatedHostGroupsClient.CreateOrUpdate method.
Example (CreateOrUpdateADedicatedHostGroup) ¶
Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/92de53a5f1e0e03c94b40475d2135d97148ed014/specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-03-01/examples/dedicatedHostExamples/DedicatedHostGroup_CreateOrUpdate.json
cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() clientFactory, err := armcompute.NewClientFactory("<subscription-id>", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } res, err := clientFactory.NewDedicatedHostGroupsClient().CreateOrUpdate(ctx, "myResourceGroup", "myDedicatedHostGroup", armcompute.DedicatedHostGroup{ Location: to.Ptr("westus"), Tags: map[string]*string{ "department": to.Ptr("finance"), }, Properties: &armcompute.DedicatedHostGroupProperties{ PlatformFaultDomainCount: to.Ptr[int32](3), SupportAutomaticPlacement: to.Ptr(true), }, Zones: []*string{ to.Ptr("1")}, }, nil) if err != nil { log.Fatalf("failed to finish the request: %v", err) } // You could use response here. We use blank identifier for just demo purposes. _ = res // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. // res.DedicatedHostGroup = armcompute.DedicatedHostGroup{ // Name: to.Ptr("myDedicatedHostGroup"), // ID: to.Ptr("/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/HostGroups/myDedicatedHostGroup"), // Location: to.Ptr("westus"), // Tags: map[string]*string{ // "department": to.Ptr("finance"), // "owner": to.Ptr("myCompany"), // }, // Properties: &armcompute.DedicatedHostGroupProperties{ // PlatformFaultDomainCount: to.Ptr[int32](3), // SupportAutomaticPlacement: to.Ptr(true), // }, // Zones: []*string{ // to.Ptr("1")}, // }
Output:
Example (CreateOrUpdateADedicatedHostGroupWithUltraSsdSupport) ¶
Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/92de53a5f1e0e03c94b40475d2135d97148ed014/specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-03-01/examples/dedicatedHostExamples/DedicatedHostGroup_CreateOrUpdate_WithUltraSSD.json
cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() clientFactory, err := armcompute.NewClientFactory("<subscription-id>", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } res, err := clientFactory.NewDedicatedHostGroupsClient().CreateOrUpdate(ctx, "myResourceGroup", "myDedicatedHostGroup", armcompute.DedicatedHostGroup{ Location: to.Ptr("westus"), Tags: map[string]*string{ "department": to.Ptr("finance"), }, Properties: &armcompute.DedicatedHostGroupProperties{ AdditionalCapabilities: &armcompute.DedicatedHostGroupPropertiesAdditionalCapabilities{ UltraSSDEnabled: to.Ptr(true), }, PlatformFaultDomainCount: to.Ptr[int32](3), SupportAutomaticPlacement: to.Ptr(true), }, Zones: []*string{ to.Ptr("1")}, }, nil) if err != nil { log.Fatalf("failed to finish the request: %v", err) } // You could use response here. We use blank identifier for just demo purposes. _ = res // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. // res.DedicatedHostGroup = armcompute.DedicatedHostGroup{ // Name: to.Ptr("myDedicatedHostGroup"), // ID: to.Ptr("/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/HostGroups/myDedicatedHostGroup"), // Location: to.Ptr("westus"), // Tags: map[string]*string{ // "department": to.Ptr("finance"), // "owner": to.Ptr("myCompany"), // }, // Properties: &armcompute.DedicatedHostGroupProperties{ // AdditionalCapabilities: &armcompute.DedicatedHostGroupPropertiesAdditionalCapabilities{ // UltraSSDEnabled: to.Ptr(true), // }, // PlatformFaultDomainCount: to.Ptr[int32](3), // SupportAutomaticPlacement: to.Ptr(true), // }, // Zones: []*string{ // to.Ptr("1")}, // }
Output:
func (*DedicatedHostGroupsClient) Delete ¶
func (client *DedicatedHostGroupsClient) Delete(ctx context.Context, resourceGroupName string, hostGroupName string, options *DedicatedHostGroupsClientDeleteOptions) (DedicatedHostGroupsClientDeleteResponse, error)
Delete - Delete a dedicated host group. If the operation fails it returns an *azcore.ResponseError type.
Generated from API version 2024-03-01
- resourceGroupName - The name of the resource group.
- hostGroupName - The name of the dedicated host group.
- options - DedicatedHostGroupsClientDeleteOptions contains the optional parameters for the DedicatedHostGroupsClient.Delete method.
Example (DedicatedHostGroupDeleteMaximumSetGen) ¶
Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/92de53a5f1e0e03c94b40475d2135d97148ed014/specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-03-01/examples/dedicatedHostExamples/DedicatedHostGroup_Delete_MaximumSet_Gen.json
cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() clientFactory, err := armcompute.NewClientFactory("<subscription-id>", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } _, err = clientFactory.NewDedicatedHostGroupsClient().Delete(ctx, "rgcompute", "a", nil) if err != nil { log.Fatalf("failed to finish the request: %v", err) }
Output:
Example (DedicatedHostGroupDeleteMinimumSetGen) ¶
Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/92de53a5f1e0e03c94b40475d2135d97148ed014/specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-03-01/examples/dedicatedHostExamples/DedicatedHostGroup_Delete_MinimumSet_Gen.json
cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() clientFactory, err := armcompute.NewClientFactory("<subscription-id>", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } _, err = clientFactory.NewDedicatedHostGroupsClient().Delete(ctx, "rgcompute", "aaaa", nil) if err != nil { log.Fatalf("failed to finish the request: %v", err) }
Output:
func (*DedicatedHostGroupsClient) Get ¶
func (client *DedicatedHostGroupsClient) Get(ctx context.Context, resourceGroupName string, hostGroupName string, options *DedicatedHostGroupsClientGetOptions) (DedicatedHostGroupsClientGetResponse, error)
Get - Retrieves information about a dedicated host group. If the operation fails it returns an *azcore.ResponseError type.
Generated from API version 2024-03-01
- resourceGroupName - The name of the resource group.
- hostGroupName - The name of the dedicated host group.
- options - DedicatedHostGroupsClientGetOptions contains the optional parameters for the DedicatedHostGroupsClient.Get method.
Example (CreateADedicatedHostGroup) ¶
Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/92de53a5f1e0e03c94b40475d2135d97148ed014/specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-03-01/examples/dedicatedHostExamples/DedicatedHostGroup_Get.json
cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() clientFactory, err := armcompute.NewClientFactory("<subscription-id>", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } res, err := clientFactory.NewDedicatedHostGroupsClient().Get(ctx, "myResourceGroup", "myDedicatedHostGroup", &armcompute.DedicatedHostGroupsClientGetOptions{Expand: nil}) if err != nil { log.Fatalf("failed to finish the request: %v", err) } // You could use response here. We use blank identifier for just demo purposes. _ = res // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. // res.DedicatedHostGroup = armcompute.DedicatedHostGroup{ // Name: to.Ptr("myDedicatedHostGroup"), // ID: to.Ptr("/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/HostGroups/myDedicatedHostGroup"), // Location: to.Ptr("westus"), // Tags: map[string]*string{ // "{tagName}": to.Ptr("{tagValue}"), // }, // Properties: &armcompute.DedicatedHostGroupProperties{ // Hosts: []*armcompute.SubResourceReadOnly{ // { // ID: to.Ptr("subscriptions/{subscriptionId}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/myDedicatedHostGroup/myHostGroup/Hosts/myHost1"), // }, // { // ID: to.Ptr("subscriptions/{subscriptionId}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/myDedicatedHostGroup/myHostGroup/Hosts/myHost2"), // }}, // InstanceView: &armcompute.DedicatedHostGroupInstanceView{ // Hosts: []*armcompute.DedicatedHostInstanceViewWithName{ // { // AssetID: to.Ptr("eb3f58b8-b4e8-4882-b69f-301a01812407"), // AvailableCapacity: &armcompute.DedicatedHostAvailableCapacity{ // AllocatableVMs: []*armcompute.DedicatedHostAllocatableVM{ // { // Count: to.Ptr[float64](10), // VMSize: to.Ptr("Standard_A1"), // }}, // }, // Statuses: []*armcompute.InstanceViewStatus{ // { // Code: to.Ptr("ProvisioningState/succeeded"), // DisplayStatus: to.Ptr("Provisioning succeeded"), // Level: to.Ptr(armcompute.StatusLevelTypesInfo), // }, // { // Code: to.Ptr("HealthState/available"), // DisplayStatus: to.Ptr("Host available"), // Level: to.Ptr(armcompute.StatusLevelTypesInfo), // }}, // Name: to.Ptr("myHost1"), // }, // { // AssetID: to.Ptr("f293d4ac-5eea-4be2-b0c0-0fcaa09aebf8"), // AvailableCapacity: &armcompute.DedicatedHostAvailableCapacity{ // AllocatableVMs: []*armcompute.DedicatedHostAllocatableVM{ // { // Count: to.Ptr[float64](10), // VMSize: to.Ptr("Standard_A1"), // }}, // }, // Statuses: []*armcompute.InstanceViewStatus{ // { // Code: to.Ptr("ProvisioningState/succeeded"), // DisplayStatus: to.Ptr("Provisioning succeeded"), // Level: to.Ptr(armcompute.StatusLevelTypesInfo), // }, // { // Code: to.Ptr("HealthState/available"), // DisplayStatus: to.Ptr("Host available"), // Level: to.Ptr(armcompute.StatusLevelTypesInfo), // }}, // Name: to.Ptr("myHost2"), // }}, // }, // PlatformFaultDomainCount: to.Ptr[int32](3), // SupportAutomaticPlacement: to.Ptr(true), // }, // Zones: []*string{ // to.Ptr("3")}, // }
Output:
Example (CreateAnUltraSsdEnabledDedicatedHostGroup) ¶
Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/92de53a5f1e0e03c94b40475d2135d97148ed014/specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-03-01/examples/dedicatedHostExamples/DedicatedHostGroup_Get_UltraSSDEnabledDedicatedHostGroup.json
cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() clientFactory, err := armcompute.NewClientFactory("<subscription-id>", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } res, err := clientFactory.NewDedicatedHostGroupsClient().Get(ctx, "myResourceGroup", "myDedicatedHostGroup", &armcompute.DedicatedHostGroupsClientGetOptions{Expand: nil}) if err != nil { log.Fatalf("failed to finish the request: %v", err) } // You could use response here. We use blank identifier for just demo purposes. _ = res // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. // res.DedicatedHostGroup = armcompute.DedicatedHostGroup{ // Name: to.Ptr("myDedicatedHostGroup"), // ID: to.Ptr("/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/HostGroups/myDedicatedHostGroup"), // Location: to.Ptr("westus"), // Tags: map[string]*string{ // "{tagName}": to.Ptr("{tagValue}"), // }, // Properties: &armcompute.DedicatedHostGroupProperties{ // AdditionalCapabilities: &armcompute.DedicatedHostGroupPropertiesAdditionalCapabilities{ // UltraSSDEnabled: to.Ptr(true), // }, // Hosts: []*armcompute.SubResourceReadOnly{ // { // ID: to.Ptr("subscriptions/{subscriptionId}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/myDedicatedHostGroup/myHostGroup/Hosts/myHost"), // }}, // InstanceView: &armcompute.DedicatedHostGroupInstanceView{ // Hosts: []*armcompute.DedicatedHostInstanceViewWithName{ // { // AssetID: to.Ptr("eb3f58b8-b4e8-4882-b69f-301a01812407"), // AvailableCapacity: &armcompute.DedicatedHostAvailableCapacity{ // AllocatableVMs: []*armcompute.DedicatedHostAllocatableVM{ // { // Count: to.Ptr[float64](10), // VMSize: to.Ptr("Standard_A1"), // }}, // }, // Statuses: []*armcompute.InstanceViewStatus{ // { // Code: to.Ptr("ProvisioningState/succeeded"), // DisplayStatus: to.Ptr("Provisioning succeeded"), // Level: to.Ptr(armcompute.StatusLevelTypesInfo), // }, // { // Code: to.Ptr("HealthState/available"), // DisplayStatus: to.Ptr("Host available"), // Level: to.Ptr(armcompute.StatusLevelTypesInfo), // }}, // Name: to.Ptr("myHost"), // }}, // }, // PlatformFaultDomainCount: to.Ptr[int32](3), // SupportAutomaticPlacement: to.Ptr(true), // }, // Zones: []*string{ // to.Ptr("3")}, // }
Output:
func (*DedicatedHostGroupsClient) NewListByResourceGroupPager ¶
func (client *DedicatedHostGroupsClient) NewListByResourceGroupPager(resourceGroupName string, options *DedicatedHostGroupsClientListByResourceGroupOptions) *runtime.Pager[DedicatedHostGroupsClientListByResourceGroupResponse]
NewListByResourceGroupPager - Lists all of the dedicated host groups in the specified resource group. Use the nextLink property in the response to get the next page of dedicated host groups.
Generated from API version 2024-03-01
- resourceGroupName - The name of the resource group.
- options - DedicatedHostGroupsClientListByResourceGroupOptions contains the optional parameters for the DedicatedHostGroupsClient.NewListByResourceGroupPager method.
Example (DedicatedHostGroupListByResourceGroupMaximumSetGen) ¶
Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/92de53a5f1e0e03c94b40475d2135d97148ed014/specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-03-01/examples/dedicatedHostExamples/DedicatedHostGroup_ListByResourceGroup_MaximumSet_Gen.json
cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() clientFactory, err := armcompute.NewClientFactory("<subscription-id>", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } pager := clientFactory.NewDedicatedHostGroupsClient().NewListByResourceGroupPager("rgcompute", nil) for pager.More() { page, err := pager.NextPage(ctx) if err != nil { log.Fatalf("failed to advance page: %v", err) } for _, v := range page.Value { // You could use page here. We use blank identifier for just demo purposes. _ = v } // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. // page.DedicatedHostGroupListResult = armcompute.DedicatedHostGroupListResult{ // Value: []*armcompute.DedicatedHostGroup{ // { // Name: to.Ptr("myDedicatedHostGroup"), // Type: to.Ptr("aaaa"), // ID: to.Ptr("/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/HostGroups/myDedicatedHostGroup"), // Location: to.Ptr("westus"), // Tags: map[string]*string{ // }, // Properties: &armcompute.DedicatedHostGroupProperties{ // Hosts: []*armcompute.SubResourceReadOnly{ // { // ID: to.Ptr("aaaa"), // }}, // InstanceView: &armcompute.DedicatedHostGroupInstanceView{ // Hosts: []*armcompute.DedicatedHostInstanceViewWithName{ // { // AssetID: to.Ptr("aaaa"), // AvailableCapacity: &armcompute.DedicatedHostAvailableCapacity{ // AllocatableVMs: []*armcompute.DedicatedHostAllocatableVM{ // { // Count: to.Ptr[float64](26), // VMSize: to.Ptr("aaaaaaaaaaaaaaaaaaaa"), // }}, // }, // Statuses: []*armcompute.InstanceViewStatus{ // { // Code: to.Ptr("aaaaaaaaaaaaaaaaaaaaaaa"), // DisplayStatus: to.Ptr("aaaaaa"), // Level: to.Ptr(armcompute.StatusLevelTypesInfo), // Message: to.Ptr("a"), // Time: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-11-30T12:58:26.522Z"); return t}()), // }}, // Name: to.Ptr("aaaaaaaaaaaaaaaaaa"), // }}, // }, // PlatformFaultDomainCount: to.Ptr[int32](3), // SupportAutomaticPlacement: to.Ptr(true), // }, // Zones: []*string{ // to.Ptr("1")}, // }}, // } }
Output:
Example (DedicatedHostGroupListByResourceGroupMinimumSetGen) ¶
Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/92de53a5f1e0e03c94b40475d2135d97148ed014/specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-03-01/examples/dedicatedHostExamples/DedicatedHostGroup_ListByResourceGroup_MinimumSet_Gen.json
cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() clientFactory, err := armcompute.NewClientFactory("<subscription-id>", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } pager := clientFactory.NewDedicatedHostGroupsClient().NewListByResourceGroupPager("rgcompute", nil) for pager.More() { page, err := pager.NextPage(ctx) if err != nil { log.Fatalf("failed to advance page: %v", err) } for _, v := range page.Value { // You could use page here. We use blank identifier for just demo purposes. _ = v } // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. // page.DedicatedHostGroupListResult = armcompute.DedicatedHostGroupListResult{ // Value: []*armcompute.DedicatedHostGroup{ // { // ID: to.Ptr("/subscriptions/{subscription-id}/resourceGroups/rgcompute/providers/Microsoft.Compute/HostGroups/myDedicatedHostGroup"), // Location: to.Ptr("westus"), // }}, // } }
Output:
func (*DedicatedHostGroupsClient) NewListBySubscriptionPager ¶
func (client *DedicatedHostGroupsClient) NewListBySubscriptionPager(options *DedicatedHostGroupsClientListBySubscriptionOptions) *runtime.Pager[DedicatedHostGroupsClientListBySubscriptionResponse]
NewListBySubscriptionPager - Lists all of the dedicated host groups in the subscription. Use the nextLink property in the response to get the next page of dedicated host groups.
Generated from API version 2024-03-01
- options - DedicatedHostGroupsClientListBySubscriptionOptions contains the optional parameters for the DedicatedHostGroupsClient.NewListBySubscriptionPager method.
Example (DedicatedHostGroupListBySubscriptionMaximumSetGen) ¶
Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/92de53a5f1e0e03c94b40475d2135d97148ed014/specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-03-01/examples/dedicatedHostExamples/DedicatedHostGroup_ListBySubscription_MaximumSet_Gen.json
cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() clientFactory, err := armcompute.NewClientFactory("<subscription-id>", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } pager := clientFactory.NewDedicatedHostGroupsClient().NewListBySubscriptionPager(nil) for pager.More() { page, err := pager.NextPage(ctx) if err != nil { log.Fatalf("failed to advance page: %v", err) } for _, v := range page.Value { // You could use page here. We use blank identifier for just demo purposes. _ = v } // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. // page.DedicatedHostGroupListResult = armcompute.DedicatedHostGroupListResult{ // Value: []*armcompute.DedicatedHostGroup{ // { // Name: to.Ptr("myDedicatedHostGroup"), // Type: to.Ptr("aaaa"), // ID: to.Ptr("/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/HostGroups/myDedicatedHostGroup"), // Location: to.Ptr("westus"), // Tags: map[string]*string{ // }, // Properties: &armcompute.DedicatedHostGroupProperties{ // Hosts: []*armcompute.SubResourceReadOnly{ // { // ID: to.Ptr("aaaa"), // }}, // InstanceView: &armcompute.DedicatedHostGroupInstanceView{ // Hosts: []*armcompute.DedicatedHostInstanceViewWithName{ // { // AssetID: to.Ptr("aaaa"), // AvailableCapacity: &armcompute.DedicatedHostAvailableCapacity{ // AllocatableVMs: []*armcompute.DedicatedHostAllocatableVM{ // { // Count: to.Ptr[float64](26), // VMSize: to.Ptr("aaaaaaaaaaaaaaaaaaaa"), // }}, // }, // Statuses: []*armcompute.InstanceViewStatus{ // { // Code: to.Ptr("aaaaaaaaaaaaaaaaaaaaaaa"), // DisplayStatus: to.Ptr("aaaaaa"), // Level: to.Ptr(armcompute.StatusLevelTypesInfo), // Message: to.Ptr("a"), // Time: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-11-30T12:58:26.522Z"); return t}()), // }}, // Name: to.Ptr("aaaaaaaaaaaaaaaaaa"), // }}, // }, // PlatformFaultDomainCount: to.Ptr[int32](3), // SupportAutomaticPlacement: to.Ptr(true), // }, // Zones: []*string{ // to.Ptr("1")}, // }}, // } }
Output:
Example (DedicatedHostGroupListBySubscriptionMinimumSetGen) ¶
Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/92de53a5f1e0e03c94b40475d2135d97148ed014/specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-03-01/examples/dedicatedHostExamples/DedicatedHostGroup_ListBySubscription_MinimumSet_Gen.json
cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() clientFactory, err := armcompute.NewClientFactory("<subscription-id>", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } pager := clientFactory.NewDedicatedHostGroupsClient().NewListBySubscriptionPager(nil) for pager.More() { page, err := pager.NextPage(ctx) if err != nil { log.Fatalf("failed to advance page: %v", err) } for _, v := range page.Value { // You could use page here. We use blank identifier for just demo purposes. _ = v } // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. // page.DedicatedHostGroupListResult = armcompute.DedicatedHostGroupListResult{ // Value: []*armcompute.DedicatedHostGroup{ // { // ID: to.Ptr("/subscriptions/{subscription-id}/resourceGroups/rgcompute/providers/Microsoft.Compute/HostGroups/myDedicatedHostGroup"), // Location: to.Ptr("westus"), // }}, // } }
Output:
func (*DedicatedHostGroupsClient) Update ¶
func (client *DedicatedHostGroupsClient) Update(ctx context.Context, resourceGroupName string, hostGroupName string, parameters DedicatedHostGroupUpdate, options *DedicatedHostGroupsClientUpdateOptions) (DedicatedHostGroupsClientUpdateResponse, error)
Update - Update an dedicated host group. If the operation fails it returns an *azcore.ResponseError type.
Generated from API version 2024-03-01
- resourceGroupName - The name of the resource group.
- hostGroupName - The name of the dedicated host group.
- parameters - Parameters supplied to the Update Dedicated Host Group operation.
- options - DedicatedHostGroupsClientUpdateOptions contains the optional parameters for the DedicatedHostGroupsClient.Update method.
Example (DedicatedHostGroupUpdateMaximumSetGen) ¶
Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/92de53a5f1e0e03c94b40475d2135d97148ed014/specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-03-01/examples/dedicatedHostExamples/DedicatedHostGroup_Update_MaximumSet_Gen.json
cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() clientFactory, err := armcompute.NewClientFactory("<subscription-id>", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } res, err := clientFactory.NewDedicatedHostGroupsClient().Update(ctx, "rgcompute", "aaaa", armcompute.DedicatedHostGroupUpdate{ Tags: map[string]*string{ "key9921": to.Ptr("aaaaaaaaaa"), }, Properties: &armcompute.DedicatedHostGroupProperties{ InstanceView: &armcompute.DedicatedHostGroupInstanceView{ Hosts: []*armcompute.DedicatedHostInstanceViewWithName{ { AvailableCapacity: &armcompute.DedicatedHostAvailableCapacity{ AllocatableVMs: []*armcompute.DedicatedHostAllocatableVM{ { Count: to.Ptr[float64](26), VMSize: to.Ptr("aaaaaaaaaaaaaaaaaaaa"), }}, }, Statuses: []*armcompute.InstanceViewStatus{ { Code: to.Ptr("aaaaaaaaaaaaaaaaaaaaaaa"), DisplayStatus: to.Ptr("aaaaaa"), Level: to.Ptr(armcompute.StatusLevelTypesInfo), Message: to.Ptr("a"), Time: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-11-30T12:58:26.522Z"); return t }()), }}, }}, }, PlatformFaultDomainCount: to.Ptr[int32](3), SupportAutomaticPlacement: to.Ptr(true), }, Zones: []*string{ to.Ptr("aaaaaaaaaaaaaaaaaaaaaaaaaaaaa")}, }, nil) if err != nil { log.Fatalf("failed to finish the request: %v", err) } // You could use response here. We use blank identifier for just demo purposes. _ = res // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. // res.DedicatedHostGroup = armcompute.DedicatedHostGroup{ // Name: to.Ptr("myDedicatedHostGroup"), // Type: to.Ptr("aaaa"), // ID: to.Ptr("/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/HostGroups/myDedicatedHostGroup"), // Location: to.Ptr("westus"), // Tags: map[string]*string{ // }, // Properties: &armcompute.DedicatedHostGroupProperties{ // Hosts: []*armcompute.SubResourceReadOnly{ // { // ID: to.Ptr("aaaa"), // }}, // InstanceView: &armcompute.DedicatedHostGroupInstanceView{ // Hosts: []*armcompute.DedicatedHostInstanceViewWithName{ // { // AssetID: to.Ptr("aaaa"), // AvailableCapacity: &armcompute.DedicatedHostAvailableCapacity{ // AllocatableVMs: []*armcompute.DedicatedHostAllocatableVM{ // { // Count: to.Ptr[float64](26), // VMSize: to.Ptr("aaaaaaaaaaaaaaaaaaaa"), // }}, // }, // Statuses: []*armcompute.InstanceViewStatus{ // { // Code: to.Ptr("aaaaaaaaaaaaaaaaaaaaaaa"), // DisplayStatus: to.Ptr("aaaaaa"), // Level: to.Ptr(armcompute.StatusLevelTypesInfo), // Message: to.Ptr("a"), // Time: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-11-30T12:58:26.522Z"); return t}()), // }}, // Name: to.Ptr("aaaaaaaaaaaaaaaaaa"), // }}, // }, // PlatformFaultDomainCount: to.Ptr[int32](3), // SupportAutomaticPlacement: to.Ptr(true), // }, // Zones: []*string{ // to.Ptr("1")}, // }
Output:
Example (DedicatedHostGroupUpdateMinimumSetGen) ¶
Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/92de53a5f1e0e03c94b40475d2135d97148ed014/specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-03-01/examples/dedicatedHostExamples/DedicatedHostGroup_Update_MinimumSet_Gen.json
cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() clientFactory, err := armcompute.NewClientFactory("<subscription-id>", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } res, err := clientFactory.NewDedicatedHostGroupsClient().Update(ctx, "rgcompute", "aaaaaaaaaaa", armcompute.DedicatedHostGroupUpdate{}, nil) if err != nil { log.Fatalf("failed to finish the request: %v", err) } // You could use response here. We use blank identifier for just demo purposes. _ = res // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. // res.DedicatedHostGroup = armcompute.DedicatedHostGroup{ // Location: to.Ptr("westus"), // }
Output:
type DedicatedHostGroupsClientCreateOrUpdateOptions ¶
type DedicatedHostGroupsClientCreateOrUpdateOptions struct { }
DedicatedHostGroupsClientCreateOrUpdateOptions contains the optional parameters for the DedicatedHostGroupsClient.CreateOrUpdate method.
type DedicatedHostGroupsClientCreateOrUpdateResponse ¶
type DedicatedHostGroupsClientCreateOrUpdateResponse struct { // Specifies information about the dedicated host group that the dedicated hosts should be assigned to. Currently, a dedicated // host can only be added to a dedicated host group at creation time. An existing dedicated host cannot be added to another // dedicated host group. DedicatedHostGroup }
DedicatedHostGroupsClientCreateOrUpdateResponse contains the response from method DedicatedHostGroupsClient.CreateOrUpdate.
type DedicatedHostGroupsClientDeleteOptions ¶
type DedicatedHostGroupsClientDeleteOptions struct { }
DedicatedHostGroupsClientDeleteOptions contains the optional parameters for the DedicatedHostGroupsClient.Delete method.
type DedicatedHostGroupsClientDeleteResponse ¶
type DedicatedHostGroupsClientDeleteResponse struct { }
DedicatedHostGroupsClientDeleteResponse contains the response from method DedicatedHostGroupsClient.Delete.
type DedicatedHostGroupsClientGetOptions ¶
type DedicatedHostGroupsClientGetOptions struct { // The expand expression to apply on the operation. 'InstanceView' will retrieve the list of instance views of the dedicated // hosts under the dedicated host group. 'UserData' is not supported for // dedicated host group. Expand *InstanceViewTypes }
DedicatedHostGroupsClientGetOptions contains the optional parameters for the DedicatedHostGroupsClient.Get method.
type DedicatedHostGroupsClientGetResponse ¶
type DedicatedHostGroupsClientGetResponse struct { // Specifies information about the dedicated host group that the dedicated hosts should be assigned to. Currently, a dedicated // host can only be added to a dedicated host group at creation time. An existing dedicated host cannot be added to another // dedicated host group. DedicatedHostGroup }
DedicatedHostGroupsClientGetResponse contains the response from method DedicatedHostGroupsClient.Get.
type DedicatedHostGroupsClientListByResourceGroupOptions ¶
type DedicatedHostGroupsClientListByResourceGroupOptions struct { }
DedicatedHostGroupsClientListByResourceGroupOptions contains the optional parameters for the DedicatedHostGroupsClient.NewListByResourceGroupPager method.
type DedicatedHostGroupsClientListByResourceGroupResponse ¶
type DedicatedHostGroupsClientListByResourceGroupResponse struct { // The List Dedicated Host Group with resource group response. DedicatedHostGroupListResult }
DedicatedHostGroupsClientListByResourceGroupResponse contains the response from method DedicatedHostGroupsClient.NewListByResourceGroupPager.
type DedicatedHostGroupsClientListBySubscriptionOptions ¶
type DedicatedHostGroupsClientListBySubscriptionOptions struct { }
DedicatedHostGroupsClientListBySubscriptionOptions contains the optional parameters for the DedicatedHostGroupsClient.NewListBySubscriptionPager method.
type DedicatedHostGroupsClientListBySubscriptionResponse ¶
type DedicatedHostGroupsClientListBySubscriptionResponse struct { // The List Dedicated Host Group with resource group response. DedicatedHostGroupListResult }
DedicatedHostGroupsClientListBySubscriptionResponse contains the response from method DedicatedHostGroupsClient.NewListBySubscriptionPager.
type DedicatedHostGroupsClientUpdateOptions ¶
type DedicatedHostGroupsClientUpdateOptions struct { }
DedicatedHostGroupsClientUpdateOptions contains the optional parameters for the DedicatedHostGroupsClient.Update method.
type DedicatedHostGroupsClientUpdateResponse ¶
type DedicatedHostGroupsClientUpdateResponse struct { // Specifies information about the dedicated host group that the dedicated hosts should be assigned to. Currently, a dedicated // host can only be added to a dedicated host group at creation time. An existing dedicated host cannot be added to another // dedicated host group. DedicatedHostGroup }
DedicatedHostGroupsClientUpdateResponse contains the response from method DedicatedHostGroupsClient.Update.
type DedicatedHostInstanceView ¶
type DedicatedHostInstanceView struct { // Unutilized capacity of the dedicated host. AvailableCapacity *DedicatedHostAvailableCapacity // The resource status information. Statuses []*InstanceViewStatus // READ-ONLY; Specifies the unique id of the dedicated physical machine on which the dedicated host resides. AssetID *string }
DedicatedHostInstanceView - The instance view of a dedicated host.
func (DedicatedHostInstanceView) MarshalJSON ¶
func (d DedicatedHostInstanceView) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type DedicatedHostInstanceView.
func (*DedicatedHostInstanceView) UnmarshalJSON ¶
func (d *DedicatedHostInstanceView) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type DedicatedHostInstanceView.
type DedicatedHostInstanceViewWithName ¶
type DedicatedHostInstanceViewWithName struct { // Unutilized capacity of the dedicated host. AvailableCapacity *DedicatedHostAvailableCapacity // The resource status information. Statuses []*InstanceViewStatus // READ-ONLY; Specifies the unique id of the dedicated physical machine on which the dedicated host resides. AssetID *string // READ-ONLY; The name of the dedicated host. Name *string }
DedicatedHostInstanceViewWithName - The instance view of a dedicated host that includes the name of the dedicated host. It is used for the response to the instance view of a dedicated host group.
func (DedicatedHostInstanceViewWithName) MarshalJSON ¶
func (d DedicatedHostInstanceViewWithName) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type DedicatedHostInstanceViewWithName.
func (*DedicatedHostInstanceViewWithName) UnmarshalJSON ¶
func (d *DedicatedHostInstanceViewWithName) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type DedicatedHostInstanceViewWithName.
type DedicatedHostLicenseTypes ¶
type DedicatedHostLicenseTypes string
DedicatedHostLicenseTypes - Specifies the software license type that will be applied to the VMs deployed on the dedicated host. Possible values are: None, WindowsServerHybrid, WindowsServerPerpetual. The default value is: None.
const ( DedicatedHostLicenseTypesNone DedicatedHostLicenseTypes = "None" DedicatedHostLicenseTypesWindowsServerHybrid DedicatedHostLicenseTypes = "Windows_Server_Hybrid" DedicatedHostLicenseTypesWindowsServerPerpetual DedicatedHostLicenseTypes = "Windows_Server_Perpetual" )
func PossibleDedicatedHostLicenseTypesValues ¶
func PossibleDedicatedHostLicenseTypesValues() []DedicatedHostLicenseTypes
PossibleDedicatedHostLicenseTypesValues returns the possible values for the DedicatedHostLicenseTypes const type.
type DedicatedHostListResult ¶
type DedicatedHostListResult struct { // REQUIRED; The list of dedicated hosts Value []*DedicatedHost // The URI to fetch the next page of dedicated hosts. Call ListNext() with this URI to fetch the next page of dedicated hosts. NextLink *string }
DedicatedHostListResult - The list dedicated host operation response.
func (DedicatedHostListResult) MarshalJSON ¶
func (d DedicatedHostListResult) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type DedicatedHostListResult.
func (*DedicatedHostListResult) UnmarshalJSON ¶
func (d *DedicatedHostListResult) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type DedicatedHostListResult.
type DedicatedHostProperties ¶
type DedicatedHostProperties struct { // Specifies whether the dedicated host should be replaced automatically in case of a failure. The value is defaulted to 'true' // when not provided. AutoReplaceOnFailure *bool // Specifies the software license type that will be applied to the VMs deployed on the dedicated host. Possible values are: // None, WindowsServerHybrid, WindowsServerPerpetual. The default value is: None. LicenseType *DedicatedHostLicenseTypes // Fault domain of the dedicated host within a dedicated host group. PlatformFaultDomain *int32 // READ-ONLY; A unique id generated and assigned to the dedicated host by the platform. Does not change throughout the lifetime // of the host. HostID *string // READ-ONLY; The dedicated host instance view. InstanceView *DedicatedHostInstanceView // READ-ONLY; The provisioning state, which only appears in the response. ProvisioningState *string // READ-ONLY; The date when the host was first provisioned. ProvisioningTime *time.Time // READ-ONLY; Specifies the time at which the Dedicated Host resource was created. Minimum api-version: 2021-11-01. TimeCreated *time.Time // READ-ONLY; A list of references to all virtual machines in the Dedicated Host. VirtualMachines []*SubResourceReadOnly }
DedicatedHostProperties - Properties of the dedicated host.
func (DedicatedHostProperties) MarshalJSON ¶
func (d DedicatedHostProperties) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type DedicatedHostProperties.
func (*DedicatedHostProperties) UnmarshalJSON ¶
func (d *DedicatedHostProperties) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type DedicatedHostProperties.
type DedicatedHostSizeListResult ¶
type DedicatedHostSizeListResult struct { // The list of dedicated host sizes. Value []*string }
DedicatedHostSizeListResult - The List Dedicated Host sizes operation response.
func (DedicatedHostSizeListResult) MarshalJSON ¶
func (d DedicatedHostSizeListResult) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type DedicatedHostSizeListResult.
func (*DedicatedHostSizeListResult) UnmarshalJSON ¶
func (d *DedicatedHostSizeListResult) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type DedicatedHostSizeListResult.
type DedicatedHostUpdate ¶
type DedicatedHostUpdate struct { // Properties of the dedicated host. Properties *DedicatedHostProperties // List all available dedicated host sizes for resizing [https://docs.microsoft.com/rest/api/compute/dedicated-hosts/listavailablesizes]. // Resizing can be only used to scale up DedicatedHost. Only name is // required to be set. SKU *SKU // Resource tags Tags map[string]*string }
DedicatedHostUpdate - Specifies information about the dedicated host. Only tags, autoReplaceOnFailure and licenseType may be updated.
func (DedicatedHostUpdate) MarshalJSON ¶
func (d DedicatedHostUpdate) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type DedicatedHostUpdate.
func (*DedicatedHostUpdate) UnmarshalJSON ¶
func (d *DedicatedHostUpdate) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type DedicatedHostUpdate.
type DedicatedHostsClient ¶
type DedicatedHostsClient struct {
// contains filtered or unexported fields
}
DedicatedHostsClient contains the methods for the DedicatedHosts group. Don't use this type directly, use NewDedicatedHostsClient() instead.
func NewDedicatedHostsClient ¶
func NewDedicatedHostsClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*DedicatedHostsClient, error)
NewDedicatedHostsClient creates a new instance of DedicatedHostsClient 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 (*DedicatedHostsClient) BeginCreateOrUpdate ¶
func (client *DedicatedHostsClient) BeginCreateOrUpdate(ctx context.Context, resourceGroupName string, hostGroupName string, hostName string, parameters DedicatedHost, options *DedicatedHostsClientBeginCreateOrUpdateOptions) (*runtime.Poller[DedicatedHostsClientCreateOrUpdateResponse], error)
BeginCreateOrUpdate - Create or update a dedicated host . If the operation fails it returns an *azcore.ResponseError type.
Generated from API version 2024-03-01
- resourceGroupName - The name of the resource group.
- hostGroupName - The name of the dedicated host group.
- hostName - The name of the dedicated host .
- parameters - Parameters supplied to the Create Dedicated Host.
- options - DedicatedHostsClientBeginCreateOrUpdateOptions contains the optional parameters for the DedicatedHostsClient.BeginCreateOrUpdate method.
Example ¶
Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/92de53a5f1e0e03c94b40475d2135d97148ed014/specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-03-01/examples/dedicatedHostExamples/DedicatedHost_CreateOrUpdate.json
cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() clientFactory, err := armcompute.NewClientFactory("<subscription-id>", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } poller, err := clientFactory.NewDedicatedHostsClient().BeginCreateOrUpdate(ctx, "myResourceGroup", "myDedicatedHostGroup", "myDedicatedHost", armcompute.DedicatedHost{ Location: to.Ptr("westus"), Tags: map[string]*string{ "department": to.Ptr("HR"), }, Properties: &armcompute.DedicatedHostProperties{ PlatformFaultDomain: to.Ptr[int32](1), }, SKU: &armcompute.SKU{ Name: to.Ptr("DSv3-Type1"), }, }, nil) if err != nil { log.Fatalf("failed to finish the request: %v", err) } res, err := poller.PollUntilDone(ctx, nil) if err != nil { log.Fatalf("failed to pull the result: %v", err) } // You could use response here. We use blank identifier for just demo purposes. _ = res // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. // res.DedicatedHost = armcompute.DedicatedHost{ // Name: to.Ptr("myDedicatedHost"), // ID: to.Ptr("/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/HostGroups/myDedicatedHostGroup/hosts/myDedicatedHost"), // Location: to.Ptr("westus"), // Tags: map[string]*string{ // "department": to.Ptr("HR"), // }, // Properties: &armcompute.DedicatedHostProperties{ // AutoReplaceOnFailure: to.Ptr(false), // HostID: to.Ptr("{GUID}"), // LicenseType: to.Ptr(armcompute.DedicatedHostLicenseTypesWindowsServerHybrid), // PlatformFaultDomain: to.Ptr[int32](1), // }, // SKU: &armcompute.SKU{ // Name: to.Ptr("DSv3-Type1"), // }, // }
Output:
func (*DedicatedHostsClient) BeginDelete ¶
func (client *DedicatedHostsClient) BeginDelete(ctx context.Context, resourceGroupName string, hostGroupName string, hostName string, options *DedicatedHostsClientBeginDeleteOptions) (*runtime.Poller[DedicatedHostsClientDeleteResponse], error)
BeginDelete - Delete a dedicated host. If the operation fails it returns an *azcore.ResponseError type.
Generated from API version 2024-03-01
- resourceGroupName - The name of the resource group.
- hostGroupName - The name of the dedicated host group.
- hostName - The name of the dedicated host.
- options - DedicatedHostsClientBeginDeleteOptions contains the optional parameters for the DedicatedHostsClient.BeginDelete method.
Example (DedicatedHostDeleteMaximumSetGen) ¶
Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/92de53a5f1e0e03c94b40475d2135d97148ed014/specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-03-01/examples/dedicatedHostExamples/DedicatedHost_Delete_MaximumSet_Gen.json
cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() clientFactory, err := armcompute.NewClientFactory("<subscription-id>", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } poller, err := clientFactory.NewDedicatedHostsClient().BeginDelete(ctx, "rgcompute", "aaaaaa", "aaaaaaaaaaaaaaa", nil) if err != nil { log.Fatalf("failed to finish the request: %v", err) } _, err = poller.PollUntilDone(ctx, nil) if err != nil { log.Fatalf("failed to pull the result: %v", err) }
Output:
Example (DedicatedHostDeleteMinimumSetGen) ¶
Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/92de53a5f1e0e03c94b40475d2135d97148ed014/specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-03-01/examples/dedicatedHostExamples/DedicatedHost_Delete_MinimumSet_Gen.json
cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() clientFactory, err := armcompute.NewClientFactory("<subscription-id>", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } poller, err := clientFactory.NewDedicatedHostsClient().BeginDelete(ctx, "rgcompute", "aaaaaaaaaaaaaaa", "aaaaa", nil) if err != nil { log.Fatalf("failed to finish the request: %v", err) } _, err = poller.PollUntilDone(ctx, nil) if err != nil { log.Fatalf("failed to pull the result: %v", err) }
Output:
func (*DedicatedHostsClient) BeginRedeploy ¶ added in v5.4.0
func (client *DedicatedHostsClient) BeginRedeploy(ctx context.Context, resourceGroupName string, hostGroupName string, hostName string, options *DedicatedHostsClientBeginRedeployOptions) (*runtime.Poller[DedicatedHostsClientRedeployResponse], error)
BeginRedeploy - Redeploy the dedicated host. The operation will complete successfully once the dedicated host has migrated to a new node and is running. To determine the health of VMs deployed on the dedicated host after the redeploy check the Resource Health Center in the Azure Portal. Please refer to https://docs.microsoft.com/azure/service-health/resource-health-overview for more details. If the operation fails it returns an *azcore.ResponseError type.
Generated from API version 2024-03-01
- resourceGroupName - The name of the resource group.
- hostGroupName - The name of the dedicated host group.
- hostName - The name of the dedicated host.
- options - DedicatedHostsClientBeginRedeployOptions contains the optional parameters for the DedicatedHostsClient.BeginRedeploy method.
Example ¶
Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/92de53a5f1e0e03c94b40475d2135d97148ed014/specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-03-01/examples/dedicatedHostExamples/DedicatedHost_Redeploy.json
cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() clientFactory, err := armcompute.NewClientFactory("<subscription-id>", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } poller, err := clientFactory.NewDedicatedHostsClient().BeginRedeploy(ctx, "myResourceGroup", "myDedicatedHostGroup", "myHost", nil) if err != nil { log.Fatalf("failed to finish the request: %v", err) } _, err = poller.PollUntilDone(ctx, nil) if err != nil { log.Fatalf("failed to pull the result: %v", err) }
Output:
func (*DedicatedHostsClient) BeginRestart ¶
func (client *DedicatedHostsClient) BeginRestart(ctx context.Context, resourceGroupName string, hostGroupName string, hostName string, options *DedicatedHostsClientBeginRestartOptions) (*runtime.Poller[DedicatedHostsClientRestartResponse], error)
BeginRestart - Restart the dedicated host. The operation will complete successfully once the dedicated host has restarted and is running. To determine the health of VMs deployed on the dedicated host after the restart check the Resource Health Center in the Azure Portal. Please refer to https://docs.microsoft.com/azure/service-health/resource-health-overview for more details. If the operation fails it returns an *azcore.ResponseError type.
Generated from API version 2024-03-01
- resourceGroupName - The name of the resource group.
- hostGroupName - The name of the dedicated host group.
- hostName - The name of the dedicated host.
- options - DedicatedHostsClientBeginRestartOptions contains the optional parameters for the DedicatedHostsClient.BeginRestart method.
Example ¶
Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/92de53a5f1e0e03c94b40475d2135d97148ed014/specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-03-01/examples/dedicatedHostExamples/DedicatedHost_Restart.json
cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() clientFactory, err := armcompute.NewClientFactory("<subscription-id>", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } poller, err := clientFactory.NewDedicatedHostsClient().BeginRestart(ctx, "myResourceGroup", "myDedicatedHostGroup", "myHost", nil) if err != nil { log.Fatalf("failed to finish the request: %v", err) } _, err = poller.PollUntilDone(ctx, nil) if err != nil { log.Fatalf("failed to pull the result: %v", err) }
Output:
func (*DedicatedHostsClient) BeginUpdate ¶
func (client *DedicatedHostsClient) BeginUpdate(ctx context.Context, resourceGroupName string, hostGroupName string, hostName string, parameters DedicatedHostUpdate, options *DedicatedHostsClientBeginUpdateOptions) (*runtime.Poller[DedicatedHostsClientUpdateResponse], error)
BeginUpdate - Update a dedicated host . If the operation fails it returns an *azcore.ResponseError type.
Generated from API version 2024-03-01
- resourceGroupName - The name of the resource group.
- hostGroupName - The name of the dedicated host group.
- hostName - The name of the dedicated host .
- parameters - Parameters supplied to the Update Dedicated Host operation.
- options - DedicatedHostsClientBeginUpdateOptions contains the optional parameters for the DedicatedHostsClient.BeginUpdate method.
Example (DedicatedHostUpdateMaximumSetGen) ¶
Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/92de53a5f1e0e03c94b40475d2135d97148ed014/specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-03-01/examples/dedicatedHostExamples/DedicatedHost_Update_MaximumSet_Gen.json
cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() clientFactory, err := armcompute.NewClientFactory("<subscription-id>", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } poller, err := clientFactory.NewDedicatedHostsClient().BeginUpdate(ctx, "rgcompute", "aaaaaaaaa", "aaaaaaaaaaaaaaaaaaaaa", armcompute.DedicatedHostUpdate{ Tags: map[string]*string{ "key8813": to.Ptr("aaaaaaaaaaaaaaaaaaaaaaaaaaa"), }, Properties: &armcompute.DedicatedHostProperties{ AutoReplaceOnFailure: to.Ptr(true), InstanceView: &armcompute.DedicatedHostInstanceView{ AvailableCapacity: &armcompute.DedicatedHostAvailableCapacity{ AllocatableVMs: []*armcompute.DedicatedHostAllocatableVM{ { Count: to.Ptr[float64](26), VMSize: to.Ptr("aaaaaaaaaaaaaaaaaaaa"), }}, }, Statuses: []*armcompute.InstanceViewStatus{ { Code: to.Ptr("aaaaaaaaaaaaaaaaaaaaaaa"), DisplayStatus: to.Ptr("aaaaaa"), Level: to.Ptr(armcompute.StatusLevelTypesInfo), Message: to.Ptr("a"), Time: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-11-30T12:58:26.522Z"); return t }()), }}, }, LicenseType: to.Ptr(armcompute.DedicatedHostLicenseTypesWindowsServerHybrid), PlatformFaultDomain: to.Ptr[int32](1), }, }, nil) if err != nil { log.Fatalf("failed to finish the request: %v", err) } res, err := poller.PollUntilDone(ctx, nil) if err != nil { log.Fatalf("failed to pull the result: %v", err) } // You could use response here. We use blank identifier for just demo purposes. _ = res // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. // res.DedicatedHost = armcompute.DedicatedHost{ // Name: to.Ptr("myDedicatedHost"), // Type: to.Ptr("aaaaaaaaaaaaaaaaaaa"), // ID: to.Ptr("/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/HostGroups/myDedicatedHostGroup/hosts/myDedicatedHost"), // Location: to.Ptr("westus"), // Tags: map[string]*string{ // }, // Properties: &armcompute.DedicatedHostProperties{ // AutoReplaceOnFailure: to.Ptr(true), // HostID: to.Ptr("{GUID}"), // InstanceView: &armcompute.DedicatedHostInstanceView{ // AssetID: to.Ptr("aaaaaaaaaaaaaaaa"), // AvailableCapacity: &armcompute.DedicatedHostAvailableCapacity{ // AllocatableVMs: []*armcompute.DedicatedHostAllocatableVM{ // { // Count: to.Ptr[float64](26), // VMSize: to.Ptr("aaaaaaaaaaaaaaaaaaaa"), // }}, // }, // Statuses: []*armcompute.InstanceViewStatus{ // { // Code: to.Ptr("aaaaaaaaaaaaaaaaaaaaaaa"), // DisplayStatus: to.Ptr("aaaaaa"), // Level: to.Ptr(armcompute.StatusLevelTypesInfo), // Message: to.Ptr("a"), // Time: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-11-30T12:58:26.522Z"); return t}()), // }}, // }, // LicenseType: to.Ptr(armcompute.DedicatedHostLicenseTypesWindowsServerHybrid), // PlatformFaultDomain: to.Ptr[int32](1), // ProvisioningState: to.Ptr("Succeeded"), // ProvisioningTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-11-30T12:58:26.526Z"); return t}()), // VirtualMachines: []*armcompute.SubResourceReadOnly{ // { // ID: to.Ptr("aaaa"), // }}, // }, // SKU: &armcompute.SKU{ // Name: to.Ptr("DSv3-Type1"), // Capacity: to.Ptr[int64](7), // Tier: to.Ptr("aaa"), // }, // }
Output:
Example (DedicatedHostUpdateMinimumSetGen) ¶
Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/92de53a5f1e0e03c94b40475d2135d97148ed014/specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-03-01/examples/dedicatedHostExamples/DedicatedHost_Update_MinimumSet_Gen.json
cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() clientFactory, err := armcompute.NewClientFactory("<subscription-id>", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } poller, err := clientFactory.NewDedicatedHostsClient().BeginUpdate(ctx, "rgcompute", "aa", "aaaaaaaaaaaaaaaaaaaaaaaaaa", armcompute.DedicatedHostUpdate{}, nil) if err != nil { log.Fatalf("failed to finish the request: %v", err) } res, err := poller.PollUntilDone(ctx, nil) if err != nil { log.Fatalf("failed to pull the result: %v", err) } // You could use response here. We use blank identifier for just demo purposes. _ = res // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. // res.DedicatedHost = armcompute.DedicatedHost{ // Location: to.Ptr("westus"), // SKU: &armcompute.SKU{ // }, // }
Output:
Example (DedicatedHostUpdateResize) ¶
Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/92de53a5f1e0e03c94b40475d2135d97148ed014/specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-03-01/examples/dedicatedHostExamples/DedicatedHost_Update_Resize.json
cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() clientFactory, err := armcompute.NewClientFactory("<subscription-id>", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } poller, err := clientFactory.NewDedicatedHostsClient().BeginUpdate(ctx, "rgcompute", "aaaaaaaaa", "aaaaaaaaaaaaaaaaaaaaa", armcompute.DedicatedHostUpdate{ SKU: &armcompute.SKU{ Name: to.Ptr("DSv3-Type1"), }, }, nil) if err != nil { log.Fatalf("failed to finish the request: %v", err) } res, err := poller.PollUntilDone(ctx, nil) if err != nil { log.Fatalf("failed to pull the result: %v", err) } // You could use response here. We use blank identifier for just demo purposes. _ = res // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. // res.DedicatedHost = armcompute.DedicatedHost{ // Name: to.Ptr("myDedicatedHost"), // Type: to.Ptr("aaaaaaaaaaaaaaaaaaa"), // ID: to.Ptr("/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/HostGroups/myDedicatedHostGroup/hosts/myDedicatedHost"), // Location: to.Ptr("westus"), // Tags: map[string]*string{ // }, // Properties: &armcompute.DedicatedHostProperties{ // AutoReplaceOnFailure: to.Ptr(true), // HostID: to.Ptr("{GUID}"), // LicenseType: to.Ptr(armcompute.DedicatedHostLicenseTypesWindowsServerHybrid), // PlatformFaultDomain: to.Ptr[int32](1), // ProvisioningState: to.Ptr("Succeeded"), // ProvisioningTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-11-30T12:58:26.526Z"); return t}()), // VirtualMachines: []*armcompute.SubResourceReadOnly{ // { // ID: to.Ptr("aaaa"), // }}, // }, // SKU: &armcompute.SKU{ // Name: to.Ptr("DSv3-Type1"), // Capacity: to.Ptr[int64](7), // Tier: to.Ptr("aaa"), // }, // }
Output:
func (*DedicatedHostsClient) Get ¶
func (client *DedicatedHostsClient) Get(ctx context.Context, resourceGroupName string, hostGroupName string, hostName string, options *DedicatedHostsClientGetOptions) (DedicatedHostsClientGetResponse, error)
Get - Retrieves information about a dedicated host. If the operation fails it returns an *azcore.ResponseError type.
Generated from API version 2024-03-01
- resourceGroupName - The name of the resource group.
- hostGroupName - The name of the dedicated host group.
- hostName - The name of the dedicated host.
- options - DedicatedHostsClientGetOptions contains the optional parameters for the DedicatedHostsClient.Get method.
Example ¶
Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/92de53a5f1e0e03c94b40475d2135d97148ed014/specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-03-01/examples/dedicatedHostExamples/DedicatedHost_Get.json
cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() clientFactory, err := armcompute.NewClientFactory("<subscription-id>", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } res, err := clientFactory.NewDedicatedHostsClient().Get(ctx, "myResourceGroup", "myDedicatedHostGroup", "myHost", &armcompute.DedicatedHostsClientGetOptions{Expand: to.Ptr(armcompute.InstanceViewTypesInstanceView)}) if err != nil { log.Fatalf("failed to finish the request: %v", err) } // You could use response here. We use blank identifier for just demo purposes. _ = res // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. // res.DedicatedHost = armcompute.DedicatedHost{ // Name: to.Ptr("myHost"), // ID: to.Ptr("/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/HostGroups/myDedicatedHostGroup/hosts/myHost"), // Location: to.Ptr("westus"), // Tags: map[string]*string{ // "department": to.Ptr("HR"), // }, // Properties: &armcompute.DedicatedHostProperties{ // AutoReplaceOnFailure: to.Ptr(true), // HostID: to.Ptr("{GUID}"), // InstanceView: &armcompute.DedicatedHostInstanceView{ // AssetID: to.Ptr("eb3f58b8-b4e8-4882-b69f-301a01812407"), // AvailableCapacity: &armcompute.DedicatedHostAvailableCapacity{ // AllocatableVMs: []*armcompute.DedicatedHostAllocatableVM{ // { // Count: to.Ptr[float64](10), // VMSize: to.Ptr("Standard_A1"), // }}, // }, // Statuses: []*armcompute.InstanceViewStatus{ // { // Code: to.Ptr("ProvisioningState/succeeded"), // DisplayStatus: to.Ptr("Provisioning succeeded"), // Level: to.Ptr(armcompute.StatusLevelTypesInfo), // }, // { // Code: to.Ptr("HealthState/available"), // DisplayStatus: to.Ptr("Host available"), // Level: to.Ptr(armcompute.StatusLevelTypesInfo), // }}, // }, // PlatformFaultDomain: to.Ptr[int32](1), // ProvisioningState: to.Ptr("Succeeded"), // ProvisioningTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2019-06-27T01:02:38.313Z"); return t}()), // TimeCreated: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2019-06-27T01:02:38.313Z"); return t}()), // VirtualMachines: []*armcompute.SubResourceReadOnly{ // { // ID: to.Ptr("/subscriptions/subId/resourceGroups/myResourceGroup/providers/Microsoft.Compute/virtualMachines/vm1"), // }}, // }, // SKU: &armcompute.SKU{ // Name: to.Ptr("DSv3-Type1"), // }, // }
Output:
func (*DedicatedHostsClient) NewListAvailableSizesPager ¶
func (client *DedicatedHostsClient) NewListAvailableSizesPager(resourceGroupName string, hostGroupName string, hostName string, options *DedicatedHostsClientListAvailableSizesOptions) *runtime.Pager[DedicatedHostsClientListAvailableSizesResponse]
NewListAvailableSizesPager - Lists all available dedicated host sizes to which the specified dedicated host can be resized. NOTE: The dedicated host sizes provided can be used to only scale up the existing dedicated host.
Generated from API version 2024-03-01
- resourceGroupName - The name of the resource group.
- hostGroupName - The name of the dedicated host group.
- hostName - The name of the dedicated host.
- options - DedicatedHostsClientListAvailableSizesOptions contains the optional parameters for the DedicatedHostsClient.NewListAvailableSizesPager method.
Example ¶
Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/92de53a5f1e0e03c94b40475d2135d97148ed014/specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-03-01/examples/dedicatedHostExamples/DedicatedHost_ListAvailableSizes.json
cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() clientFactory, err := armcompute.NewClientFactory("<subscription-id>", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } pager := clientFactory.NewDedicatedHostsClient().NewListAvailableSizesPager("myResourceGroup", "myDedicatedHostGroup", "myHost", nil) for pager.More() { page, err := pager.NextPage(ctx) if err != nil { log.Fatalf("failed to advance page: %v", err) } for _, v := range page.Value { // You could use page here. We use blank identifier for just demo purposes. _ = v } // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. // page.DedicatedHostSizeListResult = armcompute.DedicatedHostSizeListResult{ // Value: []*string{ // to.Ptr("Dsv3-Type1"), // to.Ptr("Esv3-Type1")}, // } }
Output:
func (*DedicatedHostsClient) NewListByHostGroupPager ¶
func (client *DedicatedHostsClient) NewListByHostGroupPager(resourceGroupName string, hostGroupName string, options *DedicatedHostsClientListByHostGroupOptions) *runtime.Pager[DedicatedHostsClientListByHostGroupResponse]
NewListByHostGroupPager - Lists all of the dedicated hosts in the specified dedicated host group. Use the nextLink property in the response to get the next page of dedicated hosts.
Generated from API version 2024-03-01
- resourceGroupName - The name of the resource group.
- hostGroupName - The name of the dedicated host group.
- options - DedicatedHostsClientListByHostGroupOptions contains the optional parameters for the DedicatedHostsClient.NewListByHostGroupPager method.
Example (DedicatedHostListByHostGroupMaximumSetGen) ¶
Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/92de53a5f1e0e03c94b40475d2135d97148ed014/specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-03-01/examples/dedicatedHostExamples/DedicatedHost_ListByHostGroup_MaximumSet_Gen.json
cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() clientFactory, err := armcompute.NewClientFactory("<subscription-id>", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } pager := clientFactory.NewDedicatedHostsClient().NewListByHostGroupPager("rgcompute", "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", nil) for pager.More() { page, err := pager.NextPage(ctx) if err != nil { log.Fatalf("failed to advance page: %v", err) } for _, v := range page.Value { // You could use page here. We use blank identifier for just demo purposes. _ = v } // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. // page.DedicatedHostListResult = armcompute.DedicatedHostListResult{ // Value: []*armcompute.DedicatedHost{ // { // Name: to.Ptr("myDedicatedHost"), // Type: to.Ptr("aaaaaaaaaaaaaaaaaaa"), // ID: to.Ptr("/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/HostGroups/myDedicatedHostGroup/hosts/myDedicatedHost"), // Location: to.Ptr("westus"), // Tags: map[string]*string{ // }, // Properties: &armcompute.DedicatedHostProperties{ // AutoReplaceOnFailure: to.Ptr(true), // HostID: to.Ptr("{GUID}"), // InstanceView: &armcompute.DedicatedHostInstanceView{ // AssetID: to.Ptr("aaaaaaaaaaaaaaaa"), // AvailableCapacity: &armcompute.DedicatedHostAvailableCapacity{ // AllocatableVMs: []*armcompute.DedicatedHostAllocatableVM{ // { // Count: to.Ptr[float64](26), // VMSize: to.Ptr("aaaaaaaaaaaaaaaaaaaa"), // }}, // }, // Statuses: []*armcompute.InstanceViewStatus{ // { // Code: to.Ptr("aaaaaaaaaaaaaaaaaaaaaaa"), // DisplayStatus: to.Ptr("aaaaaa"), // Level: to.Ptr(armcompute.StatusLevelTypesInfo), // Message: to.Ptr("a"), // Time: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-11-30T12:58:26.522Z"); return t}()), // }}, // }, // LicenseType: to.Ptr(armcompute.DedicatedHostLicenseTypesWindowsServerHybrid), // PlatformFaultDomain: to.Ptr[int32](1), // ProvisioningState: to.Ptr("Succeeded"), // ProvisioningTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-11-30T12:58:26.526Z"); return t}()), // VirtualMachines: []*armcompute.SubResourceReadOnly{ // { // ID: to.Ptr("aaaa"), // }}, // }, // SKU: &armcompute.SKU{ // Name: to.Ptr("DSv3-Type1"), // Capacity: to.Ptr[int64](7), // Tier: to.Ptr("aaa"), // }, // }}, // } }
Output:
Example (DedicatedHostListByHostGroupMinimumSetGen) ¶
Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/92de53a5f1e0e03c94b40475d2135d97148ed014/specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-03-01/examples/dedicatedHostExamples/DedicatedHost_ListByHostGroup_MinimumSet_Gen.json
cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() clientFactory, err := armcompute.NewClientFactory("<subscription-id>", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } pager := clientFactory.NewDedicatedHostsClient().NewListByHostGroupPager("rgcompute", "aaaa", nil) for pager.More() { page, err := pager.NextPage(ctx) if err != nil { log.Fatalf("failed to advance page: %v", err) } for _, v := range page.Value { // You could use page here. We use blank identifier for just demo purposes. _ = v } // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. // page.DedicatedHostListResult = armcompute.DedicatedHostListResult{ // Value: []*armcompute.DedicatedHost{ // { // ID: to.Ptr("/subscriptions/{subscription-id}/resourceGroups/rgcompute/providers/Microsoft.Compute/HostGroups/myDedicatedHostGroup/hosts/myHost"), // Location: to.Ptr("westus"), // SKU: &armcompute.SKU{ // }, // }}, // } }
Output:
type DedicatedHostsClientBeginCreateOrUpdateOptions ¶
type DedicatedHostsClientBeginCreateOrUpdateOptions struct { // Resumes the LRO from the provided token. ResumeToken string }
DedicatedHostsClientBeginCreateOrUpdateOptions contains the optional parameters for the DedicatedHostsClient.BeginCreateOrUpdate method.
type DedicatedHostsClientBeginDeleteOptions ¶
type DedicatedHostsClientBeginDeleteOptions struct { // Resumes the LRO from the provided token. ResumeToken string }
DedicatedHostsClientBeginDeleteOptions contains the optional parameters for the DedicatedHostsClient.BeginDelete method.
type DedicatedHostsClientBeginRedeployOptions ¶ added in v5.4.0
type DedicatedHostsClientBeginRedeployOptions struct { // Resumes the LRO from the provided token. ResumeToken string }
DedicatedHostsClientBeginRedeployOptions contains the optional parameters for the DedicatedHostsClient.BeginRedeploy method.
type DedicatedHostsClientBeginRestartOptions ¶
type DedicatedHostsClientBeginRestartOptions struct { // Resumes the LRO from the provided token. ResumeToken string }
DedicatedHostsClientBeginRestartOptions contains the optional parameters for the DedicatedHostsClient.BeginRestart method.
type DedicatedHostsClientBeginUpdateOptions ¶
type DedicatedHostsClientBeginUpdateOptions struct { // Resumes the LRO from the provided token. ResumeToken string }
DedicatedHostsClientBeginUpdateOptions contains the optional parameters for the DedicatedHostsClient.BeginUpdate method.
type DedicatedHostsClientCreateOrUpdateResponse ¶
type DedicatedHostsClientCreateOrUpdateResponse struct { // Specifies information about the Dedicated host. DedicatedHost }
DedicatedHostsClientCreateOrUpdateResponse contains the response from method DedicatedHostsClient.BeginCreateOrUpdate.
type DedicatedHostsClientDeleteResponse ¶
type DedicatedHostsClientDeleteResponse struct { }
DedicatedHostsClientDeleteResponse contains the response from method DedicatedHostsClient.BeginDelete.
type DedicatedHostsClientGetOptions ¶
type DedicatedHostsClientGetOptions struct { // The expand expression to apply on the operation. 'InstanceView' will retrieve the list of instance views of the dedicated // host. 'UserData' is not supported for dedicated host. Expand *InstanceViewTypes }
DedicatedHostsClientGetOptions contains the optional parameters for the DedicatedHostsClient.Get method.
type DedicatedHostsClientGetResponse ¶
type DedicatedHostsClientGetResponse struct { // Specifies information about the Dedicated host. DedicatedHost }
DedicatedHostsClientGetResponse contains the response from method DedicatedHostsClient.Get.
type DedicatedHostsClientListAvailableSizesOptions ¶
type DedicatedHostsClientListAvailableSizesOptions struct { }
DedicatedHostsClientListAvailableSizesOptions contains the optional parameters for the DedicatedHostsClient.NewListAvailableSizesPager method.
type DedicatedHostsClientListAvailableSizesResponse ¶
type DedicatedHostsClientListAvailableSizesResponse struct { // The List Dedicated Host sizes operation response. DedicatedHostSizeListResult }
DedicatedHostsClientListAvailableSizesResponse contains the response from method DedicatedHostsClient.NewListAvailableSizesPager.
type DedicatedHostsClientListByHostGroupOptions ¶
type DedicatedHostsClientListByHostGroupOptions struct { }
DedicatedHostsClientListByHostGroupOptions contains the optional parameters for the DedicatedHostsClient.NewListByHostGroupPager method.
type DedicatedHostsClientListByHostGroupResponse ¶
type DedicatedHostsClientListByHostGroupResponse struct { // The list dedicated host operation response. DedicatedHostListResult }
DedicatedHostsClientListByHostGroupResponse contains the response from method DedicatedHostsClient.NewListByHostGroupPager.
type DedicatedHostsClientRedeployResponse ¶ added in v5.4.0
type DedicatedHostsClientRedeployResponse struct { }
DedicatedHostsClientRedeployResponse contains the response from method DedicatedHostsClient.BeginRedeploy.
type DedicatedHostsClientRestartResponse ¶
type DedicatedHostsClientRestartResponse struct { }
DedicatedHostsClientRestartResponse contains the response from method DedicatedHostsClient.BeginRestart.
type DedicatedHostsClientUpdateResponse ¶
type DedicatedHostsClientUpdateResponse struct { // Specifies information about the Dedicated host. DedicatedHost }
DedicatedHostsClientUpdateResponse contains the response from method DedicatedHostsClient.BeginUpdate.
type DeleteOptions ¶
type DeleteOptions string
DeleteOptions - Specify what happens to the network interface when the VM is deleted
const ( DeleteOptionsDelete DeleteOptions = "Delete" DeleteOptionsDetach DeleteOptions = "Detach" )
func PossibleDeleteOptionsValues ¶
func PossibleDeleteOptionsValues() []DeleteOptions
PossibleDeleteOptionsValues returns the possible values for the DeleteOptions const type.
type DiagnosticsProfile ¶
type DiagnosticsProfile struct { // Boot Diagnostics is a debugging feature which allows you to view Console Output and Screenshot to diagnose VM status. NOTE: // If storageUri is being specified then ensure that the storage account is in // the same region and subscription as the VM. You can easily view the output of your console log. Azure also enables you // to see a screenshot of the VM from the hypervisor. BootDiagnostics *BootDiagnostics }
DiagnosticsProfile - Specifies the boot diagnostic settings state. Minimum api-version: 2015-06-15.
func (DiagnosticsProfile) MarshalJSON ¶
func (d DiagnosticsProfile) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type DiagnosticsProfile.
func (*DiagnosticsProfile) UnmarshalJSON ¶
func (d *DiagnosticsProfile) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type DiagnosticsProfile.
type DiffDiskOptions ¶
type DiffDiskOptions string
DiffDiskOptions - Specifies the ephemeral disk option for operating system disk.
const (
DiffDiskOptionsLocal DiffDiskOptions = "Local"
)
func PossibleDiffDiskOptionsValues ¶
func PossibleDiffDiskOptionsValues() []DiffDiskOptions
PossibleDiffDiskOptionsValues returns the possible values for the DiffDiskOptions const type.
type DiffDiskPlacement ¶
type DiffDiskPlacement string
DiffDiskPlacement - Specifies the ephemeral disk placement for operating system disk. This property can be used by user in the request to choose the location i.e, cache disk, resource disk or nvme disk space for Ephemeral OS disk provisioning. For more information on Ephemeral OS disk size requirements, please refer Ephemeral OS disk size requirements for Windows VM at https://docs.microsoft.com/azure/virtual-machines/windows/ephemeral-os-disks#size-requirements and Linux VM at https://docs.microsoft.com/azure/virtual-machines/linux/ephemeral-os-disks#size-requirements. Minimum api-version for NvmeDisk: 2024-03-01.
const ( DiffDiskPlacementCacheDisk DiffDiskPlacement = "CacheDisk" DiffDiskPlacementNvmeDisk DiffDiskPlacement = "NvmeDisk" DiffDiskPlacementResourceDisk DiffDiskPlacement = "ResourceDisk" )
func PossibleDiffDiskPlacementValues ¶
func PossibleDiffDiskPlacementValues() []DiffDiskPlacement
PossibleDiffDiskPlacementValues returns the possible values for the DiffDiskPlacement const type.
type DiffDiskSettings ¶
type DiffDiskSettings struct { // Specifies the ephemeral disk settings for operating system disk. Option *DiffDiskOptions // Specifies the ephemeral disk placement for operating system disk. Possible values are: CacheDisk, ResourceDisk, NvmeDisk. // The defaulting behavior is: CacheDisk if one is configured for the VM size // otherwise ResourceDisk or NvmeDisk is used. Refer to the VM size documentation for Windows VM at https://docs.microsoft.com/azure/virtual-machines/windows/sizes // and Linux VM at // https://docs.microsoft.com/azure/virtual-machines/linux/sizes to check which VM sizes exposes a cache disk. Minimum api-version // for NvmeDisk: 2024-03-01. Placement *DiffDiskPlacement }
DiffDiskSettings - Describes the parameters of ephemeral disk settings that can be specified for operating system disk. Note: The ephemeral disk settings can only be specified for managed disk.
func (DiffDiskSettings) MarshalJSON ¶
func (d DiffDiskSettings) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type DiffDiskSettings.
func (*DiffDiskSettings) UnmarshalJSON ¶
func (d *DiffDiskSettings) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type DiffDiskSettings.
type Disallowed ¶
type Disallowed struct { // A list of disk types. DiskTypes []*string }
Disallowed - Describes the disallowed disk types.
func (Disallowed) MarshalJSON ¶
func (d Disallowed) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type Disallowed.
func (*Disallowed) UnmarshalJSON ¶
func (d *Disallowed) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type Disallowed.
type DisallowedConfiguration ¶
type DisallowedConfiguration struct { // VM disk types which are disallowed. VMDiskType *VMDiskTypes }
DisallowedConfiguration - Specifies the disallowed configuration for a virtual machine image.
func (DisallowedConfiguration) MarshalJSON ¶
func (d DisallowedConfiguration) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type DisallowedConfiguration.
func (*DisallowedConfiguration) UnmarshalJSON ¶
func (d *DisallowedConfiguration) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type DisallowedConfiguration.
type Disk ¶
type Disk struct { // REQUIRED; Resource location Location *string // The extended location where the disk will be created. Extended location cannot be changed. ExtendedLocation *ExtendedLocation // Disk resource properties. Properties *DiskProperties // The disks sku name. Can be StandardLRS, PremiumLRS, StandardSSDLRS, UltraSSDLRS, PremiumZRS, StandardSSDZRS, or PremiumV2_LRS. SKU *DiskSKU // Resource tags Tags map[string]*string // The Logical zone list for Disk. Zones []*string // READ-ONLY; Resource Id ID *string // READ-ONLY; A relative URI containing the ID of the VM that has the disk attached. ManagedBy *string // READ-ONLY; List of relative URIs containing the IDs of the VMs that have the disk attached. maxShares should be set to // a value greater than one for disks to allow attaching them to multiple VMs. ManagedByExtended []*string // READ-ONLY; Resource name Name *string // READ-ONLY; Resource type Type *string }
Disk resource.
func (Disk) MarshalJSON ¶
MarshalJSON implements the json.Marshaller interface for type Disk.
func (*Disk) UnmarshalJSON ¶
UnmarshalJSON implements the json.Unmarshaller interface for type Disk.
type DiskAccess ¶
type DiskAccess struct { // REQUIRED; Resource location Location *string // The extended location where the disk access will be created. Extended location cannot be changed. ExtendedLocation *ExtendedLocation Properties *DiskAccessProperties // Resource tags Tags map[string]*string // READ-ONLY; Resource Id ID *string // READ-ONLY; Resource name Name *string // READ-ONLY; Resource type Type *string }
DiskAccess - disk access resource.
func (DiskAccess) MarshalJSON ¶
func (d DiskAccess) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type DiskAccess.
func (*DiskAccess) UnmarshalJSON ¶
func (d *DiskAccess) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type DiskAccess.
type DiskAccessList ¶
type DiskAccessList struct { // REQUIRED; A list of disk access resources. Value []*DiskAccess // The uri to fetch the next page of disk access resources. Call ListNext() with this to fetch the next page of disk access // resources. NextLink *string }
DiskAccessList - The List disk access operation response.
func (DiskAccessList) MarshalJSON ¶
func (d DiskAccessList) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type DiskAccessList.
func (*DiskAccessList) UnmarshalJSON ¶
func (d *DiskAccessList) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type DiskAccessList.
type DiskAccessProperties ¶
type DiskAccessProperties struct { // READ-ONLY; A readonly collection of private endpoint connections created on the disk. Currently only one endpoint connection // is supported. PrivateEndpointConnections []*PrivateEndpointConnection // READ-ONLY; The disk access resource provisioning state. ProvisioningState *string // READ-ONLY; The time when the disk access was created. TimeCreated *time.Time }
func (DiskAccessProperties) MarshalJSON ¶
func (d DiskAccessProperties) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type DiskAccessProperties.
func (*DiskAccessProperties) UnmarshalJSON ¶
func (d *DiskAccessProperties) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type DiskAccessProperties.
type DiskAccessUpdate ¶
DiskAccessUpdate - Used for updating a disk access resource.
func (DiskAccessUpdate) MarshalJSON ¶
func (d DiskAccessUpdate) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type DiskAccessUpdate.
func (*DiskAccessUpdate) UnmarshalJSON ¶
func (d *DiskAccessUpdate) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type DiskAccessUpdate.
type DiskAccessesClient ¶
type DiskAccessesClient struct {
// contains filtered or unexported fields
}
DiskAccessesClient contains the methods for the DiskAccesses group. Don't use this type directly, use NewDiskAccessesClient() instead.
func NewDiskAccessesClient ¶
func NewDiskAccessesClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*DiskAccessesClient, error)
NewDiskAccessesClient creates a new instance of DiskAccessesClient 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 (*DiskAccessesClient) BeginCreateOrUpdate ¶
func (client *DiskAccessesClient) BeginCreateOrUpdate(ctx context.Context, resourceGroupName string, diskAccessName string, diskAccess DiskAccess, options *DiskAccessesClientBeginCreateOrUpdateOptions) (*runtime.Poller[DiskAccessesClientCreateOrUpdateResponse], error)
BeginCreateOrUpdate - Creates or updates a disk access resource If the operation fails it returns an *azcore.ResponseError type.
Generated from API version 2023-10-02
- resourceGroupName - The name of the resource group.
- diskAccessName - The name of the disk access resource that is being created. The name can't be changed after the disk encryption set is created. Supported characters for the name are a-z, A-Z, 0-9, _ and -. The maximum name length is 80 characters.
- diskAccess - disk access object supplied in the body of the Put disk access operation.
- options - DiskAccessesClientBeginCreateOrUpdateOptions contains the optional parameters for the DiskAccessesClient.BeginCreateOrUpdate method.
Example ¶
Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/92de53a5f1e0e03c94b40475d2135d97148ed014/specification/compute/resource-manager/Microsoft.Compute/DiskRP/stable/2023-10-02/examples/diskAccessExamples/DiskAccess_Create.json
cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() clientFactory, err := armcompute.NewClientFactory("<subscription-id>", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } poller, err := clientFactory.NewDiskAccessesClient().BeginCreateOrUpdate(ctx, "myResourceGroup", "myDiskAccess", armcompute.DiskAccess{ Location: to.Ptr("West US"), }, nil) if err != nil { log.Fatalf("failed to finish the request: %v", err) } res, err := poller.PollUntilDone(ctx, nil) if err != nil { log.Fatalf("failed to pull the result: %v", err) } // You could use response here. We use blank identifier for just demo purposes. _ = res // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. // res.DiskAccess = armcompute.DiskAccess{ // Name: to.Ptr("myDiskAccess"), // Type: to.Ptr("Microsoft.Compute/diskAccesses"), // ID: to.Ptr("/subscriptions/{subscription-id}/resourceGroups/myResourcegroup/providers/Microsoft.Compute/diskAccesses/myDiskAccess"), // Location: to.Ptr("West US"), // Properties: &armcompute.DiskAccessProperties{ // ProvisioningState: to.Ptr("Succeeded"), // TimeCreated: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-05-01T04:41:35.079Z"); return t}()), // }, // }
Output:
func (*DiskAccessesClient) BeginDelete ¶
func (client *DiskAccessesClient) BeginDelete(ctx context.Context, resourceGroupName string, diskAccessName string, options *DiskAccessesClientBeginDeleteOptions) (*runtime.Poller[DiskAccessesClientDeleteResponse], error)
BeginDelete - Deletes a disk access resource. If the operation fails it returns an *azcore.ResponseError type.
Generated from API version 2023-10-02
- resourceGroupName - The name of the resource group.
- diskAccessName - The name of the disk access resource that is being created. The name can't be changed after the disk encryption set is created. Supported characters for the name are a-z, A-Z, 0-9, _ and -. The maximum name length is 80 characters.
- options - DiskAccessesClientBeginDeleteOptions contains the optional parameters for the DiskAccessesClient.BeginDelete method.
Example ¶
Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/92de53a5f1e0e03c94b40475d2135d97148ed014/specification/compute/resource-manager/Microsoft.Compute/DiskRP/stable/2023-10-02/examples/diskAccessExamples/DiskAccess_Delete.json
cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() clientFactory, err := armcompute.NewClientFactory("<subscription-id>", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } poller, err := clientFactory.NewDiskAccessesClient().BeginDelete(ctx, "myResourceGroup", "myDiskAccess", nil) if err != nil { log.Fatalf("failed to finish the request: %v", err) } _, err = poller.PollUntilDone(ctx, nil) if err != nil { log.Fatalf("failed to pull the result: %v", err) }
Output:
func (*DiskAccessesClient) BeginDeleteAPrivateEndpointConnection ¶
func (client *DiskAccessesClient) BeginDeleteAPrivateEndpointConnection(ctx context.Context, resourceGroupName string, diskAccessName string, privateEndpointConnectionName string, options *DiskAccessesClientBeginDeleteAPrivateEndpointConnectionOptions) (*runtime.Poller[DiskAccessesClientDeleteAPrivateEndpointConnectionResponse], error)
BeginDeleteAPrivateEndpointConnection - Deletes a private endpoint connection under a disk access resource. If the operation fails it returns an *azcore.ResponseError type.
Generated from API version 2023-10-02
- resourceGroupName - The name of the resource group.
- diskAccessName - The name of the disk access resource that is being created. The name can't be changed after the disk encryption set is created. Supported characters for the name are a-z, A-Z, 0-9, _ and -. The maximum name length is 80 characters.
- privateEndpointConnectionName - The name of the private endpoint connection.
- options - DiskAccessesClientBeginDeleteAPrivateEndpointConnectionOptions contains the optional parameters for the DiskAccessesClient.BeginDeleteAPrivateEndpointConnection method.
Example ¶
Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/92de53a5f1e0e03c94b40475d2135d97148ed014/specification/compute/resource-manager/Microsoft.Compute/DiskRP/stable/2023-10-02/examples/diskAccessExamples/DiskAccessPrivateEndpointConnection_Delete.json
cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() clientFactory, err := armcompute.NewClientFactory("<subscription-id>", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } poller, err := clientFactory.NewDiskAccessesClient().BeginDeleteAPrivateEndpointConnection(ctx, "myResourceGroup", "myDiskAccess", "myPrivateEndpointConnection", nil) if err != nil { log.Fatalf("failed to finish the request: %v", err) } _, err = poller.PollUntilDone(ctx, nil) if err != nil { log.Fatalf("failed to pull the result: %v", err) }
Output:
func (*DiskAccessesClient) BeginUpdate ¶
func (client *DiskAccessesClient) BeginUpdate(ctx context.Context, resourceGroupName string, diskAccessName string, diskAccess DiskAccessUpdate, options *DiskAccessesClientBeginUpdateOptions) (*runtime.Poller[DiskAccessesClientUpdateResponse], error)
BeginUpdate - Updates (patches) a disk access resource. If the operation fails it returns an *azcore.ResponseError type.
Generated from API version 2023-10-02
- resourceGroupName - The name of the resource group.
- diskAccessName - The name of the disk access resource that is being created. The name can't be changed after the disk encryption set is created. Supported characters for the name are a-z, A-Z, 0-9, _ and -. The maximum name length is 80 characters.
- diskAccess - disk access object supplied in the body of the Patch disk access operation.
- options - DiskAccessesClientBeginUpdateOptions contains the optional parameters for the DiskAccessesClient.BeginUpdate method.
Example ¶
Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/92de53a5f1e0e03c94b40475d2135d97148ed014/specification/compute/resource-manager/Microsoft.Compute/DiskRP/stable/2023-10-02/examples/diskAccessExamples/DiskAccess_Update.json
cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() clientFactory, err := armcompute.NewClientFactory("<subscription-id>", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } poller, err := clientFactory.NewDiskAccessesClient().BeginUpdate(ctx, "myResourceGroup", "myDiskAccess", armcompute.DiskAccessUpdate{ Tags: map[string]*string{ "department": to.Ptr("Development"), "project": to.Ptr("PrivateEndpoints"), }, }, nil) if err != nil { log.Fatalf("failed to finish the request: %v", err) } res, err := poller.PollUntilDone(ctx, nil) if err != nil { log.Fatalf("failed to pull the result: %v", err) } // You could use response here. We use blank identifier for just demo purposes. _ = res // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. // res.DiskAccess = armcompute.DiskAccess{ // Name: to.Ptr("myDiskAccess"), // Type: to.Ptr("Microsoft.Compute/diskAccesses"), // ID: to.Ptr("/subscriptions/{subscription-id}/resourceGroups/myResourcegroup/providers/Microsoft.Compute/diskAccesses/myDiskAccess"), // Location: to.Ptr("West US"), // Tags: map[string]*string{ // "department": to.Ptr("Development"), // "project": to.Ptr("PrivateEndpoints"), // }, // }
Output:
func (*DiskAccessesClient) BeginUpdateAPrivateEndpointConnection ¶
func (client *DiskAccessesClient) BeginUpdateAPrivateEndpointConnection(ctx context.Context, resourceGroupName string, diskAccessName string, privateEndpointConnectionName string, privateEndpointConnection PrivateEndpointConnection, options *DiskAccessesClientBeginUpdateAPrivateEndpointConnectionOptions) (*runtime.Poller[DiskAccessesClientUpdateAPrivateEndpointConnectionResponse], error)
BeginUpdateAPrivateEndpointConnection - Approve or reject a private endpoint connection under disk access resource, this can't be used to create a new private endpoint connection. If the operation fails it returns an *azcore.ResponseError type.
Generated from API version 2023-10-02
- resourceGroupName - The name of the resource group.
- diskAccessName - The name of the disk access resource that is being created. The name can't be changed after the disk encryption set is created. Supported characters for the name are a-z, A-Z, 0-9, _ and -. The maximum name length is 80 characters.
- privateEndpointConnectionName - The name of the private endpoint connection.
- privateEndpointConnection - private endpoint connection object supplied in the body of the Put private endpoint connection operation.
- options - DiskAccessesClientBeginUpdateAPrivateEndpointConnectionOptions contains the optional parameters for the DiskAccessesClient.BeginUpdateAPrivateEndpointConnection method.
Example ¶
Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/92de53a5f1e0e03c94b40475d2135d97148ed014/specification/compute/resource-manager/Microsoft.Compute/DiskRP/stable/2023-10-02/examples/diskAccessExamples/DiskAccessPrivateEndpointConnection_Approve.json
cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() clientFactory, err := armcompute.NewClientFactory("<subscription-id>", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } poller, err := clientFactory.NewDiskAccessesClient().BeginUpdateAPrivateEndpointConnection(ctx, "myResourceGroup", "myDiskAccess", "myPrivateEndpointConnection", armcompute.PrivateEndpointConnection{ Properties: &armcompute.PrivateEndpointConnectionProperties{ PrivateLinkServiceConnectionState: &armcompute.PrivateLinkServiceConnectionState{ Description: to.Ptr("Approving myPrivateEndpointConnection"), Status: to.Ptr(armcompute.PrivateEndpointServiceConnectionStatusApproved), }, }, }, nil) if err != nil { log.Fatalf("failed to finish the request: %v", err) } res, err := poller.PollUntilDone(ctx, nil) if err != nil { log.Fatalf("failed to pull the result: %v", err) } // You could use response here. We use blank identifier for just demo purposes. _ = res // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. // res.PrivateEndpointConnection = armcompute.PrivateEndpointConnection{ // Name: to.Ptr("myPrivateEndpointConnectionName"), // Type: to.Ptr("Microsoft.Compute/diskAccesses/PrivateEndpointConnections"), // ID: to.Ptr("/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/diskAccesses/myDiskAccess/privateEndpoinConnections/myPrivateEndpointConnectionName"), // Properties: &armcompute.PrivateEndpointConnectionProperties{ // PrivateEndpoint: &armcompute.PrivateEndpoint{ // ID: to.Ptr("/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/privateEndpoints/myPrivateEndpoint"), // }, // PrivateLinkServiceConnectionState: &armcompute.PrivateLinkServiceConnectionState{ // Description: to.Ptr("Approving myPrivateEndpointConnection"), // ActionsRequired: to.Ptr("None"), // Status: to.Ptr(armcompute.PrivateEndpointServiceConnectionStatusApproved), // }, // ProvisioningState: to.Ptr(armcompute.PrivateEndpointConnectionProvisioningStateSucceeded), // }, // }
Output:
func (*DiskAccessesClient) Get ¶
func (client *DiskAccessesClient) Get(ctx context.Context, resourceGroupName string, diskAccessName string, options *DiskAccessesClientGetOptions) (DiskAccessesClientGetResponse, error)
Get - Gets information about a disk access resource. If the operation fails it returns an *azcore.ResponseError type.
Generated from API version 2023-10-02
- resourceGroupName - The name of the resource group.
- diskAccessName - The name of the disk access resource that is being created. The name can't be changed after the disk encryption set is created. Supported characters for the name are a-z, A-Z, 0-9, _ and -. The maximum name length is 80 characters.
- options - DiskAccessesClientGetOptions contains the optional parameters for the DiskAccessesClient.Get method.
Example (GetInformationAboutADiskAccessResource) ¶
Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/92de53a5f1e0e03c94b40475d2135d97148ed014/specification/compute/resource-manager/Microsoft.Compute/DiskRP/stable/2023-10-02/examples/diskAccessExamples/DiskAccess_Get.json
cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() clientFactory, err := armcompute.NewClientFactory("<subscription-id>", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } res, err := clientFactory.NewDiskAccessesClient().Get(ctx, "myResourceGroup", "myDiskAccess", nil) if err != nil { log.Fatalf("failed to finish the request: %v", err) } // You could use response here. We use blank identifier for just demo purposes. _ = res // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. // res.DiskAccess = armcompute.DiskAccess{ // Name: to.Ptr("myDiskAccess"), // Type: to.Ptr("Microsoft.Compute/diskAccesses"), // ID: to.Ptr("/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/diskAccesses/myDiskAccess"), // Location: to.Ptr("westus"), // Tags: map[string]*string{ // "department": to.Ptr("Development"), // "project": to.Ptr("PrivateEndpoints"), // }, // Properties: &armcompute.DiskAccessProperties{ // ProvisioningState: to.Ptr("Succeeded"), // TimeCreated: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-05-01T04:41:35.079Z"); return t}()), // }, // }
Output:
Example (GetInformationAboutADiskAccessResourceWithPrivateEndpoints) ¶
Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/92de53a5f1e0e03c94b40475d2135d97148ed014/specification/compute/resource-manager/Microsoft.Compute/DiskRP/stable/2023-10-02/examples/diskAccessExamples/DiskAccess_Get_WithPrivateEndpoints.json
cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() clientFactory, err := armcompute.NewClientFactory("<subscription-id>", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } res, err := clientFactory.NewDiskAccessesClient().Get(ctx, "myResourceGroup", "myDiskAccess", nil) if err != nil { log.Fatalf("failed to finish the request: %v", err) } // You could use response here. We use blank identifier for just demo purposes. _ = res // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. // res.DiskAccess = armcompute.DiskAccess{ // Name: to.Ptr("myDiskAccess"), // Type: to.Ptr("Microsoft.Compute/diskAccesses"), // ID: to.Ptr("/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/diskAccesses/myDiskAccess"), // Location: to.Ptr("westus"), // Tags: map[string]*string{ // "department": to.Ptr("Development"), // "project": to.Ptr("PrivateEndpoints"), // }, // Properties: &armcompute.DiskAccessProperties{ // PrivateEndpointConnections: []*armcompute.PrivateEndpointConnection{ // { // Name: to.Ptr("myDiskAccess.d4914cfa-6bc2-4049-a57c-3d1f622d8eef"), // Type: to.Ptr("Microsoft.Compute/diskAccesses/PrivateEndpointConnections"), // ID: to.Ptr("/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/diskAccesses/myDiskAccess/privateEndpoinConnections/myDiskAccess.d4914cfa-6bc2-4049-a57c-3d1f622d8eef"), // Properties: &armcompute.PrivateEndpointConnectionProperties{ // PrivateEndpoint: &armcompute.PrivateEndpoint{ // ID: to.Ptr("/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/privateEndpoints/myPrivateEndpoint"), // }, // PrivateLinkServiceConnectionState: &armcompute.PrivateLinkServiceConnectionState{ // Description: to.Ptr("Auto-Approved"), // ActionsRequired: to.Ptr("None"), // Status: to.Ptr(armcompute.PrivateEndpointServiceConnectionStatusApproved), // }, // ProvisioningState: to.Ptr(armcompute.PrivateEndpointConnectionProvisioningStateSucceeded), // }, // }}, // ProvisioningState: to.Ptr("Succeeded"), // TimeCreated: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-05-01T04:41:35.079Z"); return t}()), // }, // }
Output:
func (*DiskAccessesClient) GetAPrivateEndpointConnection ¶
func (client *DiskAccessesClient) GetAPrivateEndpointConnection(ctx context.Context, resourceGroupName string, diskAccessName string, privateEndpointConnectionName string, options *DiskAccessesClientGetAPrivateEndpointConnectionOptions) (DiskAccessesClientGetAPrivateEndpointConnectionResponse, error)
GetAPrivateEndpointConnection - Gets information about a private endpoint connection under a disk access resource. If the operation fails it returns an *azcore.ResponseError type.
Generated from API version 2023-10-02
- resourceGroupName - The name of the resource group.
- diskAccessName - The name of the disk access resource that is being created. The name can't be changed after the disk encryption set is created. Supported characters for the name are a-z, A-Z, 0-9, _ and -. The maximum name length is 80 characters.
- privateEndpointConnectionName - The name of the private endpoint connection.
- options - DiskAccessesClientGetAPrivateEndpointConnectionOptions contains the optional parameters for the DiskAccessesClient.GetAPrivateEndpointConnection method.
Example ¶
Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/92de53a5f1e0e03c94b40475d2135d97148ed014/specification/compute/resource-manager/Microsoft.Compute/DiskRP/stable/2023-10-02/examples/diskAccessExamples/DiskAccessPrivateEndpointConnection_Get.json
cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() clientFactory, err := armcompute.NewClientFactory("<subscription-id>", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } res, err := clientFactory.NewDiskAccessesClient().GetAPrivateEndpointConnection(ctx, "myResourceGroup", "myDiskAccess", "myPrivateEndpointConnection", nil) if err != nil { log.Fatalf("failed to finish the request: %v", err) } // You could use response here. We use blank identifier for just demo purposes. _ = res // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. // res.PrivateEndpointConnection = armcompute.PrivateEndpointConnection{ // Name: to.Ptr("myPrivateEndpointConnection"), // Type: to.Ptr("Microsoft.Compute/diskAccesses/PrivateEndpointConnections"), // ID: to.Ptr("/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/diskAccesses/myDiskAccess/privateEndpoinConnections/myPrivateEndpointConnection"), // Properties: &armcompute.PrivateEndpointConnectionProperties{ // PrivateEndpoint: &armcompute.PrivateEndpoint{ // ID: to.Ptr("/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/privateEndpoints/myPrivateEndpoint"), // }, // PrivateLinkServiceConnectionState: &armcompute.PrivateLinkServiceConnectionState{ // Description: to.Ptr("Auto-Approved"), // ActionsRequired: to.Ptr("None"), // Status: to.Ptr(armcompute.PrivateEndpointServiceConnectionStatusApproved), // }, // ProvisioningState: to.Ptr(armcompute.PrivateEndpointConnectionProvisioningStateSucceeded), // }, // }
Output:
func (*DiskAccessesClient) GetPrivateLinkResources ¶
func (client *DiskAccessesClient) GetPrivateLinkResources(ctx context.Context, resourceGroupName string, diskAccessName string, options *DiskAccessesClientGetPrivateLinkResourcesOptions) (DiskAccessesClientGetPrivateLinkResourcesResponse, error)
GetPrivateLinkResources - Gets the private link resources possible under disk access resource If the operation fails it returns an *azcore.ResponseError type.
Generated from API version 2023-10-02
- resourceGroupName - The name of the resource group.
- diskAccessName - The name of the disk access resource that is being created. The name can't be changed after the disk encryption set is created. Supported characters for the name are a-z, A-Z, 0-9, _ and -. The maximum name length is 80 characters.
- options - DiskAccessesClientGetPrivateLinkResourcesOptions contains the optional parameters for the DiskAccessesClient.GetPrivateLinkResources method.
Example ¶
Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/92de53a5f1e0e03c94b40475d2135d97148ed014/specification/compute/resource-manager/Microsoft.Compute/DiskRP/stable/2023-10-02/examples/diskAccessExamples/DiskAccessPrivateLinkResources_Get.json
cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() clientFactory, err := armcompute.NewClientFactory("<subscription-id>", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } res, err := clientFactory.NewDiskAccessesClient().GetPrivateLinkResources(ctx, "myResourceGroup", "myDiskAccess", nil) if err != nil { log.Fatalf("failed to finish the request: %v", err) } // You could use response here. We use blank identifier for just demo purposes. _ = res // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. // res.PrivateLinkResourceListResult = armcompute.PrivateLinkResourceListResult{ // Value: []*armcompute.PrivateLinkResource{ // { // Name: to.Ptr("disks"), // Type: to.Ptr("Microsoft.Compute/diskAccesses/privateLinkResources"), // ID: to.Ptr("/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/diskAccesses/myDiskAccess/privateLinkResources/disks"), // Properties: &armcompute.PrivateLinkResourceProperties{ // GroupID: to.Ptr("disks"), // RequiredMembers: []*string{ // to.Ptr("diskAccess_1")}, // RequiredZoneNames: []*string{ // to.Ptr("privatelink.blob.core.windows.net")}, // }, // }}, // }
Output:
func (*DiskAccessesClient) NewListByResourceGroupPager ¶
func (client *DiskAccessesClient) NewListByResourceGroupPager(resourceGroupName string, options *DiskAccessesClientListByResourceGroupOptions) *runtime.Pager[DiskAccessesClientListByResourceGroupResponse]
NewListByResourceGroupPager - Lists all the disk access resources under a resource group.
Generated from API version 2023-10-02
- resourceGroupName - The name of the resource group.
- options - DiskAccessesClientListByResourceGroupOptions contains the optional parameters for the DiskAccessesClient.NewListByResourceGroupPager method.
Example ¶
Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/92de53a5f1e0e03c94b40475d2135d97148ed014/specification/compute/resource-manager/Microsoft.Compute/DiskRP/stable/2023-10-02/examples/diskAccessExamples/DiskAccess_ListByResourceGroup.json
cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() clientFactory, err := armcompute.NewClientFactory("<subscription-id>", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } pager := clientFactory.NewDiskAccessesClient().NewListByResourceGroupPager("myResourceGroup", nil) for pager.More() { page, err := pager.NextPage(ctx) if err != nil { log.Fatalf("failed to advance page: %v", err) } for _, v := range page.Value { // You could use page here. We use blank identifier for just demo purposes. _ = v } // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. // page.DiskAccessList = armcompute.DiskAccessList{ // Value: []*armcompute.DiskAccess{ // { // Name: to.Ptr("myDiskAccess"), // Type: to.Ptr("Microsoft.Compute/diskAccesses"), // ID: to.Ptr("/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/diskAccesses/myDiskAccess"), // Location: to.Ptr("westus"), // Tags: map[string]*string{ // "department": to.Ptr("Development"), // "project": to.Ptr("PrivateEndpoints"), // }, // Properties: &armcompute.DiskAccessProperties{ // ProvisioningState: to.Ptr("Succeeded"), // TimeCreated: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-05-01T04:41:35.079Z"); return t}()), // }, // }, // { // Name: to.Ptr("myDiskAccess2"), // Type: to.Ptr("Microsoft.Compute/diskAccesses"), // ID: to.Ptr("/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/diskAccesses/myDiskAccess2"), // Location: to.Ptr("westus"), // Tags: map[string]*string{ // "department": to.Ptr("Development"), // "project": to.Ptr("PrivateEndpoints"), // }, // Properties: &armcompute.DiskAccessProperties{ // PrivateEndpointConnections: []*armcompute.PrivateEndpointConnection{ // { // Name: to.Ptr("myDiskAccess.d4914cfa-6bc2-4049-a57c-3d1f622d8eef"), // Type: to.Ptr("Microsoft.Compute/diskAccesses/PrivateEndpointConnections"), // ID: to.Ptr("/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/diskAccesses/myDiskAccess2/privateEndpoinConnections/myDiskAccess2.d4914cfa-6bc2-4049-a57c-3d1f622d8eef"), // Properties: &armcompute.PrivateEndpointConnectionProperties{ // PrivateEndpoint: &armcompute.PrivateEndpoint{ // ID: to.Ptr("/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/privateEndpoints/myPrivateEndpoint2"), // }, // PrivateLinkServiceConnectionState: &armcompute.PrivateLinkServiceConnectionState{ // Description: to.Ptr("Auto-Approved"), // ActionsRequired: to.Ptr("None"), // Status: to.Ptr(armcompute.PrivateEndpointServiceConnectionStatusApproved), // }, // ProvisioningState: to.Ptr(armcompute.PrivateEndpointConnectionProvisioningStateSucceeded), // }, // }}, // ProvisioningState: to.Ptr("Succeeded"), // TimeCreated: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-05-01T04:41:35.079Z"); return t}()), // }, // }}, // } }
Output:
func (*DiskAccessesClient) NewListPager ¶
func (client *DiskAccessesClient) NewListPager(options *DiskAccessesClientListOptions) *runtime.Pager[DiskAccessesClientListResponse]
NewListPager - Lists all the disk access resources under a subscription.
Generated from API version 2023-10-02
- options - DiskAccessesClientListOptions contains the optional parameters for the DiskAccessesClient.NewListPager method.
Example ¶
Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/92de53a5f1e0e03c94b40475d2135d97148ed014/specification/compute/resource-manager/Microsoft.Compute/DiskRP/stable/2023-10-02/examples/diskAccessExamples/DiskAccess_ListBySubscription.json
cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() clientFactory, err := armcompute.NewClientFactory("<subscription-id>", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } pager := clientFactory.NewDiskAccessesClient().NewListPager(nil) for pager.More() { page, err := pager.NextPage(ctx) if err != nil { log.Fatalf("failed to advance page: %v", err) } for _, v := range page.Value { // You could use page here. We use blank identifier for just demo purposes. _ = v } // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. // page.DiskAccessList = armcompute.DiskAccessList{ // Value: []*armcompute.DiskAccess{ // { // Name: to.Ptr("myDiskAccess"), // Type: to.Ptr("Microsoft.Compute/diskAccesses"), // ID: to.Ptr("/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/diskAccesses/myDiskAccess"), // Location: to.Ptr("westus"), // Tags: map[string]*string{ // "department": to.Ptr("Development"), // "project": to.Ptr("PrivateEndpoints"), // }, // Properties: &armcompute.DiskAccessProperties{ // ProvisioningState: to.Ptr("Succeeded"), // TimeCreated: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-05-01T04:41:35.079Z"); return t}()), // }, // }, // { // Name: to.Ptr("myDiskAccess2"), // Type: to.Ptr("Microsoft.Compute/diskAccesses"), // ID: to.Ptr("/subscriptions/{subscription-id}/resourceGroups/mySecondResourceGroup/providers/Microsoft.Compute/diskAccesses/myDiskAccess2"), // Location: to.Ptr("westus"), // Tags: map[string]*string{ // "department": to.Ptr("Development"), // "project": to.Ptr("PrivateEndpoints"), // }, // Properties: &armcompute.DiskAccessProperties{ // PrivateEndpointConnections: []*armcompute.PrivateEndpointConnection{ // { // Name: to.Ptr("myDiskAccess.d4914cfa-6bc2-4049-a57c-3d1f622d8eef"), // Type: to.Ptr("Microsoft.Compute/diskAccesses/PrivateEndpointConnections"), // ID: to.Ptr("/subscriptions/{subscription-id}/resourceGroups/mySecondResourceGroup/providers/Microsoft.Compute/diskAccesses/myDiskAccess2/privateEndpoinConnections/myDiskAccess2.d4914cfa-6bc2-4049-a57c-3d1f622d8eef"), // Properties: &armcompute.PrivateEndpointConnectionProperties{ // PrivateEndpoint: &armcompute.PrivateEndpoint{ // ID: to.Ptr("/subscriptions/{subscription-id}/resourceGroups/mySecondResourceGroup/providers/Microsoft.Network/privateEndpoints/myPrivateEndpoint2"), // }, // PrivateLinkServiceConnectionState: &armcompute.PrivateLinkServiceConnectionState{ // Description: to.Ptr("Auto-Approved"), // ActionsRequired: to.Ptr("None"), // Status: to.Ptr(armcompute.PrivateEndpointServiceConnectionStatusApproved), // }, // ProvisioningState: to.Ptr(armcompute.PrivateEndpointConnectionProvisioningStateSucceeded), // }, // }}, // ProvisioningState: to.Ptr("Succeeded"), // TimeCreated: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-05-01T04:41:35.079Z"); return t}()), // }, // }}, // } }
Output:
func (*DiskAccessesClient) NewListPrivateEndpointConnectionsPager ¶
func (client *DiskAccessesClient) NewListPrivateEndpointConnectionsPager(resourceGroupName string, diskAccessName string, options *DiskAccessesClientListPrivateEndpointConnectionsOptions) *runtime.Pager[DiskAccessesClientListPrivateEndpointConnectionsResponse]
NewListPrivateEndpointConnectionsPager - List information about private endpoint connections under a disk access resource
Generated from API version 2023-10-02
- resourceGroupName - The name of the resource group.
- diskAccessName - The name of the disk access resource that is being created. The name can't be changed after the disk encryption set is created. Supported characters for the name are a-z, A-Z, 0-9, _ and -. The maximum name length is 80 characters.
- options - DiskAccessesClientListPrivateEndpointConnectionsOptions contains the optional parameters for the DiskAccessesClient.NewListPrivateEndpointConnectionsPager method.
Example ¶
Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/92de53a5f1e0e03c94b40475d2135d97148ed014/specification/compute/resource-manager/Microsoft.Compute/DiskRP/stable/2023-10-02/examples/diskAccessExamples/DiskAccessPrivateEndpointConnection_ListByDiskAccess.json
cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() clientFactory, err := armcompute.NewClientFactory("<subscription-id>", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } pager := clientFactory.NewDiskAccessesClient().NewListPrivateEndpointConnectionsPager("myResourceGroup", "myDiskAccess", nil) for pager.More() { page, err := pager.NextPage(ctx) if err != nil { log.Fatalf("failed to advance page: %v", err) } for _, v := range page.Value { // You could use page here. We use blank identifier for just demo purposes. _ = v } // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. // page.PrivateEndpointConnectionListResult = armcompute.PrivateEndpointConnectionListResult{ // Value: []*armcompute.PrivateEndpointConnection{ // { // Name: to.Ptr("myPrivateEndpointConnection"), // Type: to.Ptr("Microsoft.Compute/diskAccesses/PrivateEndpointConnections"), // ID: to.Ptr("/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/diskAccesses/myDiskAccess/privateEndpoinConnections/myPrivateEndpointConnection"), // Properties: &armcompute.PrivateEndpointConnectionProperties{ // PrivateEndpoint: &armcompute.PrivateEndpoint{ // ID: to.Ptr("/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/privateEndpoints/myPrivateEndpoint"), // }, // PrivateLinkServiceConnectionState: &armcompute.PrivateLinkServiceConnectionState{ // Description: to.Ptr("Auto-Approved"), // ActionsRequired: to.Ptr("None"), // Status: to.Ptr(armcompute.PrivateEndpointServiceConnectionStatusApproved), // }, // ProvisioningState: to.Ptr(armcompute.PrivateEndpointConnectionProvisioningStateSucceeded), // }, // }}, // } }
Output:
type DiskAccessesClientBeginCreateOrUpdateOptions ¶
type DiskAccessesClientBeginCreateOrUpdateOptions struct { // Resumes the LRO from the provided token. ResumeToken string }
DiskAccessesClientBeginCreateOrUpdateOptions contains the optional parameters for the DiskAccessesClient.BeginCreateOrUpdate method.
type DiskAccessesClientBeginDeleteAPrivateEndpointConnectionOptions ¶
type DiskAccessesClientBeginDeleteAPrivateEndpointConnectionOptions struct { // Resumes the LRO from the provided token. ResumeToken string }
DiskAccessesClientBeginDeleteAPrivateEndpointConnectionOptions contains the optional parameters for the DiskAccessesClient.BeginDeleteAPrivateEndpointConnection method.
type DiskAccessesClientBeginDeleteOptions ¶
type DiskAccessesClientBeginDeleteOptions struct { // Resumes the LRO from the provided token. ResumeToken string }
DiskAccessesClientBeginDeleteOptions contains the optional parameters for the DiskAccessesClient.BeginDelete method.
type DiskAccessesClientBeginUpdateAPrivateEndpointConnectionOptions ¶
type DiskAccessesClientBeginUpdateAPrivateEndpointConnectionOptions struct { // Resumes the LRO from the provided token. ResumeToken string }
DiskAccessesClientBeginUpdateAPrivateEndpointConnectionOptions contains the optional parameters for the DiskAccessesClient.BeginUpdateAPrivateEndpointConnection method.
type DiskAccessesClientBeginUpdateOptions ¶
type DiskAccessesClientBeginUpdateOptions struct { // Resumes the LRO from the provided token. ResumeToken string }
DiskAccessesClientBeginUpdateOptions contains the optional parameters for the DiskAccessesClient.BeginUpdate method.
type DiskAccessesClientCreateOrUpdateResponse ¶
type DiskAccessesClientCreateOrUpdateResponse struct { // disk access resource. DiskAccess }
DiskAccessesClientCreateOrUpdateResponse contains the response from method DiskAccessesClient.BeginCreateOrUpdate.
type DiskAccessesClientDeleteAPrivateEndpointConnectionResponse ¶
type DiskAccessesClientDeleteAPrivateEndpointConnectionResponse struct { }
DiskAccessesClientDeleteAPrivateEndpointConnectionResponse contains the response from method DiskAccessesClient.BeginDeleteAPrivateEndpointConnection.
type DiskAccessesClientDeleteResponse ¶
type DiskAccessesClientDeleteResponse struct { }
DiskAccessesClientDeleteResponse contains the response from method DiskAccessesClient.BeginDelete.
type DiskAccessesClientGetAPrivateEndpointConnectionOptions ¶
type DiskAccessesClientGetAPrivateEndpointConnectionOptions struct { }
DiskAccessesClientGetAPrivateEndpointConnectionOptions contains the optional parameters for the DiskAccessesClient.GetAPrivateEndpointConnection method.
type DiskAccessesClientGetAPrivateEndpointConnectionResponse ¶
type DiskAccessesClientGetAPrivateEndpointConnectionResponse struct { // The Private Endpoint Connection resource. PrivateEndpointConnection }
DiskAccessesClientGetAPrivateEndpointConnectionResponse contains the response from method DiskAccessesClient.GetAPrivateEndpointConnection.
type DiskAccessesClientGetOptions ¶
type DiskAccessesClientGetOptions struct { }
DiskAccessesClientGetOptions contains the optional parameters for the DiskAccessesClient.Get method.
type DiskAccessesClientGetPrivateLinkResourcesOptions ¶
type DiskAccessesClientGetPrivateLinkResourcesOptions struct { }
DiskAccessesClientGetPrivateLinkResourcesOptions contains the optional parameters for the DiskAccessesClient.GetPrivateLinkResources method.
type DiskAccessesClientGetPrivateLinkResourcesResponse ¶
type DiskAccessesClientGetPrivateLinkResourcesResponse struct { // A list of private link resources PrivateLinkResourceListResult }
DiskAccessesClientGetPrivateLinkResourcesResponse contains the response from method DiskAccessesClient.GetPrivateLinkResources.
type DiskAccessesClientGetResponse ¶
type DiskAccessesClientGetResponse struct { // disk access resource. DiskAccess }
DiskAccessesClientGetResponse contains the response from method DiskAccessesClient.Get.
type DiskAccessesClientListByResourceGroupOptions ¶
type DiskAccessesClientListByResourceGroupOptions struct { }
DiskAccessesClientListByResourceGroupOptions contains the optional parameters for the DiskAccessesClient.NewListByResourceGroupPager method.
type DiskAccessesClientListByResourceGroupResponse ¶
type DiskAccessesClientListByResourceGroupResponse struct { // The List disk access operation response. DiskAccessList }
DiskAccessesClientListByResourceGroupResponse contains the response from method DiskAccessesClient.NewListByResourceGroupPager.
type DiskAccessesClientListOptions ¶
type DiskAccessesClientListOptions struct { }
DiskAccessesClientListOptions contains the optional parameters for the DiskAccessesClient.NewListPager method.
type DiskAccessesClientListPrivateEndpointConnectionsOptions ¶
type DiskAccessesClientListPrivateEndpointConnectionsOptions struct { }
DiskAccessesClientListPrivateEndpointConnectionsOptions contains the optional parameters for the DiskAccessesClient.NewListPrivateEndpointConnectionsPager method.
type DiskAccessesClientListPrivateEndpointConnectionsResponse ¶
type DiskAccessesClientListPrivateEndpointConnectionsResponse struct { // A list of private link resources PrivateEndpointConnectionListResult }
DiskAccessesClientListPrivateEndpointConnectionsResponse contains the response from method DiskAccessesClient.NewListPrivateEndpointConnectionsPager.
type DiskAccessesClientListResponse ¶
type DiskAccessesClientListResponse struct { // The List disk access operation response. DiskAccessList }
DiskAccessesClientListResponse contains the response from method DiskAccessesClient.NewListPager.
type DiskAccessesClientUpdateAPrivateEndpointConnectionResponse ¶
type DiskAccessesClientUpdateAPrivateEndpointConnectionResponse struct { // The Private Endpoint Connection resource. PrivateEndpointConnection }
DiskAccessesClientUpdateAPrivateEndpointConnectionResponse contains the response from method DiskAccessesClient.BeginUpdateAPrivateEndpointConnection.
type DiskAccessesClientUpdateResponse ¶
type DiskAccessesClientUpdateResponse struct { // disk access resource. DiskAccess }
DiskAccessesClientUpdateResponse contains the response from method DiskAccessesClient.BeginUpdate.
type DiskControllerTypes ¶
type DiskControllerTypes string
DiskControllerTypes - Specifies the disk controller type configured for the VM and VirtualMachineScaleSet. This property is only supported for virtual machines whose operating system disk and VM sku supports Generation 2 (https://docs.microsoft.com/en-us/azure/virtual-machines/generation-2), please check the HyperVGenerations capability returned as part of VM sku capabilities in the response of Microsoft.Compute SKUs api for the region contains V2 (https://docs.microsoft.com/rest/api/compute/resourceskus/list). For more information about Disk Controller Types supported please refer to https://aka.ms/azure-diskcontrollertypes.
const ( DiskControllerTypesNVMe DiskControllerTypes = "NVMe" DiskControllerTypesSCSI DiskControllerTypes = "SCSI" )
func PossibleDiskControllerTypesValues ¶
func PossibleDiskControllerTypesValues() []DiskControllerTypes
PossibleDiskControllerTypesValues returns the possible values for the DiskControllerTypes const type.
type DiskCreateOption ¶
type DiskCreateOption string
DiskCreateOption - This enumerates the possible sources of a disk's creation.
const ( // DiskCreateOptionAttach - Disk will be attached to a VM. DiskCreateOptionAttach DiskCreateOption = "Attach" // DiskCreateOptionCopy - Create a new disk or snapshot by copying from a disk or snapshot specified by the given sourceResourceId. DiskCreateOptionCopy DiskCreateOption = "Copy" // DiskCreateOptionCopyFromSanSnapshot - Create a new disk by exporting from elastic san volume snapshot DiskCreateOptionCopyFromSanSnapshot DiskCreateOption = "CopyFromSanSnapshot" // DiskCreateOptionCopyStart - Create a new disk by using a deep copy process, where the resource creation is considered complete // only after all data has been copied from the source. DiskCreateOptionCopyStart DiskCreateOption = "CopyStart" // DiskCreateOptionEmpty - Create an empty data disk of a size given by diskSizeGB. DiskCreateOptionEmpty DiskCreateOption = "Empty" // DiskCreateOptionFromImage - Create a new disk from a platform image specified by the given imageReference or galleryImageReference. DiskCreateOptionFromImage DiskCreateOption = "FromImage" // DiskCreateOptionImport - Create a disk by importing from a blob specified by a sourceUri in a storage account specified // by storageAccountId. DiskCreateOptionImport DiskCreateOption = "Import" // DiskCreateOptionImportSecure - Similar to Import create option. Create a new Trusted Launch VM or Confidential VM supported // disk by importing additional blob for VM guest state specified by securityDataUri in storage account specified by storageAccountId DiskCreateOptionImportSecure DiskCreateOption = "ImportSecure" // DiskCreateOptionRestore - Create a new disk by copying from a backup recovery point. DiskCreateOptionRestore DiskCreateOption = "Restore" // DiskCreateOptionUpload - Create a new disk by obtaining a write token and using it to directly upload the contents of the // disk. DiskCreateOptionUpload DiskCreateOption = "Upload" // DiskCreateOptionUploadPreparedSecure - Similar to Upload create option. Create a new Trusted Launch VM or Confidential // VM supported disk and upload using write token in both disk and VM guest state DiskCreateOptionUploadPreparedSecure DiskCreateOption = "UploadPreparedSecure" )
func PossibleDiskCreateOptionValues ¶
func PossibleDiskCreateOptionValues() []DiskCreateOption
PossibleDiskCreateOptionValues returns the possible values for the DiskCreateOption const type.
type DiskCreateOptionTypes ¶
type DiskCreateOptionTypes string
DiskCreateOptionTypes - Specifies how the virtual machine disk should be created. Possible values are Attach: This value is used when you are using a specialized disk to create the virtual machine. FromImage: This value is used when you are using an image to create the virtual machine. If you are using a platform image, you should also use the imageReference element described above. If you are using a marketplace image, you should also use the plan element previously described. Empty: This value is used when creating an empty data disk. Copy: This value is used to create a data disk from a snapshot or another disk. Restore: This value is used to create a data disk from a disk restore point.
const ( DiskCreateOptionTypesAttach DiskCreateOptionTypes = "Attach" DiskCreateOptionTypesCopy DiskCreateOptionTypes = "Copy" DiskCreateOptionTypesEmpty DiskCreateOptionTypes = "Empty" DiskCreateOptionTypesFromImage DiskCreateOptionTypes = "FromImage" DiskCreateOptionTypesRestore DiskCreateOptionTypes = "Restore" )
func PossibleDiskCreateOptionTypesValues ¶
func PossibleDiskCreateOptionTypesValues() []DiskCreateOptionTypes
PossibleDiskCreateOptionTypesValues returns the possible values for the DiskCreateOptionTypes const type.
type DiskDeleteOptionTypes ¶
type DiskDeleteOptionTypes string
DiskDeleteOptionTypes - Specifies the behavior of the managed disk when the VM gets deleted, for example whether the managed disk is deleted or detached. Supported values are: Delete. If this value is used, the managed disk is deleted when VM gets deleted. Detach. If this value is used, the managed disk is retained after VM gets deleted. Minimum api-version: 2021-03-01.
const ( DiskDeleteOptionTypesDelete DiskDeleteOptionTypes = "Delete" DiskDeleteOptionTypesDetach DiskDeleteOptionTypes = "Detach" )
func PossibleDiskDeleteOptionTypesValues ¶
func PossibleDiskDeleteOptionTypesValues() []DiskDeleteOptionTypes
PossibleDiskDeleteOptionTypesValues returns the possible values for the DiskDeleteOptionTypes const type.
type DiskDetachOptionTypes ¶
type DiskDetachOptionTypes string
DiskDetachOptionTypes - Specifies the detach behavior to be used while detaching a disk or which is already in the process of detachment from the virtual machine. Supported values are: ForceDetach. detachOption: ForceDetach is applicable only for managed data disks. If a previous detachment attempt of the data disk did not complete due to an unexpected failure from the virtual machine and the disk is still not released then use force-detach as a last resort option to detach the disk forcibly from the VM. All writes might not have been flushed when using this detach behavior. This feature is still in preview mode and is not supported for VirtualMachineScaleSet. To force-detach a data disk update toBeDetached to 'true' along with setting detachOption: 'ForceDetach'.
const (
DiskDetachOptionTypesForceDetach DiskDetachOptionTypes = "ForceDetach"
)
func PossibleDiskDetachOptionTypesValues ¶
func PossibleDiskDetachOptionTypesValues() []DiskDetachOptionTypes
PossibleDiskDetachOptionTypesValues returns the possible values for the DiskDetachOptionTypes const type.
type DiskEncryptionSet ¶
type DiskEncryptionSet struct { // REQUIRED; Resource location Location *string // The managed identity for the disk encryption set. It should be given permission on the key vault before it can be used // to encrypt disks. Identity *EncryptionSetIdentity Properties *EncryptionSetProperties // Resource tags Tags map[string]*string // READ-ONLY; Resource Id ID *string // READ-ONLY; Resource name Name *string // READ-ONLY; Resource type Type *string }
DiskEncryptionSet - disk encryption set resource.
func (DiskEncryptionSet) MarshalJSON ¶
func (d DiskEncryptionSet) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type DiskEncryptionSet.
func (*DiskEncryptionSet) UnmarshalJSON ¶
func (d *DiskEncryptionSet) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type DiskEncryptionSet.
type DiskEncryptionSetIdentityType ¶
type DiskEncryptionSetIdentityType string
DiskEncryptionSetIdentityType - The type of Managed Identity used by the DiskEncryptionSet. Only SystemAssigned is supported for new creations. Disk Encryption Sets can be updated with Identity type None during migration of subscription to a new Azure Active Directory tenant; it will cause the encrypted resources to lose access to the keys.
const ( DiskEncryptionSetIdentityTypeNone DiskEncryptionSetIdentityType = "None" DiskEncryptionSetIdentityTypeSystemAssigned DiskEncryptionSetIdentityType = "SystemAssigned" DiskEncryptionSetIdentityTypeSystemAssignedUserAssigned DiskEncryptionSetIdentityType = "SystemAssigned, UserAssigned" DiskEncryptionSetIdentityTypeUserAssigned DiskEncryptionSetIdentityType = "UserAssigned" )
func PossibleDiskEncryptionSetIdentityTypeValues ¶
func PossibleDiskEncryptionSetIdentityTypeValues() []DiskEncryptionSetIdentityType
PossibleDiskEncryptionSetIdentityTypeValues returns the possible values for the DiskEncryptionSetIdentityType const type.
type DiskEncryptionSetList ¶
type DiskEncryptionSetList struct { // REQUIRED; A list of disk encryption sets. Value []*DiskEncryptionSet // The uri to fetch the next page of disk encryption sets. Call ListNext() with this to fetch the next page of disk encryption // sets. NextLink *string }
DiskEncryptionSetList - The List disk encryption set operation response.
func (DiskEncryptionSetList) MarshalJSON ¶
func (d DiskEncryptionSetList) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type DiskEncryptionSetList.
func (*DiskEncryptionSetList) UnmarshalJSON ¶
func (d *DiskEncryptionSetList) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type DiskEncryptionSetList.
type DiskEncryptionSetParameters ¶
type DiskEncryptionSetParameters struct { // Resource Id ID *string }
DiskEncryptionSetParameters - Describes the parameter of customer managed disk encryption set resource id that can be specified for disk. Note: The disk encryption set resource id can only be specified for managed disk. Please refer https://aka.ms/mdssewithcmkoverview for more details.
func (DiskEncryptionSetParameters) MarshalJSON ¶
func (d DiskEncryptionSetParameters) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type DiskEncryptionSetParameters.
func (*DiskEncryptionSetParameters) UnmarshalJSON ¶
func (d *DiskEncryptionSetParameters) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type DiskEncryptionSetParameters.
type DiskEncryptionSetType ¶
type DiskEncryptionSetType string
DiskEncryptionSetType - The type of key used to encrypt the data of the disk.
const ( // DiskEncryptionSetTypeConfidentialVMEncryptedWithCustomerKey - Confidential VM supported disk and VM guest state would be // encrypted with customer managed key. DiskEncryptionSetTypeConfidentialVMEncryptedWithCustomerKey DiskEncryptionSetType = "ConfidentialVmEncryptedWithCustomerKey" // DiskEncryptionSetTypeEncryptionAtRestWithCustomerKey - Resource using diskEncryptionSet would be encrypted at rest with // Customer managed key that can be changed and revoked by a customer. DiskEncryptionSetTypeEncryptionAtRestWithCustomerKey DiskEncryptionSetType = "EncryptionAtRestWithCustomerKey" // DiskEncryptionSetTypeEncryptionAtRestWithPlatformAndCustomerKeys - Resource using diskEncryptionSet would be encrypted // at rest with two layers of encryption. One of the keys is Customer managed and the other key is Platform managed. DiskEncryptionSetTypeEncryptionAtRestWithPlatformAndCustomerKeys DiskEncryptionSetType = "EncryptionAtRestWithPlatformAndCustomerKeys" )
func PossibleDiskEncryptionSetTypeValues ¶
func PossibleDiskEncryptionSetTypeValues() []DiskEncryptionSetType
PossibleDiskEncryptionSetTypeValues returns the possible values for the DiskEncryptionSetType const type.
type DiskEncryptionSetUpdate ¶
type DiskEncryptionSetUpdate struct { // The managed identity for the disk encryption set. It should be given permission on the key vault before it can be used // to encrypt disks. Identity *EncryptionSetIdentity // disk encryption set resource update properties. Properties *DiskEncryptionSetUpdateProperties // Resource tags Tags map[string]*string }
DiskEncryptionSetUpdate - disk encryption set update resource.
func (DiskEncryptionSetUpdate) MarshalJSON ¶
func (d DiskEncryptionSetUpdate) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type DiskEncryptionSetUpdate.
func (*DiskEncryptionSetUpdate) UnmarshalJSON ¶
func (d *DiskEncryptionSetUpdate) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type DiskEncryptionSetUpdate.
type DiskEncryptionSetUpdateProperties ¶
type DiskEncryptionSetUpdateProperties struct { // Key Vault Key Url to be used for server side encryption of Managed Disks and Snapshots ActiveKey *KeyForDiskEncryptionSet // The type of key used to encrypt the data of the disk. EncryptionType *DiskEncryptionSetType // Multi-tenant application client id to access key vault in a different tenant. Setting the value to 'None' will clear the // property. FederatedClientID *string // Set this flag to true to enable auto-updating of this disk encryption set to the latest key version. RotationToLatestKeyVersionEnabled *bool }
DiskEncryptionSetUpdateProperties - disk encryption set resource update properties.
func (DiskEncryptionSetUpdateProperties) MarshalJSON ¶
func (d DiskEncryptionSetUpdateProperties) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type DiskEncryptionSetUpdateProperties.
func (*DiskEncryptionSetUpdateProperties) UnmarshalJSON ¶
func (d *DiskEncryptionSetUpdateProperties) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type DiskEncryptionSetUpdateProperties.
type DiskEncryptionSetsClient ¶
type DiskEncryptionSetsClient struct {
// contains filtered or unexported fields
}
DiskEncryptionSetsClient contains the methods for the DiskEncryptionSets group. Don't use this type directly, use NewDiskEncryptionSetsClient() instead.
func NewDiskEncryptionSetsClient ¶
func NewDiskEncryptionSetsClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*DiskEncryptionSetsClient, error)
NewDiskEncryptionSetsClient creates a new instance of DiskEncryptionSetsClient 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 (*DiskEncryptionSetsClient) BeginCreateOrUpdate ¶
func (client *DiskEncryptionSetsClient) BeginCreateOrUpdate(ctx context.Context, resourceGroupName string, diskEncryptionSetName string, diskEncryptionSet DiskEncryptionSet, options *DiskEncryptionSetsClientBeginCreateOrUpdateOptions) (*runtime.Poller[DiskEncryptionSetsClientCreateOrUpdateResponse], error)
BeginCreateOrUpdate - Creates or updates a disk encryption set If the operation fails it returns an *azcore.ResponseError type.
Generated from API version 2023-10-02
- resourceGroupName - The name of the resource group.
- diskEncryptionSetName - The name of the disk encryption set that is being created. The name can't be changed after the disk encryption set is created. Supported characters for the name are a-z, A-Z, 0-9, _ and -. The maximum name length is 80 characters.
- diskEncryptionSet - disk encryption set object supplied in the body of the Put disk encryption set operation.
- options - DiskEncryptionSetsClientBeginCreateOrUpdateOptions contains the optional parameters for the DiskEncryptionSetsClient.BeginCreateOrUpdate method.
Example (CreateADiskEncryptionSet) ¶
Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/92de53a5f1e0e03c94b40475d2135d97148ed014/specification/compute/resource-manager/Microsoft.Compute/DiskRP/stable/2023-10-02/examples/diskEncryptionSetExamples/DiskEncryptionSet_Create.json
cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() clientFactory, err := armcompute.NewClientFactory("<subscription-id>", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } poller, err := clientFactory.NewDiskEncryptionSetsClient().BeginCreateOrUpdate(ctx, "myResourceGroup", "myDiskEncryptionSet", armcompute.DiskEncryptionSet{ Location: to.Ptr("West US"), Identity: &armcompute.EncryptionSetIdentity{ Type: to.Ptr(armcompute.DiskEncryptionSetIdentityTypeSystemAssigned), }, Properties: &armcompute.EncryptionSetProperties{ ActiveKey: &armcompute.KeyForDiskEncryptionSet{ KeyURL: to.Ptr("https://myvmvault.vault-int.azure-int.net/keys/{key}"), SourceVault: &armcompute.SourceVault{ ID: to.Ptr("/subscriptions/{subscriptionId}/resourceGroups/myResourceGroup/providers/Microsoft.KeyVault/vaults/myVMVault"), }, }, EncryptionType: to.Ptr(armcompute.DiskEncryptionSetTypeEncryptionAtRestWithCustomerKey), }, }, nil) if err != nil { log.Fatalf("failed to finish the request: %v", err) } res, err := poller.PollUntilDone(ctx, nil) if err != nil { log.Fatalf("failed to pull the result: %v", err) } // You could use response here. We use blank identifier for just demo purposes. _ = res // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. // res.DiskEncryptionSet = armcompute.DiskEncryptionSet{ // Name: to.Ptr("myDiskEncryptionSet"), // ID: to.Ptr("/subscriptions/{subscriptionId}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/diskEncryptionSets/myDiskEncryptionSet"), // Location: to.Ptr("West US"), // Identity: &armcompute.EncryptionSetIdentity{ // Type: to.Ptr(armcompute.DiskEncryptionSetIdentityTypeSystemAssigned), // }, // Properties: &armcompute.EncryptionSetProperties{ // ActiveKey: &armcompute.KeyForDiskEncryptionSet{ // KeyURL: to.Ptr("https://myvmvault.vault-int.azure-int.net/keys/{key}"), // SourceVault: &armcompute.SourceVault{ // ID: to.Ptr("/subscriptions/{subscriptionId}/resourceGroups/myResourceGroup/providers/Microsoft.KeyVault/vaults/myVMVault"), // }, // }, // EncryptionType: to.Ptr(armcompute.DiskEncryptionSetTypeEncryptionAtRestWithCustomerKey), // PreviousKeys: []*armcompute.KeyForDiskEncryptionSet{ // }, // }, // }
Output:
Example (CreateADiskEncryptionSetWithKeyVaultFromADifferentSubscription) ¶
Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/92de53a5f1e0e03c94b40475d2135d97148ed014/specification/compute/resource-manager/Microsoft.Compute/DiskRP/stable/2023-10-02/examples/diskEncryptionSetExamples/DiskEncryptionSet_Create_WithKeyVaultFromADifferentSubscription.json
cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() clientFactory, err := armcompute.NewClientFactory("<subscription-id>", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } poller, err := clientFactory.NewDiskEncryptionSetsClient().BeginCreateOrUpdate(ctx, "myResourceGroup", "myDiskEncryptionSet", armcompute.DiskEncryptionSet{ Location: to.Ptr("West US"), Identity: &armcompute.EncryptionSetIdentity{ Type: to.Ptr(armcompute.DiskEncryptionSetIdentityTypeSystemAssigned), }, Properties: &armcompute.EncryptionSetProperties{ ActiveKey: &armcompute.KeyForDiskEncryptionSet{ KeyURL: to.Ptr("https://myvaultdifferentsub.vault-int.azure-int.net/keys/{key}"), }, EncryptionType: to.Ptr(armcompute.DiskEncryptionSetTypeEncryptionAtRestWithCustomerKey), }, }, nil) if err != nil { log.Fatalf("failed to finish the request: %v", err) } res, err := poller.PollUntilDone(ctx, nil) if err != nil { log.Fatalf("failed to pull the result: %v", err) } // You could use response here. We use blank identifier for just demo purposes. _ = res // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. // res.DiskEncryptionSet = armcompute.DiskEncryptionSet{ // Name: to.Ptr("myDiskEncryptionSet"), // ID: to.Ptr("/subscriptions/{subscriptionId}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/diskEncryptionSets/myDiskEncryptionSet"), // Location: to.Ptr("West US"), // Identity: &armcompute.EncryptionSetIdentity{ // Type: to.Ptr(armcompute.DiskEncryptionSetIdentityTypeSystemAssigned), // }, // Properties: &armcompute.EncryptionSetProperties{ // ActiveKey: &armcompute.KeyForDiskEncryptionSet{ // KeyURL: to.Ptr("https://myvaultdifferentsub.vault-int.azure-int.net/keys/{key}"), // }, // EncryptionType: to.Ptr(armcompute.DiskEncryptionSetTypeEncryptionAtRestWithCustomerKey), // PreviousKeys: []*armcompute.KeyForDiskEncryptionSet{ // }, // }, // }
Output:
Example (CreateADiskEncryptionSetWithKeyVaultFromADifferentTenant) ¶
Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/92de53a5f1e0e03c94b40475d2135d97148ed014/specification/compute/resource-manager/Microsoft.Compute/DiskRP/stable/2023-10-02/examples/diskEncryptionSetExamples/DiskEncryptionSet_Create_WithKeyVaultFromADifferentTenant.json
cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() clientFactory, err := armcompute.NewClientFactory("<subscription-id>", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } poller, err := clientFactory.NewDiskEncryptionSetsClient().BeginCreateOrUpdate(ctx, "myResourceGroup", "myDiskEncryptionSet", armcompute.DiskEncryptionSet{ Location: to.Ptr("West US"), Identity: &armcompute.EncryptionSetIdentity{ Type: to.Ptr(armcompute.DiskEncryptionSetIdentityTypeUserAssigned), UserAssignedIdentities: map[string]*armcompute.UserAssignedIdentitiesValue{ "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{identityName}": {}, }, }, Properties: &armcompute.EncryptionSetProperties{ ActiveKey: &armcompute.KeyForDiskEncryptionSet{ KeyURL: to.Ptr("https://myvaultdifferenttenant.vault-int.azure-int.net/keys/{key}"), }, EncryptionType: to.Ptr(armcompute.DiskEncryptionSetTypeEncryptionAtRestWithCustomerKey), FederatedClientID: to.Ptr("00000000-0000-0000-0000-000000000000"), }, }, nil) if err != nil { log.Fatalf("failed to finish the request: %v", err) } res, err := poller.PollUntilDone(ctx, nil) if err != nil { log.Fatalf("failed to pull the result: %v", err) } // You could use response here. We use blank identifier for just demo purposes. _ = res // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. // res.DiskEncryptionSet = armcompute.DiskEncryptionSet{ // Name: to.Ptr("myDiskEncryptionSet"), // ID: to.Ptr("/subscriptions/{subscriptionId}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/diskEncryptionSets/myDiskEncryptionSet"), // Location: to.Ptr("West US"), // Identity: &armcompute.EncryptionSetIdentity{ // Type: to.Ptr(armcompute.DiskEncryptionSetIdentityTypeUserAssigned), // UserAssignedIdentities: map[string]*armcompute.UserAssignedIdentitiesValue{ // "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{identityName}": &armcompute.UserAssignedIdentitiesValue{ // }, // }, // }, // Properties: &armcompute.EncryptionSetProperties{ // ActiveKey: &armcompute.KeyForDiskEncryptionSet{ // KeyURL: to.Ptr("https://myvaultdifferenttenant.vault-int.azure-int.net/keys/{key}"), // }, // EncryptionType: to.Ptr(armcompute.DiskEncryptionSetTypeEncryptionAtRestWithCustomerKey), // FederatedClientID: to.Ptr("00000000-0000-0000-0000-000000000000"), // PreviousKeys: []*armcompute.KeyForDiskEncryptionSet{ // }, // }, // }
Output:
func (*DiskEncryptionSetsClient) BeginDelete ¶
func (client *DiskEncryptionSetsClient) BeginDelete(ctx context.Context, resourceGroupName string, diskEncryptionSetName string, options *DiskEncryptionSetsClientBeginDeleteOptions) (*runtime.Poller[DiskEncryptionSetsClientDeleteResponse], error)
BeginDelete - Deletes a disk encryption set. If the operation fails it returns an *azcore.ResponseError type.
Generated from API version 2023-10-02
- resourceGroupName - The name of the resource group.
- diskEncryptionSetName - The name of the disk encryption set that is being created. The name can't be changed after the disk encryption set is created. Supported characters for the name are a-z, A-Z, 0-9, _ and -. The maximum name length is 80 characters.
- options - DiskEncryptionSetsClientBeginDeleteOptions contains the optional parameters for the DiskEncryptionSetsClient.BeginDelete method.
Example ¶
Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/92de53a5f1e0e03c94b40475d2135d97148ed014/specification/compute/resource-manager/Microsoft.Compute/DiskRP/stable/2023-10-02/examples/diskEncryptionSetExamples/DiskEncryptionSet_Delete.json
cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() clientFactory, err := armcompute.NewClientFactory("<subscription-id>", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } poller, err := clientFactory.NewDiskEncryptionSetsClient().BeginDelete(ctx, "myResourceGroup", "myDiskEncryptionSet", nil) if err != nil { log.Fatalf("failed to finish the request: %v", err) } _, err = poller.PollUntilDone(ctx, nil) if err != nil { log.Fatalf("failed to pull the result: %v", err) }
Output:
func (*DiskEncryptionSetsClient) BeginUpdate ¶
func (client *DiskEncryptionSetsClient) BeginUpdate(ctx context.Context, resourceGroupName string, diskEncryptionSetName string, diskEncryptionSet DiskEncryptionSetUpdate, options *DiskEncryptionSetsClientBeginUpdateOptions) (*runtime.Poller[DiskEncryptionSetsClientUpdateResponse], error)
BeginUpdate - Updates (patches) a disk encryption set. If the operation fails it returns an *azcore.ResponseError type.
Generated from API version 2023-10-02
- resourceGroupName - The name of the resource group.
- diskEncryptionSetName - The name of the disk encryption set that is being created. The name can't be changed after the disk encryption set is created. Supported characters for the name are a-z, A-Z, 0-9, _ and -. The maximum name length is 80 characters.
- diskEncryptionSet - disk encryption set object supplied in the body of the Patch disk encryption set operation.
- options - DiskEncryptionSetsClientBeginUpdateOptions contains the optional parameters for the DiskEncryptionSetsClient.BeginUpdate method.
Example (UpdateADiskEncryptionSet) ¶
Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/92de53a5f1e0e03c94b40475d2135d97148ed014/specification/compute/resource-manager/Microsoft.Compute/DiskRP/stable/2023-10-02/examples/diskEncryptionSetExamples/DiskEncryptionSet_Update.json
cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() clientFactory, err := armcompute.NewClientFactory("<subscription-id>", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } poller, err := clientFactory.NewDiskEncryptionSetsClient().BeginUpdate(ctx, "myResourceGroup", "myDiskEncryptionSet", armcompute.DiskEncryptionSetUpdate{ Properties: &armcompute.DiskEncryptionSetUpdateProperties{ ActiveKey: &armcompute.KeyForDiskEncryptionSet{ KeyURL: to.Ptr("https://myvmvault.vault-int.azure-int.net/keys/keyName/keyVersion"), SourceVault: &armcompute.SourceVault{ ID: to.Ptr("/subscriptions/{subscriptionId}/resourceGroups/myResourceGroup/providers/Microsoft.KeyVault/vaults/myVMVault"), }, }, EncryptionType: to.Ptr(armcompute.DiskEncryptionSetTypeEncryptionAtRestWithCustomerKey), }, Tags: map[string]*string{ "department": to.Ptr("Development"), "project": to.Ptr("Encryption"), }, }, nil) if err != nil { log.Fatalf("failed to finish the request: %v", err) } res, err := poller.PollUntilDone(ctx, nil) if err != nil { log.Fatalf("failed to pull the result: %v", err) } // You could use response here. We use blank identifier for just demo purposes. _ = res // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. // res.DiskEncryptionSet = armcompute.DiskEncryptionSet{ // Name: to.Ptr("myDiskEncryptionSet"), // Location: to.Ptr("West US"), // Tags: map[string]*string{ // "department": to.Ptr("Development"), // "project": to.Ptr("Encryption"), // }, // Identity: &armcompute.EncryptionSetIdentity{ // Type: to.Ptr(armcompute.DiskEncryptionSetIdentityTypeSystemAssigned), // }, // Properties: &armcompute.EncryptionSetProperties{ // ActiveKey: &armcompute.KeyForDiskEncryptionSet{ // KeyURL: to.Ptr("https://myvmvault.vault-int.azure-int.net/keys/keyName/keyVersion"), // SourceVault: &armcompute.SourceVault{ // ID: to.Ptr("/subscriptions/{subscriptionId}/resourceGroups/myResourceGroup/providers/Microsoft.KeyVault/vaults/myVMVault"), // }, // }, // EncryptionType: to.Ptr(armcompute.DiskEncryptionSetTypeEncryptionAtRestWithCustomerKey), // LastKeyRotationTimestamp: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-04-01T04:41:35.079Z"); return t}()), // PreviousKeys: []*armcompute.KeyForDiskEncryptionSet{ // }, // }, // }
Output:
Example (UpdateADiskEncryptionSetWithRotationToLatestKeyVersionEnabledSetToTrueSucceeded) ¶
Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/92de53a5f1e0e03c94b40475d2135d97148ed014/specification/compute/resource-manager/Microsoft.Compute/DiskRP/stable/2023-10-02/examples/diskEncryptionSetExamples/DiskEncryptionSet_Update_WithRotationToLatestKeyVersionEnabled.json
cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() clientFactory, err := armcompute.NewClientFactory("<subscription-id>", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } poller, err := clientFactory.NewDiskEncryptionSetsClient().BeginUpdate(ctx, "myResourceGroup", "myDiskEncryptionSet", armcompute.DiskEncryptionSetUpdate{ Identity: &armcompute.EncryptionSetIdentity{ Type: to.Ptr(armcompute.DiskEncryptionSetIdentityTypeSystemAssigned), }, Properties: &armcompute.DiskEncryptionSetUpdateProperties{ ActiveKey: &armcompute.KeyForDiskEncryptionSet{ KeyURL: to.Ptr("https://myvaultdifferentsub.vault-int.azure-int.net/keys/keyName/keyVersion1"), }, EncryptionType: to.Ptr(armcompute.DiskEncryptionSetTypeEncryptionAtRestWithCustomerKey), RotationToLatestKeyVersionEnabled: to.Ptr(true), }, }, nil) if err != nil { log.Fatalf("failed to finish the request: %v", err) } res, err := poller.PollUntilDone(ctx, nil) if err != nil { log.Fatalf("failed to pull the result: %v", err) } // You could use response here. We use blank identifier for just demo purposes. _ = res // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. // res.DiskEncryptionSet = armcompute.DiskEncryptionSet{ // Name: to.Ptr("myDiskEncryptionSet"), // Type: to.Ptr("Microsoft.Compute/diskEncryptionSets"), // ID: to.Ptr("/subscriptions/{subscriptionId}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/diskEncryptionSets/myDiskEncryptionSet"), // Location: to.Ptr("West US"), // Identity: &armcompute.EncryptionSetIdentity{ // Type: to.Ptr(armcompute.DiskEncryptionSetIdentityTypeSystemAssigned), // }, // Properties: &armcompute.EncryptionSetProperties{ // ActiveKey: &armcompute.KeyForDiskEncryptionSet{ // KeyURL: to.Ptr("https://myvaultdifferentsub.vault-int.azure-int.net/keys/keyName/KeyVersion2"), // }, // EncryptionType: to.Ptr(armcompute.DiskEncryptionSetTypeEncryptionAtRestWithCustomerKey), // LastKeyRotationTimestamp: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-04-01T04:41:35.079Z"); return t}()), // ProvisioningState: to.Ptr("Succeeded"), // RotationToLatestKeyVersionEnabled: to.Ptr(true), // }, // }
Output:
Example (UpdateADiskEncryptionSetWithRotationToLatestKeyVersionEnabledSetToTrueUpdating) ¶
Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/92de53a5f1e0e03c94b40475d2135d97148ed014/specification/compute/resource-manager/Microsoft.Compute/DiskRP/stable/2023-10-02/examples/diskEncryptionSetExamples/DiskEncryptionSet_Update_WithRotationToLatestKeyVersionEnabledInProgress.json
cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() clientFactory, err := armcompute.NewClientFactory("<subscription-id>", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } poller, err := clientFactory.NewDiskEncryptionSetsClient().BeginUpdate(ctx, "myResourceGroup", "myDiskEncryptionSet", armcompute.DiskEncryptionSetUpdate{ Identity: &armcompute.EncryptionSetIdentity{ Type: to.Ptr(armcompute.DiskEncryptionSetIdentityTypeSystemAssigned), }, Properties: &armcompute.DiskEncryptionSetUpdateProperties{ ActiveKey: &armcompute.KeyForDiskEncryptionSet{ KeyURL: to.Ptr("https://myvaultdifferentsub.vault-int.azure-int.net/keys/keyName/keyVersion1"), }, EncryptionType: to.Ptr(armcompute.DiskEncryptionSetTypeEncryptionAtRestWithCustomerKey), RotationToLatestKeyVersionEnabled: to.Ptr(true), }, }, nil) if err != nil { log.Fatalf("failed to finish the request: %v", err) } res, err := poller.PollUntilDone(ctx, nil) if err != nil { log.Fatalf("failed to pull the result: %v", err) } // You could use response here. We use blank identifier for just demo purposes. _ = res // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. // res.DiskEncryptionSet = armcompute.DiskEncryptionSet{ // Name: to.Ptr("myDiskEncryptionSet"), // Type: to.Ptr("Microsoft.Compute/diskEncryptionSets"), // ID: to.Ptr("/subscriptions/{subscriptionId}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/diskEncryptionSets/myDiskEncryptionSet"), // Location: to.Ptr("West US"), // Identity: &armcompute.EncryptionSetIdentity{ // Type: to.Ptr(armcompute.DiskEncryptionSetIdentityTypeSystemAssigned), // }, // Properties: &armcompute.EncryptionSetProperties{ // ActiveKey: &armcompute.KeyForDiskEncryptionSet{ // KeyURL: to.Ptr("https://myvaultdifferentsub.vault-int.azure-int.net/keys/keyName/keyVersion2"), // }, // EncryptionType: to.Ptr(armcompute.DiskEncryptionSetTypeEncryptionAtRestWithCustomerKey), // LastKeyRotationTimestamp: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-04-01T04:41:35.079Z"); return t}()), // PreviousKeys: []*armcompute.KeyForDiskEncryptionSet{ // { // KeyURL: to.Ptr("https://myvaultdifferentsub.vault-int.azure-int.net/keys/keyName/keyVersion1"), // }}, // ProvisioningState: to.Ptr("Succeeded"), // RotationToLatestKeyVersionEnabled: to.Ptr(true), // }, // }
Output:
func (*DiskEncryptionSetsClient) Get ¶
func (client *DiskEncryptionSetsClient) Get(ctx context.Context, resourceGroupName string, diskEncryptionSetName string, options *DiskEncryptionSetsClientGetOptions) (DiskEncryptionSetsClientGetResponse, error)
Get - Gets information about a disk encryption set. If the operation fails it returns an *azcore.ResponseError type.
Generated from API version 2023-10-02
- resourceGroupName - The name of the resource group.
- diskEncryptionSetName - The name of the disk encryption set that is being created. The name can't be changed after the disk encryption set is created. Supported characters for the name are a-z, A-Z, 0-9, _ and -. The maximum name length is 80 characters.
- options - DiskEncryptionSetsClientGetOptions contains the optional parameters for the DiskEncryptionSetsClient.Get method.
Example (GetInformationAboutADiskEncryptionSet) ¶
Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/92de53a5f1e0e03c94b40475d2135d97148ed014/specification/compute/resource-manager/Microsoft.Compute/DiskRP/stable/2023-10-02/examples/diskEncryptionSetExamples/DiskEncryptionSet_Get.json
cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() clientFactory, err := armcompute.NewClientFactory("<subscription-id>", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } res, err := clientFactory.NewDiskEncryptionSetsClient().Get(ctx, "myResourceGroup", "myDiskEncryptionSet", nil) if err != nil { log.Fatalf("failed to finish the request: %v", err) } // You could use response here. We use blank identifier for just demo purposes. _ = res // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. // res.DiskEncryptionSet = armcompute.DiskEncryptionSet{ // Name: to.Ptr("myDiskEncryptionSet"), // Type: to.Ptr("Microsoft.Compute/diskEncryptionSets"), // ID: to.Ptr("/subscriptions/{subscriptionId}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/diskEncryptionSets/myDiskEncryptionSet"), // Location: to.Ptr("westus"), // Tags: map[string]*string{ // "department": to.Ptr("Development"), // "project": to.Ptr("Encryption"), // }, // Identity: &armcompute.EncryptionSetIdentity{ // Type: to.Ptr(armcompute.DiskEncryptionSetIdentityTypeSystemAssigned), // }, // Properties: &armcompute.EncryptionSetProperties{ // ActiveKey: &armcompute.KeyForDiskEncryptionSet{ // KeyURL: to.Ptr("https://myvmvault.vault-int.azure-int.net/keys/{key}"), // SourceVault: &armcompute.SourceVault{ // ID: to.Ptr("/subscriptions/{subscriptionId}/resourceGroups/myResourceGroup/providers/Microsoft.KeyVault/vaults/myVMVault"), // }, // }, // EncryptionType: to.Ptr(armcompute.DiskEncryptionSetTypeEncryptionAtRestWithCustomerKey), // PreviousKeys: []*armcompute.KeyForDiskEncryptionSet{ // }, // ProvisioningState: to.Ptr("Succeeded"), // }, // }
Output:
Example (GetInformationAboutADiskEncryptionSetWhenAutoKeyRotationFailed) ¶
Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/92de53a5f1e0e03c94b40475d2135d97148ed014/specification/compute/resource-manager/Microsoft.Compute/DiskRP/stable/2023-10-02/examples/diskEncryptionSetExamples/DiskEncryptionSet_Get_WithAutoKeyRotationError.json
cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() clientFactory, err := armcompute.NewClientFactory("<subscription-id>", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } res, err := clientFactory.NewDiskEncryptionSetsClient().Get(ctx, "myResourceGroup", "myDiskEncryptionSet", nil) if err != nil { log.Fatalf("failed to finish the request: %v", err) } // You could use response here. We use blank identifier for just demo purposes. _ = res // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. // res.DiskEncryptionSet = armcompute.DiskEncryptionSet{ // Name: to.Ptr("myDiskEncryptionSet"), // Type: to.Ptr("Microsoft.Compute/diskEncryptionSets"), // ID: to.Ptr("/subscriptions/{subscriptionId}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/diskEncryptionSets/myDiskEncryptionSet"), // Location: to.Ptr("westus"), // Tags: map[string]*string{ // "department": to.Ptr("Development"), // "project": to.Ptr("Encryption"), // }, // Identity: &armcompute.EncryptionSetIdentity{ // Type: to.Ptr(armcompute.DiskEncryptionSetIdentityTypeSystemAssigned), // }, // Properties: &armcompute.EncryptionSetProperties{ // ActiveKey: &armcompute.KeyForDiskEncryptionSet{ // KeyURL: to.Ptr("https://myvmvault.vault-int.azure-int.net/keys/{key}"), // SourceVault: &armcompute.SourceVault{ // ID: to.Ptr("/subscriptions/{subscriptionId}/resourceGroups/myResourceGroup/providers/Microsoft.KeyVault/vaults/myVMVault"), // }, // }, // AutoKeyRotationError: &armcompute.APIError{ // Code: to.Ptr("ManagedServiceIdentityNotFound"), // Message: to.Ptr("Auto-key rotation was disabled as managed service identity associated with DiskEncryptionSet 'myDiskEncryptionSet' was not found. Please update the resource with correct identity to re-enable auto-key rotation."), // }, // EncryptionType: to.Ptr(armcompute.DiskEncryptionSetTypeEncryptionAtRestWithCustomerKey), // PreviousKeys: []*armcompute.KeyForDiskEncryptionSet{ // }, // ProvisioningState: to.Ptr("Succeeded"), // RotationToLatestKeyVersionEnabled: to.Ptr(true), // }, // }
Output:
func (*DiskEncryptionSetsClient) NewListAssociatedResourcesPager ¶
func (client *DiskEncryptionSetsClient) NewListAssociatedResourcesPager(resourceGroupName string, diskEncryptionSetName string, options *DiskEncryptionSetsClientListAssociatedResourcesOptions) *runtime.Pager[DiskEncryptionSetsClientListAssociatedResourcesResponse]
NewListAssociatedResourcesPager - Lists all resources that are encrypted with this disk encryption set.
Generated from API version 2023-10-02
- resourceGroupName - The name of the resource group.
- diskEncryptionSetName - The name of the disk encryption set that is being created. The name can't be changed after the disk encryption set is created. Supported characters for the name are a-z, A-Z, 0-9, _ and -. The maximum name length is 80 characters.
- options - DiskEncryptionSetsClientListAssociatedResourcesOptions contains the optional parameters for the DiskEncryptionSetsClient.NewListAssociatedResourcesPager method.
Example ¶
Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/92de53a5f1e0e03c94b40475d2135d97148ed014/specification/compute/resource-manager/Microsoft.Compute/DiskRP/stable/2023-10-02/examples/diskEncryptionSetExamples/DiskEncryptionSet_ListAssociatedResources.json
cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() clientFactory, err := armcompute.NewClientFactory("<subscription-id>", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } pager := clientFactory.NewDiskEncryptionSetsClient().NewListAssociatedResourcesPager("myResourceGroup", "myDiskEncryptionSet", nil) for pager.More() { page, err := pager.NextPage(ctx) if err != nil { log.Fatalf("failed to advance page: %v", err) } for _, v := range page.Value { // You could use page here. We use blank identifier for just demo purposes. _ = v } // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. // page.ResourceURIList = armcompute.ResourceURIList{ // Value: []*string{ // to.Ptr("/subscriptions/{subscriptionId}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/disks/myManagedDisk"), // to.Ptr("/subscriptions/{subscriptionId}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/snapshots/mySnapshot")}, // } }
Output:
func (*DiskEncryptionSetsClient) NewListByResourceGroupPager ¶
func (client *DiskEncryptionSetsClient) NewListByResourceGroupPager(resourceGroupName string, options *DiskEncryptionSetsClientListByResourceGroupOptions) *runtime.Pager[DiskEncryptionSetsClientListByResourceGroupResponse]
NewListByResourceGroupPager - Lists all the disk encryption sets under a resource group.
Generated from API version 2023-10-02
- resourceGroupName - The name of the resource group.
- options - DiskEncryptionSetsClientListByResourceGroupOptions contains the optional parameters for the DiskEncryptionSetsClient.NewListByResourceGroupPager method.
Example ¶
Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/92de53a5f1e0e03c94b40475d2135d97148ed014/specification/compute/resource-manager/Microsoft.Compute/DiskRP/stable/2023-10-02/examples/diskEncryptionSetExamples/DiskEncryptionSet_ListByResourceGroup.json
cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() clientFactory, err := armcompute.NewClientFactory("<subscription-id>", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } pager := clientFactory.NewDiskEncryptionSetsClient().NewListByResourceGroupPager("myResourceGroup", nil) for pager.More() { page, err := pager.NextPage(ctx) if err != nil { log.Fatalf("failed to advance page: %v", err) } for _, v := range page.Value { // You could use page here. We use blank identifier for just demo purposes. _ = v } // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. // page.DiskEncryptionSetList = armcompute.DiskEncryptionSetList{ // Value: []*armcompute.DiskEncryptionSet{ // { // Name: to.Ptr("myDiskEncryptionSet"), // Type: to.Ptr("Microsoft.Compute/diskEncryptionSets"), // ID: to.Ptr("/subscriptions/{subscriptionId}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/diskEncryptionSets/myDiskEncryptionSet"), // Location: to.Ptr("westus"), // Tags: map[string]*string{ // "department": to.Ptr("Development"), // "project": to.Ptr("Encryption"), // }, // Identity: &armcompute.EncryptionSetIdentity{ // Type: to.Ptr(armcompute.DiskEncryptionSetIdentityTypeSystemAssigned), // }, // Properties: &armcompute.EncryptionSetProperties{ // ActiveKey: &armcompute.KeyForDiskEncryptionSet{ // KeyURL: to.Ptr("https://myvmvault.vault-int.azure-int.net/keys/{key}"), // SourceVault: &armcompute.SourceVault{ // ID: to.Ptr("/subscriptions/{subscriptionId}/resourceGroups/myResourceGroup/providers/Microsoft.KeyVault/vaults/myVMVault"), // }, // }, // EncryptionType: to.Ptr(armcompute.DiskEncryptionSetTypeEncryptionAtRestWithCustomerKey), // PreviousKeys: []*armcompute.KeyForDiskEncryptionSet{ // }, // ProvisioningState: to.Ptr("Succeeded"), // }, // }, // { // Name: to.Ptr("myDiskEncryptionSet2"), // Type: to.Ptr("Microsoft.Compute/diskEncryptionSets"), // ID: to.Ptr("/subscriptions/{subscriptionId}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/diskEncryptionSets/myDiskEncryptionSet2"), // Location: to.Ptr("westus"), // Tags: map[string]*string{ // "department": to.Ptr("Development"), // "project": to.Ptr("Encryption"), // }, // Identity: &armcompute.EncryptionSetIdentity{ // Type: to.Ptr(armcompute.DiskEncryptionSetIdentityTypeSystemAssigned), // }, // Properties: &armcompute.EncryptionSetProperties{ // ActiveKey: &armcompute.KeyForDiskEncryptionSet{ // KeyURL: to.Ptr("https://myvmvault.vault-int.azure-int.net/keys/{key}"), // SourceVault: &armcompute.SourceVault{ // ID: to.Ptr("/subscriptions/{subscriptionId}/resourceGroups/myResourceGroup/providers/Microsoft.KeyVault/vaults/myVMVault2"), // }, // }, // EncryptionType: to.Ptr(armcompute.DiskEncryptionSetTypeEncryptionAtRestWithCustomerKey), // PreviousKeys: []*armcompute.KeyForDiskEncryptionSet{ // }, // ProvisioningState: to.Ptr("Succeeded"), // }, // }}, // } }
Output:
func (*DiskEncryptionSetsClient) NewListPager ¶
func (client *DiskEncryptionSetsClient) NewListPager(options *DiskEncryptionSetsClientListOptions) *runtime.Pager[DiskEncryptionSetsClientListResponse]
NewListPager - Lists all the disk encryption sets under a subscription.
Generated from API version 2023-10-02
- options - DiskEncryptionSetsClientListOptions contains the optional parameters for the DiskEncryptionSetsClient.NewListPager method.
Example ¶
Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/92de53a5f1e0e03c94b40475d2135d97148ed014/specification/compute/resource-manager/Microsoft.Compute/DiskRP/stable/2023-10-02/examples/diskEncryptionSetExamples/DiskEncryptionSet_ListBySubscription.json
cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() clientFactory, err := armcompute.NewClientFactory("<subscription-id>", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } pager := clientFactory.NewDiskEncryptionSetsClient().NewListPager(nil) for pager.More() { page, err := pager.NextPage(ctx) if err != nil { log.Fatalf("failed to advance page: %v", err) } for _, v := range page.Value { // You could use page here. We use blank identifier for just demo purposes. _ = v } // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. // page.DiskEncryptionSetList = armcompute.DiskEncryptionSetList{ // Value: []*armcompute.DiskEncryptionSet{ // { // Name: to.Ptr("myDiskEncryptionSet"), // Type: to.Ptr("Microsoft.Compute/diskEncryptionSets"), // ID: to.Ptr("/subscriptions/{subscriptionId}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/diskEncryptionSets/myDiskEncryptionSet"), // Location: to.Ptr("westus"), // Tags: map[string]*string{ // "department": to.Ptr("Development"), // "project": to.Ptr("Encryption"), // }, // Identity: &armcompute.EncryptionSetIdentity{ // Type: to.Ptr(armcompute.DiskEncryptionSetIdentityTypeSystemAssigned), // }, // Properties: &armcompute.EncryptionSetProperties{ // ActiveKey: &armcompute.KeyForDiskEncryptionSet{ // KeyURL: to.Ptr("https://myvmvault.vault-int.azure-int.net/keys/{key}"), // SourceVault: &armcompute.SourceVault{ // ID: to.Ptr("/subscriptions/{subscriptionId}/resourceGroups/myResourceGroup/providers/Microsoft.KeyVault/vaults/myVMVault"), // }, // }, // EncryptionType: to.Ptr(armcompute.DiskEncryptionSetTypeEncryptionAtRestWithCustomerKey), // PreviousKeys: []*armcompute.KeyForDiskEncryptionSet{ // }, // ProvisioningState: to.Ptr("Succeeded"), // }, // }, // { // Name: to.Ptr("myDiskEncryptionSet2"), // Type: to.Ptr("Microsoft.Compute/diskEncryptionSets"), // ID: to.Ptr("/subscriptions/{subscriptionId}/resourceGroups/mySecondResourceGroup/providers/Microsoft.Compute/diskEncryptionSets/myDiskEncryptionSet2"), // Location: to.Ptr("westus"), // Tags: map[string]*string{ // "department": to.Ptr("Development"), // "project": to.Ptr("Encryption"), // }, // Identity: &armcompute.EncryptionSetIdentity{ // Type: to.Ptr(armcompute.DiskEncryptionSetIdentityTypeSystemAssigned), // }, // Properties: &armcompute.EncryptionSetProperties{ // ActiveKey: &armcompute.KeyForDiskEncryptionSet{ // KeyURL: to.Ptr("https://myvmvault.vault-int.azure-int.net/keys/{key}"), // SourceVault: &armcompute.SourceVault{ // ID: to.Ptr("/subscriptions/{subscriptionId}/resourceGroups/mySecondResourceGroup/providers/Microsoft.KeyVault/vaults/myVMVault2"), // }, // }, // EncryptionType: to.Ptr(armcompute.DiskEncryptionSetTypeEncryptionAtRestWithCustomerKey), // PreviousKeys: []*armcompute.KeyForDiskEncryptionSet{ // }, // ProvisioningState: to.Ptr("Succeeded"), // }, // }}, // } }
Output:
type DiskEncryptionSetsClientBeginCreateOrUpdateOptions ¶
type DiskEncryptionSetsClientBeginCreateOrUpdateOptions struct { // Resumes the LRO from the provided token. ResumeToken string }
DiskEncryptionSetsClientBeginCreateOrUpdateOptions contains the optional parameters for the DiskEncryptionSetsClient.BeginCreateOrUpdate method.
type DiskEncryptionSetsClientBeginDeleteOptions ¶
type DiskEncryptionSetsClientBeginDeleteOptions struct { // Resumes the LRO from the provided token. ResumeToken string }
DiskEncryptionSetsClientBeginDeleteOptions contains the optional parameters for the DiskEncryptionSetsClient.BeginDelete method.
type DiskEncryptionSetsClientBeginUpdateOptions ¶
type DiskEncryptionSetsClientBeginUpdateOptions struct { // Resumes the LRO from the provided token. ResumeToken string }
DiskEncryptionSetsClientBeginUpdateOptions contains the optional parameters for the DiskEncryptionSetsClient.BeginUpdate method.
type DiskEncryptionSetsClientCreateOrUpdateResponse ¶
type DiskEncryptionSetsClientCreateOrUpdateResponse struct { // disk encryption set resource. DiskEncryptionSet }
DiskEncryptionSetsClientCreateOrUpdateResponse contains the response from method DiskEncryptionSetsClient.BeginCreateOrUpdate.
type DiskEncryptionSetsClientDeleteResponse ¶
type DiskEncryptionSetsClientDeleteResponse struct { }
DiskEncryptionSetsClientDeleteResponse contains the response from method DiskEncryptionSetsClient.BeginDelete.
type DiskEncryptionSetsClientGetOptions ¶
type DiskEncryptionSetsClientGetOptions struct { }
DiskEncryptionSetsClientGetOptions contains the optional parameters for the DiskEncryptionSetsClient.Get method.
type DiskEncryptionSetsClientGetResponse ¶
type DiskEncryptionSetsClientGetResponse struct { // disk encryption set resource. DiskEncryptionSet }
DiskEncryptionSetsClientGetResponse contains the response from method DiskEncryptionSetsClient.Get.
type DiskEncryptionSetsClientListAssociatedResourcesOptions ¶
type DiskEncryptionSetsClientListAssociatedResourcesOptions struct { }
DiskEncryptionSetsClientListAssociatedResourcesOptions contains the optional parameters for the DiskEncryptionSetsClient.NewListAssociatedResourcesPager method.
type DiskEncryptionSetsClientListAssociatedResourcesResponse ¶
type DiskEncryptionSetsClientListAssociatedResourcesResponse struct { // The List resources which are encrypted with the disk encryption set. ResourceURIList }
DiskEncryptionSetsClientListAssociatedResourcesResponse contains the response from method DiskEncryptionSetsClient.NewListAssociatedResourcesPager.
type DiskEncryptionSetsClientListByResourceGroupOptions ¶
type DiskEncryptionSetsClientListByResourceGroupOptions struct { }
DiskEncryptionSetsClientListByResourceGroupOptions contains the optional parameters for the DiskEncryptionSetsClient.NewListByResourceGroupPager method.
type DiskEncryptionSetsClientListByResourceGroupResponse ¶
type DiskEncryptionSetsClientListByResourceGroupResponse struct { // The List disk encryption set operation response. DiskEncryptionSetList }
DiskEncryptionSetsClientListByResourceGroupResponse contains the response from method DiskEncryptionSetsClient.NewListByResourceGroupPager.
type DiskEncryptionSetsClientListOptions ¶
type DiskEncryptionSetsClientListOptions struct { }
DiskEncryptionSetsClientListOptions contains the optional parameters for the DiskEncryptionSetsClient.NewListPager method.
type DiskEncryptionSetsClientListResponse ¶
type DiskEncryptionSetsClientListResponse struct { // The List disk encryption set operation response. DiskEncryptionSetList }
DiskEncryptionSetsClientListResponse contains the response from method DiskEncryptionSetsClient.NewListPager.
type DiskEncryptionSetsClientUpdateResponse ¶
type DiskEncryptionSetsClientUpdateResponse struct { // disk encryption set resource. DiskEncryptionSet }
DiskEncryptionSetsClientUpdateResponse contains the response from method DiskEncryptionSetsClient.BeginUpdate.
type DiskEncryptionSettings ¶
type DiskEncryptionSettings struct { // Specifies the location of the disk encryption key, which is a Key Vault Secret. DiskEncryptionKey *KeyVaultSecretReference // Specifies whether disk encryption should be enabled on the virtual machine. Enabled *bool // Specifies the location of the key encryption key in Key Vault. KeyEncryptionKey *KeyVaultKeyReference }
DiskEncryptionSettings - Describes a Encryption Settings for a Disk
func (DiskEncryptionSettings) MarshalJSON ¶
func (d DiskEncryptionSettings) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type DiskEncryptionSettings.
func (*DiskEncryptionSettings) UnmarshalJSON ¶
func (d *DiskEncryptionSettings) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type DiskEncryptionSettings.
type DiskImageEncryption ¶
type DiskImageEncryption struct { // A relative URI containing the resource ID of the disk encryption set. DiskEncryptionSetID *string }
DiskImageEncryption - This is the disk image encryption base class.
func (DiskImageEncryption) MarshalJSON ¶
func (d DiskImageEncryption) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type DiskImageEncryption.
func (*DiskImageEncryption) UnmarshalJSON ¶
func (d *DiskImageEncryption) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type DiskImageEncryption.
type DiskInstanceView ¶
type DiskInstanceView struct { // Specifies the encryption settings for the OS Disk. // Minimum api-version: 2015-06-15 EncryptionSettings []*DiskEncryptionSettings // The disk name. Name *string // The resource status information. Statuses []*InstanceViewStatus }
DiskInstanceView - The instance view of the disk.
func (DiskInstanceView) MarshalJSON ¶
func (d DiskInstanceView) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type DiskInstanceView.
func (*DiskInstanceView) UnmarshalJSON ¶
func (d *DiskInstanceView) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type DiskInstanceView.
type DiskList ¶
type DiskList struct { // REQUIRED; A list of disks. Value []*Disk // The uri to fetch the next page of disks. Call ListNext() with this to fetch the next page of disks. NextLink *string }
DiskList - The List Disks operation response.
func (DiskList) MarshalJSON ¶
MarshalJSON implements the json.Marshaller interface for type DiskList.
func (*DiskList) UnmarshalJSON ¶
UnmarshalJSON implements the json.Unmarshaller interface for type DiskList.
type DiskProperties ¶
type DiskProperties struct { // REQUIRED; Disk source information. CreationData information cannot be changed after the disk has been created. CreationData *CreationData // Set to true to enable bursting beyond the provisioned performance target of the disk. Bursting is disabled by default. // Does not apply to Ultra disks. BurstingEnabled *bool // Percentage complete for the background copy when a resource is created via the CopyStart operation. CompletionPercent *float32 // Additional authentication requirements when exporting or uploading to a disk or snapshot. DataAccessAuthMode *DataAccessAuthMode // ARM id of the DiskAccess resource for using private endpoints on disks. DiskAccessID *string // The total number of IOPS that will be allowed across all VMs mounting the shared disk as ReadOnly. One operation can transfer // between 4k and 256k bytes. DiskIOPSReadOnly *int64 // The number of IOPS allowed for this disk; only settable for UltraSSD disks. One operation can transfer between 4k and 256k // bytes. DiskIOPSReadWrite *int64 // The total throughput (MBps) that will be allowed across all VMs mounting the shared disk as ReadOnly. MBps means millions // of bytes per second - MB here uses the ISO notation, of powers of 10. DiskMBpsReadOnly *int64 // The bandwidth allowed for this disk; only settable for UltraSSD disks. MBps means millions of bytes per second - MB here // uses the ISO notation, of powers of 10. DiskMBpsReadWrite *int64 // If creationData.createOption is Empty, this field is mandatory and it indicates the size of the disk to create. If this // field is present for updates or creation with other options, it indicates a // resize. Resizes are only allowed if the disk is not attached to a running VM, and can only increase the disk's size. DiskSizeGB *int32 // Encryption property can be used to encrypt data at rest with customer managed keys or platform managed keys. Encryption *Encryption // Encryption settings collection used for Azure Disk Encryption, can contain multiple encryption settings per disk or snapshot. EncryptionSettingsCollection *EncryptionSettingsCollection // The hypervisor generation of the Virtual Machine. Applicable to OS disks only. HyperVGeneration *HyperVGeneration // be mounted on multiple VMs at the same time. MaxShares *int32 // Policy for accessing the disk via network. NetworkAccessPolicy *NetworkAccessPolicy // The Operating System type. OSType *OperatingSystemTypes // Setting this property to true improves reliability and performance of data disks that are frequently (more than 5 times // a day) by detached from one virtual machine and attached to another. This // property should not be set for disks that are not detached and attached frequently as it causes the disks to not align // with the fault domain of the virtual machine. OptimizedForFrequentAttach *bool // Policy for controlling export on the disk. PublicNetworkAccess *PublicNetworkAccess // Purchase plan information for the the image from which the OS disk was created. E.g. - {name: 2019-Datacenter, publisher: // MicrosoftWindowsServer, product: WindowsServer} PurchasePlan *DiskPurchasePlan // Contains the security related information for the resource. SecurityProfile *DiskSecurityProfile // List of supported capabilities for the image from which the OS disk was created. SupportedCapabilities *SupportedCapabilities // Indicates the OS on a disk supports hibernation. SupportsHibernation *bool // Performance tier of the disk (e.g, P4, S10) as described here: https://azure.microsoft.com/en-us/pricing/details/managed-disks/. // Does not apply to Ultra disks. Tier *string // READ-ONLY; Latest time when bursting was last enabled on a disk. BurstingEnabledTime *time.Time // READ-ONLY; The size of the disk in bytes. This field is read only. DiskSizeBytes *int64 // READ-ONLY; The state of the disk. DiskState *DiskState // READ-ONLY; The UTC time when the ownership state of the disk was last changed i.e., the time the disk was last attached // or detached from a VM or the time when the VM to which the disk was attached was // deallocated or started. LastOwnershipUpdateTime *time.Time // READ-ONLY; Properties of the disk for which update is pending. PropertyUpdatesInProgress *PropertyUpdatesInProgress // READ-ONLY; The disk provisioning state. ProvisioningState *string // one for disks to allow attaching them to multiple VMs. ShareInfo []*ShareInfoElement // READ-ONLY; The time when the disk was created. TimeCreated *time.Time // READ-ONLY; Unique Guid identifying the resource. UniqueID *string }
DiskProperties - Disk resource properties.
func (DiskProperties) MarshalJSON ¶
func (d DiskProperties) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type DiskProperties.
func (*DiskProperties) UnmarshalJSON ¶
func (d *DiskProperties) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type DiskProperties.
type DiskPurchasePlan ¶
type DiskPurchasePlan struct { // REQUIRED; The plan ID. Name *string // REQUIRED; Specifies the product of the image from the marketplace. This is the same value as Offer under the imageReference // element. Product *string // REQUIRED; The publisher ID. Publisher *string // The Offer Promotion Code. PromotionCode *string }
DiskPurchasePlan - Used for establishing the purchase context of any 3rd Party artifact through MarketPlace.
func (DiskPurchasePlan) MarshalJSON ¶
func (d DiskPurchasePlan) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type DiskPurchasePlan.
func (*DiskPurchasePlan) UnmarshalJSON ¶
func (d *DiskPurchasePlan) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type DiskPurchasePlan.
type DiskRestorePoint ¶
type DiskRestorePoint struct { // Properties of an incremental disk restore point Properties *DiskRestorePointProperties // READ-ONLY; Resource Id ID *string // READ-ONLY; Resource name Name *string // READ-ONLY; Resource type Type *string }
DiskRestorePoint - Properties of disk restore point
func (DiskRestorePoint) MarshalJSON ¶
func (d DiskRestorePoint) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type DiskRestorePoint.
func (*DiskRestorePoint) UnmarshalJSON ¶
func (d *DiskRestorePoint) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type DiskRestorePoint.
type DiskRestorePointAttributes ¶
type DiskRestorePointAttributes struct { // Encryption at rest settings for disk restore point. It is an optional property that can be specified in the input while // creating a restore point. Encryption *RestorePointEncryption // Resource Id of the source disk restore point. SourceDiskRestorePoint *APIEntityReference // READ-ONLY; Resource Id ID *string }
DiskRestorePointAttributes - Disk Restore Point details.
func (DiskRestorePointAttributes) MarshalJSON ¶
func (d DiskRestorePointAttributes) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type DiskRestorePointAttributes.
func (*DiskRestorePointAttributes) UnmarshalJSON ¶
func (d *DiskRestorePointAttributes) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type DiskRestorePointAttributes.
type DiskRestorePointClient ¶
type DiskRestorePointClient struct {
// contains filtered or unexported fields
}
DiskRestorePointClient contains the methods for the DiskRestorePoint group. Don't use this type directly, use NewDiskRestorePointClient() instead.
func NewDiskRestorePointClient ¶
func NewDiskRestorePointClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*DiskRestorePointClient, error)
NewDiskRestorePointClient creates a new instance of DiskRestorePointClient 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 (*DiskRestorePointClient) BeginGrantAccess ¶
func (client *DiskRestorePointClient) BeginGrantAccess(ctx context.Context, resourceGroupName string, restorePointCollectionName string, vmRestorePointName string, diskRestorePointName string, grantAccessData GrantAccessData, options *DiskRestorePointClientBeginGrantAccessOptions) (*runtime.Poller[DiskRestorePointClientGrantAccessResponse], error)
BeginGrantAccess - Grants access to a diskRestorePoint. If the operation fails it returns an *azcore.ResponseError type.
Generated from API version 2023-10-02
- resourceGroupName - The name of the resource group.
- restorePointCollectionName - The name of the restore point collection that the disk restore point belongs.
- vmRestorePointName - The name of the vm restore point that the disk disk restore point belongs.
- diskRestorePointName - The name of the disk restore point created.
- grantAccessData - Access data object supplied in the body of the get disk access operation.
- options - DiskRestorePointClientBeginGrantAccessOptions contains the optional parameters for the DiskRestorePointClient.BeginGrantAccess method.
Example ¶
Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/92de53a5f1e0e03c94b40475d2135d97148ed014/specification/compute/resource-manager/Microsoft.Compute/DiskRP/stable/2023-10-02/examples/diskRestorePointExamples/DiskRestorePoint_BeginGetAccess.json
cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() clientFactory, err := armcompute.NewClientFactory("<subscription-id>", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } poller, err := clientFactory.NewDiskRestorePointClient().BeginGrantAccess(ctx, "myResourceGroup", "rpc", "vmrp", "TestDisk45ceb03433006d1baee0_b70cd924-3362-4a80-93c2-9415eaa12745", armcompute.GrantAccessData{ Access: to.Ptr(armcompute.AccessLevelRead), DurationInSeconds: to.Ptr[int32](300), FileFormat: to.Ptr(armcompute.FileFormatVHDX), }, nil) if err != nil { log.Fatalf("failed to finish the request: %v", err) } res, err := poller.PollUntilDone(ctx, nil) if err != nil { log.Fatalf("failed to pull the result: %v", err) } // You could use response here. We use blank identifier for just demo purposes. _ = res // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. // res.AccessURI = armcompute.AccessURI{ // AccessSAS: to.Ptr("https://md-gpvmcxzlzxgd.partition.blob.storage.azure.net/xx3cqcx53f0v/abcd?sv=2014-02-14&sr=b&sk=key1&sig=XXX&st=2021-05-24T18:02:34Z&se=2021-05-24T18:19:14Z&sp=r"), // }
Output:
func (*DiskRestorePointClient) BeginRevokeAccess ¶
func (client *DiskRestorePointClient) BeginRevokeAccess(ctx context.Context, resourceGroupName string, restorePointCollectionName string, vmRestorePointName string, diskRestorePointName string, options *DiskRestorePointClientBeginRevokeAccessOptions) (*runtime.Poller[DiskRestorePointClientRevokeAccessResponse], error)
BeginRevokeAccess - Revokes access to a diskRestorePoint. If the operation fails it returns an *azcore.ResponseError type.
Generated from API version 2023-10-02
- resourceGroupName - The name of the resource group.
- restorePointCollectionName - The name of the restore point collection that the disk restore point belongs.
- vmRestorePointName - The name of the vm restore point that the disk disk restore point belongs.
- diskRestorePointName - The name of the disk restore point created.
- options - DiskRestorePointClientBeginRevokeAccessOptions contains the optional parameters for the DiskRestorePointClient.BeginRevokeAccess method.
Example ¶
Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/92de53a5f1e0e03c94b40475d2135d97148ed014/specification/compute/resource-manager/Microsoft.Compute/DiskRP/stable/2023-10-02/examples/diskRestorePointExamples/DiskRestorePoint_EndGetAccess.json
cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() clientFactory, err := armcompute.NewClientFactory("<subscription-id>", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } poller, err := clientFactory.NewDiskRestorePointClient().BeginRevokeAccess(ctx, "myResourceGroup", "rpc", "vmrp", "TestDisk45ceb03433006d1baee0_b70cd924-3362-4a80-93c2-9415eaa12745", nil) if err != nil { log.Fatalf("failed to finish the request: %v", err) } _, err = poller.PollUntilDone(ctx, nil) if err != nil { log.Fatalf("failed to pull the result: %v", err) }
Output:
func (*DiskRestorePointClient) Get ¶
func (client *DiskRestorePointClient) Get(ctx context.Context, resourceGroupName string, restorePointCollectionName string, vmRestorePointName string, diskRestorePointName string, options *DiskRestorePointClientGetOptions) (DiskRestorePointClientGetResponse, error)
Get - Get disk restorePoint resource If the operation fails it returns an *azcore.ResponseError type.
Generated from API version 2023-10-02
- resourceGroupName - The name of the resource group.
- restorePointCollectionName - The name of the restore point collection that the disk restore point belongs.
- vmRestorePointName - The name of the vm restore point that the disk disk restore point belongs.
- diskRestorePointName - The name of the disk restore point created.
- options - DiskRestorePointClientGetOptions contains the optional parameters for the DiskRestorePointClient.Get method.
Example (GetAnIncrementalDiskRestorePointResource) ¶
Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/92de53a5f1e0e03c94b40475d2135d97148ed014/specification/compute/resource-manager/Microsoft.Compute/DiskRP/stable/2023-10-02/examples/diskRestorePointExamples/DiskRestorePoint_Get.json
cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() clientFactory, err := armcompute.NewClientFactory("<subscription-id>", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } res, err := clientFactory.NewDiskRestorePointClient().Get(ctx, "myResourceGroup", "rpc", "vmrp", "TestDisk45ceb03433006d1baee0_b70cd924-3362-4a80-93c2-9415eaa12745", nil) if err != nil { log.Fatalf("failed to finish the request: %v", err) } // You could use response here. We use blank identifier for just demo purposes. _ = res // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. // res.DiskRestorePoint = armcompute.DiskRestorePoint{ // Name: to.Ptr("TestDisk45ceb03433006d1baee0_b70cd924-3362-4a80-93c2-9415eaa12745"), // ID: to.Ptr("/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/restorePointCollections/rpc/restorePoints/vmrp/diskRestorePoints/TestDisk45ceb03433006d1baee0_b70cd924-3362-4a80-93c2-9415eaa12745"), // Properties: &armcompute.DiskRestorePointProperties{ // FamilyID: to.Ptr("996bf3ce-b6ff-4e86-9db6-dc27ea06cea5"), // HyperVGeneration: to.Ptr(armcompute.HyperVGenerationV1), // NetworkAccessPolicy: to.Ptr(armcompute.NetworkAccessPolicyAllowAll), // OSType: to.Ptr(armcompute.OperatingSystemTypesWindows), // PublicNetworkAccess: to.Ptr(armcompute.PublicNetworkAccessDisabled), // SourceResourceID: to.Ptr("/subscriptions/d2260d06-e00d-422f-8b63-93df551a59ae/resourceGroups/rg0680fb0c-89f1-41b4-96c0-35733a181558/providers/Microsoft.Compute/disks/TestDisk45ceb03433006d1baee0"), // SourceUniqueID: to.Ptr("48e058b1-7eea-4968-b532-10a8a1130c13"), // TimeCreated: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-09-16T04:41:35.079Z"); return t}()), // }, // }
Output:
Example (GetAnIncrementalDiskRestorePointWhenSourceResourceIsFromADifferentRegion) ¶
Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/92de53a5f1e0e03c94b40475d2135d97148ed014/specification/compute/resource-manager/Microsoft.Compute/DiskRP/stable/2023-10-02/examples/diskRestorePointExamples/DiskRestorePoint_Get_WhenSourceResourceIsFromDifferentRegion.json
cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() clientFactory, err := armcompute.NewClientFactory("<subscription-id>", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } res, err := clientFactory.NewDiskRestorePointClient().Get(ctx, "myResourceGroup", "rpc", "vmrp", "TestDisk45ceb03433006d1baee0_b70cd924-3362-4a80-93c2-9415eaa12745", nil) if err != nil { log.Fatalf("failed to finish the request: %v", err) } // You could use response here. We use blank identifier for just demo purposes. _ = res // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. // res.DiskRestorePoint = armcompute.DiskRestorePoint{ // Name: to.Ptr("TestDisk45ceb03433006d1baee0_b70cd924-3362-4a80-93c2-9415eaa12745"), // ID: to.Ptr("/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/restorePointCollections/rpc/restorePoints/vmrp/diskRestorePoints/TestDisk45ceb03433006d1baee0_b70cd924-3362-4a80-93c2-9415eaa12745"), // Properties: &armcompute.DiskRestorePointProperties{ // CompletionPercent: to.Ptr[float32](100), // FamilyID: to.Ptr("996bf3ce-b6ff-4e86-9db6-dc27ea06cea5"), // HyperVGeneration: to.Ptr(armcompute.HyperVGenerationV1), // NetworkAccessPolicy: to.Ptr(armcompute.NetworkAccessPolicyAllowAll), // OSType: to.Ptr(armcompute.OperatingSystemTypesWindows), // PublicNetworkAccess: to.Ptr(armcompute.PublicNetworkAccessDisabled), // ReplicationState: to.Ptr("Succeeded"), // SourceResourceID: to.Ptr("/subscriptions/d2260d06-e00d-422f-8b63-93df551a59ae/resourceGroups/rg0680fb0c-89f1-41b4-96c0-35733a181558/providers/Microsoft.Compute/disks/TestDisk45ceb03433006d1baee0"), // SourceResourceLocation: to.Ptr("eastus2"), // SourceUniqueID: to.Ptr("48e058b1-7eea-4968-b532-10a8a1130c13"), // TimeCreated: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-09-16T04:41:35.079Z"); return t}()), // }, // }
Output:
func (*DiskRestorePointClient) NewListByRestorePointPager ¶
func (client *DiskRestorePointClient) NewListByRestorePointPager(resourceGroupName string, restorePointCollectionName string, vmRestorePointName string, options *DiskRestorePointClientListByRestorePointOptions) *runtime.Pager[DiskRestorePointClientListByRestorePointResponse]
NewListByRestorePointPager - Lists diskRestorePoints under a vmRestorePoint.
Generated from API version 2023-10-02
- resourceGroupName - The name of the resource group.
- restorePointCollectionName - The name of the restore point collection that the disk restore point belongs.
- vmRestorePointName - The name of the vm restore point that the disk disk restore point belongs.
- options - DiskRestorePointClientListByRestorePointOptions contains the optional parameters for the DiskRestorePointClient.NewListByRestorePointPager method.
Example ¶
Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/92de53a5f1e0e03c94b40475d2135d97148ed014/specification/compute/resource-manager/Microsoft.Compute/DiskRP/stable/2023-10-02/examples/diskRestorePointExamples/DiskRestorePoint_ListByVmRestorePoint.json
cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() clientFactory, err := armcompute.NewClientFactory("<subscription-id>", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } pager := clientFactory.NewDiskRestorePointClient().NewListByRestorePointPager("myResourceGroup", "rpc", "vmrp", nil) for pager.More() { page, err := pager.NextPage(ctx) if err != nil { log.Fatalf("failed to advance page: %v", err) } for _, v := range page.Value { // You could use page here. We use blank identifier for just demo purposes. _ = v } // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. // page.DiskRestorePointList = armcompute.DiskRestorePointList{ // Value: []*armcompute.DiskRestorePoint{ // { // Name: to.Ptr("TestDisk45ceb03433006d1baee0_b70cd924-3362-4a80-93c2-9415eaa12745"), // ID: to.Ptr("/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/restorePointCollections/rpc/restorePoints/vmrp/diskRestorePoints/TestDisk45ceb03433006d1baee0_b70cd924-3362-4a80-93c2-9415eaa12745"), // Properties: &armcompute.DiskRestorePointProperties{ // FamilyID: to.Ptr("996bf3ce-b6ff-4e86-9db6-dc27ea06cea5"), // HyperVGeneration: to.Ptr(armcompute.HyperVGenerationV1), // NetworkAccessPolicy: to.Ptr(armcompute.NetworkAccessPolicyAllowAll), // OSType: to.Ptr(armcompute.OperatingSystemTypesWindows), // PublicNetworkAccess: to.Ptr(armcompute.PublicNetworkAccessDisabled), // SourceResourceID: to.Ptr("/subscriptions/d2260d06-e00d-422f-8b63-93df551a59ae/resourceGroups/rg0680fb0c-89f1-41b4-96c0-35733a181558/providers/Microsoft.Compute/disks/TestDisk45ceb03433006d1baee0"), // SourceUniqueID: to.Ptr("48e058b1-7eea-4968-b532-10a8a1130c13"), // TimeCreated: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-09-16T04:41:35.079Z"); return t}()), // }, // }}, // } }
Output:
type DiskRestorePointClientBeginGrantAccessOptions ¶
type DiskRestorePointClientBeginGrantAccessOptions struct { // Resumes the LRO from the provided token. ResumeToken string }
DiskRestorePointClientBeginGrantAccessOptions contains the optional parameters for the DiskRestorePointClient.BeginGrantAccess method.
type DiskRestorePointClientBeginRevokeAccessOptions ¶
type DiskRestorePointClientBeginRevokeAccessOptions struct { // Resumes the LRO from the provided token. ResumeToken string }
DiskRestorePointClientBeginRevokeAccessOptions contains the optional parameters for the DiskRestorePointClient.BeginRevokeAccess method.
type DiskRestorePointClientGetOptions ¶
type DiskRestorePointClientGetOptions struct { }
DiskRestorePointClientGetOptions contains the optional parameters for the DiskRestorePointClient.Get method.
type DiskRestorePointClientGetResponse ¶
type DiskRestorePointClientGetResponse struct { // Properties of disk restore point DiskRestorePoint }
DiskRestorePointClientGetResponse contains the response from method DiskRestorePointClient.Get.
type DiskRestorePointClientGrantAccessResponse ¶
type DiskRestorePointClientGrantAccessResponse struct { // A disk access SAS uri. AccessURI }
DiskRestorePointClientGrantAccessResponse contains the response from method DiskRestorePointClient.BeginGrantAccess.
type DiskRestorePointClientListByRestorePointOptions ¶
type DiskRestorePointClientListByRestorePointOptions struct { }
DiskRestorePointClientListByRestorePointOptions contains the optional parameters for the DiskRestorePointClient.NewListByRestorePointPager method.
type DiskRestorePointClientListByRestorePointResponse ¶
type DiskRestorePointClientListByRestorePointResponse struct { // The List Disk Restore Points operation response. DiskRestorePointList }
DiskRestorePointClientListByRestorePointResponse contains the response from method DiskRestorePointClient.NewListByRestorePointPager.
type DiskRestorePointClientRevokeAccessResponse ¶
type DiskRestorePointClientRevokeAccessResponse struct { }
DiskRestorePointClientRevokeAccessResponse contains the response from method DiskRestorePointClient.BeginRevokeAccess.
type DiskRestorePointInstanceView ¶
type DiskRestorePointInstanceView struct { // Disk restore point Id. ID *string // The disk restore point replication status information. ReplicationStatus *DiskRestorePointReplicationStatus }
DiskRestorePointInstanceView - The instance view of a disk restore point.
func (DiskRestorePointInstanceView) MarshalJSON ¶
func (d DiskRestorePointInstanceView) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type DiskRestorePointInstanceView.
func (*DiskRestorePointInstanceView) UnmarshalJSON ¶
func (d *DiskRestorePointInstanceView) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type DiskRestorePointInstanceView.
type DiskRestorePointList ¶
type DiskRestorePointList struct { // REQUIRED; A list of disk restore points. Value []*DiskRestorePoint // The uri to fetch the next page of disk restore points. Call ListNext() with this to fetch the next page of disk restore // points. NextLink *string }
DiskRestorePointList - The List Disk Restore Points operation response.
func (DiskRestorePointList) MarshalJSON ¶
func (d DiskRestorePointList) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type DiskRestorePointList.
func (*DiskRestorePointList) UnmarshalJSON ¶
func (d *DiskRestorePointList) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type DiskRestorePointList.
type DiskRestorePointProperties ¶
type DiskRestorePointProperties struct { // Percentage complete for the background copy of disk restore point when source resource is from a different region. CompletionPercent *float32 // ARM id of the DiskAccess resource for using private endpoints on disks. DiskAccessID *string // The hypervisor generation of the Virtual Machine. Applicable to OS disks only. HyperVGeneration *HyperVGeneration // Policy for accessing the disk via network. NetworkAccessPolicy *NetworkAccessPolicy // Policy for controlling export on the disk. PublicNetworkAccess *PublicNetworkAccess // Purchase plan information for the the image from which the OS disk was created. PurchasePlan *DiskPurchasePlan // Contains the security related information for the resource. SecurityProfile *DiskSecurityProfile // List of supported capabilities for the image from which the OS disk was created. SupportedCapabilities *SupportedCapabilities // Indicates the OS on a disk supports hibernation. SupportsHibernation *bool // READ-ONLY; Encryption property can be used to encrypt data at rest with customer managed keys or platform managed keys. Encryption *Encryption // READ-ONLY; id of the backing snapshot's MIS family FamilyID *string // READ-ONLY; The Operating System type. OSType *OperatingSystemTypes // READ-ONLY; Replication state of disk restore point when source resource is from a different region. ReplicationState *string // READ-ONLY; arm id of source disk or source disk restore point. SourceResourceID *string // READ-ONLY; Location of source disk or source disk restore point when source resource is from a different region. SourceResourceLocation *string // READ-ONLY; unique incarnation id of the source disk SourceUniqueID *string // READ-ONLY; The timestamp of restorePoint creation TimeCreated *time.Time }
DiskRestorePointProperties - Properties of an incremental disk restore point
func (DiskRestorePointProperties) MarshalJSON ¶
func (d DiskRestorePointProperties) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type DiskRestorePointProperties.
func (*DiskRestorePointProperties) UnmarshalJSON ¶
func (d *DiskRestorePointProperties) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type DiskRestorePointProperties.
type DiskRestorePointReplicationStatus ¶
type DiskRestorePointReplicationStatus struct { // Replication completion percentage. CompletionPercent *int32 // The resource status information. Status *InstanceViewStatus }
DiskRestorePointReplicationStatus - The instance view of a disk restore point.
func (DiskRestorePointReplicationStatus) MarshalJSON ¶
func (d DiskRestorePointReplicationStatus) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type DiskRestorePointReplicationStatus.
func (*DiskRestorePointReplicationStatus) UnmarshalJSON ¶
func (d *DiskRestorePointReplicationStatus) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type DiskRestorePointReplicationStatus.
type DiskSKU ¶
type DiskSKU struct { // The sku name. Name *DiskStorageAccountTypes // READ-ONLY; The sku tier. Tier *string }
DiskSKU - The disks sku name. Can be StandardLRS, PremiumLRS, StandardSSDLRS, UltraSSDLRS, PremiumZRS, StandardSSDZRS, or PremiumV2_LRS.
func (DiskSKU) MarshalJSON ¶
MarshalJSON implements the json.Marshaller interface for type DiskSKU.
func (*DiskSKU) UnmarshalJSON ¶
UnmarshalJSON implements the json.Unmarshaller interface for type DiskSKU.
type DiskSecurityProfile ¶
type DiskSecurityProfile struct { // ResourceId of the disk encryption set associated to Confidential VM supported disk encrypted with customer managed key SecureVMDiskEncryptionSetID *string // Specifies the SecurityType of the VM. Applicable for OS disks only. SecurityType *DiskSecurityTypes }
DiskSecurityProfile - Contains the security related information for the resource.
func (DiskSecurityProfile) MarshalJSON ¶
func (d DiskSecurityProfile) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type DiskSecurityProfile.
func (*DiskSecurityProfile) UnmarshalJSON ¶
func (d *DiskSecurityProfile) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type DiskSecurityProfile.
type DiskSecurityTypes ¶
type DiskSecurityTypes string
DiskSecurityTypes - Specifies the SecurityType of the VM. Applicable for OS disks only.
const ( // DiskSecurityTypesConfidentialVMDiskEncryptedWithCustomerKey - Indicates Confidential VM disk with both OS disk and VM guest // state encrypted with a customer managed key DiskSecurityTypesConfidentialVMDiskEncryptedWithCustomerKey DiskSecurityTypes = "ConfidentialVM_DiskEncryptedWithCustomerKey" // DiskSecurityTypesConfidentialVMDiskEncryptedWithPlatformKey - Indicates Confidential VM disk with both OS disk and VM guest // state encrypted with a platform managed key DiskSecurityTypesConfidentialVMDiskEncryptedWithPlatformKey DiskSecurityTypes = "ConfidentialVM_DiskEncryptedWithPlatformKey" // DiskSecurityTypesConfidentialVMNonPersistedTPM - Indicates Confidential VM disk with a ephemeral vTPM. vTPM state is not // persisted across VM reboots. DiskSecurityTypesConfidentialVMNonPersistedTPM DiskSecurityTypes = "ConfidentialVM_NonPersistedTPM" // DiskSecurityTypesConfidentialVMVmguestStateOnlyEncryptedWithPlatformKey - Indicates Confidential VM disk with only VM guest // state encrypted DiskSecurityTypesConfidentialVMVmguestStateOnlyEncryptedWithPlatformKey DiskSecurityTypes = "ConfidentialVM_VMGuestStateOnlyEncryptedWithPlatformKey" // DiskSecurityTypesTrustedLaunch - Trusted Launch provides security features such as secure boot and virtual Trusted Platform // Module (vTPM) DiskSecurityTypesTrustedLaunch DiskSecurityTypes = "TrustedLaunch" )
func PossibleDiskSecurityTypesValues ¶
func PossibleDiskSecurityTypesValues() []DiskSecurityTypes
PossibleDiskSecurityTypesValues returns the possible values for the DiskSecurityTypes const type.
type DiskState ¶
type DiskState string
DiskState - This enumerates the possible state of the disk.
const ( // DiskStateActiveSAS - The disk currently has an Active SAS Uri associated with it. DiskStateActiveSAS DiskState = "ActiveSAS" // DiskStateActiveSASFrozen - The disk is attached to a VM in hibernated state and has an active SAS URI associated with it. DiskStateActiveSASFrozen DiskState = "ActiveSASFrozen" // DiskStateActiveUpload - A disk is created for upload and a write token has been issued for uploading to it. DiskStateActiveUpload DiskState = "ActiveUpload" // DiskStateAttached - The disk is currently attached to a running VM. DiskStateAttached DiskState = "Attached" // DiskStateFrozen - The disk is attached to a VM which is in hibernated state. DiskStateFrozen DiskState = "Frozen" // DiskStateReadyToUpload - A disk is ready to be created by upload by requesting a write token. DiskStateReadyToUpload DiskState = "ReadyToUpload" // DiskStateReserved - The disk is attached to a stopped-deallocated VM. DiskStateReserved DiskState = "Reserved" // DiskStateUnattached - The disk is not being used and can be attached to a VM. DiskStateUnattached DiskState = "Unattached" )
func PossibleDiskStateValues ¶
func PossibleDiskStateValues() []DiskState
PossibleDiskStateValues returns the possible values for the DiskState const type.
type DiskStorageAccountTypes ¶
type DiskStorageAccountTypes string
DiskStorageAccountTypes - The sku name.
const ( // DiskStorageAccountTypesPremiumLRS - Premium SSD locally redundant storage. Best for production and performance sensitive // workloads. DiskStorageAccountTypesPremiumLRS DiskStorageAccountTypes = "Premium_LRS" // DiskStorageAccountTypesPremiumV2LRS - Premium SSD v2 locally redundant storage. Best for production and performance-sensitive // workloads that consistently require low latency and high IOPS and throughput. DiskStorageAccountTypesPremiumV2LRS DiskStorageAccountTypes = "PremiumV2_LRS" // DiskStorageAccountTypesPremiumZRS - Premium SSD zone redundant storage. Best for the production workloads that need storage // resiliency against zone failures. DiskStorageAccountTypesPremiumZRS DiskStorageAccountTypes = "Premium_ZRS" // DiskStorageAccountTypesStandardLRS - Standard HDD locally redundant storage. Best for backup, non-critical, and infrequent // access. DiskStorageAccountTypesStandardLRS DiskStorageAccountTypes = "Standard_LRS" // DiskStorageAccountTypesStandardSSDLRS - Standard SSD locally redundant storage. Best for web servers, lightly used enterprise // applications and dev/test. DiskStorageAccountTypesStandardSSDLRS DiskStorageAccountTypes = "StandardSSD_LRS" // DiskStorageAccountTypesStandardSSDZRS - Standard SSD zone redundant storage. Best for web servers, lightly used enterprise // applications and dev/test that need storage resiliency against zone failures. DiskStorageAccountTypesStandardSSDZRS DiskStorageAccountTypes = "StandardSSD_ZRS" // DiskStorageAccountTypesUltraSSDLRS - Ultra SSD locally redundant storage. Best for IO-intensive workloads such as SAP HANA, // top tier databases (for example, SQL, Oracle), and other transaction-heavy workloads. DiskStorageAccountTypesUltraSSDLRS DiskStorageAccountTypes = "UltraSSD_LRS" )
func PossibleDiskStorageAccountTypesValues ¶
func PossibleDiskStorageAccountTypesValues() []DiskStorageAccountTypes
PossibleDiskStorageAccountTypesValues returns the possible values for the DiskStorageAccountTypes const type.
type DiskUpdate ¶
type DiskUpdate struct { // Disk resource update properties. Properties *DiskUpdateProperties // The disks sku name. Can be StandardLRS, PremiumLRS, StandardSSDLRS, UltraSSDLRS, PremiumZRS, StandardSSDZRS, or PremiumV2_LRS. SKU *DiskSKU // Resource tags Tags map[string]*string }
DiskUpdate - Disk update resource.
func (DiskUpdate) MarshalJSON ¶
func (d DiskUpdate) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type DiskUpdate.
func (*DiskUpdate) UnmarshalJSON ¶
func (d *DiskUpdate) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type DiskUpdate.
type DiskUpdateProperties ¶
type DiskUpdateProperties struct { // Set to true to enable bursting beyond the provisioned performance target of the disk. Bursting is disabled by default. // Does not apply to Ultra disks. BurstingEnabled *bool // Additional authentication requirements when exporting or uploading to a disk or snapshot. DataAccessAuthMode *DataAccessAuthMode // ARM id of the DiskAccess resource for using private endpoints on disks. DiskAccessID *string // The total number of IOPS that will be allowed across all VMs mounting the shared disk as ReadOnly. One operation can transfer // between 4k and 256k bytes. DiskIOPSReadOnly *int64 // The number of IOPS allowed for this disk; only settable for UltraSSD disks. One operation can transfer between 4k and 256k // bytes. DiskIOPSReadWrite *int64 // The total throughput (MBps) that will be allowed across all VMs mounting the shared disk as ReadOnly. MBps means millions // of bytes per second - MB here uses the ISO notation, of powers of 10. DiskMBpsReadOnly *int64 // The bandwidth allowed for this disk; only settable for UltraSSD disks. MBps means millions of bytes per second - MB here // uses the ISO notation, of powers of 10. DiskMBpsReadWrite *int64 // If creationData.createOption is Empty, this field is mandatory and it indicates the size of the disk to create. If this // field is present for updates or creation with other options, it indicates a // resize. Resizes are only allowed if the disk is not attached to a running VM, and can only increase the disk's size. DiskSizeGB *int32 // Encryption property can be used to encrypt data at rest with customer managed keys or platform managed keys. Encryption *Encryption // Encryption settings collection used be Azure Disk Encryption, can contain multiple encryption settings per disk or snapshot. EncryptionSettingsCollection *EncryptionSettingsCollection // be mounted on multiple VMs at the same time. MaxShares *int32 // Policy for accessing the disk via network. NetworkAccessPolicy *NetworkAccessPolicy // the Operating System type. OSType *OperatingSystemTypes // Setting this property to true improves reliability and performance of data disks that are frequently (more than 5 times // a day) by detached from one virtual machine and attached to another. This // property should not be set for disks that are not detached and attached frequently as it causes the disks to not align // with the fault domain of the virtual machine. OptimizedForFrequentAttach *bool // Policy for controlling export on the disk. PublicNetworkAccess *PublicNetworkAccess // Purchase plan information to be added on the OS disk PurchasePlan *DiskPurchasePlan // List of supported capabilities to be added on the OS disk. SupportedCapabilities *SupportedCapabilities // Indicates the OS on a disk supports hibernation. SupportsHibernation *bool // Performance tier of the disk (e.g, P4, S10) as described here: https://azure.microsoft.com/en-us/pricing/details/managed-disks/. // Does not apply to Ultra disks. Tier *string // READ-ONLY; Properties of the disk for which update is pending. PropertyUpdatesInProgress *PropertyUpdatesInProgress }
DiskUpdateProperties - Disk resource update properties.
func (DiskUpdateProperties) MarshalJSON ¶
func (d DiskUpdateProperties) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type DiskUpdateProperties.
func (*DiskUpdateProperties) UnmarshalJSON ¶
func (d *DiskUpdateProperties) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type DiskUpdateProperties.
type DisksClient ¶
type DisksClient struct {
// contains filtered or unexported fields
}
DisksClient contains the methods for the Disks group. Don't use this type directly, use NewDisksClient() instead.
func NewDisksClient ¶
func NewDisksClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*DisksClient, error)
NewDisksClient creates a new instance of DisksClient 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 (*DisksClient) BeginCreateOrUpdate ¶
func (client *DisksClient) BeginCreateOrUpdate(ctx context.Context, resourceGroupName string, diskName string, disk Disk, options *DisksClientBeginCreateOrUpdateOptions) (*runtime.Poller[DisksClientCreateOrUpdateResponse], error)
BeginCreateOrUpdate - Creates or updates a disk. If the operation fails it returns an *azcore.ResponseError type.
Generated from API version 2023-10-02
- resourceGroupName - The name of the resource group.
- diskName - The name of the managed disk that is being created. The name can't be changed after the disk is created. Supported characters for the name are a-z, A-Z, 0-9, _ and -. The maximum name length is 80 characters.
- disk - Disk object supplied in the body of the Put disk operation.
- options - DisksClientBeginCreateOrUpdateOptions contains the optional parameters for the DisksClient.BeginCreateOrUpdate method.
Example (CreateAConfidentialVmSupportedDiskEncryptedWithCustomerManagedKey) ¶
Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/92de53a5f1e0e03c94b40475d2135d97148ed014/specification/compute/resource-manager/Microsoft.Compute/DiskRP/stable/2023-10-02/examples/diskExamples/Disk_Create_ConfidentialVMSupportedDiskEncryptedWithCMK.json
cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() clientFactory, err := armcompute.NewClientFactory("<subscription-id>", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } poller, err := clientFactory.NewDisksClient().BeginCreateOrUpdate(ctx, "myResourceGroup", "myDisk", armcompute.Disk{ Location: to.Ptr("West US"), Properties: &armcompute.DiskProperties{ CreationData: &armcompute.CreationData{ CreateOption: to.Ptr(armcompute.DiskCreateOptionFromImage), ImageReference: &armcompute.ImageDiskReference{ ID: to.Ptr("/Subscriptions/{subscriptionId}/Providers/Microsoft.Compute/Locations/westus/Publishers/{publisher}/ArtifactTypes/VMImage/Offers/{offer}/Skus/{sku}/Versions/1.0.0"), }, }, OSType: to.Ptr(armcompute.OperatingSystemTypesWindows), SecurityProfile: &armcompute.DiskSecurityProfile{ SecureVMDiskEncryptionSetID: to.Ptr("/subscriptions/{subscriptionId}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/diskEncryptionSets/{diskEncryptionSetName}"), SecurityType: to.Ptr(armcompute.DiskSecurityTypesConfidentialVMDiskEncryptedWithCustomerKey), }, }, }, nil) if err != nil { log.Fatalf("failed to finish the request: %v", err) } res, err := poller.PollUntilDone(ctx, nil) if err != nil { log.Fatalf("failed to pull the result: %v", err) } // You could use response here. We use blank identifier for just demo purposes. _ = res // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. // res.Disk = armcompute.Disk{ // Name: to.Ptr("myDisk"), // ID: to.Ptr("/subscriptions/{subscriptionId}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/disks/myDisk"), // Location: to.Ptr("West US"), // Properties: &armcompute.DiskProperties{ // CreationData: &armcompute.CreationData{ // CreateOption: to.Ptr(armcompute.DiskCreateOptionFromImage), // ImageReference: &armcompute.ImageDiskReference{ // ID: to.Ptr("/Subscriptions/{subscriptionId}/Providers/Microsoft.Compute/Locations/westus/Publishers/{publisher}/ArtifactTypes/VMImage/Offers/{offer}/Skus/{sku}/Versions/1.0.0"), // }, // }, // OSType: to.Ptr(armcompute.OperatingSystemTypesWindows), // ProvisioningState: to.Ptr("Succeeded"), // SecurityProfile: &armcompute.DiskSecurityProfile{ // SecureVMDiskEncryptionSetID: to.Ptr("/subscriptions/{subscriptionId}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/diskEncryptionSets/{diskEncryptionSetName}"), // SecurityType: to.Ptr(armcompute.DiskSecurityTypesConfidentialVMDiskEncryptedWithCustomerKey), // }, // }, // }
Output:
Example (CreateAManagedDiskAndAssociateWithDiskAccessResource) ¶
Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/92de53a5f1e0e03c94b40475d2135d97148ed014/specification/compute/resource-manager/Microsoft.Compute/DiskRP/stable/2023-10-02/examples/diskExamples/Disk_Create_WithDiskAccess.json
cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() clientFactory, err := armcompute.NewClientFactory("<subscription-id>", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } poller, err := clientFactory.NewDisksClient().BeginCreateOrUpdate(ctx, "myResourceGroup", "myDisk", armcompute.Disk{ Location: to.Ptr("West US"), Properties: &armcompute.DiskProperties{ CreationData: &armcompute.CreationData{ CreateOption: to.Ptr(armcompute.DiskCreateOptionEmpty), }, DiskAccessID: to.Ptr("/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/diskAccesses/{existing-diskAccess-name}"), DiskSizeGB: to.Ptr[int32](200), NetworkAccessPolicy: to.Ptr(armcompute.NetworkAccessPolicyAllowPrivate), }, }, nil) if err != nil { log.Fatalf("failed to finish the request: %v", err) } res, err := poller.PollUntilDone(ctx, nil) if err != nil { log.Fatalf("failed to pull the result: %v", err) } // You could use response here. We use blank identifier for just demo purposes. _ = res // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. // res.Disk = armcompute.Disk{ // Name: to.Ptr("myDisk"), // ID: to.Ptr("/subscriptions/{subscriptionId}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/disks/myDisk"), // Location: to.Ptr("West US"), // Properties: &armcompute.DiskProperties{ // CreationData: &armcompute.CreationData{ // CreateOption: to.Ptr(armcompute.DiskCreateOptionEmpty), // }, // DiskAccessID: to.Ptr("/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/diskAccesses/{existing-diskAccess-name}"), // DiskSizeGB: to.Ptr[int32](200), // NetworkAccessPolicy: to.Ptr(armcompute.NetworkAccessPolicyAllowPrivate), // ProvisioningState: to.Ptr("Succeeded"), // PublicNetworkAccess: to.Ptr(armcompute.PublicNetworkAccessEnabled), // }, // }
Output:
Example (CreateAManagedDiskAndAssociateWithDiskEncryptionSet) ¶
Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/92de53a5f1e0e03c94b40475d2135d97148ed014/specification/compute/resource-manager/Microsoft.Compute/DiskRP/stable/2023-10-02/examples/diskExamples/Disk_Create_WithDiskEncryptionSet.json
cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() clientFactory, err := armcompute.NewClientFactory("<subscription-id>", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } poller, err := clientFactory.NewDisksClient().BeginCreateOrUpdate(ctx, "myResourceGroup", "myDisk", armcompute.Disk{ Location: to.Ptr("West US"), Properties: &armcompute.DiskProperties{ CreationData: &armcompute.CreationData{ CreateOption: to.Ptr(armcompute.DiskCreateOptionEmpty), }, DiskSizeGB: to.Ptr[int32](200), Encryption: &armcompute.Encryption{ DiskEncryptionSetID: to.Ptr("/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/diskEncryptionSets/{existing-diskEncryptionSet-name}"), }, }, }, nil) if err != nil { log.Fatalf("failed to finish the request: %v", err) } res, err := poller.PollUntilDone(ctx, nil) if err != nil { log.Fatalf("failed to pull the result: %v", err) } // You could use response here. We use blank identifier for just demo purposes. _ = res // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. // res.Disk = armcompute.Disk{ // Name: to.Ptr("myDisk"), // ID: to.Ptr("/subscriptions/{subscriptionId}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/disks/myDisk"), // Location: to.Ptr("West US"), // Properties: &armcompute.DiskProperties{ // CreationData: &armcompute.CreationData{ // CreateOption: to.Ptr(armcompute.DiskCreateOptionEmpty), // }, // DiskSizeGB: to.Ptr[int32](200), // Encryption: &armcompute.Encryption{ // DiskEncryptionSetID: to.Ptr("/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/diskEncryptionSets/{existing-diskEncryptionSet-name}"), // }, // ProvisioningState: to.Ptr("Succeeded"), // }, // }
Output:
Example (CreateAManagedDiskByCopyingASnapshot) ¶
Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/92de53a5f1e0e03c94b40475d2135d97148ed014/specification/compute/resource-manager/Microsoft.Compute/DiskRP/stable/2023-10-02/examples/diskExamples/Disk_Create_ByCopyingASnapshot.json
cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() clientFactory, err := armcompute.NewClientFactory("<subscription-id>", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } poller, err := clientFactory.NewDisksClient().BeginCreateOrUpdate(ctx, "myResourceGroup", "myDisk", armcompute.Disk{ Location: to.Ptr("West US"), Properties: &armcompute.DiskProperties{ CreationData: &armcompute.CreationData{ CreateOption: to.Ptr(armcompute.DiskCreateOptionCopy), SourceResourceID: to.Ptr("subscriptions/{subscriptionId}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/snapshots/mySnapshot"), }, }, }, nil) if err != nil { log.Fatalf("failed to finish the request: %v", err) } res, err := poller.PollUntilDone(ctx, nil) if err != nil { log.Fatalf("failed to pull the result: %v", err) } // You could use response here. We use blank identifier for just demo purposes. _ = res // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. // res.Disk = armcompute.Disk{ // Name: to.Ptr("myDisk"), // ID: to.Ptr("/subscriptions/{subscriptionId}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/disks/myDisk"), // Location: to.Ptr("West US"), // Properties: &armcompute.DiskProperties{ // CreationData: &armcompute.CreationData{ // CreateOption: to.Ptr(armcompute.DiskCreateOptionCopy), // SourceResourceID: to.Ptr("subscriptions/{subscriptionId}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/snapshots/mySnapshot"), // }, // ProvisioningState: to.Ptr("Succeeded"), // }, // }
Output:
Example (CreateAManagedDiskByImportingAnUnmanagedBlobFromADifferentSubscription) ¶
Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/92de53a5f1e0e03c94b40475d2135d97148ed014/specification/compute/resource-manager/Microsoft.Compute/DiskRP/stable/2023-10-02/examples/diskExamples/Disk_Create_ByImportingBlobFromADifferentSubscription.json
cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() clientFactory, err := armcompute.NewClientFactory("<subscription-id>", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } poller, err := clientFactory.NewDisksClient().BeginCreateOrUpdate(ctx, "myResourceGroup", "myDisk", armcompute.Disk{ Location: to.Ptr("West US"), Properties: &armcompute.DiskProperties{ CreationData: &armcompute.CreationData{ CreateOption: to.Ptr(armcompute.DiskCreateOptionImport), SourceURI: to.Ptr("https://mystorageaccount.blob.core.windows.net/osimages/osimage.vhd"), StorageAccountID: to.Ptr("subscriptions/{subscriptionId}/resourceGroups/myResourceGroup/providers/Microsoft.Storage/storageAccounts/myStorageAccount"), }, }, }, nil) if err != nil { log.Fatalf("failed to finish the request: %v", err) } res, err := poller.PollUntilDone(ctx, nil) if err != nil { log.Fatalf("failed to pull the result: %v", err) } // You could use response here. We use blank identifier for just demo purposes. _ = res // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. // res.Disk = armcompute.Disk{ // Name: to.Ptr("myDisk"), // ID: to.Ptr("/subscriptions/{subscriptionId}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/disks/myDisk"), // Location: to.Ptr("West US"), // Properties: &armcompute.DiskProperties{ // CreationData: &armcompute.CreationData{ // CreateOption: to.Ptr(armcompute.DiskCreateOptionImport), // SourceURI: to.Ptr("https://mystorageaccount.blob.core.windows.net/osimages/osimage.vhd"), // StorageAccountID: to.Ptr("subscriptions/{subscriptionId}/resourceGroups/myResourceGroup/providers/Microsoft.Storage/storageAccounts/myStorageAccount"), // }, // ProvisioningState: to.Ptr("Succeeded"), // }, // }
Output:
Example (CreateAManagedDiskByImportingAnUnmanagedBlobFromTheSameSubscription) ¶
Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/92de53a5f1e0e03c94b40475d2135d97148ed014/specification/compute/resource-manager/Microsoft.Compute/DiskRP/stable/2023-10-02/examples/diskExamples/Disk_Create_ByImportingBlobFromTheSameSubscription.json
cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() clientFactory, err := armcompute.NewClientFactory("<subscription-id>", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } poller, err := clientFactory.NewDisksClient().BeginCreateOrUpdate(ctx, "myResourceGroup", "myDisk", armcompute.Disk{ Location: to.Ptr("West US"), Properties: &armcompute.DiskProperties{ CreationData: &armcompute.CreationData{ CreateOption: to.Ptr(armcompute.DiskCreateOptionImport), SourceURI: to.Ptr("https://mystorageaccount.blob.core.windows.net/osimages/osimage.vhd"), }, }, }, nil) if err != nil { log.Fatalf("failed to finish the request: %v", err) } res, err := poller.PollUntilDone(ctx, nil) if err != nil { log.Fatalf("failed to pull the result: %v", err) } // You could use response here. We use blank identifier for just demo purposes. _ = res // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. // res.Disk = armcompute.Disk{ // Name: to.Ptr("myDisk"), // ID: to.Ptr("/subscriptions/{subscriptionId}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/disks/myDisk"), // Location: to.Ptr("West US"), // Properties: &armcompute.DiskProperties{ // CreationData: &armcompute.CreationData{ // CreateOption: to.Ptr(armcompute.DiskCreateOptionImport), // SourceURI: to.Ptr("https://mystorageaccount.blob.core.windows.net/osimages/osimage.vhd"), // }, // ProvisioningState: to.Ptr("Succeeded"), // }, // }
Output:
Example (CreateAManagedDiskFromAPlatformImage) ¶
Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/92de53a5f1e0e03c94b40475d2135d97148ed014/specification/compute/resource-manager/Microsoft.Compute/DiskRP/stable/2023-10-02/examples/diskExamples/Disk_Create_FromAPlatformImage.json
cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() clientFactory, err := armcompute.NewClientFactory("<subscription-id>", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } poller, err := clientFactory.NewDisksClient().BeginCreateOrUpdate(ctx, "myResourceGroup", "myDisk", armcompute.Disk{ Location: to.Ptr("West US"), Properties: &armcompute.DiskProperties{ CreationData: &armcompute.CreationData{ CreateOption: to.Ptr(armcompute.DiskCreateOptionFromImage), ImageReference: &armcompute.ImageDiskReference{ ID: to.Ptr("/Subscriptions/{subscriptionId}/Providers/Microsoft.Compute/Locations/westus/Publishers/{publisher}/ArtifactTypes/VMImage/Offers/{offer}/Skus/{sku}/Versions/1.0.0"), }, }, OSType: to.Ptr(armcompute.OperatingSystemTypesWindows), }, }, nil) if err != nil { log.Fatalf("failed to finish the request: %v", err) } res, err := poller.PollUntilDone(ctx, nil) if err != nil { log.Fatalf("failed to pull the result: %v", err) } // You could use response here. We use blank identifier for just demo purposes. _ = res // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. // res.Disk = armcompute.Disk{ // Name: to.Ptr("myDisk"), // ID: to.Ptr("/subscriptions/{subscriptionId}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/disks/myDisk"), // Location: to.Ptr("West US"), // Properties: &armcompute.DiskProperties{ // CreationData: &armcompute.CreationData{ // CreateOption: to.Ptr(armcompute.DiskCreateOptionFromImage), // ImageReference: &armcompute.ImageDiskReference{ // ID: to.Ptr("/Subscriptions/{subscriptionId}/Providers/Microsoft.Compute/Locations/westus/Publishers/{publisher}/ArtifactTypes/VMImage/Offers/{offer}/Skus/{sku}/Versions/1.0.0"), // }, // }, // HyperVGeneration: to.Ptr(armcompute.HyperVGenerationV1), // OSType: to.Ptr(armcompute.OperatingSystemTypesWindows), // ProvisioningState: to.Ptr("Succeeded"), // PurchasePlan: &armcompute.DiskPurchasePlan{ // Name: to.Ptr("{sku}"), // Product: to.Ptr("{offer}"), // Publisher: to.Ptr("{publisher}"), // }, // SupportedCapabilities: &armcompute.SupportedCapabilities{ // AcceleratedNetwork: to.Ptr(true), // }, // }, // }
Output:
Example (CreateAManagedDiskFromAnAzureComputeGalleryCommunityImage) ¶
Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/92de53a5f1e0e03c94b40475d2135d97148ed014/specification/compute/resource-manager/Microsoft.Compute/DiskRP/stable/2023-10-02/examples/diskExamples/Disk_Create_FromAnAzureComputeGalleryCommunityImage.json
cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() clientFactory, err := armcompute.NewClientFactory("<subscription-id>", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } poller, err := clientFactory.NewDisksClient().BeginCreateOrUpdate(ctx, "myResourceGroup", "myDisk", armcompute.Disk{ Location: to.Ptr("West US"), Properties: &armcompute.DiskProperties{ CreationData: &armcompute.CreationData{ CreateOption: to.Ptr(armcompute.DiskCreateOptionFromImage), GalleryImageReference: &armcompute.ImageDiskReference{ CommunityGalleryImageID: to.Ptr("/CommunityGalleries/{communityGalleryPublicGalleryName}/Images/{imageName}/Versions/1.0.0"), }, }, OSType: to.Ptr(armcompute.OperatingSystemTypesWindows), }, }, nil) if err != nil { log.Fatalf("failed to finish the request: %v", err) } res, err := poller.PollUntilDone(ctx, nil) if err != nil { log.Fatalf("failed to pull the result: %v", err) } // You could use response here. We use blank identifier for just demo purposes. _ = res // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. // res.Disk = armcompute.Disk{ // Name: to.Ptr("myDisk"), // ID: to.Ptr("/subscriptions/{subscriptionId}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/disks/myDisk"), // Location: to.Ptr("West US"), // Properties: &armcompute.DiskProperties{ // CreationData: &armcompute.CreationData{ // CreateOption: to.Ptr(armcompute.DiskCreateOptionFromImage), // GalleryImageReference: &armcompute.ImageDiskReference{ // CommunityGalleryImageID: to.Ptr("/CommunityGalleries/{communityGalleryPublicGalleryName}/Images/{imageName}/Versions/1.0.0"), // }, // }, // HyperVGeneration: to.Ptr(armcompute.HyperVGenerationV1), // OSType: to.Ptr(armcompute.OperatingSystemTypesWindows), // ProvisioningState: to.Ptr("Succeeded"), // SupportedCapabilities: &armcompute.SupportedCapabilities{ // AcceleratedNetwork: to.Ptr(true), // }, // }, // }
Output:
Example (CreateAManagedDiskFromAnAzureComputeGalleryImage) ¶
Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/92de53a5f1e0e03c94b40475d2135d97148ed014/specification/compute/resource-manager/Microsoft.Compute/DiskRP/stable/2023-10-02/examples/diskExamples/Disk_Create_FromAnAzureComputeGalleryImage.json
cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() clientFactory, err := armcompute.NewClientFactory("<subscription-id>", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } poller, err := clientFactory.NewDisksClient().BeginCreateOrUpdate(ctx, "myResourceGroup", "myDisk", armcompute.Disk{ Location: to.Ptr("West US"), Properties: &armcompute.DiskProperties{ CreationData: &armcompute.CreationData{ CreateOption: to.Ptr(armcompute.DiskCreateOptionFromImage), GalleryImageReference: &armcompute.ImageDiskReference{ ID: to.Ptr("/Subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/Providers/Microsoft.Compute/Galleries/{galleryName}/Images/{imageName}/Versions/1.0.0"), }, }, OSType: to.Ptr(armcompute.OperatingSystemTypesWindows), }, }, nil) if err != nil { log.Fatalf("failed to finish the request: %v", err) } res, err := poller.PollUntilDone(ctx, nil) if err != nil { log.Fatalf("failed to pull the result: %v", err) } // You could use response here. We use blank identifier for just demo purposes. _ = res // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. // res.Disk = armcompute.Disk{ // Name: to.Ptr("myDisk"), // ID: to.Ptr("/subscriptions/{subscriptionId}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/disks/myDisk"), // Location: to.Ptr("West US"), // Properties: &armcompute.DiskProperties{ // CreationData: &armcompute.CreationData{ // CreateOption: to.Ptr(armcompute.DiskCreateOptionFromImage), // GalleryImageReference: &armcompute.ImageDiskReference{ // ID: to.Ptr("/Subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/Providers/Microsoft.Compute/Galleries/{galleryName}/Images/{imageName}/Versions/1.0.0"), // }, // }, // HyperVGeneration: to.Ptr(armcompute.HyperVGenerationV1), // OSType: to.Ptr(armcompute.OperatingSystemTypesWindows), // ProvisioningState: to.Ptr("Succeeded"), // SupportedCapabilities: &armcompute.SupportedCapabilities{ // AcceleratedNetwork: to.Ptr(true), // }, // }, // }
Output:
Example (CreateAManagedDiskFromAnExistingManagedDiskInTheSameOrDifferentSubscription) ¶
Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/92de53a5f1e0e03c94b40475d2135d97148ed014/specification/compute/resource-manager/Microsoft.Compute/DiskRP/stable/2023-10-02/examples/diskExamples/Disk_Create_FromAnExistingManagedDisk.json
cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() clientFactory, err := armcompute.NewClientFactory("<subscription-id>", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } poller, err := clientFactory.NewDisksClient().BeginCreateOrUpdate(ctx, "myResourceGroup", "myDisk2", armcompute.Disk{ Location: to.Ptr("West US"), Properties: &armcompute.DiskProperties{ CreationData: &armcompute.CreationData{ CreateOption: to.Ptr(armcompute.DiskCreateOptionCopy), SourceResourceID: to.Ptr("subscriptions/{subscriptionId}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/disks/myDisk1"), }, }, }, nil) if err != nil { log.Fatalf("failed to finish the request: %v", err) } res, err := poller.PollUntilDone(ctx, nil) if err != nil { log.Fatalf("failed to pull the result: %v", err) } // You could use response here. We use blank identifier for just demo purposes. _ = res // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. // res.Disk = armcompute.Disk{ // Name: to.Ptr("myDisk2"), // ID: to.Ptr("/subscriptions/{subscriptionId}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/disks/myDisk"), // Location: to.Ptr("West US"), // Properties: &armcompute.DiskProperties{ // CreationData: &armcompute.CreationData{ // CreateOption: to.Ptr(armcompute.DiskCreateOptionCopy), // SourceResourceID: to.Ptr("subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/disks/myDisk1"), // }, // ProvisioningState: to.Ptr("Succeeded"), // }, // }
Output:
Example (CreateAManagedDiskFromElasticSanVolumeSnapshot) ¶
Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/92de53a5f1e0e03c94b40475d2135d97148ed014/specification/compute/resource-manager/Microsoft.Compute/DiskRP/stable/2023-10-02/examples/diskExamples/Disk_Create_FromAnElasticSanVolumeSnapshot.json
cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() clientFactory, err := armcompute.NewClientFactory("<subscription-id>", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } poller, err := clientFactory.NewDisksClient().BeginCreateOrUpdate(ctx, "myResourceGroup", "myDisk", armcompute.Disk{ Location: to.Ptr("West US"), Properties: &armcompute.DiskProperties{ CreationData: &armcompute.CreationData{ CreateOption: to.Ptr(armcompute.DiskCreateOptionCopyFromSanSnapshot), ElasticSanResourceID: to.Ptr("subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.ElasticSan/elasticSans/myElasticSan/volumegroups/myElasticSanVolumeGroup/snapshots/myElasticSanVolumeSnapshot"), }, }, }, nil) if err != nil { log.Fatalf("failed to finish the request: %v", err) } res, err := poller.PollUntilDone(ctx, nil) if err != nil { log.Fatalf("failed to pull the result: %v", err) } // You could use response here. We use blank identifier for just demo purposes. _ = res // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. // res.Disk = armcompute.Disk{ // Name: to.Ptr("myDisk"), // ID: to.Ptr("/subscriptions/{subscriptionId}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/disks/myDisk"), // Location: to.Ptr("West US"), // Properties: &armcompute.DiskProperties{ // CreationData: &armcompute.CreationData{ // CreateOption: to.Ptr(armcompute.DiskCreateOptionCopyFromSanSnapshot), // ElasticSanResourceID: to.Ptr("subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.ElasticSan/elasticSans/myElasticSan/volumegroups/myElasticSanVolumeGroup/snapshots/myElasticSanVolumeSnapshot"), // }, // ProvisioningState: to.Ptr("Succeeded"), // }, // }
Output:
Example (CreateAManagedDiskFromImportSecureCreateOption) ¶
Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/92de53a5f1e0e03c94b40475d2135d97148ed014/specification/compute/resource-manager/Microsoft.Compute/DiskRP/stable/2023-10-02/examples/diskExamples/Disk_Create_FromImportSecure.json
cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() clientFactory, err := armcompute.NewClientFactory("<subscription-id>", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } poller, err := clientFactory.NewDisksClient().BeginCreateOrUpdate(ctx, "myResourceGroup", "myDisk", armcompute.Disk{ Location: to.Ptr("West US"), Properties: &armcompute.DiskProperties{ CreationData: &armcompute.CreationData{ CreateOption: to.Ptr(armcompute.DiskCreateOptionImportSecure), SecurityDataURI: to.Ptr("https://mystorageaccount.blob.core.windows.net/osimages/vmgs.vhd"), SourceURI: to.Ptr("https://mystorageaccount.blob.core.windows.net/osimages/osimage.vhd"), StorageAccountID: to.Ptr("subscriptions/{subscriptionId}/resourceGroups/myResourceGroup/providers/Microsoft.Storage/storageAccounts/myStorageAccount"), }, OSType: to.Ptr(armcompute.OperatingSystemTypesWindows), SecurityProfile: &armcompute.DiskSecurityProfile{ SecurityType: to.Ptr(armcompute.DiskSecurityTypesConfidentialVMVmguestStateOnlyEncryptedWithPlatformKey), }, }, }, nil) if err != nil { log.Fatalf("failed to finish the request: %v", err) } res, err := poller.PollUntilDone(ctx, nil) if err != nil { log.Fatalf("failed to pull the result: %v", err) } // You could use response here. We use blank identifier for just demo purposes. _ = res // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. // res.Disk = armcompute.Disk{ // Name: to.Ptr("myDisk"), // ID: to.Ptr("/subscriptions/{subscriptionId}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/disks/myDisk"), // Location: to.Ptr("West US"), // Properties: &armcompute.DiskProperties{ // CreationData: &armcompute.CreationData{ // CreateOption: to.Ptr(armcompute.DiskCreateOptionImportSecure), // SecurityDataURI: to.Ptr("https://mystorageaccount.blob.core.windows.net/osimages/vmgs.vhd"), // SourceURI: to.Ptr("https://mystorageaccount.blob.core.windows.net/osimages/osimage.vhd"), // StorageAccountID: to.Ptr("subscriptions/{subscriptionId}/resourceGroups/myResourceGroup/providers/Microsoft.Storage/storageAccounts/myStorageAccount"), // }, // OSType: to.Ptr(armcompute.OperatingSystemTypesWindows), // ProvisioningState: to.Ptr("Succeeded"), // SecurityProfile: &armcompute.DiskSecurityProfile{ // SecurityType: to.Ptr(armcompute.DiskSecurityTypesConfidentialVMVmguestStateOnlyEncryptedWithPlatformKey), // }, // }, // }
Output:
Example (CreateAManagedDiskFromUploadPreparedSecureCreateOption) ¶
Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/92de53a5f1e0e03c94b40475d2135d97148ed014/specification/compute/resource-manager/Microsoft.Compute/DiskRP/stable/2023-10-02/examples/diskExamples/Disk_Create_FromUploadPreparedSecure.json
cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() clientFactory, err := armcompute.NewClientFactory("<subscription-id>", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } poller, err := clientFactory.NewDisksClient().BeginCreateOrUpdate(ctx, "myResourceGroup", "myDisk", armcompute.Disk{ Location: to.Ptr("West US"), Properties: &armcompute.DiskProperties{ CreationData: &armcompute.CreationData{ CreateOption: to.Ptr(armcompute.DiskCreateOptionUploadPreparedSecure), UploadSizeBytes: to.Ptr[int64](10737418752), }, OSType: to.Ptr(armcompute.OperatingSystemTypesWindows), SecurityProfile: &armcompute.DiskSecurityProfile{ SecurityType: to.Ptr(armcompute.DiskSecurityTypesTrustedLaunch), }, }, }, nil) if err != nil { log.Fatalf("failed to finish the request: %v", err) } res, err := poller.PollUntilDone(ctx, nil) if err != nil { log.Fatalf("failed to pull the result: %v", err) } // You could use response here. We use blank identifier for just demo purposes. _ = res // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. // res.Disk = armcompute.Disk{ // Name: to.Ptr("myDisk"), // ID: to.Ptr("/subscriptions/{subscriptionId}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/disks/myDisk"), // Location: to.Ptr("West US"), // Properties: &armcompute.DiskProperties{ // CreationData: &armcompute.CreationData{ // CreateOption: to.Ptr(armcompute.DiskCreateOptionUploadPreparedSecure), // UploadSizeBytes: to.Ptr[int64](10737418752), // }, // OSType: to.Ptr(armcompute.OperatingSystemTypesWindows), // ProvisioningState: to.Ptr("Succeeded"), // SecurityProfile: &armcompute.DiskSecurityProfile{ // SecurityType: to.Ptr(armcompute.DiskSecurityTypesTrustedLaunch), // }, // }, // }
Output:
Example (CreateAManagedDiskWithDataAccessAuthMode) ¶
Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/92de53a5f1e0e03c94b40475d2135d97148ed014/specification/compute/resource-manager/Microsoft.Compute/DiskRP/stable/2023-10-02/examples/diskExamples/Disk_Create_WithDataAccessAuthMode.json
cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() clientFactory, err := armcompute.NewClientFactory("<subscription-id>", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } poller, err := clientFactory.NewDisksClient().BeginCreateOrUpdate(ctx, "myResourceGroup", "myDisk", armcompute.Disk{ Location: to.Ptr("West US"), Properties: &armcompute.DiskProperties{ CreationData: &armcompute.CreationData{ CreateOption: to.Ptr(armcompute.DiskCreateOptionEmpty), }, DataAccessAuthMode: to.Ptr(armcompute.DataAccessAuthModeAzureActiveDirectory), DiskSizeGB: to.Ptr[int32](200), }, }, nil) if err != nil { log.Fatalf("failed to finish the request: %v", err) } res, err := poller.PollUntilDone(ctx, nil) if err != nil { log.Fatalf("failed to pull the result: %v", err) } // You could use response here. We use blank identifier for just demo purposes. _ = res // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. // res.Disk = armcompute.Disk{ // Name: to.Ptr("myDisk"), // ID: to.Ptr("/subscriptions/{subscriptionId}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/disks/myDisk"), // Location: to.Ptr("West US"), // Properties: &armcompute.DiskProperties{ // CreationData: &armcompute.CreationData{ // CreateOption: to.Ptr(armcompute.DiskCreateOptionEmpty), // }, // DataAccessAuthMode: to.Ptr(armcompute.DataAccessAuthModeAzureActiveDirectory), // DiskSizeGB: to.Ptr[int32](200), // ProvisioningState: to.Ptr("Succeeded"), // }, // }
Output:
Example (CreateAManagedDiskWithOptimizedForFrequentAttach) ¶
Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/92de53a5f1e0e03c94b40475d2135d97148ed014/specification/compute/resource-manager/Microsoft.Compute/DiskRP/stable/2023-10-02/examples/diskExamples/Disk_Create_WithOptimizedForFrequentAttach.json
cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() clientFactory, err := armcompute.NewClientFactory("<subscription-id>", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } poller, err := clientFactory.NewDisksClient().BeginCreateOrUpdate(ctx, "myResourceGroup", "myDisk", armcompute.Disk{ Location: to.Ptr("West US"), Properties: &armcompute.DiskProperties{ CreationData: &armcompute.CreationData{ CreateOption: to.Ptr(armcompute.DiskCreateOptionEmpty), }, DiskSizeGB: to.Ptr[int32](200), OptimizedForFrequentAttach: to.Ptr(true), }, }, nil) if err != nil { log.Fatalf("failed to finish the request: %v", err) } res, err := poller.PollUntilDone(ctx, nil) if err != nil { log.Fatalf("failed to pull the result: %v", err) } // You could use response here. We use blank identifier for just demo purposes. _ = res // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. // res.Disk = armcompute.Disk{ // Name: to.Ptr("myDisk"), // ID: to.Ptr("/subscriptions/{subscriptionId}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/disks/myDisk"), // Location: to.Ptr("West US"), // Properties: &armcompute.DiskProperties{ // CreationData: &armcompute.CreationData{ // CreateOption: to.Ptr(armcompute.DiskCreateOptionEmpty), // }, // DiskSizeGB: to.Ptr[int32](200), // OptimizedForFrequentAttach: to.Ptr(true), // ProvisioningState: to.Ptr("Succeeded"), // }, // }
Output:
Example (CreateAManagedDiskWithPerformancePlus) ¶
Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/92de53a5f1e0e03c94b40475d2135d97148ed014/specification/compute/resource-manager/Microsoft.Compute/DiskRP/stable/2023-10-02/examples/diskExamples/Disk_Create_PerformancePlus.json
cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() clientFactory, err := armcompute.NewClientFactory("<subscription-id>", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } poller, err := clientFactory.NewDisksClient().BeginCreateOrUpdate(ctx, "myResourceGroup", "myDisk", armcompute.Disk{ Location: to.Ptr("West US"), Properties: &armcompute.DiskProperties{ CreationData: &armcompute.CreationData{ CreateOption: to.Ptr(armcompute.DiskCreateOptionUpload), PerformancePlus: to.Ptr(true), }, }, }, nil) if err != nil { log.Fatalf("failed to finish the request: %v", err) } res, err := poller.PollUntilDone(ctx, nil) if err != nil { log.Fatalf("failed to pull the result: %v", err) } // You could use response here. We use blank identifier for just demo purposes. _ = res // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. // res.Disk = armcompute.Disk{ // Name: to.Ptr("myDisk"), // ID: to.Ptr("/subscriptions/{subscriptionId}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/disks/myDisk"), // Location: to.Ptr("West US"), // Properties: &armcompute.DiskProperties{ // CreationData: &armcompute.CreationData{ // CreateOption: to.Ptr(armcompute.DiskCreateOptionUpload), // PerformancePlus: to.Ptr(true), // }, // ProvisioningState: to.Ptr("Succeeded"), // }, // }
Output:
Example (CreateAManagedDiskWithPremiumV2AccountType) ¶
Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/92de53a5f1e0e03c94b40475d2135d97148ed014/specification/compute/resource-manager/Microsoft.Compute/DiskRP/stable/2023-10-02/examples/diskExamples/Disk_Create_WithPremiumV2_LRSAccountType.json
cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() clientFactory, err := armcompute.NewClientFactory("<subscription-id>", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } poller, err := clientFactory.NewDisksClient().BeginCreateOrUpdate(ctx, "myResourceGroup", "myPremiumV2Disk", armcompute.Disk{ Location: to.Ptr("West US"), Properties: &armcompute.DiskProperties{ CreationData: &armcompute.CreationData{ CreateOption: to.Ptr(armcompute.DiskCreateOptionEmpty), }, DiskIOPSReadWrite: to.Ptr[int64](125), DiskMBpsReadWrite: to.Ptr[int64](3000), DiskSizeGB: to.Ptr[int32](200), }, SKU: &armcompute.DiskSKU{ Name: to.Ptr(armcompute.DiskStorageAccountTypesPremiumV2LRS), }, }, nil) if err != nil { log.Fatalf("failed to finish the request: %v", err) } res, err := poller.PollUntilDone(ctx, nil) if err != nil { log.Fatalf("failed to pull the result: %v", err) } // You could use response here. We use blank identifier for just demo purposes. _ = res // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. // res.Disk = armcompute.Disk{ // Name: to.Ptr("myPremiumV2Disk"), // ID: to.Ptr("/subscriptions/{subscriptionId}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/disks/myDisk"), // Location: to.Ptr("West US"), // Properties: &armcompute.DiskProperties{ // CreationData: &armcompute.CreationData{ // CreateOption: to.Ptr(armcompute.DiskCreateOptionEmpty), // }, // DiskSizeGB: to.Ptr[int32](200), // ProvisioningState: to.Ptr("Succeeded"), // }, // SKU: &armcompute.DiskSKU{ // Name: to.Ptr(armcompute.DiskStorageAccountTypesPremiumV2LRS), // Tier: to.Ptr("Premium"), // }, // }
Output:
Example (CreateAManagedDiskWithSecurityProfile) ¶
Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/92de53a5f1e0e03c94b40475d2135d97148ed014/specification/compute/resource-manager/Microsoft.Compute/DiskRP/stable/2023-10-02/examples/diskExamples/Disk_Create_WithSecurityProfile.json
cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() clientFactory, err := armcompute.NewClientFactory("<subscription-id>", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } poller, err := clientFactory.NewDisksClient().BeginCreateOrUpdate(ctx, "myResourceGroup", "myDisk", armcompute.Disk{ Location: to.Ptr("North Central US"), Properties: &armcompute.DiskProperties{ CreationData: &armcompute.CreationData{ CreateOption: to.Ptr(armcompute.DiskCreateOptionFromImage), ImageReference: &armcompute.ImageDiskReference{ ID: to.Ptr("/Subscriptions/{subscriptionId}/Providers/Microsoft.Compute/Locations/uswest/Publishers/Microsoft/ArtifactTypes/VMImage/Offers/{offer}"), }, }, OSType: to.Ptr(armcompute.OperatingSystemTypesWindows), SecurityProfile: &armcompute.DiskSecurityProfile{ SecurityType: to.Ptr(armcompute.DiskSecurityTypesTrustedLaunch), }, }, }, nil) if err != nil { log.Fatalf("failed to finish the request: %v", err) } res, err := poller.PollUntilDone(ctx, nil) if err != nil { log.Fatalf("failed to pull the result: %v", err) } // You could use response here. We use blank identifier for just demo purposes. _ = res // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. // res.Disk = armcompute.Disk{ // Name: to.Ptr("myDisk"), // ID: to.Ptr("/subscriptions/{subscriptionId}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/disks/myDisk"), // Location: to.Ptr("North Central US"), // Properties: &armcompute.DiskProperties{ // CreationData: &armcompute.CreationData{ // CreateOption: to.Ptr(armcompute.DiskCreateOptionFromImage), // ImageReference: &armcompute.ImageDiskReference{ // ID: to.Ptr("/Subscriptions/{subscriptionId}/Providers/Microsoft.Compute/Locations/uswest/Publishers/Microsoft/ArtifactTypes/VMImage/Offers/{offer}"), // }, // }, // OSType: to.Ptr(armcompute.OperatingSystemTypesWindows), // ProvisioningState: to.Ptr("Succeeded"), // SecurityProfile: &armcompute.DiskSecurityProfile{ // SecurityType: to.Ptr(armcompute.DiskSecurityTypesTrustedLaunch), // }, // }, // }
Output:
Example (CreateAManagedDiskWithSsdZrsAccountType) ¶
Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/92de53a5f1e0e03c94b40475d2135d97148ed014/specification/compute/resource-manager/Microsoft.Compute/DiskRP/stable/2023-10-02/examples/diskExamples/Disk_Create_WithSSDZRSAccountType.json
cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() clientFactory, err := armcompute.NewClientFactory("<subscription-id>", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } poller, err := clientFactory.NewDisksClient().BeginCreateOrUpdate(ctx, "myResourceGroup", "myDisk", armcompute.Disk{ Location: to.Ptr("West US"), Properties: &armcompute.DiskProperties{ CreationData: &armcompute.CreationData{ CreateOption: to.Ptr(armcompute.DiskCreateOptionEmpty), }, DiskSizeGB: to.Ptr[int32](200), }, SKU: &armcompute.DiskSKU{ Name: to.Ptr(armcompute.DiskStorageAccountTypesPremiumZRS), }, }, nil) if err != nil { log.Fatalf("failed to finish the request: %v", err) } res, err := poller.PollUntilDone(ctx, nil) if err != nil { log.Fatalf("failed to pull the result: %v", err) } // You could use response here. We use blank identifier for just demo purposes. _ = res // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. // res.Disk = armcompute.Disk{ // Name: to.Ptr("myDisk"), // ID: to.Ptr("/subscriptions/{subscriptionId}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/disks/myDisk"), // Location: to.Ptr("West US"), // Properties: &armcompute.DiskProperties{ // CreationData: &armcompute.CreationData{ // CreateOption: to.Ptr(armcompute.DiskCreateOptionEmpty), // }, // DiskSizeGB: to.Ptr[int32](200), // ProvisioningState: to.Ptr("Succeeded"), // }, // SKU: &armcompute.DiskSKU{ // Name: to.Ptr(armcompute.DiskStorageAccountTypesPremiumZRS), // Tier: to.Ptr("Premium"), // }, // }
Output:
Example (CreateAManagedDiskWithUltraAccountTypeWithReadOnlyPropertySet) ¶
Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/92de53a5f1e0e03c94b40475d2135d97148ed014/specification/compute/resource-manager/Microsoft.Compute/DiskRP/stable/2023-10-02/examples/diskExamples/Disk_Create_WithUltraSSD_ReadOnly.json
cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() clientFactory, err := armcompute.NewClientFactory("<subscription-id>", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } poller, err := clientFactory.NewDisksClient().BeginCreateOrUpdate(ctx, "myResourceGroup", "myUltraReadOnlyDisk", armcompute.Disk{ Location: to.Ptr("West US"), Properties: &armcompute.DiskProperties{ CreationData: &armcompute.CreationData{ CreateOption: to.Ptr(armcompute.DiskCreateOptionEmpty), LogicalSectorSize: to.Ptr[int32](4096), }, DiskIOPSReadWrite: to.Ptr[int64](125), DiskMBpsReadWrite: to.Ptr[int64](3000), DiskSizeGB: to.Ptr[int32](200), Encryption: &armcompute.Encryption{ Type: to.Ptr(armcompute.EncryptionTypeEncryptionAtRestWithPlatformKey), }, }, SKU: &armcompute.DiskSKU{ Name: to.Ptr(armcompute.DiskStorageAccountTypesUltraSSDLRS), }, }, nil) if err != nil { log.Fatalf("failed to finish the request: %v", err) } res, err := poller.PollUntilDone(ctx, nil) if err != nil { log.Fatalf("failed to pull the result: %v", err) } // You could use response here. We use blank identifier for just demo purposes. _ = res // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. // res.Disk = armcompute.Disk{ // Name: to.Ptr("myUltraReadOnlyDisk"), // ID: to.Ptr("/subscriptions/{subscriptionId}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/disks/myDisk"), // Location: to.Ptr("West US"), // Properties: &armcompute.DiskProperties{ // CreationData: &armcompute.CreationData{ // CreateOption: to.Ptr(armcompute.DiskCreateOptionEmpty), // }, // DiskSizeGB: to.Ptr[int32](200), // Encryption: &armcompute.Encryption{ // Type: to.Ptr(armcompute.EncryptionTypeEncryptionAtRestWithPlatformKey), // }, // ProvisioningState: to.Ptr("Succeeded"), // }, // SKU: &armcompute.DiskSKU{ // Name: to.Ptr(armcompute.DiskStorageAccountTypesUltraSSDLRS), // Tier: to.Ptr("Ultra"), // }, // }
Output:
Example (CreateAManagedUploadDisk) ¶
Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/92de53a5f1e0e03c94b40475d2135d97148ed014/specification/compute/resource-manager/Microsoft.Compute/DiskRP/stable/2023-10-02/examples/diskExamples/Disk_Create_UploadDisk.json
cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() clientFactory, err := armcompute.NewClientFactory("<subscription-id>", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } poller, err := clientFactory.NewDisksClient().BeginCreateOrUpdate(ctx, "myResourceGroup", "myDisk", armcompute.Disk{ Location: to.Ptr("West US"), Properties: &armcompute.DiskProperties{ CreationData: &armcompute.CreationData{ CreateOption: to.Ptr(armcompute.DiskCreateOptionUpload), UploadSizeBytes: to.Ptr[int64](10737418752), }, }, }, nil) if err != nil { log.Fatalf("failed to finish the request: %v", err) } res, err := poller.PollUntilDone(ctx, nil) if err != nil { log.Fatalf("failed to pull the result: %v", err) } // You could use response here. We use blank identifier for just demo purposes. _ = res // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. // res.Disk = armcompute.Disk{ // Name: to.Ptr("myDisk"), // ID: to.Ptr("/subscriptions/{subscriptionId}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/disks/myDisk"), // Location: to.Ptr("West US"), // Properties: &armcompute.DiskProperties{ // CreationData: &armcompute.CreationData{ // CreateOption: to.Ptr(armcompute.DiskCreateOptionUpload), // UploadSizeBytes: to.Ptr[int64](10737418752), // }, // ProvisioningState: to.Ptr("Succeeded"), // }, // }
Output:
Example (CreateAnEmptyManagedDisk) ¶
Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/92de53a5f1e0e03c94b40475d2135d97148ed014/specification/compute/resource-manager/Microsoft.Compute/DiskRP/stable/2023-10-02/examples/diskExamples/Disk_Create_Empty.json
cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() clientFactory, err := armcompute.NewClientFactory("<subscription-id>", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } poller, err := clientFactory.NewDisksClient().BeginCreateOrUpdate(ctx, "myResourceGroup", "myDisk", armcompute.Disk{ Location: to.Ptr("West US"), Properties: &armcompute.DiskProperties{ CreationData: &armcompute.CreationData{ CreateOption: to.Ptr(armcompute.DiskCreateOptionEmpty), }, DiskSizeGB: to.Ptr[int32](200), }, }, nil) if err != nil { log.Fatalf("failed to finish the request: %v", err) } res, err := poller.PollUntilDone(ctx, nil) if err != nil { log.Fatalf("failed to pull the result: %v", err) } // You could use response here. We use blank identifier for just demo purposes. _ = res // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. // res.Disk = armcompute.Disk{ // Name: to.Ptr("myDisk"), // ID: to.Ptr("/subscriptions/{subscriptionId}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/disks/myDisk"), // Location: to.Ptr("West US"), // Properties: &armcompute.DiskProperties{ // CreationData: &armcompute.CreationData{ // CreateOption: to.Ptr(armcompute.DiskCreateOptionEmpty), // }, // DiskSizeGB: to.Ptr[int32](200), // ProvisioningState: to.Ptr("Succeeded"), // }, // }
Output:
Example (CreateAnEmptyManagedDiskInExtendedLocation) ¶
Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/92de53a5f1e0e03c94b40475d2135d97148ed014/specification/compute/resource-manager/Microsoft.Compute/DiskRP/stable/2023-10-02/examples/diskExamples/Disk_Create_InExtendedLocation.json
cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() clientFactory, err := armcompute.NewClientFactory("<subscription-id>", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } poller, err := clientFactory.NewDisksClient().BeginCreateOrUpdate(ctx, "myResourceGroup", "myDisk", armcompute.Disk{ Location: to.Ptr("West US"), ExtendedLocation: &armcompute.ExtendedLocation{ Name: to.Ptr("{edge-zone-id}"), Type: to.Ptr(armcompute.ExtendedLocationTypesEdgeZone), }, Properties: &armcompute.DiskProperties{ CreationData: &armcompute.CreationData{ CreateOption: to.Ptr(armcompute.DiskCreateOptionEmpty), }, DiskSizeGB: to.Ptr[int32](200), }, }, nil) if err != nil { log.Fatalf("failed to finish the request: %v", err) } res, err := poller.PollUntilDone(ctx, nil) if err != nil { log.Fatalf("failed to pull the result: %v", err) } // You could use response here. We use blank identifier for just demo purposes. _ = res // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. // res.Disk = armcompute.Disk{ // Name: to.Ptr("myDisk"), // ID: to.Ptr("/subscriptions/{subscriptionId}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/disks/myDisk"), // Location: to.Ptr("West US"), // ExtendedLocation: &armcompute.ExtendedLocation{ // Name: to.Ptr("{edge-zone-id}"), // Type: to.Ptr(armcompute.ExtendedLocationTypesEdgeZone), // }, // Properties: &armcompute.DiskProperties{ // CreationData: &armcompute.CreationData{ // CreateOption: to.Ptr(armcompute.DiskCreateOptionEmpty), // }, // DiskSizeGB: to.Ptr[int32](200), // ProvisioningState: to.Ptr("Succeeded"), // }, // }
Output:
Example (CreateAnUltraManagedDiskWithLogicalSectorSize512E) ¶
Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/92de53a5f1e0e03c94b40475d2135d97148ed014/specification/compute/resource-manager/Microsoft.Compute/DiskRP/stable/2023-10-02/examples/diskExamples/Disk_Create_WithLogicalSectorSize.json
cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() clientFactory, err := armcompute.NewClientFactory("<subscription-id>", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } poller, err := clientFactory.NewDisksClient().BeginCreateOrUpdate(ctx, "myResourceGroup", "myDisk", armcompute.Disk{ Location: to.Ptr("West US"), Properties: &armcompute.DiskProperties{ CreationData: &armcompute.CreationData{ CreateOption: to.Ptr(armcompute.DiskCreateOptionEmpty), LogicalSectorSize: to.Ptr[int32](512), }, DiskSizeGB: to.Ptr[int32](200), }, SKU: &armcompute.DiskSKU{ Name: to.Ptr(armcompute.DiskStorageAccountTypesUltraSSDLRS), }, }, nil) if err != nil { log.Fatalf("failed to finish the request: %v", err) } res, err := poller.PollUntilDone(ctx, nil) if err != nil { log.Fatalf("failed to pull the result: %v", err) } // You could use response here. We use blank identifier for just demo purposes. _ = res // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. // res.Disk = armcompute.Disk{ // Name: to.Ptr("myDisk"), // ID: to.Ptr("/subscriptions/{subscriptionId}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/disks/myDisk"), // Location: to.Ptr("West US"), // Properties: &armcompute.DiskProperties{ // CreationData: &armcompute.CreationData{ // CreateOption: to.Ptr(armcompute.DiskCreateOptionEmpty), // LogicalSectorSize: to.Ptr[int32](512), // }, // DiskSizeGB: to.Ptr[int32](200), // ProvisioningState: to.Ptr("Succeeded"), // }, // SKU: &armcompute.DiskSKU{ // Name: to.Ptr(armcompute.DiskStorageAccountTypesUltraSSDLRS), // Tier: to.Ptr("Ultra"), // }, // }
Output:
func (*DisksClient) BeginDelete ¶
func (client *DisksClient) BeginDelete(ctx context.Context, resourceGroupName string, diskName string, options *DisksClientBeginDeleteOptions) (*runtime.Poller[DisksClientDeleteResponse], error)
BeginDelete - Deletes a disk. If the operation fails it returns an *azcore.ResponseError type.
Generated from API version 2023-10-02
- resourceGroupName - The name of the resource group.
- diskName - The name of the managed disk that is being created. The name can't be changed after the disk is created. Supported characters for the name are a-z, A-Z, 0-9, _ and -. The maximum name length is 80 characters.
- options - DisksClientBeginDeleteOptions contains the optional parameters for the DisksClient.BeginDelete method.
Example ¶
Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/92de53a5f1e0e03c94b40475d2135d97148ed014/specification/compute/resource-manager/Microsoft.Compute/DiskRP/stable/2023-10-02/examples/diskExamples/Disk_Delete.json
cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() clientFactory, err := armcompute.NewClientFactory("<subscription-id>", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } poller, err := clientFactory.NewDisksClient().BeginDelete(ctx, "myResourceGroup", "myDisk", nil) if err != nil { log.Fatalf("failed to finish the request: %v", err) } _, err = poller.PollUntilDone(ctx, nil) if err != nil { log.Fatalf("failed to pull the result: %v", err) }
Output:
func (*DisksClient) BeginGrantAccess ¶
func (client *DisksClient) BeginGrantAccess(ctx context.Context, resourceGroupName string, diskName string, grantAccessData GrantAccessData, options *DisksClientBeginGrantAccessOptions) (*runtime.Poller[DisksClientGrantAccessResponse], error)
BeginGrantAccess - Grants access to a disk. If the operation fails it returns an *azcore.ResponseError type.
Generated from API version 2023-10-02
- resourceGroupName - The name of the resource group.
- diskName - The name of the managed disk that is being created. The name can't be changed after the disk is created. Supported characters for the name are a-z, A-Z, 0-9, _ and -. The maximum name length is 80 characters.
- grantAccessData - Access data object supplied in the body of the get disk access operation.
- options - DisksClientBeginGrantAccessOptions contains the optional parameters for the DisksClient.BeginGrantAccess method.
Example (GetASasOnAManagedDisk) ¶
Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/92de53a5f1e0e03c94b40475d2135d97148ed014/specification/compute/resource-manager/Microsoft.Compute/DiskRP/stable/2023-10-02/examples/diskExamples/Disk_BeginGetAccess.json
cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() clientFactory, err := armcompute.NewClientFactory("<subscription-id>", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } poller, err := clientFactory.NewDisksClient().BeginGrantAccess(ctx, "myResourceGroup", "myDisk", armcompute.GrantAccessData{ Access: to.Ptr(armcompute.AccessLevelRead), DurationInSeconds: to.Ptr[int32](300), FileFormat: to.Ptr(armcompute.FileFormatVHD), }, nil) if err != nil { log.Fatalf("failed to finish the request: %v", err) } res, err := poller.PollUntilDone(ctx, nil) if err != nil { log.Fatalf("failed to pull the result: %v", err) } // You could use response here. We use blank identifier for just demo purposes. _ = res // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. // res.AccessURI = armcompute.AccessURI{ // AccessSAS: to.Ptr("https://md-gpvmcxzlzxgd.partition.blob.storage.azure.net/xx3cqcx53f0v/abcd?sv=2014-02-14&sr=b&sk=key1&sig=XXX&st=2021-05-24T18:02:34Z&se=2021-05-24T18:19:14Z&sp=r"), // }
Output:
Example (GetSasOnManagedDiskAndVmGuestState) ¶
Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/92de53a5f1e0e03c94b40475d2135d97148ed014/specification/compute/resource-manager/Microsoft.Compute/DiskRP/stable/2023-10-02/examples/diskExamples/Disk_BeginGetAccess_WithVMGuestState.json
cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() clientFactory, err := armcompute.NewClientFactory("<subscription-id>", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } poller, err := clientFactory.NewDisksClient().BeginGrantAccess(ctx, "myResourceGroup", "myDisk", armcompute.GrantAccessData{ Access: to.Ptr(armcompute.AccessLevelRead), DurationInSeconds: to.Ptr[int32](300), GetSecureVMGuestStateSAS: to.Ptr(true), }, nil) if err != nil { log.Fatalf("failed to finish the request: %v", err) } res, err := poller.PollUntilDone(ctx, nil) if err != nil { log.Fatalf("failed to pull the result: %v", err) } // You could use response here. We use blank identifier for just demo purposes. _ = res // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. // res.AccessURI = armcompute.AccessURI{ // AccessSAS: to.Ptr("https://md-gpvmcxzlzxgd.partition.blob.storage.azure.net/xx3cqcx53f0v/abcd?sv=2014-02-14&sr=b&sk=key1&sig=XXX&st=2021-05-24T18:02:34Z&se=2021-05-24T18:19:14Z&sp=r"), // SecurityDataAccessSAS: to.Ptr("https://md-gpvmcxzlzxgd.partition.blob.storage.azure.net/xx3cqcx53f0v/b9bf5824-6122-49e0-ba22-042f76ccd8a1_vmgs?sv=2014-02-14&sr=b&sk=key1&sig=XXX&st=2021-05-24T18:02:34Z&se=2021-05-24T18:19:14Z&sp=r"), // }
Output:
func (*DisksClient) BeginRevokeAccess ¶
func (client *DisksClient) BeginRevokeAccess(ctx context.Context, resourceGroupName string, diskName string, options *DisksClientBeginRevokeAccessOptions) (*runtime.Poller[DisksClientRevokeAccessResponse], error)
BeginRevokeAccess - Revokes access to a disk. If the operation fails it returns an *azcore.ResponseError type.
Generated from API version 2023-10-02
- resourceGroupName - The name of the resource group.
- diskName - The name of the managed disk that is being created. The name can't be changed after the disk is created. Supported characters for the name are a-z, A-Z, 0-9, _ and -. The maximum name length is 80 characters.
- options - DisksClientBeginRevokeAccessOptions contains the optional parameters for the DisksClient.BeginRevokeAccess method.
Example ¶
Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/92de53a5f1e0e03c94b40475d2135d97148ed014/specification/compute/resource-manager/Microsoft.Compute/DiskRP/stable/2023-10-02/examples/diskExamples/Disk_EndGetAccess.json
cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() clientFactory, err := armcompute.NewClientFactory("<subscription-id>", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } poller, err := clientFactory.NewDisksClient().BeginRevokeAccess(ctx, "myResourceGroup", "myDisk", nil) if err != nil { log.Fatalf("failed to finish the request: %v", err) } _, err = poller.PollUntilDone(ctx, nil) if err != nil { log.Fatalf("failed to pull the result: %v", err) }
Output:
func (*DisksClient) BeginUpdate ¶
func (client *DisksClient) BeginUpdate(ctx context.Context, resourceGroupName string, diskName string, disk DiskUpdate, options *DisksClientBeginUpdateOptions) (*runtime.Poller[DisksClientUpdateResponse], error)
BeginUpdate - Updates (patches) a disk. If the operation fails it returns an *azcore.ResponseError type.
Generated from API version 2023-10-02
- resourceGroupName - The name of the resource group.
- diskName - The name of the managed disk that is being created. The name can't be changed after the disk is created. Supported characters for the name are a-z, A-Z, 0-9, _ and -. The maximum name length is 80 characters.
- disk - Disk object supplied in the body of the Patch disk operation.
- options - DisksClientBeginUpdateOptions contains the optional parameters for the DisksClient.BeginUpdate method.
Example (CreateOrUpdateABurstingEnabledManagedDisk) ¶
Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/92de53a5f1e0e03c94b40475d2135d97148ed014/specification/compute/resource-manager/Microsoft.Compute/DiskRP/stable/2023-10-02/examples/diskExamples/Disk_CreateOrUpdate_BurstingEnabled.json
cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() clientFactory, err := armcompute.NewClientFactory("<subscription-id>", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } poller, err := clientFactory.NewDisksClient().BeginUpdate(ctx, "myResourceGroup", "myDisk", armcompute.DiskUpdate{ Properties: &armcompute.DiskUpdateProperties{ BurstingEnabled: to.Ptr(true), DiskSizeGB: to.Ptr[int32](1024), }, }, nil) if err != nil { log.Fatalf("failed to finish the request: %v", err) } res, err := poller.PollUntilDone(ctx, nil) if err != nil { log.Fatalf("failed to pull the result: %v", err) } // You could use response here. We use blank identifier for just demo purposes. _ = res // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. // res.Disk = armcompute.Disk{ // Name: to.Ptr("myDisk"), // ID: to.Ptr("/subscriptions/{subscriptionId}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/disks/myDisk"), // Location: to.Ptr("West US"), // Properties: &armcompute.DiskProperties{ // BurstingEnabled: to.Ptr(true), // CreationData: &armcompute.CreationData{ // CreateOption: to.Ptr(armcompute.DiskCreateOptionEmpty), // }, // DiskSizeGB: to.Ptr[int32](1024), // ProvisioningState: to.Ptr("Succeeded"), // }, // }
Output:
Example (UpdateAManagedDiskToAddAcceleratedNetworking) ¶
Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/92de53a5f1e0e03c94b40475d2135d97148ed014/specification/compute/resource-manager/Microsoft.Compute/DiskRP/stable/2023-10-02/examples/diskExamples/Disk_Update_AddAcceleratedNetworking.json
cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() clientFactory, err := armcompute.NewClientFactory("<subscription-id>", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } poller, err := clientFactory.NewDisksClient().BeginUpdate(ctx, "myResourceGroup", "myDisk", armcompute.DiskUpdate{ Properties: &armcompute.DiskUpdateProperties{ SupportedCapabilities: &armcompute.SupportedCapabilities{ AcceleratedNetwork: to.Ptr(false), }, }, }, nil) if err != nil { log.Fatalf("failed to finish the request: %v", err) } res, err := poller.PollUntilDone(ctx, nil) if err != nil { log.Fatalf("failed to pull the result: %v", err) } // You could use response here. We use blank identifier for just demo purposes. _ = res // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. // res.Disk = armcompute.Disk{ // Name: to.Ptr("myDisk"), // Location: to.Ptr("westus"), // Properties: &armcompute.DiskProperties{ // CreationData: &armcompute.CreationData{ // CreateOption: to.Ptr(armcompute.DiskCreateOptionFromImage), // ImageReference: &armcompute.ImageDiskReference{ // ID: to.Ptr("/Subscriptions/{subscription-id}/Providers/Microsoft.Compute/Locations/westus/Publishers/test_test_pmc2pc1/ArtifactTypes/VMImage/Offers/marketplace_vm_test/Skus/test_sku/Versions/1.0.0"), // }, // }, // DiskSizeGB: to.Ptr[int32](127), // HyperVGeneration: to.Ptr(armcompute.HyperVGenerationV1), // OSType: to.Ptr(armcompute.OperatingSystemTypesWindows), // ProvisioningState: to.Ptr("Succeeded"), // SupportedCapabilities: &armcompute.SupportedCapabilities{ // AcceleratedNetwork: to.Ptr(false), // }, // }, // SKU: &armcompute.DiskSKU{ // Name: to.Ptr(armcompute.DiskStorageAccountTypesStandardLRS), // Tier: to.Ptr("Standard"), // }, // }
Output:
Example (UpdateAManagedDiskToAddArchitecture) ¶
Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/92de53a5f1e0e03c94b40475d2135d97148ed014/specification/compute/resource-manager/Microsoft.Compute/DiskRP/stable/2023-10-02/examples/diskExamples/Disk_Update_ToAddArchitecture.json
cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() clientFactory, err := armcompute.NewClientFactory("<subscription-id>", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } poller, err := clientFactory.NewDisksClient().BeginUpdate(ctx, "myResourceGroup", "myDisk", armcompute.DiskUpdate{ Properties: &armcompute.DiskUpdateProperties{ SupportedCapabilities: &armcompute.SupportedCapabilities{ Architecture: to.Ptr(armcompute.ArchitectureArm64), }, }, }, nil) if err != nil { log.Fatalf("failed to finish the request: %v", err) } res, err := poller.PollUntilDone(ctx, nil) if err != nil { log.Fatalf("failed to pull the result: %v", err) } // You could use response here. We use blank identifier for just demo purposes. _ = res // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. // res.Disk = armcompute.Disk{ // Name: to.Ptr("myDisk"), // Location: to.Ptr("westus"), // Properties: &armcompute.DiskProperties{ // CreationData: &armcompute.CreationData{ // CreateOption: to.Ptr(armcompute.DiskCreateOptionFromImage), // ImageReference: &armcompute.ImageDiskReference{ // ID: to.Ptr("/Subscriptions/{subscription-id}/Providers/Microsoft.Compute/Locations/westus/Publishers/test_test_pmc2pc1/ArtifactTypes/VMImage/Offers/marketplace_vm_test/Skus/test_sku/Versions/1.0.0"), // }, // }, // DiskSizeGB: to.Ptr[int32](127), // HyperVGeneration: to.Ptr(armcompute.HyperVGenerationV1), // OSType: to.Ptr(armcompute.OperatingSystemTypesWindows), // ProvisioningState: to.Ptr("Succeeded"), // SupportedCapabilities: &armcompute.SupportedCapabilities{ // Architecture: to.Ptr(armcompute.ArchitectureArm64), // }, // }, // SKU: &armcompute.DiskSKU{ // Name: to.Ptr(armcompute.DiskStorageAccountTypesStandardLRS), // Tier: to.Ptr("Standard"), // }, // }
Output:
Example (UpdateAManagedDiskToAddPurchasePlan) ¶
Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/92de53a5f1e0e03c94b40475d2135d97148ed014/specification/compute/resource-manager/Microsoft.Compute/DiskRP/stable/2023-10-02/examples/diskExamples/Disk_Update_AddPurchasePlan.json
cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() clientFactory, err := armcompute.NewClientFactory("<subscription-id>", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } poller, err := clientFactory.NewDisksClient().BeginUpdate(ctx, "myResourceGroup", "myDisk", armcompute.DiskUpdate{ Properties: &armcompute.DiskUpdateProperties{ PurchasePlan: &armcompute.DiskPurchasePlan{ Name: to.Ptr("myPurchasePlanName"), Product: to.Ptr("myPurchasePlanProduct"), PromotionCode: to.Ptr("myPurchasePlanPromotionCode"), Publisher: to.Ptr("myPurchasePlanPublisher"), }, }, }, nil) if err != nil { log.Fatalf("failed to finish the request: %v", err) } res, err := poller.PollUntilDone(ctx, nil) if err != nil { log.Fatalf("failed to pull the result: %v", err) } // You could use response here. We use blank identifier for just demo purposes. _ = res // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. // res.Disk = armcompute.Disk{ // Name: to.Ptr("myDisk"), // Location: to.Ptr("westus"), // Properties: &armcompute.DiskProperties{ // CreationData: &armcompute.CreationData{ // CreateOption: to.Ptr(armcompute.DiskCreateOptionFromImage), // ImageReference: &armcompute.ImageDiskReference{ // ID: to.Ptr("/Subscriptions/{subscription-id}/Providers/Microsoft.Compute/Locations/westus/Publishers/test_test_pmc2pc1/ArtifactTypes/VMImage/Offers/marketplace_vm_test/Skus/test_sku/Versions/1.0.0"), // }, // }, // DiskSizeGB: to.Ptr[int32](127), // HyperVGeneration: to.Ptr(armcompute.HyperVGenerationV1), // OSType: to.Ptr(armcompute.OperatingSystemTypesWindows), // ProvisioningState: to.Ptr("Succeeded"), // PurchasePlan: &armcompute.DiskPurchasePlan{ // Name: to.Ptr("myPurchasePlanName"), // Product: to.Ptr("myPurchasePlanProduct"), // PromotionCode: to.Ptr("myPurchasePlanPromotionCode"), // Publisher: to.Ptr("myPurchasePlanPublisher"), // }, // }, // SKU: &armcompute.DiskSKU{ // Name: to.Ptr(armcompute.DiskStorageAccountTypesStandardLRS), // Tier: to.Ptr("Standard"), // }, // }
Output:
Example (UpdateAManagedDiskToAddSupportsHibernation) ¶
Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/92de53a5f1e0e03c94b40475d2135d97148ed014/specification/compute/resource-manager/Microsoft.Compute/DiskRP/stable/2023-10-02/examples/diskExamples/Disk_Update_AddSupportsHibernation.json
cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() clientFactory, err := armcompute.NewClientFactory("<subscription-id>", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } poller, err := clientFactory.NewDisksClient().BeginUpdate(ctx, "myResourceGroup", "myDisk", armcompute.DiskUpdate{ Properties: &armcompute.DiskUpdateProperties{ SupportsHibernation: to.Ptr(true), }, }, nil) if err != nil { log.Fatalf("failed to finish the request: %v", err) } res, err := poller.PollUntilDone(ctx, nil) if err != nil { log.Fatalf("failed to pull the result: %v", err) } // You could use response here. We use blank identifier for just demo purposes. _ = res // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. // res.Disk = armcompute.Disk{ // Name: to.Ptr("myDisk"), // Location: to.Ptr("westus"), // Properties: &armcompute.DiskProperties{ // CreationData: &armcompute.CreationData{ // CreateOption: to.Ptr(armcompute.DiskCreateOptionImport), // SourceURI: to.Ptr("https://mystorageaccount.blob.core.windows.net/osimages/osimage.vhd"), // }, // DiskSizeGB: to.Ptr[int32](127), // HyperVGeneration: to.Ptr(armcompute.HyperVGenerationV1), // OSType: to.Ptr(armcompute.OperatingSystemTypesWindows), // ProvisioningState: to.Ptr("Succeeded"), // SupportsHibernation: to.Ptr(true), // }, // SKU: &armcompute.DiskSKU{ // Name: to.Ptr(armcompute.DiskStorageAccountTypesStandardLRS), // Tier: to.Ptr("Standard"), // }, // }
Output:
Example (UpdateAManagedDiskToChangeTier) ¶
Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/92de53a5f1e0e03c94b40475d2135d97148ed014/specification/compute/resource-manager/Microsoft.Compute/DiskRP/stable/2023-10-02/examples/diskExamples/Disk_Update_ChangeTier.json
cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() clientFactory, err := armcompute.NewClientFactory("<subscription-id>", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } poller, err := clientFactory.NewDisksClient().BeginUpdate(ctx, "myResourceGroup", "myDisk", armcompute.DiskUpdate{ Properties: &armcompute.DiskUpdateProperties{ Tier: to.Ptr("P30"), }, }, nil) if err != nil { log.Fatalf("failed to finish the request: %v", err) } res, err := poller.PollUntilDone(ctx, nil) if err != nil { log.Fatalf("failed to pull the result: %v", err) } // You could use response here. We use blank identifier for just demo purposes. _ = res // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. // res.Disk = armcompute.Disk{ // Name: to.Ptr("myDisk"), // Location: to.Ptr("West US"), // Properties: &armcompute.DiskProperties{ // CreationData: &armcompute.CreationData{ // CreateOption: to.Ptr(armcompute.DiskCreateOptionEmpty), // }, // ProvisioningState: to.Ptr("Succeeded"), // Tier: to.Ptr("P30"), // }, // }
Output:
Example (UpdateAManagedDiskToDisableBursting) ¶
Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/92de53a5f1e0e03c94b40475d2135d97148ed014/specification/compute/resource-manager/Microsoft.Compute/DiskRP/stable/2023-10-02/examples/diskExamples/Disk_Update_DisableBursting.json
cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() clientFactory, err := armcompute.NewClientFactory("<subscription-id>", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } poller, err := clientFactory.NewDisksClient().BeginUpdate(ctx, "myResourceGroup", "myDisk", armcompute.DiskUpdate{ Properties: &armcompute.DiskUpdateProperties{ BurstingEnabled: to.Ptr(false), }, }, nil) if err != nil { log.Fatalf("failed to finish the request: %v", err) } res, err := poller.PollUntilDone(ctx, nil) if err != nil { log.Fatalf("failed to pull the result: %v", err) } // You could use response here. We use blank identifier for just demo purposes. _ = res // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. // res.Disk = armcompute.Disk{ // Name: to.Ptr("myDisk"), // Location: to.Ptr("West US"), // Properties: &armcompute.DiskProperties{ // CreationData: &armcompute.CreationData{ // CreateOption: to.Ptr(armcompute.DiskCreateOptionEmpty), // }, // ProvisioningState: to.Ptr("Succeeded"), // }, // }
Output:
Example (UpdateAManagedDiskToDisableOptimizedForFrequentAttach) ¶
Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/92de53a5f1e0e03c94b40475d2135d97148ed014/specification/compute/resource-manager/Microsoft.Compute/DiskRP/stable/2023-10-02/examples/diskExamples/Disk_Update_DisableOptimizedForFrequentAttach.json
cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() clientFactory, err := armcompute.NewClientFactory("<subscription-id>", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } poller, err := clientFactory.NewDisksClient().BeginUpdate(ctx, "myResourceGroup", "myDisk", armcompute.DiskUpdate{ Properties: &armcompute.DiskUpdateProperties{ OptimizedForFrequentAttach: to.Ptr(false), }, }, nil) if err != nil { log.Fatalf("failed to finish the request: %v", err) } res, err := poller.PollUntilDone(ctx, nil) if err != nil { log.Fatalf("failed to pull the result: %v", err) } // You could use response here. We use blank identifier for just demo purposes. _ = res // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. // res.Disk = armcompute.Disk{ // Name: to.Ptr("myDisk"), // Location: to.Ptr("West US"), // Properties: &armcompute.DiskProperties{ // CreationData: &armcompute.CreationData{ // CreateOption: to.Ptr(armcompute.DiskCreateOptionEmpty), // }, // DiskSizeGB: to.Ptr[int32](200), // OptimizedForFrequentAttach: to.Ptr(false), // ProvisioningState: to.Ptr("Succeeded"), // }, // }
Output:
Example (UpdateAManagedDiskWithDiskControllerTypes) ¶
Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/92de53a5f1e0e03c94b40475d2135d97148ed014/specification/compute/resource-manager/Microsoft.Compute/DiskRP/stable/2023-10-02/examples/diskExamples/Disk_Update_AddDiskControllerTypes.json
cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() clientFactory, err := armcompute.NewClientFactory("<subscription-id>", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } poller, err := clientFactory.NewDisksClient().BeginUpdate(ctx, "myResourceGroup", "myDisk", armcompute.DiskUpdate{ Properties: &armcompute.DiskUpdateProperties{ SupportedCapabilities: &armcompute.SupportedCapabilities{ DiskControllerTypes: to.Ptr("SCSI"), }, }, }, nil) if err != nil { log.Fatalf("failed to finish the request: %v", err) } res, err := poller.PollUntilDone(ctx, nil) if err != nil { log.Fatalf("failed to pull the result: %v", err) } // You could use response here. We use blank identifier for just demo purposes. _ = res // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. // res.Disk = armcompute.Disk{ // Name: to.Ptr("myDisk"), // Location: to.Ptr("westus"), // Properties: &armcompute.DiskProperties{ // CreationData: &armcompute.CreationData{ // CreateOption: to.Ptr(armcompute.DiskCreateOptionFromImage), // ImageReference: &armcompute.ImageDiskReference{ // ID: to.Ptr("/Subscriptions/{subscription-id}/Providers/Microsoft.Compute/Locations/westus/Publishers/marketplacetestfirstparty/ArtifactTypes/VMImage/Offers/nvme_test_062/Skus/test_sku/Versions/1.0.0"), // }, // }, // DiskSizeGB: to.Ptr[int32](127), // HyperVGeneration: to.Ptr(armcompute.HyperVGenerationV1), // OSType: to.Ptr(armcompute.OperatingSystemTypesWindows), // ProvisioningState: to.Ptr("Succeeded"), // SupportedCapabilities: &armcompute.SupportedCapabilities{ // DiskControllerTypes: to.Ptr("SCSI"), // }, // }, // SKU: &armcompute.DiskSKU{ // Name: to.Ptr(armcompute.DiskStorageAccountTypesStandardLRS), // Tier: to.Ptr("Standard"), // }, // }
Output:
Example (UpdateManagedDiskToRemoveDiskAccessResourceAssociation) ¶
Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/92de53a5f1e0e03c94b40475d2135d97148ed014/specification/compute/resource-manager/Microsoft.Compute/DiskRP/stable/2023-10-02/examples/diskExamples/Disk_Update_RemoveDiskAccess.json
cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() clientFactory, err := armcompute.NewClientFactory("<subscription-id>", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } poller, err := clientFactory.NewDisksClient().BeginUpdate(ctx, "myResourceGroup", "myDisk", armcompute.DiskUpdate{ Properties: &armcompute.DiskUpdateProperties{ NetworkAccessPolicy: to.Ptr(armcompute.NetworkAccessPolicyAllowAll), }, }, nil) if err != nil { log.Fatalf("failed to finish the request: %v", err) } res, err := poller.PollUntilDone(ctx, nil) if err != nil { log.Fatalf("failed to pull the result: %v", err) } // You could use response here. We use blank identifier for just demo purposes. _ = res // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. // res.Disk = armcompute.Disk{ // Name: to.Ptr("myDisk"), // Location: to.Ptr("West US"), // Properties: &armcompute.DiskProperties{ // CreationData: &armcompute.CreationData{ // CreateOption: to.Ptr(armcompute.DiskCreateOptionEmpty), // }, // DiskSizeGB: to.Ptr[int32](200), // NetworkAccessPolicy: to.Ptr(armcompute.NetworkAccessPolicyAllowAll), // ProvisioningState: to.Ptr("Succeeded"), // }, // }
Output:
func (*DisksClient) Get ¶
func (client *DisksClient) Get(ctx context.Context, resourceGroupName string, diskName string, options *DisksClientGetOptions) (DisksClientGetResponse, error)
Get - Gets information about a disk. If the operation fails it returns an *azcore.ResponseError type.
Generated from API version 2023-10-02
- resourceGroupName - The name of the resource group.
- diskName - The name of the managed disk that is being created. The name can't be changed after the disk is created. Supported characters for the name are a-z, A-Z, 0-9, _ and -. The maximum name length is 80 characters.
- options - DisksClientGetOptions contains the optional parameters for the DisksClient.Get method.
Example ¶
Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/92de53a5f1e0e03c94b40475d2135d97148ed014/specification/compute/resource-manager/Microsoft.Compute/DiskRP/stable/2023-10-02/examples/diskExamples/Disk_Get.json
cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() clientFactory, err := armcompute.NewClientFactory("<subscription-id>", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } res, err := clientFactory.NewDisksClient().Get(ctx, "myResourceGroup", "myManagedDisk", nil) if err != nil { log.Fatalf("failed to finish the request: %v", err) } // You could use response here. We use blank identifier for just demo purposes. _ = res // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. // res.Disk = armcompute.Disk{ // Name: to.Ptr("myManagedDisk"), // Type: to.Ptr("Microsoft.Compute/disks"), // ID: to.Ptr("/subscriptions/{subscriptionId}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/disks/myManagedDisk"), // Location: to.Ptr("westus"), // Tags: map[string]*string{ // "department": to.Ptr("Development"), // "project": to.Ptr("ManagedDisks"), // }, // ManagedBy: to.Ptr("/subscriptions/123caaa-123v-v211-a49f-f88ccac5bf88/resourceGroups/ResourceGroupName/providers/Microsoft.Compute/virtualMachines/TestVM414689371c88843d65ec"), // Properties: &armcompute.DiskProperties{ // LastOwnershipUpdateTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2016-12-28T04:41:35.079Z"); return t}()), // CreationData: &armcompute.CreationData{ // CreateOption: to.Ptr(armcompute.DiskCreateOptionFromImage), // ImageReference: &armcompute.ImageDiskReference{ // ID: to.Ptr("/Subscriptions/{subscription-id}/Providers/Microsoft.Compute/Locations/westus/Publishers/test_test_pmc2pc1/ArtifactTypes/VMImage/Offers/marketplace_vm_test/Skus/test_sku/Versions/1.0.0"), // }, // }, // DiskSizeGB: to.Ptr[int32](10), // Encryption: &armcompute.Encryption{ // Type: to.Ptr(armcompute.EncryptionTypeEncryptionAtRestWithPlatformKey), // }, // EncryptionSettingsCollection: &armcompute.EncryptionSettingsCollection{ // Enabled: to.Ptr(true), // EncryptionSettings: []*armcompute.EncryptionSettingsElement{ // { // DiskEncryptionKey: &armcompute.KeyVaultAndSecretReference{ // SecretURL: to.Ptr("https://myvmvault.vault-int.azure-int.net/secrets/{secret}"), // SourceVault: &armcompute.SourceVault{ // ID: to.Ptr("/subscriptions/{subscriptionId}/resourceGroups/myResourceGroup/providers/Microsoft.KeyVault/vaults/myVMVault"), // }, // }, // KeyEncryptionKey: &armcompute.KeyVaultAndKeyReference{ // KeyURL: to.Ptr("https://myvmvault.vault-int.azure-int.net/keys/{key}"), // SourceVault: &armcompute.SourceVault{ // ID: to.Ptr("/subscriptions/{subscriptionId}/resourceGroups/myResourceGroup/providers/Microsoft.KeyVault/vaults/myVMVault"), // }, // }, // }}, // }, // HyperVGeneration: to.Ptr(armcompute.HyperVGenerationV1), // OSType: to.Ptr(armcompute.OperatingSystemTypesWindows), // ProvisioningState: to.Ptr("Succeeded"), // PurchasePlan: &armcompute.DiskPurchasePlan{ // Name: to.Ptr("test_sku"), // Product: to.Ptr("marketplace_vm_test"), // Publisher: to.Ptr("test_test_pmc2pc1"), // }, // SecurityProfile: &armcompute.DiskSecurityProfile{ // SecurityType: to.Ptr(armcompute.DiskSecurityTypesTrustedLaunch), // }, // SupportedCapabilities: &armcompute.SupportedCapabilities{ // AcceleratedNetwork: to.Ptr(true), // }, // SupportsHibernation: to.Ptr(true), // TimeCreated: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2016-12-28T04:41:35.079Z"); return t}()), // }, // SKU: &armcompute.DiskSKU{ // Name: to.Ptr(armcompute.DiskStorageAccountTypesStandardLRS), // }, // }
Output:
func (*DisksClient) NewListByResourceGroupPager ¶
func (client *DisksClient) NewListByResourceGroupPager(resourceGroupName string, options *DisksClientListByResourceGroupOptions) *runtime.Pager[DisksClientListByResourceGroupResponse]
NewListByResourceGroupPager - Lists all the disks under a resource group.
Generated from API version 2023-10-02
- resourceGroupName - The name of the resource group.
- options - DisksClientListByResourceGroupOptions contains the optional parameters for the DisksClient.NewListByResourceGroupPager method.
Example ¶
Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/92de53a5f1e0e03c94b40475d2135d97148ed014/specification/compute/resource-manager/Microsoft.Compute/DiskRP/stable/2023-10-02/examples/diskExamples/Disk_ListByResourceGroup.json
cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() clientFactory, err := armcompute.NewClientFactory("<subscription-id>", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } pager := clientFactory.NewDisksClient().NewListByResourceGroupPager("myResourceGroup", nil) for pager.More() { page, err := pager.NextPage(ctx) if err != nil { log.Fatalf("failed to advance page: %v", err) } for _, v := range page.Value { // You could use page here. We use blank identifier for just demo purposes. _ = v } // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. // page.DiskList = armcompute.DiskList{ // Value: []*armcompute.Disk{ // { // Name: to.Ptr("myManagedDisk1"), // Type: to.Ptr("Microsoft.Compute/disks"), // ID: to.Ptr("/subscriptions/{subscriptionId}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/disks/myManagedDisk"), // Location: to.Ptr("westus"), // Tags: map[string]*string{ // "department": to.Ptr("Development"), // "project": to.Ptr("ManagedDisks"), // }, // Properties: &armcompute.DiskProperties{ // CreationData: &armcompute.CreationData{ // CreateOption: to.Ptr(armcompute.DiskCreateOptionCopy), // SourceResourceID: to.Ptr("subscriptions/{subscriptionId}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/disks/myManagedDisk"), // }, // DiskSizeGB: to.Ptr[int32](200), // Encryption: &armcompute.Encryption{ // Type: to.Ptr(armcompute.EncryptionTypeEncryptionAtRestWithPlatformKey), // }, // EncryptionSettingsCollection: &armcompute.EncryptionSettingsCollection{ // Enabled: to.Ptr(true), // EncryptionSettings: []*armcompute.EncryptionSettingsElement{ // { // DiskEncryptionKey: &armcompute.KeyVaultAndSecretReference{ // SecretURL: to.Ptr("https://myvmvault.vault-int.azure-int.net/secrets/{secret}"), // SourceVault: &armcompute.SourceVault{ // ID: to.Ptr("/subscriptions/{subscriptionId}/resourceGroups/myResourceGroup/providers/Microsoft.KeyVault/vaults/myVMVault"), // }, // }, // KeyEncryptionKey: &armcompute.KeyVaultAndKeyReference{ // KeyURL: to.Ptr("https://myvmvault.vault-int.azure-int.net/keys/{key}"), // SourceVault: &armcompute.SourceVault{ // ID: to.Ptr("/subscriptions/{subscriptionId}/resourceGroups/myResourceGroup/providers/Microsoft.KeyVault/vaults/myVMVault"), // }, // }, // }}, // }, // OSType: to.Ptr(armcompute.OperatingSystemTypesWindows), // ProvisioningState: to.Ptr("Succeeded"), // TimeCreated: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2016-12-28T04:41:35.927Z"); return t}()), // }, // }, // { // Name: to.Ptr("myManagedDisk2"), // Type: to.Ptr("Microsoft.Compute/disks"), // ID: to.Ptr("/subscriptions/{subscriptionId}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/disks/myManagedDisk"), // Location: to.Ptr("westus"), // Properties: &armcompute.DiskProperties{ // CreationData: &armcompute.CreationData{ // CreateOption: to.Ptr(armcompute.DiskCreateOptionEmpty), // }, // DiskSizeGB: to.Ptr[int32](10), // Encryption: &armcompute.Encryption{ // Type: to.Ptr(armcompute.EncryptionTypeEncryptionAtRestWithPlatformKey), // }, // OSType: to.Ptr(armcompute.OperatingSystemTypesWindows), // ProvisioningState: to.Ptr("Succeeded"), // TimeCreated: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2016-12-28T04:41:36.872Z"); return t}()), // }, // }, // { // Name: to.Ptr("myManagedDisk3"), // Type: to.Ptr("Microsoft.Compute/disks"), // ID: to.Ptr("/subscriptions/{subscriptionId}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/disks/myManagedDisk"), // Location: to.Ptr("westus"), // Tags: map[string]*string{ // "department": to.Ptr("Development"), // "project": to.Ptr("ManagedDisks"), // }, // Properties: &armcompute.DiskProperties{ // CreationData: &armcompute.CreationData{ // CreateOption: to.Ptr(armcompute.DiskCreateOptionFromImage), // ImageReference: &armcompute.ImageDiskReference{ // ID: to.Ptr("/Subscriptions/{subscriptionId}/Providers/Microsoft.Compute/Locations/uswest/Publishers/Microsoft/ArtifactTypes/VMImage/Offers/{offer}"), // }, // }, // DiskSizeGB: to.Ptr[int32](200), // Encryption: &armcompute.Encryption{ // Type: to.Ptr(armcompute.EncryptionTypeEncryptionAtRestWithPlatformKey), // }, // EncryptionSettingsCollection: &armcompute.EncryptionSettingsCollection{ // Enabled: to.Ptr(true), // EncryptionSettings: []*armcompute.EncryptionSettingsElement{ // { // DiskEncryptionKey: &armcompute.KeyVaultAndSecretReference{ // SecretURL: to.Ptr("https://myvmvault.vault-int.azure-int.net/secrets/{secret}"), // SourceVault: &armcompute.SourceVault{ // ID: to.Ptr("/subscriptions/{subscriptionId}/resourceGroups/myResourceGroup/providers/Microsoft.KeyVault/vaults/myVMVault"), // }, // }, // KeyEncryptionKey: &armcompute.KeyVaultAndKeyReference{ // KeyURL: to.Ptr("https://myvmvault.vault-int.azure-int.net/keys/{key}"), // SourceVault: &armcompute.SourceVault{ // ID: to.Ptr("/subscriptions/{subscriptionId}/resourceGroups/myResourceGroup/providers/Microsoft.KeyVault/vaults/myVMVault"), // }, // }, // }}, // }, // OSType: to.Ptr(armcompute.OperatingSystemTypesWindows), // ProvisioningState: to.Ptr("Succeeded"), // TimeCreated: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2016-12-28T04:41:36.397Z"); return t}()), // }, // }}, // } }
Output:
func (*DisksClient) NewListPager ¶
func (client *DisksClient) NewListPager(options *DisksClientListOptions) *runtime.Pager[DisksClientListResponse]
NewListPager - Lists all the disks under a subscription.
Generated from API version 2023-10-02
- options - DisksClientListOptions contains the optional parameters for the DisksClient.NewListPager method.
Example ¶
Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/92de53a5f1e0e03c94b40475d2135d97148ed014/specification/compute/resource-manager/Microsoft.Compute/DiskRP/stable/2023-10-02/examples/diskExamples/Disk_ListBySubscription.json
cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() clientFactory, err := armcompute.NewClientFactory("<subscription-id>", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } pager := clientFactory.NewDisksClient().NewListPager(nil) for pager.More() { page, err := pager.NextPage(ctx) if err != nil { log.Fatalf("failed to advance page: %v", err) } for _, v := range page.Value { // You could use page here. We use blank identifier for just demo purposes. _ = v } // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. // page.DiskList = armcompute.DiskList{ // Value: []*armcompute.Disk{ // { // Name: to.Ptr("myManagedDisk1"), // Type: to.Ptr("Microsoft.Compute/disks"), // ID: to.Ptr("/subscriptions/{subscriptionId}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/disks/myManagedDisk1"), // Location: to.Ptr("westus"), // Tags: map[string]*string{ // "department": to.Ptr("Development"), // "project": to.Ptr("ManagedDisks"), // }, // Properties: &armcompute.DiskProperties{ // CreationData: &armcompute.CreationData{ // CreateOption: to.Ptr(armcompute.DiskCreateOptionCopy), // SourceResourceID: to.Ptr("subscriptions/{subscriptionId}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/disks/myManagedDisk1"), // }, // DiskSizeGB: to.Ptr[int32](200), // Encryption: &armcompute.Encryption{ // Type: to.Ptr(armcompute.EncryptionTypeEncryptionAtRestWithPlatformKey), // }, // EncryptionSettingsCollection: &armcompute.EncryptionSettingsCollection{ // Enabled: to.Ptr(true), // EncryptionSettings: []*armcompute.EncryptionSettingsElement{ // { // DiskEncryptionKey: &armcompute.KeyVaultAndSecretReference{ // SecretURL: to.Ptr("https://myvmvault.vault-int.azure-int.net/secrets/{secret}"), // SourceVault: &armcompute.SourceVault{ // ID: to.Ptr("/subscriptions/{subscriptionId}/resourceGroups/myResourceGroup/providers/Microsoft.KeyVault/vaults/myVMVault"), // }, // }, // KeyEncryptionKey: &armcompute.KeyVaultAndKeyReference{ // KeyURL: to.Ptr("https://myvmvault.vault-int.azure-int.net/keys/{key}"), // SourceVault: &armcompute.SourceVault{ // ID: to.Ptr("/subscriptions/{subscriptionId}/resourceGroups/myResourceGroup/providers/Microsoft.KeyVault/vaults/myVMVault"), // }, // }, // }}, // }, // OSType: to.Ptr(armcompute.OperatingSystemTypesWindows), // ProvisioningState: to.Ptr("Succeeded"), // TimeCreated: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2016-12-28T04:41:35.927Z"); return t}()), // }, // }, // { // Name: to.Ptr("myManagedDisk2"), // Type: to.Ptr("Microsoft.Compute/disks"), // ID: to.Ptr("/subscriptions/{subscriptionId}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/disks/myManagedDisk2"), // Location: to.Ptr("westus"), // Properties: &armcompute.DiskProperties{ // CreationData: &armcompute.CreationData{ // CreateOption: to.Ptr(armcompute.DiskCreateOptionEmpty), // }, // DiskSizeGB: to.Ptr[int32](10), // Encryption: &armcompute.Encryption{ // Type: to.Ptr(armcompute.EncryptionTypeEncryptionAtRestWithPlatformKey), // }, // OSType: to.Ptr(armcompute.OperatingSystemTypesWindows), // ProvisioningState: to.Ptr("Succeeded"), // TimeCreated: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2016-12-28T04:41:36.872Z"); return t}()), // }, // }, // { // Name: to.Ptr("myManagedDisk3"), // Type: to.Ptr("Microsoft.Compute/disks"), // ID: to.Ptr("/subscriptions/{subscriptionId}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/disks/myManagedDisk3"), // Location: to.Ptr("westus"), // Tags: map[string]*string{ // "department": to.Ptr("Development"), // "project": to.Ptr("ManagedDisks"), // }, // Properties: &armcompute.DiskProperties{ // CreationData: &armcompute.CreationData{ // CreateOption: to.Ptr(armcompute.DiskCreateOptionFromImage), // ImageReference: &armcompute.ImageDiskReference{ // ID: to.Ptr("/Subscriptions/{subscriptionId}/Providers/Microsoft.Compute/Locations/uswest/Publishers/Microsoft/ArtifactTypes/VMImage/Offers/{offer}"), // }, // }, // DiskSizeGB: to.Ptr[int32](200), // Encryption: &armcompute.Encryption{ // Type: to.Ptr(armcompute.EncryptionTypeEncryptionAtRestWithPlatformKey), // }, // EncryptionSettingsCollection: &armcompute.EncryptionSettingsCollection{ // Enabled: to.Ptr(true), // EncryptionSettings: []*armcompute.EncryptionSettingsElement{ // { // DiskEncryptionKey: &armcompute.KeyVaultAndSecretReference{ // SecretURL: to.Ptr("https://myvmvault.vault-int.azure-int.net/secrets/{secret}"), // SourceVault: &armcompute.SourceVault{ // ID: to.Ptr("/subscriptions/{subscriptionId}/resourceGroups/myResourceGroup/providers/Microsoft.KeyVault/vaults/myVMVault"), // }, // }, // KeyEncryptionKey: &armcompute.KeyVaultAndKeyReference{ // KeyURL: to.Ptr("https://myvmvault.vault-int.azure-int.net/keys/{key}"), // SourceVault: &armcompute.SourceVault{ // ID: to.Ptr("/subscriptions/{subscriptionId}/resourceGroups/myResourceGroup/providers/Microsoft.KeyVault/vaults/myVMVault"), // }, // }, // }}, // }, // OSType: to.Ptr(armcompute.OperatingSystemTypesWindows), // ProvisioningState: to.Ptr("Succeeded"), // TimeCreated: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2016-12-28T04:41:36.397Z"); return t}()), // }, // }}, // } }
Output:
type DisksClientBeginCreateOrUpdateOptions ¶
type DisksClientBeginCreateOrUpdateOptions struct { // Resumes the LRO from the provided token. ResumeToken string }
DisksClientBeginCreateOrUpdateOptions contains the optional parameters for the DisksClient.BeginCreateOrUpdate method.
type DisksClientBeginDeleteOptions ¶
type DisksClientBeginDeleteOptions struct { // Resumes the LRO from the provided token. ResumeToken string }
DisksClientBeginDeleteOptions contains the optional parameters for the DisksClient.BeginDelete method.
type DisksClientBeginGrantAccessOptions ¶
type DisksClientBeginGrantAccessOptions struct { // Resumes the LRO from the provided token. ResumeToken string }
DisksClientBeginGrantAccessOptions contains the optional parameters for the DisksClient.BeginGrantAccess method.
type DisksClientBeginRevokeAccessOptions ¶
type DisksClientBeginRevokeAccessOptions struct { // Resumes the LRO from the provided token. ResumeToken string }
DisksClientBeginRevokeAccessOptions contains the optional parameters for the DisksClient.BeginRevokeAccess method.
type DisksClientBeginUpdateOptions ¶
type DisksClientBeginUpdateOptions struct { // Resumes the LRO from the provided token. ResumeToken string }
DisksClientBeginUpdateOptions contains the optional parameters for the DisksClient.BeginUpdate method.
type DisksClientCreateOrUpdateResponse ¶
type DisksClientCreateOrUpdateResponse struct { // Disk resource. Disk }
DisksClientCreateOrUpdateResponse contains the response from method DisksClient.BeginCreateOrUpdate.
type DisksClientDeleteResponse ¶
type DisksClientDeleteResponse struct { }
DisksClientDeleteResponse contains the response from method DisksClient.BeginDelete.
type DisksClientGetOptions ¶
type DisksClientGetOptions struct { }
DisksClientGetOptions contains the optional parameters for the DisksClient.Get method.
type DisksClientGetResponse ¶
type DisksClientGetResponse struct { // Disk resource. Disk }
DisksClientGetResponse contains the response from method DisksClient.Get.
type DisksClientGrantAccessResponse ¶
type DisksClientGrantAccessResponse struct { // A disk access SAS uri. AccessURI }
DisksClientGrantAccessResponse contains the response from method DisksClient.BeginGrantAccess.
type DisksClientListByResourceGroupOptions ¶
type DisksClientListByResourceGroupOptions struct { }
DisksClientListByResourceGroupOptions contains the optional parameters for the DisksClient.NewListByResourceGroupPager method.
type DisksClientListByResourceGroupResponse ¶
type DisksClientListByResourceGroupResponse struct { // The List Disks operation response. DiskList }
DisksClientListByResourceGroupResponse contains the response from method DisksClient.NewListByResourceGroupPager.
type DisksClientListOptions ¶
type DisksClientListOptions struct { }
DisksClientListOptions contains the optional parameters for the DisksClient.NewListPager method.
type DisksClientListResponse ¶
type DisksClientListResponse struct { // The List Disks operation response. DiskList }
DisksClientListResponse contains the response from method DisksClient.NewListPager.
type DisksClientRevokeAccessResponse ¶
type DisksClientRevokeAccessResponse struct { }
DisksClientRevokeAccessResponse contains the response from method DisksClient.BeginRevokeAccess.
type DisksClientUpdateResponse ¶
type DisksClientUpdateResponse struct { // Disk resource. Disk }
DisksClientUpdateResponse contains the response from method DisksClient.BeginUpdate.
type DomainNameLabelScopeTypes ¶ added in v5.2.0
type DomainNameLabelScopeTypes string
DomainNameLabelScopeTypes - The Domain name label scope.The concatenation of the hashed domain name label that generated according to the policy from domain name label scope and vm index will be the domain name labels of the PublicIPAddress resources that will be created
const ( DomainNameLabelScopeTypesNoReuse DomainNameLabelScopeTypes = "NoReuse" DomainNameLabelScopeTypesResourceGroupReuse DomainNameLabelScopeTypes = "ResourceGroupReuse" DomainNameLabelScopeTypesSubscriptionReuse DomainNameLabelScopeTypes = "SubscriptionReuse" DomainNameLabelScopeTypesTenantReuse DomainNameLabelScopeTypes = "TenantReuse" )
func PossibleDomainNameLabelScopeTypesValues ¶ added in v5.2.0
func PossibleDomainNameLabelScopeTypesValues() []DomainNameLabelScopeTypes
PossibleDomainNameLabelScopeTypesValues returns the possible values for the DomainNameLabelScopeTypes const type.
type EdgeZoneStorageAccountType ¶
type EdgeZoneStorageAccountType string
EdgeZoneStorageAccountType - Specifies the storage account type to be used to store the image. This property is not updatable.
const ( EdgeZoneStorageAccountTypePremiumLRS EdgeZoneStorageAccountType = "Premium_LRS" EdgeZoneStorageAccountTypeStandardLRS EdgeZoneStorageAccountType = "Standard_LRS" EdgeZoneStorageAccountTypeStandardSSDLRS EdgeZoneStorageAccountType = "StandardSSD_LRS" EdgeZoneStorageAccountTypeStandardZRS EdgeZoneStorageAccountType = "Standard_ZRS" )
func PossibleEdgeZoneStorageAccountTypeValues ¶
func PossibleEdgeZoneStorageAccountTypeValues() []EdgeZoneStorageAccountType
PossibleEdgeZoneStorageAccountTypeValues returns the possible values for the EdgeZoneStorageAccountType const type.
type Encryption ¶
type Encryption struct { // ResourceId of the disk encryption set to use for enabling encryption at rest. DiskEncryptionSetID *string // The type of key used to encrypt the data of the disk. Type *EncryptionType }
Encryption at rest settings for disk or snapshot
func (Encryption) MarshalJSON ¶
func (e Encryption) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type Encryption.
func (*Encryption) UnmarshalJSON ¶
func (e *Encryption) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type Encryption.
type EncryptionIdentity ¶ added in v5.4.0
type EncryptionIdentity struct { // Specifies ARM Resource ID of one of the user identities associated with the VM. UserAssignedIdentityResourceID *string }
EncryptionIdentity - Specifies the Managed Identity used by ADE to get access token for keyvault operations.
func (EncryptionIdentity) MarshalJSON ¶ added in v5.4.0
func (e EncryptionIdentity) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type EncryptionIdentity.
func (*EncryptionIdentity) UnmarshalJSON ¶ added in v5.4.0
func (e *EncryptionIdentity) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type EncryptionIdentity.
type EncryptionImages ¶
type EncryptionImages struct { // A list of encryption specifications for data disk images. DataDiskImages []*DataDiskImageEncryption // Contains encryption settings for an OS disk image. OSDiskImage *OSDiskImageEncryption }
EncryptionImages - Optional. Allows users to provide customer managed keys for encrypting the OS and data disks in the gallery artifact.
func (EncryptionImages) MarshalJSON ¶
func (e EncryptionImages) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type EncryptionImages.
func (*EncryptionImages) UnmarshalJSON ¶
func (e *EncryptionImages) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type EncryptionImages.
type EncryptionSetIdentity ¶
type EncryptionSetIdentity struct { // The type of Managed Identity used by the DiskEncryptionSet. Only SystemAssigned is supported for new creations. Disk Encryption // Sets can be updated with Identity type None during migration of // subscription to a new Azure Active Directory tenant; it will cause the encrypted resources to lose access to the keys. Type *DiskEncryptionSetIdentityType // The list of user identities associated with the disk encryption set. The user identity dictionary key references will be // ARM resource ids in the form: // '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{identityName}'. UserAssignedIdentities map[string]*UserAssignedIdentitiesValue // READ-ONLY; The object id of the Managed Identity Resource. This will be sent to the RP from ARM via the x-ms-identity-principal-id // header in the PUT request if the resource has a systemAssigned(implicit) // identity PrincipalID *string // READ-ONLY; The tenant id of the Managed Identity Resource. This will be sent to the RP from ARM via the x-ms-client-tenant-id // header in the PUT request if the resource has a systemAssigned(implicit) identity TenantID *string }
EncryptionSetIdentity - The managed identity for the disk encryption set. It should be given permission on the key vault before it can be used to encrypt disks.
func (EncryptionSetIdentity) MarshalJSON ¶
func (e EncryptionSetIdentity) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type EncryptionSetIdentity.
func (*EncryptionSetIdentity) UnmarshalJSON ¶
func (e *EncryptionSetIdentity) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type EncryptionSetIdentity.
type EncryptionSetProperties ¶
type EncryptionSetProperties struct { // The key vault key which is currently used by this disk encryption set. ActiveKey *KeyForDiskEncryptionSet // The type of key used to encrypt the data of the disk. EncryptionType *DiskEncryptionSetType // Multi-tenant application client id to access key vault in a different tenant. Setting the value to 'None' will clear the // property. FederatedClientID *string // Set this flag to true to enable auto-updating of this disk encryption set to the latest key version. RotationToLatestKeyVersionEnabled *bool // READ-ONLY; The error that was encountered during auto-key rotation. If an error is present, then auto-key rotation will // not be attempted until the error on this disk encryption set is fixed. AutoKeyRotationError *APIError // READ-ONLY; The time when the active key of this disk encryption set was updated. LastKeyRotationTimestamp *time.Time // READ-ONLY; A readonly collection of key vault keys previously used by this disk encryption set while a key rotation is // in progress. It will be empty if there is no ongoing key rotation. PreviousKeys []*KeyForDiskEncryptionSet // READ-ONLY; The disk encryption set provisioning state. ProvisioningState *string }
func (EncryptionSetProperties) MarshalJSON ¶
func (e EncryptionSetProperties) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type EncryptionSetProperties.
func (*EncryptionSetProperties) UnmarshalJSON ¶
func (e *EncryptionSetProperties) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type EncryptionSetProperties.
type EncryptionSettingsCollection ¶
type EncryptionSettingsCollection struct { // REQUIRED; Set this flag to true and provide DiskEncryptionKey and optional KeyEncryptionKey to enable encryption. Set this // flag to false and remove DiskEncryptionKey and KeyEncryptionKey to disable encryption. // If EncryptionSettings is null in the request object, the existing settings remain unchanged. Enabled *bool // A collection of encryption settings, one for each disk volume. EncryptionSettings []*EncryptionSettingsElement // Describes what type of encryption is used for the disks. Once this field is set, it cannot be overwritten. '1.0' corresponds // to Azure Disk Encryption with AAD app.'1.1' corresponds to Azure Disk // Encryption. EncryptionSettingsVersion *string }
EncryptionSettingsCollection - Encryption settings for disk or snapshot
func (EncryptionSettingsCollection) MarshalJSON ¶
func (e EncryptionSettingsCollection) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type EncryptionSettingsCollection.
func (*EncryptionSettingsCollection) UnmarshalJSON ¶
func (e *EncryptionSettingsCollection) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type EncryptionSettingsCollection.
type EncryptionSettingsElement ¶
type EncryptionSettingsElement struct { // Key Vault Secret Url and vault id of the disk encryption key DiskEncryptionKey *KeyVaultAndSecretReference // Key Vault Key Url and vault id of the key encryption key. KeyEncryptionKey is optional and when provided is used to unwrap // the disk encryption key. KeyEncryptionKey *KeyVaultAndKeyReference }
EncryptionSettingsElement - Encryption settings for one disk volume.
func (EncryptionSettingsElement) MarshalJSON ¶
func (e EncryptionSettingsElement) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type EncryptionSettingsElement.
func (*EncryptionSettingsElement) UnmarshalJSON ¶
func (e *EncryptionSettingsElement) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type EncryptionSettingsElement.
type EncryptionType ¶
type EncryptionType string
EncryptionType - The type of key used to encrypt the data of the disk.
const ( // EncryptionTypeEncryptionAtRestWithCustomerKey - Disk is encrypted at rest with Customer managed key that can be changed // and revoked by a customer. EncryptionTypeEncryptionAtRestWithCustomerKey EncryptionType = "EncryptionAtRestWithCustomerKey" // EncryptionTypeEncryptionAtRestWithPlatformAndCustomerKeys - Disk is encrypted at rest with 2 layers of encryption. One // of the keys is Customer managed and the other key is Platform managed. EncryptionTypeEncryptionAtRestWithPlatformAndCustomerKeys EncryptionType = "EncryptionAtRestWithPlatformAndCustomerKeys" // EncryptionTypeEncryptionAtRestWithPlatformKey - Disk is encrypted at rest with Platform managed key. It is the default // encryption type. This is not a valid encryption type for disk encryption sets. EncryptionTypeEncryptionAtRestWithPlatformKey EncryptionType = "EncryptionAtRestWithPlatformKey" )
func PossibleEncryptionTypeValues ¶
func PossibleEncryptionTypeValues() []EncryptionType
PossibleEncryptionTypeValues returns the possible values for the EncryptionType const type.
type EventGridAndResourceGraph ¶ added in v5.7.0
type EventGridAndResourceGraph struct { // Specifies if event grid and resource graph is enabled for Scheduled event related configurations. Enable *bool }
EventGridAndResourceGraph - Specifies eventGridAndResourceGraph related Scheduled Event related configurations.
func (EventGridAndResourceGraph) MarshalJSON ¶ added in v5.7.0
func (e EventGridAndResourceGraph) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type EventGridAndResourceGraph.
func (*EventGridAndResourceGraph) UnmarshalJSON ¶ added in v5.7.0
func (e *EventGridAndResourceGraph) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type EventGridAndResourceGraph.
type ExecutionState ¶
type ExecutionState string
ExecutionState - Script execution status.
const ( ExecutionStateCanceled ExecutionState = "Canceled" ExecutionStateFailed ExecutionState = "Failed" ExecutionStatePending ExecutionState = "Pending" ExecutionStateRunning ExecutionState = "Running" ExecutionStateSucceeded ExecutionState = "Succeeded" ExecutionStateTimedOut ExecutionState = "TimedOut" ExecutionStateUnknown ExecutionState = "Unknown" )
func PossibleExecutionStateValues ¶
func PossibleExecutionStateValues() []ExecutionState
PossibleExecutionStateValues returns the possible values for the ExecutionState const type.
type ExpandTypeForListVMs ¶
type ExpandTypeForListVMs string
const (
ExpandTypeForListVMsInstanceView ExpandTypeForListVMs = "instanceView"
)
func PossibleExpandTypeForListVMsValues ¶
func PossibleExpandTypeForListVMsValues() []ExpandTypeForListVMs
PossibleExpandTypeForListVMsValues returns the possible values for the ExpandTypeForListVMs const type.
type ExpandTypesForGetCapacityReservationGroups ¶
type ExpandTypesForGetCapacityReservationGroups string
const ( ExpandTypesForGetCapacityReservationGroupsVirtualMachineScaleSetVMsRef ExpandTypesForGetCapacityReservationGroups = "virtualMachineScaleSetVMs/$ref" ExpandTypesForGetCapacityReservationGroupsVirtualMachinesRef ExpandTypesForGetCapacityReservationGroups = "virtualMachines/$ref" )
func PossibleExpandTypesForGetCapacityReservationGroupsValues ¶
func PossibleExpandTypesForGetCapacityReservationGroupsValues() []ExpandTypesForGetCapacityReservationGroups
PossibleExpandTypesForGetCapacityReservationGroupsValues returns the possible values for the ExpandTypesForGetCapacityReservationGroups const type.
type ExpandTypesForGetVMScaleSets ¶
type ExpandTypesForGetVMScaleSets string
const (
ExpandTypesForGetVMScaleSetsUserData ExpandTypesForGetVMScaleSets = "userData"
)
func PossibleExpandTypesForGetVMScaleSetsValues ¶
func PossibleExpandTypesForGetVMScaleSetsValues() []ExpandTypesForGetVMScaleSets
PossibleExpandTypesForGetVMScaleSetsValues returns the possible values for the ExpandTypesForGetVMScaleSets const type.
type ExpandTypesForListVMs ¶
type ExpandTypesForListVMs string
const (
ExpandTypesForListVMsInstanceView ExpandTypesForListVMs = "instanceView"
)
func PossibleExpandTypesForListVMsValues ¶
func PossibleExpandTypesForListVMsValues() []ExpandTypesForListVMs
PossibleExpandTypesForListVMsValues returns the possible values for the ExpandTypesForListVMs const type.
type ExtendedLocation ¶
type ExtendedLocation struct { // The name of the extended location. Name *string // The type of the extended location. Type *ExtendedLocationTypes }
ExtendedLocation - The complex type of the extended location.
func (ExtendedLocation) MarshalJSON ¶
func (e ExtendedLocation) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type ExtendedLocation.
func (*ExtendedLocation) UnmarshalJSON ¶
func (e *ExtendedLocation) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type ExtendedLocation.
type ExtendedLocationType ¶
type ExtendedLocationType string
ExtendedLocationType - The type of the extended location.
const (
ExtendedLocationTypeEdgeZone ExtendedLocationType = "EdgeZone"
)
func PossibleExtendedLocationTypeValues ¶
func PossibleExtendedLocationTypeValues() []ExtendedLocationType
PossibleExtendedLocationTypeValues returns the possible values for the ExtendedLocationType const type.
type ExtendedLocationTypes ¶
type ExtendedLocationTypes string
ExtendedLocationTypes - The type of extendedLocation.
const (
ExtendedLocationTypesEdgeZone ExtendedLocationTypes = "EdgeZone"
)
func PossibleExtendedLocationTypesValues ¶
func PossibleExtendedLocationTypesValues() []ExtendedLocationTypes
PossibleExtendedLocationTypesValues returns the possible values for the ExtendedLocationTypes const type.
type Extension ¶
type Extension struct { // The name of the extension. Name *string // Extension Properties. Properties *CloudServiceExtensionProperties }
Extension - Describes a cloud service Extension.
func (Extension) MarshalJSON ¶
MarshalJSON implements the json.Marshaller interface for type Extension.
func (*Extension) UnmarshalJSON ¶
UnmarshalJSON implements the json.Unmarshaller interface for type Extension.
type FileFormat ¶ added in v5.1.0
type FileFormat string
FileFormat - Used to specify the file format when making request for SAS on a VHDX file format snapshot
const ( // FileFormatVHD - A VHD file is a disk image file in the Virtual Hard Disk file format. FileFormatVHD FileFormat = "VHD" // FileFormatVHDX - A VHDX file is a disk image file in the Virtual Hard Disk v2 file format. FileFormatVHDX FileFormat = "VHDX" )
func PossibleFileFormatValues ¶ added in v5.1.0
func PossibleFileFormatValues() []FileFormat
PossibleFileFormatValues returns the possible values for the FileFormat const type.
type GalleriesClient ¶
type GalleriesClient struct {
// contains filtered or unexported fields
}
GalleriesClient contains the methods for the Galleries group. Don't use this type directly, use NewGalleriesClient() instead.
func NewGalleriesClient ¶
func NewGalleriesClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*GalleriesClient, error)
NewGalleriesClient creates a new instance of GalleriesClient 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 (*GalleriesClient) BeginCreateOrUpdate ¶
func (client *GalleriesClient) BeginCreateOrUpdate(ctx context.Context, resourceGroupName string, galleryName string, gallery Gallery, options *GalleriesClientBeginCreateOrUpdateOptions) (*runtime.Poller[GalleriesClientCreateOrUpdateResponse], error)
BeginCreateOrUpdate - Create or update a Shared Image Gallery. If the operation fails it returns an *azcore.ResponseError type.
Generated from API version 2023-07-03
- resourceGroupName - The name of the resource group.
- galleryName - The name of the Shared Image Gallery. The allowed characters are alphabets and numbers with dots and periods allowed in the middle. The maximum length is 80 characters.
- gallery - Parameters supplied to the create or update Shared Image Gallery operation.
- options - GalleriesClientBeginCreateOrUpdateOptions contains the optional parameters for the GalleriesClient.BeginCreateOrUpdate method.
Example (CreateACommunityGallery) ¶
Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/92de53a5f1e0e03c94b40475d2135d97148ed014/specification/compute/resource-manager/Microsoft.Compute/GalleryRP/stable/2023-07-03/examples/galleryExamples/CommunityGallery_Create.json
cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() clientFactory, err := armcompute.NewClientFactory("<subscription-id>", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } poller, err := clientFactory.NewGalleriesClient().BeginCreateOrUpdate(ctx, "myResourceGroup", "myGalleryName", armcompute.Gallery{ Location: to.Ptr("West US"), Properties: &armcompute.GalleryProperties{ Description: to.Ptr("This is the gallery description."), SharingProfile: &armcompute.SharingProfile{ CommunityGalleryInfo: &armcompute.CommunityGalleryInfo{ Eula: to.Ptr("eula"), PublicNamePrefix: to.Ptr("PirPublic"), PublisherContact: to.Ptr("pir@microsoft.com"), PublisherURI: to.Ptr("uri"), }, Permissions: to.Ptr(armcompute.GallerySharingPermissionTypesCommunity), }, }, }, nil) if err != nil { log.Fatalf("failed to finish the request: %v", err) } res, err := poller.PollUntilDone(ctx, nil) if err != nil { log.Fatalf("failed to pull the result: %v", err) } // You could use response here. We use blank identifier for just demo purposes. _ = res // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. // res.Gallery = armcompute.Gallery{ // Name: to.Ptr("myGalleryName"), // ID: to.Ptr("/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/galleries/myGalleryName"), // Location: to.Ptr("West US"), // Properties: &armcompute.GalleryProperties{ // Description: to.Ptr("This is the gallery description."), // Identifier: &armcompute.GalleryIdentifier{ // UniqueName: to.Ptr("{subscription-id}-MYGALLERYNAME"), // }, // ProvisioningState: to.Ptr(armcompute.GalleryProvisioningStateSucceeded), // SharingProfile: &armcompute.SharingProfile{ // CommunityGalleryInfo: &armcompute.CommunityGalleryInfo{ // Eula: to.Ptr("eula"), // PublicNamePrefix: to.Ptr("PirPublic"), // PublisherContact: to.Ptr("pir@microsoft.com"), // PublisherURI: to.Ptr("uri"), // }, // Permissions: to.Ptr(armcompute.GallerySharingPermissionTypesCommunity), // }, // }, // }
Output:
Example (CreateOrUpdateASimpleGallery) ¶
Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/92de53a5f1e0e03c94b40475d2135d97148ed014/specification/compute/resource-manager/Microsoft.Compute/GalleryRP/stable/2023-07-03/examples/galleryExamples/Gallery_Create.json
cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() clientFactory, err := armcompute.NewClientFactory("<subscription-id>", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } poller, err := clientFactory.NewGalleriesClient().BeginCreateOrUpdate(ctx, "myResourceGroup", "myGalleryName", armcompute.Gallery{ Location: to.Ptr("West US"), Properties: &armcompute.GalleryProperties{ Description: to.Ptr("This is the gallery description."), }, }, nil) if err != nil { log.Fatalf("failed to finish the request: %v", err) } res, err := poller.PollUntilDone(ctx, nil) if err != nil { log.Fatalf("failed to pull the result: %v", err) } // You could use response here. We use blank identifier for just demo purposes. _ = res // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. // res.Gallery = armcompute.Gallery{ // Name: to.Ptr("myGalleryName"), // ID: to.Ptr("/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/galleries/myGallery"), // Location: to.Ptr("West US"), // Properties: &armcompute.GalleryProperties{ // Description: to.Ptr("This is the gallery description."), // Identifier: &armcompute.GalleryIdentifier{ // UniqueName: to.Ptr("{subscription-id}-MYGALLERYNAME"), // }, // ProvisioningState: to.Ptr(armcompute.GalleryProvisioningStateSucceeded), // }, // }
Output:
Example (CreateOrUpdateASimpleGalleryWithSharingProfile) ¶
Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/92de53a5f1e0e03c94b40475d2135d97148ed014/specification/compute/resource-manager/Microsoft.Compute/GalleryRP/stable/2023-07-03/examples/galleryExamples/Gallery_Create_WithSharingProfile.json
cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() clientFactory, err := armcompute.NewClientFactory("<subscription-id>", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } poller, err := clientFactory.NewGalleriesClient().BeginCreateOrUpdate(ctx, "myResourceGroup", "myGalleryName", armcompute.Gallery{ Location: to.Ptr("West US"), Properties: &armcompute.GalleryProperties{ Description: to.Ptr("This is the gallery description."), SharingProfile: &armcompute.SharingProfile{ Permissions: to.Ptr(armcompute.GallerySharingPermissionTypesGroups), }, }, }, nil) if err != nil { log.Fatalf("failed to finish the request: %v", err) } res, err := poller.PollUntilDone(ctx, nil) if err != nil { log.Fatalf("failed to pull the result: %v", err) } // You could use response here. We use blank identifier for just demo purposes. _ = res // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. // res.Gallery = armcompute.Gallery{ // Name: to.Ptr("myGalleryName"), // ID: to.Ptr("/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/galleries/myGalleryName"), // Location: to.Ptr("West US"), // Properties: &armcompute.GalleryProperties{ // Description: to.Ptr("This is the gallery description."), // Identifier: &armcompute.GalleryIdentifier{ // UniqueName: to.Ptr("{subscription-id}-MYGALLERYNAME"), // }, // ProvisioningState: to.Ptr(armcompute.GalleryProvisioningStateSucceeded), // SharingProfile: &armcompute.SharingProfile{ // Permissions: to.Ptr(armcompute.GallerySharingPermissionTypesGroups), // }, // }, // }
Output:
Example (CreateOrUpdateASimpleGalleryWithSoftDeletionEnabled) ¶
Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/92de53a5f1e0e03c94b40475d2135d97148ed014/specification/compute/resource-manager/Microsoft.Compute/GalleryRP/stable/2023-07-03/examples/galleryExamples/Gallery_Create_SoftDeletionEnabled.json
cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() clientFactory, err := armcompute.NewClientFactory("<subscription-id>", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } poller, err := clientFactory.NewGalleriesClient().BeginCreateOrUpdate(ctx, "myResourceGroup", "myGalleryName", armcompute.Gallery{ Location: to.Ptr("West US"), Properties: &armcompute.GalleryProperties{ Description: to.Ptr("This is the gallery description."), SoftDeletePolicy: &armcompute.SoftDeletePolicy{ IsSoftDeleteEnabled: to.Ptr(true), }, }, }, nil) if err != nil { log.Fatalf("failed to finish the request: %v", err) } res, err := poller.PollUntilDone(ctx, nil) if err != nil { log.Fatalf("failed to pull the result: %v", err) } // You could use response here. We use blank identifier for just demo purposes. _ = res // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. // res.Gallery = armcompute.Gallery{ // Name: to.Ptr("myGalleryName"), // ID: to.Ptr("/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/galleries/myGalleryName"), // Location: to.Ptr("West US"), // Properties: &armcompute.GalleryProperties{ // Description: to.Ptr("This is the gallery description."), // Identifier: &armcompute.GalleryIdentifier{ // UniqueName: to.Ptr("{subscription-id}-MYGALLERYNAME"), // }, // ProvisioningState: to.Ptr(armcompute.GalleryProvisioningStateSucceeded), // SoftDeletePolicy: &armcompute.SoftDeletePolicy{ // IsSoftDeleteEnabled: to.Ptr(true), // }, // }, // }
Output:
func (*GalleriesClient) BeginDelete ¶
func (client *GalleriesClient) BeginDelete(ctx context.Context, resourceGroupName string, galleryName string, options *GalleriesClientBeginDeleteOptions) (*runtime.Poller[GalleriesClientDeleteResponse], error)
BeginDelete - Delete a Shared Image Gallery. If the operation fails it returns an *azcore.ResponseError type.
Generated from API version 2023-07-03
- resourceGroupName - The name of the resource group.
- galleryName - The name of the Shared Image Gallery to be deleted.
- options - GalleriesClientBeginDeleteOptions contains the optional parameters for the GalleriesClient.BeginDelete method.
Example ¶
Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/92de53a5f1e0e03c94b40475d2135d97148ed014/specification/compute/resource-manager/Microsoft.Compute/GalleryRP/stable/2023-07-03/examples/galleryExamples/Gallery_Delete.json
cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() clientFactory, err := armcompute.NewClientFactory("<subscription-id>", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } poller, err := clientFactory.NewGalleriesClient().BeginDelete(ctx, "myResourceGroup", "myGalleryName", nil) if err != nil { log.Fatalf("failed to finish the request: %v", err) } _, err = poller.PollUntilDone(ctx, nil) if err != nil { log.Fatalf("failed to pull the result: %v", err) }
Output:
func (*GalleriesClient) BeginUpdate ¶
func (client *GalleriesClient) BeginUpdate(ctx context.Context, resourceGroupName string, galleryName string, gallery GalleryUpdate, options *GalleriesClientBeginUpdateOptions) (*runtime.Poller[GalleriesClientUpdateResponse], error)
BeginUpdate - Update a Shared Image Gallery. If the operation fails it returns an *azcore.ResponseError type.
Generated from API version 2023-07-03
- resourceGroupName - The name of the resource group.
- galleryName - The name of the Shared Image Gallery. The allowed characters are alphabets and numbers with dots and periods allowed in the middle. The maximum length is 80 characters.
- gallery - Parameters supplied to the update Shared Image Gallery operation.
- options - GalleriesClientBeginUpdateOptions contains the optional parameters for the GalleriesClient.BeginUpdate method.
Example ¶
Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/92de53a5f1e0e03c94b40475d2135d97148ed014/specification/compute/resource-manager/Microsoft.Compute/GalleryRP/stable/2023-07-03/examples/galleryExamples/Gallery_Update.json
cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() clientFactory, err := armcompute.NewClientFactory("<subscription-id>", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } poller, err := clientFactory.NewGalleriesClient().BeginUpdate(ctx, "myResourceGroup", "myGalleryName", armcompute.GalleryUpdate{ Properties: &armcompute.GalleryProperties{ Description: to.Ptr("This is the gallery description."), }, }, nil) if err != nil { log.Fatalf("failed to finish the request: %v", err) } res, err := poller.PollUntilDone(ctx, nil) if err != nil { log.Fatalf("failed to pull the result: %v", err) } // You could use response here. We use blank identifier for just demo purposes. _ = res // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. // res.Gallery = armcompute.Gallery{ // Name: to.Ptr("myGalleryName"), // Location: to.Ptr("West US"), // Properties: &armcompute.GalleryProperties{ // Description: to.Ptr("This is the gallery description."), // Identifier: &armcompute.GalleryIdentifier{ // UniqueName: to.Ptr("{subscription-id}-MYGALLERYNAME"), // }, // ProvisioningState: to.Ptr(armcompute.GalleryProvisioningStateSucceeded), // }, // }
Output:
func (*GalleriesClient) Get ¶
func (client *GalleriesClient) Get(ctx context.Context, resourceGroupName string, galleryName string, options *GalleriesClientGetOptions) (GalleriesClientGetResponse, error)
Get - Retrieves information about a Shared Image Gallery. If the operation fails it returns an *azcore.ResponseError type.
Generated from API version 2023-07-03
- resourceGroupName - The name of the resource group.
- galleryName - The name of the Shared Image Gallery.
- options - GalleriesClientGetOptions contains the optional parameters for the GalleriesClient.Get method.
Example (GetACommunityGallery) ¶
Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/92de53a5f1e0e03c94b40475d2135d97148ed014/specification/compute/resource-manager/Microsoft.Compute/GalleryRP/stable/2023-07-03/examples/galleryExamples/CommunityGallery_Get.json
cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() clientFactory, err := armcompute.NewClientFactory("<subscription-id>", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } res, err := clientFactory.NewGalleriesClient().Get(ctx, "myResourceGroup", "myGalleryName", &armcompute.GalleriesClientGetOptions{Select: nil, Expand: nil, }) if err != nil { log.Fatalf("failed to finish the request: %v", err) } // You could use response here. We use blank identifier for just demo purposes. _ = res // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. // res.Gallery = armcompute.Gallery{ // Name: to.Ptr("myGalleryName"), // ID: to.Ptr("/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/communityGalleries/myGalleryName"), // Location: to.Ptr("West US"), // Properties: &armcompute.GalleryProperties{ // Description: to.Ptr("This is the gallery description."), // Identifier: &armcompute.GalleryIdentifier{ // UniqueName: to.Ptr("{subscription-id}-MYGALLERYNAME"), // }, // ProvisioningState: to.Ptr(armcompute.GalleryProvisioningStateSucceeded), // SharingProfile: &armcompute.SharingProfile{ // CommunityGalleryInfo: &armcompute.CommunityGalleryInfo{ // CommunityGalleryEnabled: to.Ptr(true), // Eula: to.Ptr("eula"), // PublicNames: []*string{ // to.Ptr("GalleryPublicName")}, // PublisherContact: to.Ptr("pir@microsoft.com"), // PublisherURI: to.Ptr("uri"), // }, // Permissions: to.Ptr(armcompute.GallerySharingPermissionTypesCommunity), // }, // SharingStatus: &armcompute.SharingStatus{ // AggregatedState: to.Ptr(armcompute.SharingStateSucceeded), // Summary: []*armcompute.RegionalSharingStatus{ // { // Region: to.Ptr("westus"), // State: to.Ptr(armcompute.SharingStateSucceeded), // Details: to.Ptr(""), // }}, // }, // }, // }
Output:
Example (GetAGallery) ¶
Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/92de53a5f1e0e03c94b40475d2135d97148ed014/specification/compute/resource-manager/Microsoft.Compute/GalleryRP/stable/2023-07-03/examples/galleryExamples/Gallery_Get.json
cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() clientFactory, err := armcompute.NewClientFactory("<subscription-id>", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } res, err := clientFactory.NewGalleriesClient().Get(ctx, "myResourceGroup", "myGalleryName", &armcompute.GalleriesClientGetOptions{Select: nil, Expand: nil, }) if err != nil { log.Fatalf("failed to finish the request: %v", err) } // You could use response here. We use blank identifier for just demo purposes. _ = res // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. // res.Gallery = armcompute.Gallery{ // Name: to.Ptr("myGalleryName"), // ID: to.Ptr("/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/galleries/myGalleryName"), // Location: to.Ptr("West US"), // Properties: &armcompute.GalleryProperties{ // Description: to.Ptr("This is the gallery description."), // Identifier: &armcompute.GalleryIdentifier{ // UniqueName: to.Ptr("{subscription-id}-MYGALLERYNAME"), // }, // ProvisioningState: to.Ptr(armcompute.GalleryProvisioningStateSucceeded), // }, // }
Output:
Example (GetAGalleryWithExpandSharingProfileGroups) ¶
Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/92de53a5f1e0e03c94b40475d2135d97148ed014/specification/compute/resource-manager/Microsoft.Compute/GalleryRP/stable/2023-07-03/examples/galleryExamples/Gallery_Get_WithExpandSharingProfileGroups.json
cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() clientFactory, err := armcompute.NewClientFactory("<subscription-id>", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } res, err := clientFactory.NewGalleriesClient().Get(ctx, "myResourceGroup", "myGalleryName", &armcompute.GalleriesClientGetOptions{Select: nil, Expand: to.Ptr(armcompute.GalleryExpandParamsSharingProfileGroups), }) if err != nil { log.Fatalf("failed to finish the request: %v", err) } // You could use response here. We use blank identifier for just demo purposes. _ = res // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. // res.Gallery = armcompute.Gallery{ // Name: to.Ptr("myGalleryName"), // ID: to.Ptr("/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/galleries/myGalleryName"), // Location: to.Ptr("West US"), // Properties: &armcompute.GalleryProperties{ // SharingProfile: &armcompute.SharingProfile{ // Groups: []*armcompute.SharingProfileGroup{ // { // Type: to.Ptr(armcompute.SharingProfileGroupTypesSubscriptions), // IDs: []*string{ // to.Ptr("34a4ab42-0d72-47d9-bd1a-aed207386dac"), // to.Ptr("380fd389-260b-41aa-bad9-0a83108c370b")}, // }, // { // Type: to.Ptr(armcompute.SharingProfileGroupTypesAADTenants), // IDs: []*string{ // to.Ptr("c24c76aa-8897-4027-9b03-8f7928b54ff6")}, // }}, // Permissions: to.Ptr(armcompute.GallerySharingPermissionTypesGroups), // }, // }, // }
Output:
Example (GetAGalleryWithSelectPermissions) ¶
Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/92de53a5f1e0e03c94b40475d2135d97148ed014/specification/compute/resource-manager/Microsoft.Compute/GalleryRP/stable/2023-07-03/examples/galleryExamples/Gallery_Get_WithSelectPermissions.json
cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() clientFactory, err := armcompute.NewClientFactory("<subscription-id>", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } res, err := clientFactory.NewGalleriesClient().Get(ctx, "myResourceGroup", "myGalleryName", &armcompute.GalleriesClientGetOptions{Select: to.Ptr(armcompute.SelectPermissionsPermissions), Expand: nil, }) if err != nil { log.Fatalf("failed to finish the request: %v", err) } // You could use response here. We use blank identifier for just demo purposes. _ = res // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. // res.Gallery = armcompute.Gallery{ // Name: to.Ptr("myGalleryName"), // ID: to.Ptr("/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/galleries/myGalleryName"), // Location: to.Ptr("West US"), // Properties: &armcompute.GalleryProperties{ // SharingProfile: &armcompute.SharingProfile{ // Groups: []*armcompute.SharingProfileGroup{ // { // Type: to.Ptr(armcompute.SharingProfileGroupTypesSubscriptions), // IDs: []*string{ // to.Ptr("34a4ab42-0d72-47d9-bd1a-aed207386dac"), // to.Ptr("380fd389-260b-41aa-bad9-0a83108c370b")}, // }, // { // Type: to.Ptr(armcompute.SharingProfileGroupTypesAADTenants), // IDs: []*string{ // to.Ptr("c24c76aa-8897-4027-9b03-8f7928b54ff6")}, // }}, // Permissions: to.Ptr(armcompute.GallerySharingPermissionTypesGroups), // }, // }, // }
Output:
func (*GalleriesClient) NewListByResourceGroupPager ¶
func (client *GalleriesClient) NewListByResourceGroupPager(resourceGroupName string, options *GalleriesClientListByResourceGroupOptions) *runtime.Pager[GalleriesClientListByResourceGroupResponse]
NewListByResourceGroupPager - List galleries under a resource group.
Generated from API version 2023-07-03
- resourceGroupName - The name of the resource group.
- options - GalleriesClientListByResourceGroupOptions contains the optional parameters for the GalleriesClient.NewListByResourceGroupPager method.
Example ¶
Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/92de53a5f1e0e03c94b40475d2135d97148ed014/specification/compute/resource-manager/Microsoft.Compute/GalleryRP/stable/2023-07-03/examples/galleryExamples/Gallery_ListByResourceGroup.json
cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() clientFactory, err := armcompute.NewClientFactory("<subscription-id>", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } pager := clientFactory.NewGalleriesClient().NewListByResourceGroupPager("myResourceGroup", nil) for pager.More() { page, err := pager.NextPage(ctx) if err != nil { log.Fatalf("failed to advance page: %v", err) } for _, v := range page.Value { // You could use page here. We use blank identifier for just demo purposes. _ = v } // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. // page.GalleryList = armcompute.GalleryList{ // Value: []*armcompute.Gallery{ // { // Name: to.Ptr("myGalleryName"), // ID: to.Ptr("/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/galleries/myGalleryName"), // Location: to.Ptr("West US"), // Properties: &armcompute.GalleryProperties{ // Description: to.Ptr("This is the gallery description."), // Identifier: &armcompute.GalleryIdentifier{ // UniqueName: to.Ptr("{subscription-id}-MYGALLERYNAME"), // }, // ProvisioningState: to.Ptr(armcompute.GalleryProvisioningStateSucceeded), // }, // }}, // } }
Output:
func (*GalleriesClient) NewListPager ¶
func (client *GalleriesClient) NewListPager(options *GalleriesClientListOptions) *runtime.Pager[GalleriesClientListResponse]
NewListPager - List galleries under a subscription.
Generated from API version 2023-07-03
- options - GalleriesClientListOptions contains the optional parameters for the GalleriesClient.NewListPager method.
Example ¶
Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/92de53a5f1e0e03c94b40475d2135d97148ed014/specification/compute/resource-manager/Microsoft.Compute/GalleryRP/stable/2023-07-03/examples/galleryExamples/Gallery_ListBySubscription.json
cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() clientFactory, err := armcompute.NewClientFactory("<subscription-id>", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } pager := clientFactory.NewGalleriesClient().NewListPager(nil) for pager.More() { page, err := pager.NextPage(ctx) if err != nil { log.Fatalf("failed to advance page: %v", err) } for _, v := range page.Value { // You could use page here. We use blank identifier for just demo purposes. _ = v } // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. // page.GalleryList = armcompute.GalleryList{ // Value: []*armcompute.Gallery{ // { // Name: to.Ptr("myGalleryName"), // ID: to.Ptr("/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/galleries/myGalleryName"), // Location: to.Ptr("West US"), // Properties: &armcompute.GalleryProperties{ // Description: to.Ptr("This is the gallery description."), // Identifier: &armcompute.GalleryIdentifier{ // UniqueName: to.Ptr("{subscription-id}-MYGALLERYNAME"), // }, // ProvisioningState: to.Ptr(armcompute.GalleryProvisioningStateSucceeded), // }, // }}, // } }
Output:
type GalleriesClientBeginCreateOrUpdateOptions ¶
type GalleriesClientBeginCreateOrUpdateOptions struct { // Resumes the LRO from the provided token. ResumeToken string }
GalleriesClientBeginCreateOrUpdateOptions contains the optional parameters for the GalleriesClient.BeginCreateOrUpdate method.
type GalleriesClientBeginDeleteOptions ¶
type GalleriesClientBeginDeleteOptions struct { // Resumes the LRO from the provided token. ResumeToken string }
GalleriesClientBeginDeleteOptions contains the optional parameters for the GalleriesClient.BeginDelete method.
type GalleriesClientBeginUpdateOptions ¶
type GalleriesClientBeginUpdateOptions struct { // Resumes the LRO from the provided token. ResumeToken string }
GalleriesClientBeginUpdateOptions contains the optional parameters for the GalleriesClient.BeginUpdate method.
type GalleriesClientCreateOrUpdateResponse ¶
type GalleriesClientCreateOrUpdateResponse struct { // Specifies information about the Shared Image Gallery that you want to create or update. Gallery }
GalleriesClientCreateOrUpdateResponse contains the response from method GalleriesClient.BeginCreateOrUpdate.
type GalleriesClientDeleteResponse ¶
type GalleriesClientDeleteResponse struct { }
GalleriesClientDeleteResponse contains the response from method GalleriesClient.BeginDelete.
type GalleriesClientGetOptions ¶
type GalleriesClientGetOptions struct { // The expand query option to apply on the operation. Expand *GalleryExpandParams // The select expression to apply on the operation. Select *SelectPermissions }
GalleriesClientGetOptions contains the optional parameters for the GalleriesClient.Get method.
type GalleriesClientGetResponse ¶
type GalleriesClientGetResponse struct { // Specifies information about the Shared Image Gallery that you want to create or update. Gallery }
GalleriesClientGetResponse contains the response from method GalleriesClient.Get.
type GalleriesClientListByResourceGroupOptions ¶
type GalleriesClientListByResourceGroupOptions struct { }
GalleriesClientListByResourceGroupOptions contains the optional parameters for the GalleriesClient.NewListByResourceGroupPager method.
type GalleriesClientListByResourceGroupResponse ¶
type GalleriesClientListByResourceGroupResponse struct { // The List Galleries operation response. GalleryList }
GalleriesClientListByResourceGroupResponse contains the response from method GalleriesClient.NewListByResourceGroupPager.
type GalleriesClientListOptions ¶
type GalleriesClientListOptions struct { }
GalleriesClientListOptions contains the optional parameters for the GalleriesClient.NewListPager method.
type GalleriesClientListResponse ¶
type GalleriesClientListResponse struct { // The List Galleries operation response. GalleryList }
GalleriesClientListResponse contains the response from method GalleriesClient.NewListPager.
type GalleriesClientUpdateResponse ¶
type GalleriesClientUpdateResponse struct { // Specifies information about the Shared Image Gallery that you want to create or update. Gallery }
GalleriesClientUpdateResponse contains the response from method GalleriesClient.BeginUpdate.
type Gallery ¶
type Gallery struct { // REQUIRED; Resource location Location *string // Describes the properties of a Shared Image Gallery. Properties *GalleryProperties // Resource tags Tags map[string]*string // READ-ONLY; Resource Id ID *string // READ-ONLY; Resource name Name *string // READ-ONLY; Resource type Type *string }
Gallery - Specifies information about the Shared Image Gallery that you want to create or update.
func (Gallery) MarshalJSON ¶
MarshalJSON implements the json.Marshaller interface for type Gallery.
func (*Gallery) UnmarshalJSON ¶
UnmarshalJSON implements the json.Unmarshaller interface for type Gallery.
type GalleryApplication ¶
type GalleryApplication struct { // REQUIRED; Resource location Location *string // Describes the properties of a gallery Application Definition. Properties *GalleryApplicationProperties // Resource tags Tags map[string]*string // READ-ONLY; Resource Id ID *string // READ-ONLY; Resource name Name *string // READ-ONLY; Resource type Type *string }
GalleryApplication - Specifies information about the gallery Application Definition that you want to create or update.
func (GalleryApplication) MarshalJSON ¶
func (g GalleryApplication) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type GalleryApplication.
func (*GalleryApplication) UnmarshalJSON ¶
func (g *GalleryApplication) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type GalleryApplication.
type GalleryApplicationCustomAction ¶
type GalleryApplicationCustomAction struct { // REQUIRED; The name of the custom action. Must be unique within the Gallery Application Version. Name *string // REQUIRED; The script to run when executing this custom action. Script *string // Description to help the users understand what this custom action does. Description *string // The parameters that this custom action uses Parameters []*GalleryApplicationCustomActionParameter }
GalleryApplicationCustomAction - A custom action that can be performed with a Gallery Application Version.
func (GalleryApplicationCustomAction) MarshalJSON ¶
func (g GalleryApplicationCustomAction) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type GalleryApplicationCustomAction.
func (*GalleryApplicationCustomAction) UnmarshalJSON ¶
func (g *GalleryApplicationCustomAction) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type GalleryApplicationCustomAction.
type GalleryApplicationCustomActionParameter ¶
type GalleryApplicationCustomActionParameter struct { // REQUIRED; The name of the custom action. Must be unique within the Gallery Application Version. Name *string // The default value of the parameter. Only applies to string types DefaultValue *string // A description to help users understand what this parameter means Description *string // Indicates whether this parameter must be passed when running the custom action. Required *bool // Specifies the type of the custom action parameter. Possible values are: String, ConfigurationDataBlob or LogOutputBlob Type *GalleryApplicationCustomActionParameterType }
GalleryApplicationCustomActionParameter - The definition of a parameter that can be passed to a custom action of a Gallery Application Version.
func (GalleryApplicationCustomActionParameter) MarshalJSON ¶
func (g GalleryApplicationCustomActionParameter) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type GalleryApplicationCustomActionParameter.
func (*GalleryApplicationCustomActionParameter) UnmarshalJSON ¶
func (g *GalleryApplicationCustomActionParameter) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type GalleryApplicationCustomActionParameter.
type GalleryApplicationCustomActionParameterType ¶
type GalleryApplicationCustomActionParameterType string
GalleryApplicationCustomActionParameterType - Specifies the type of the custom action parameter. Possible values are: String, ConfigurationDataBlob or LogOutputBlob
const ( GalleryApplicationCustomActionParameterTypeConfigurationDataBlob GalleryApplicationCustomActionParameterType = "ConfigurationDataBlob" GalleryApplicationCustomActionParameterTypeLogOutputBlob GalleryApplicationCustomActionParameterType = "LogOutputBlob" GalleryApplicationCustomActionParameterTypeString GalleryApplicationCustomActionParameterType = "String" )
func PossibleGalleryApplicationCustomActionParameterTypeValues ¶
func PossibleGalleryApplicationCustomActionParameterTypeValues() []GalleryApplicationCustomActionParameterType
PossibleGalleryApplicationCustomActionParameterTypeValues returns the possible values for the GalleryApplicationCustomActionParameterType const type.
type GalleryApplicationList ¶
type GalleryApplicationList struct { // REQUIRED; A list of Gallery Applications. Value []*GalleryApplication // The uri to fetch the next page of Application Definitions in the Application Gallery. Call ListNext() with this to fetch // the next page of gallery Application Definitions. NextLink *string }
GalleryApplicationList - The List Gallery Applications operation response.
func (GalleryApplicationList) MarshalJSON ¶
func (g GalleryApplicationList) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type GalleryApplicationList.
func (*GalleryApplicationList) UnmarshalJSON ¶
func (g *GalleryApplicationList) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type GalleryApplicationList.
type GalleryApplicationProperties ¶
type GalleryApplicationProperties struct { // REQUIRED; This property allows you to specify the supported type of the OS that application is built for. Possible values // are: Windows, Linux. SupportedOSType *OperatingSystemTypes // A list of custom actions that can be performed with all of the Gallery Application Versions within this Gallery Application. CustomActions []*GalleryApplicationCustomAction // The description of this gallery Application Definition resource. This property is updatable. Description *string // The end of life date of the gallery Application Definition. This property can be used for decommissioning purposes. This // property is updatable. EndOfLifeDate *time.Time // The Eula agreement for the gallery Application Definition. Eula *string // The privacy statement uri. PrivacyStatementURI *string // The release note uri. ReleaseNoteURI *string }
GalleryApplicationProperties - Describes the properties of a gallery Application Definition.
func (GalleryApplicationProperties) MarshalJSON ¶
func (g GalleryApplicationProperties) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type GalleryApplicationProperties.
func (*GalleryApplicationProperties) UnmarshalJSON ¶
func (g *GalleryApplicationProperties) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type GalleryApplicationProperties.
type GalleryApplicationUpdate ¶
type GalleryApplicationUpdate struct { // Describes the properties of a gallery Application Definition. Properties *GalleryApplicationProperties // Resource tags Tags map[string]*string // READ-ONLY; Resource Id ID *string // READ-ONLY; Resource name Name *string // READ-ONLY; Resource type Type *string }
GalleryApplicationUpdate - Specifies information about the gallery Application Definition that you want to update.
func (GalleryApplicationUpdate) MarshalJSON ¶
func (g GalleryApplicationUpdate) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type GalleryApplicationUpdate.
func (*GalleryApplicationUpdate) UnmarshalJSON ¶
func (g *GalleryApplicationUpdate) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type GalleryApplicationUpdate.
type GalleryApplicationVersion ¶
type GalleryApplicationVersion struct { // REQUIRED; Resource location Location *string // Describes the properties of a gallery image version. Properties *GalleryApplicationVersionProperties // Resource tags Tags map[string]*string // READ-ONLY; Resource Id ID *string // READ-ONLY; Resource name Name *string // READ-ONLY; Resource type Type *string }
GalleryApplicationVersion - Specifies information about the gallery Application Version that you want to create or update.
func (GalleryApplicationVersion) MarshalJSON ¶
func (g GalleryApplicationVersion) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type GalleryApplicationVersion.
func (*GalleryApplicationVersion) UnmarshalJSON ¶
func (g *GalleryApplicationVersion) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type GalleryApplicationVersion.
type GalleryApplicationVersionList ¶
type GalleryApplicationVersionList struct { // REQUIRED; A list of gallery Application Versions. Value []*GalleryApplicationVersion // The uri to fetch the next page of gallery Application Versions. Call ListNext() with this to fetch the next page of gallery // Application Versions. NextLink *string }
GalleryApplicationVersionList - The List Gallery Application version operation response.
func (GalleryApplicationVersionList) MarshalJSON ¶
func (g GalleryApplicationVersionList) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type GalleryApplicationVersionList.
func (*GalleryApplicationVersionList) UnmarshalJSON ¶
func (g *GalleryApplicationVersionList) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type GalleryApplicationVersionList.
type GalleryApplicationVersionProperties ¶
type GalleryApplicationVersionProperties struct { // REQUIRED; The publishing profile of a gallery image version. PublishingProfile *GalleryApplicationVersionPublishingProfile // The safety profile of the Gallery Application Version. SafetyProfile *GalleryApplicationVersionSafetyProfile // READ-ONLY; The provisioning state, which only appears in the response. ProvisioningState *GalleryProvisioningState // READ-ONLY; This is the replication status of the gallery image version. ReplicationStatus *ReplicationStatus }
GalleryApplicationVersionProperties - Describes the properties of a gallery image version.
func (GalleryApplicationVersionProperties) MarshalJSON ¶
func (g GalleryApplicationVersionProperties) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type GalleryApplicationVersionProperties.
func (*GalleryApplicationVersionProperties) UnmarshalJSON ¶
func (g *GalleryApplicationVersionProperties) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type GalleryApplicationVersionProperties.
type GalleryApplicationVersionPublishingProfile ¶
type GalleryApplicationVersionPublishingProfile struct { // REQUIRED; The source image from which the Image Version is going to be created. Source *UserArtifactSource // Optional. Additional settings to pass to the vm-application-manager extension. For advanced use only. AdvancedSettings map[string]*string // A list of custom actions that can be performed with this Gallery Application Version. CustomActions []*GalleryApplicationCustomAction // Optional. Whether or not this application reports health. EnableHealthCheck *bool // The end of life date of the gallery image version. This property can be used for decommissioning purposes. This property // is updatable. EndOfLifeDate *time.Time // If set to true, Virtual Machines deployed from the latest version of the Image Definition won't use this Image Version. ExcludeFromLatest *bool ManageActions *UserArtifactManage // The number of replicas of the Image Version to be created per region. This property would take effect for a region when // regionalReplicaCount is not specified. This property is updatable. ReplicaCount *int32 // Optional parameter which specifies the mode to be used for replication. This property is not updatable. ReplicationMode *ReplicationMode // Additional settings for the VM app that contains the target package and config file name when it is deployed to target // VM or VM scale set. Settings *UserArtifactSettings // Specifies the storage account type to be used to store the image. This property is not updatable. StorageAccountType *StorageAccountType // The target extended locations where the Image Version is going to be replicated to. This property is updatable. TargetExtendedLocations []*GalleryTargetExtendedLocation // The target regions where the Image Version is going to be replicated to. This property is updatable. TargetRegions []*TargetRegion // READ-ONLY; The timestamp for when the gallery image version is published. PublishedDate *time.Time }
GalleryApplicationVersionPublishingProfile - The publishing profile of a gallery image version.
func (GalleryApplicationVersionPublishingProfile) MarshalJSON ¶
func (g GalleryApplicationVersionPublishingProfile) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type GalleryApplicationVersionPublishingProfile.
func (*GalleryApplicationVersionPublishingProfile) UnmarshalJSON ¶
func (g *GalleryApplicationVersionPublishingProfile) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type GalleryApplicationVersionPublishingProfile.
type GalleryApplicationVersionSafetyProfile ¶
type GalleryApplicationVersionSafetyProfile struct { // Indicates whether or not removing this Gallery Image Version from replicated regions is allowed. AllowDeletionOfReplicatedLocations *bool }
GalleryApplicationVersionSafetyProfile - The safety profile of the Gallery Application Version.
func (GalleryApplicationVersionSafetyProfile) MarshalJSON ¶
func (g GalleryApplicationVersionSafetyProfile) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type GalleryApplicationVersionSafetyProfile.
func (*GalleryApplicationVersionSafetyProfile) UnmarshalJSON ¶
func (g *GalleryApplicationVersionSafetyProfile) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type GalleryApplicationVersionSafetyProfile.
type GalleryApplicationVersionUpdate ¶
type GalleryApplicationVersionUpdate struct { // Describes the properties of a gallery image version. Properties *GalleryApplicationVersionProperties // Resource tags Tags map[string]*string // READ-ONLY; Resource Id ID *string // READ-ONLY; Resource name Name *string // READ-ONLY; Resource type Type *string }
GalleryApplicationVersionUpdate - Specifies information about the gallery Application Version that you want to update.
func (GalleryApplicationVersionUpdate) MarshalJSON ¶
func (g GalleryApplicationVersionUpdate) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type GalleryApplicationVersionUpdate.
func (*GalleryApplicationVersionUpdate) UnmarshalJSON ¶
func (g *GalleryApplicationVersionUpdate) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type GalleryApplicationVersionUpdate.
type GalleryApplicationVersionsClient ¶
type GalleryApplicationVersionsClient struct {
// contains filtered or unexported fields
}
GalleryApplicationVersionsClient contains the methods for the GalleryApplicationVersions group. Don't use this type directly, use NewGalleryApplicationVersionsClient() instead.
func NewGalleryApplicationVersionsClient ¶
func NewGalleryApplicationVersionsClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*GalleryApplicationVersionsClient, error)
NewGalleryApplicationVersionsClient creates a new instance of GalleryApplicationVersionsClient 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 (*GalleryApplicationVersionsClient) BeginCreateOrUpdate ¶
func (client *GalleryApplicationVersionsClient) BeginCreateOrUpdate(ctx context.Context, resourceGroupName string, galleryName string, galleryApplicationName string, galleryApplicationVersionName string, galleryApplicationVersion GalleryApplicationVersion, options *GalleryApplicationVersionsClientBeginCreateOrUpdateOptions) (*runtime.Poller[GalleryApplicationVersionsClientCreateOrUpdateResponse], error)
BeginCreateOrUpdate - Create or update a gallery Application Version. If the operation fails it returns an *azcore.ResponseError type.
Generated from API version 2023-07-03
- resourceGroupName - The name of the resource group.
- galleryName - The name of the Shared Application Gallery in which the Application Definition resides.
- galleryApplicationName - The name of the gallery Application Definition in which the Application Version is to be created.
- galleryApplicationVersionName - The name of the gallery Application Version to be created. Needs to follow semantic version name pattern: The allowed characters are digit and period. Digits must be within the range of a 32-bit integer. Format: ..
- galleryApplicationVersion - Parameters supplied to the create or update gallery Application Version operation.
- options - GalleryApplicationVersionsClientBeginCreateOrUpdateOptions contains the optional parameters for the GalleryApplicationVersionsClient.BeginCreateOrUpdate method.
Example ¶
Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/92de53a5f1e0e03c94b40475d2135d97148ed014/specification/compute/resource-manager/Microsoft.Compute/GalleryRP/stable/2023-07-03/examples/galleryExamples/GalleryApplicationVersion_Create.json
cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() clientFactory, err := armcompute.NewClientFactory("<subscription-id>", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } poller, err := clientFactory.NewGalleryApplicationVersionsClient().BeginCreateOrUpdate(ctx, "myResourceGroup", "myGalleryName", "myGalleryApplicationName", "1.0.0", armcompute.GalleryApplicationVersion{ Location: to.Ptr("West US"), Properties: &armcompute.GalleryApplicationVersionProperties{ PublishingProfile: &armcompute.GalleryApplicationVersionPublishingProfile{ EndOfLifeDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2019-07-01T07:00:00.000Z"); return t }()), ReplicaCount: to.Ptr[int32](1), StorageAccountType: to.Ptr(armcompute.StorageAccountTypeStandardLRS), TargetRegions: []*armcompute.TargetRegion{ { Name: to.Ptr("West US"), ExcludeFromLatest: to.Ptr(false), RegionalReplicaCount: to.Ptr[int32](1), StorageAccountType: to.Ptr(armcompute.StorageAccountTypeStandardLRS), }}, CustomActions: []*armcompute.GalleryApplicationCustomAction{ { Name: to.Ptr("myCustomAction"), Description: to.Ptr("This is the custom action description."), Parameters: []*armcompute.GalleryApplicationCustomActionParameter{ { Name: to.Ptr("myCustomActionParameter"), Type: to.Ptr(armcompute.GalleryApplicationCustomActionParameterTypeString), Description: to.Ptr("This is the description of the parameter"), DefaultValue: to.Ptr("default value of parameter."), Required: to.Ptr(false), }}, Script: to.Ptr("myCustomActionScript"), }}, ManageActions: &armcompute.UserArtifactManage{ Install: to.Ptr("powershell -command \"Expand-Archive -Path package.zip -DestinationPath C:\\package\""), Remove: to.Ptr("del C:\\package "), }, Source: &armcompute.UserArtifactSource{ MediaLink: to.Ptr("https://mystorageaccount.blob.core.windows.net/mycontainer/package.zip?{sasKey}"), }, }, SafetyProfile: &armcompute.GalleryApplicationVersionSafetyProfile{ AllowDeletionOfReplicatedLocations: to.Ptr(false), }, }, }, nil) if err != nil { log.Fatalf("failed to finish the request: %v", err) } res, err := poller.PollUntilDone(ctx, nil) if err != nil { log.Fatalf("failed to pull the result: %v", err) } // You could use response here. We use blank identifier for just demo purposes. _ = res // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. // res.GalleryApplicationVersion = armcompute.GalleryApplicationVersion{ // Name: to.Ptr("1.0.0"), // Type: to.Ptr("Microsoft.Compute/galleries/applications/versions"), // ID: to.Ptr("/subscriptions/01523d7c-60da-455e-adef-521b547922c4/resourceGroups/galleryPsTestRg98/providers/Microsoft.Compute/galleries/galleryPsTestGallery6165/applications/galleryPsTestGalleryApplication7825/versions/1.0.0"), // Location: to.Ptr("West US"), // Properties: &armcompute.GalleryApplicationVersionProperties{ // ProvisioningState: to.Ptr(armcompute.GalleryProvisioningStateSucceeded), // PublishingProfile: &armcompute.GalleryApplicationVersionPublishingProfile{ // EndOfLifeDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2019-07-01T07:00:00.000Z"); return t}()), // ExcludeFromLatest: to.Ptr(false), // PublishedDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2019-06-21T17:13:57.597Z"); return t}()), // ReplicaCount: to.Ptr[int32](1), // StorageAccountType: to.Ptr(armcompute.StorageAccountTypeStandardLRS), // TargetRegions: []*armcompute.TargetRegion{ // { // Name: to.Ptr("West US"), // ExcludeFromLatest: to.Ptr(false), // RegionalReplicaCount: to.Ptr[int32](1), // StorageAccountType: to.Ptr(armcompute.StorageAccountTypeStandardLRS), // }}, // AdvancedSettings: map[string]*string{ // "timeout": to.Ptr("300"), // "user": to.Ptr("root"), // }, // CustomActions: []*armcompute.GalleryApplicationCustomAction{ // { // Name: to.Ptr("myCustomAction"), // Description: to.Ptr("This is the custom action description."), // Parameters: []*armcompute.GalleryApplicationCustomActionParameter{ // { // Name: to.Ptr("myCustomActionParameter"), // Type: to.Ptr(armcompute.GalleryApplicationCustomActionParameterTypeString), // Description: to.Ptr("This is the description of the parameter"), // DefaultValue: to.Ptr("default value of parameter."), // Required: to.Ptr(false), // }}, // Script: to.Ptr("myCustomActionScript"), // }}, // EnableHealthCheck: to.Ptr(false), // ManageActions: &armcompute.UserArtifactManage{ // Install: to.Ptr("powershell -command \"Expand-Archive -Path package.zip -DestinationPath C:\\package\""), // Remove: to.Ptr("del C:\\package "), // }, // Settings: &armcompute.UserArtifactSettings{ // ConfigFileName: to.Ptr("configuration.cfg"), // PackageFileName: to.Ptr("package.zip"), // }, // Source: &armcompute.UserArtifactSource{ // MediaLink: to.Ptr("https://mystorageaccount.blob.core.windows.net/mycontainer/package.zip?{sasKey}"), // }, // }, // SafetyProfile: &armcompute.GalleryApplicationVersionSafetyProfile{ // AllowDeletionOfReplicatedLocations: to.Ptr(false), // }, // }, // }
Output:
func (*GalleryApplicationVersionsClient) BeginDelete ¶
func (client *GalleryApplicationVersionsClient) BeginDelete(ctx context.Context, resourceGroupName string, galleryName string, galleryApplicationName string, galleryApplicationVersionName string, options *GalleryApplicationVersionsClientBeginDeleteOptions) (*runtime.Poller[GalleryApplicationVersionsClientDeleteResponse], error)
BeginDelete - Delete a gallery Application Version. If the operation fails it returns an *azcore.ResponseError type.
Generated from API version 2023-07-03
- resourceGroupName - The name of the resource group.
- galleryName - The name of the Shared Application Gallery in which the Application Definition resides.
- galleryApplicationName - The name of the gallery Application Definition in which the Application Version resides.
- galleryApplicationVersionName - The name of the gallery Application Version to be deleted.
- options - GalleryApplicationVersionsClientBeginDeleteOptions contains the optional parameters for the GalleryApplicationVersionsClient.BeginDelete method.
Example ¶
Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/92de53a5f1e0e03c94b40475d2135d97148ed014/specification/compute/resource-manager/Microsoft.Compute/GalleryRP/stable/2023-07-03/examples/galleryExamples/GalleryApplicationVersion_Delete.json
cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() clientFactory, err := armcompute.NewClientFactory("<subscription-id>", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } poller, err := clientFactory.NewGalleryApplicationVersionsClient().BeginDelete(ctx, "myResourceGroup", "myGalleryName", "myGalleryApplicationName", "1.0.0", nil) if err != nil { log.Fatalf("failed to finish the request: %v", err) } _, err = poller.PollUntilDone(ctx, nil) if err != nil { log.Fatalf("failed to pull the result: %v", err) }
Output:
func (*GalleryApplicationVersionsClient) BeginUpdate ¶
func (client *GalleryApplicationVersionsClient) BeginUpdate(ctx context.Context, resourceGroupName string, galleryName string, galleryApplicationName string, galleryApplicationVersionName string, galleryApplicationVersion GalleryApplicationVersionUpdate, options *GalleryApplicationVersionsClientBeginUpdateOptions) (*runtime.Poller[GalleryApplicationVersionsClientUpdateResponse], error)
BeginUpdate - Update a gallery Application Version. If the operation fails it returns an *azcore.ResponseError type.
Generated from API version 2023-07-03
- resourceGroupName - The name of the resource group.
- galleryName - The name of the Shared Application Gallery in which the Application Definition resides.
- galleryApplicationName - The name of the gallery Application Definition in which the Application Version is to be updated.
- galleryApplicationVersionName - The name of the gallery Application Version to be updated. Needs to follow semantic version name pattern: The allowed characters are digit and period. Digits must be within the range of a 32-bit integer. Format: ..
- galleryApplicationVersion - Parameters supplied to the update gallery Application Version operation.
- options - GalleryApplicationVersionsClientBeginUpdateOptions contains the optional parameters for the GalleryApplicationVersionsClient.BeginUpdate method.
Example ¶
Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/92de53a5f1e0e03c94b40475d2135d97148ed014/specification/compute/resource-manager/Microsoft.Compute/GalleryRP/stable/2023-07-03/examples/galleryExamples/GalleryApplicationVersion_Update.json
cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() clientFactory, err := armcompute.NewClientFactory("<subscription-id>", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } poller, err := clientFactory.NewGalleryApplicationVersionsClient().BeginUpdate(ctx, "myResourceGroup", "myGalleryName", "myGalleryApplicationName", "1.0.0", armcompute.GalleryApplicationVersionUpdate{ Properties: &armcompute.GalleryApplicationVersionProperties{ PublishingProfile: &armcompute.GalleryApplicationVersionPublishingProfile{ EndOfLifeDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2019-07-01T07:00:00.000Z"); return t }()), ReplicaCount: to.Ptr[int32](1), StorageAccountType: to.Ptr(armcompute.StorageAccountTypeStandardLRS), TargetRegions: []*armcompute.TargetRegion{ { Name: to.Ptr("West US"), ExcludeFromLatest: to.Ptr(false), RegionalReplicaCount: to.Ptr[int32](1), StorageAccountType: to.Ptr(armcompute.StorageAccountTypeStandardLRS), }}, ManageActions: &armcompute.UserArtifactManage{ Install: to.Ptr("powershell -command \"Expand-Archive -Path package.zip -DestinationPath C:\\package\""), Remove: to.Ptr("del C:\\package "), }, Source: &armcompute.UserArtifactSource{ MediaLink: to.Ptr("https://mystorageaccount.blob.core.windows.net/mycontainer/package.zip?{sasKey}"), }, }, SafetyProfile: &armcompute.GalleryApplicationVersionSafetyProfile{ AllowDeletionOfReplicatedLocations: to.Ptr(false), }, }, }, nil) if err != nil { log.Fatalf("failed to finish the request: %v", err) } res, err := poller.PollUntilDone(ctx, nil) if err != nil { log.Fatalf("failed to pull the result: %v", err) } // You could use response here. We use blank identifier for just demo purposes. _ = res // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. // res.GalleryApplicationVersion = armcompute.GalleryApplicationVersion{ // Name: to.Ptr("1.0.0"), // Type: to.Ptr("Microsoft.Compute/galleries/applications/versions"), // ID: to.Ptr("/subscriptions/01523d7c-60da-455e-adef-521b547922c4/resourceGroups/galleryPsTestRg98/providers/Microsoft.Compute/galleries/galleryPsTestGallery6165/applications/galleryPsTestGalleryApplication7825/versions/1.0.0"), // Location: to.Ptr("West US"), // Properties: &armcompute.GalleryApplicationVersionProperties{ // ProvisioningState: to.Ptr(armcompute.GalleryProvisioningStateSucceeded), // PublishingProfile: &armcompute.GalleryApplicationVersionPublishingProfile{ // EndOfLifeDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2019-07-01T07:00:00.000Z"); return t}()), // ExcludeFromLatest: to.Ptr(false), // PublishedDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2019-06-21T17:13:57.597Z"); return t}()), // ReplicaCount: to.Ptr[int32](1), // StorageAccountType: to.Ptr(armcompute.StorageAccountTypeStandardLRS), // TargetRegions: []*armcompute.TargetRegion{ // { // Name: to.Ptr("West US"), // ExcludeFromLatest: to.Ptr(false), // RegionalReplicaCount: to.Ptr[int32](1), // StorageAccountType: to.Ptr(armcompute.StorageAccountTypeStandardLRS), // }}, // EnableHealthCheck: to.Ptr(false), // ManageActions: &armcompute.UserArtifactManage{ // Install: to.Ptr("powershell -command \"Expand-Archive -Path package.zip -DestinationPath C:\\package\""), // Remove: to.Ptr("del C:\\package "), // }, // Source: &armcompute.UserArtifactSource{ // MediaLink: to.Ptr("https://mystorageaccount.blob.core.windows.net/mycontainer/package.zip?{sasKey}"), // }, // }, // SafetyProfile: &armcompute.GalleryApplicationVersionSafetyProfile{ // AllowDeletionOfReplicatedLocations: to.Ptr(false), // }, // }, // }
Output:
func (*GalleryApplicationVersionsClient) Get ¶
func (client *GalleryApplicationVersionsClient) Get(ctx context.Context, resourceGroupName string, galleryName string, galleryApplicationName string, galleryApplicationVersionName string, options *GalleryApplicationVersionsClientGetOptions) (GalleryApplicationVersionsClientGetResponse, error)
Get - Retrieves information about a gallery Application Version. If the operation fails it returns an *azcore.ResponseError type.
Generated from API version 2023-07-03
- resourceGroupName - The name of the resource group.
- galleryName - The name of the Shared Application Gallery in which the Application Definition resides.
- galleryApplicationName - The name of the gallery Application Definition in which the Application Version resides.
- galleryApplicationVersionName - The name of the gallery Application Version to be retrieved.
- options - GalleryApplicationVersionsClientGetOptions contains the optional parameters for the GalleryApplicationVersionsClient.Get method.
Example (GetAGalleryApplicationVersion) ¶
Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/92de53a5f1e0e03c94b40475d2135d97148ed014/specification/compute/resource-manager/Microsoft.Compute/GalleryRP/stable/2023-07-03/examples/galleryExamples/GalleryApplicationVersion_Get.json
cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() clientFactory, err := armcompute.NewClientFactory("<subscription-id>", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } res, err := clientFactory.NewGalleryApplicationVersionsClient().Get(ctx, "myResourceGroup", "myGalleryName", "myGalleryApplicationName", "1.0.0", &armcompute.GalleryApplicationVersionsClientGetOptions{Expand: nil}) if err != nil { log.Fatalf("failed to finish the request: %v", err) } // You could use response here. We use blank identifier for just demo purposes. _ = res // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. // res.GalleryApplicationVersion = armcompute.GalleryApplicationVersion{ // Name: to.Ptr("1.0.0"), // Type: to.Ptr("Microsoft.Compute/galleries/applications/versions"), // ID: to.Ptr("/subscriptions/01523d7c-60da-455e-adef-521b547922c4/resourceGroups/galleryPsTestRg98/providers/Microsoft.Compute/galleries/galleryPsTestGallery6165/applications/galleryPsTestGalleryApplication7825/versions/1.0.0"), // Location: to.Ptr("West US"), // Properties: &armcompute.GalleryApplicationVersionProperties{ // ProvisioningState: to.Ptr(armcompute.GalleryProvisioningStateSucceeded), // PublishingProfile: &armcompute.GalleryApplicationVersionPublishingProfile{ // EndOfLifeDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2019-07-01T07:00:00.000Z"); return t}()), // ExcludeFromLatest: to.Ptr(false), // PublishedDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2019-06-21T17:13:57.597Z"); return t}()), // ReplicaCount: to.Ptr[int32](1), // StorageAccountType: to.Ptr(armcompute.StorageAccountTypeStandardLRS), // TargetRegions: []*armcompute.TargetRegion{ // { // Name: to.Ptr("West US"), // ExcludeFromLatest: to.Ptr(false), // RegionalReplicaCount: to.Ptr[int32](1), // StorageAccountType: to.Ptr(armcompute.StorageAccountTypeStandardLRS), // }}, // CustomActions: []*armcompute.GalleryApplicationCustomAction{ // { // Name: to.Ptr("myCustomAction"), // Description: to.Ptr("This is the custom action description."), // Parameters: []*armcompute.GalleryApplicationCustomActionParameter{ // { // Name: to.Ptr("myCustomActionParameter"), // Type: to.Ptr(armcompute.GalleryApplicationCustomActionParameterTypeString), // Description: to.Ptr("This is the description of the parameter"), // DefaultValue: to.Ptr("default value of parameter."), // Required: to.Ptr(false), // }}, // Script: to.Ptr("myCustomActionScript"), // }}, // EnableHealthCheck: to.Ptr(false), // ManageActions: &armcompute.UserArtifactManage{ // Install: to.Ptr("powershell -command \"Expand-Archive -Path package.zip -DestinationPath C:\\package\""), // Remove: to.Ptr("del C:\\package "), // }, // Source: &armcompute.UserArtifactSource{ // MediaLink: to.Ptr("https://mystorageaccount.blob.core.windows.net/mycontainer/package.zip?{sasKey}"), // }, // }, // SafetyProfile: &armcompute.GalleryApplicationVersionSafetyProfile{ // AllowDeletionOfReplicatedLocations: to.Ptr(false), // }, // }, // }
Output:
Example (GetAGalleryApplicationVersionWithReplicationStatus) ¶
Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/92de53a5f1e0e03c94b40475d2135d97148ed014/specification/compute/resource-manager/Microsoft.Compute/GalleryRP/stable/2023-07-03/examples/galleryExamples/GalleryApplicationVersion_Get_WithReplicationStatus.json
cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() clientFactory, err := armcompute.NewClientFactory("<subscription-id>", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } res, err := clientFactory.NewGalleryApplicationVersionsClient().Get(ctx, "myResourceGroup", "myGalleryName", "myGalleryApplicationName", "1.0.0", &armcompute.GalleryApplicationVersionsClientGetOptions{Expand: to.Ptr(armcompute.ReplicationStatusTypesReplicationStatus)}) if err != nil { log.Fatalf("failed to finish the request: %v", err) } // You could use response here. We use blank identifier for just demo purposes. _ = res // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. // res.GalleryApplicationVersion = armcompute.GalleryApplicationVersion{ // Name: to.Ptr("1.0.0"), // ID: to.Ptr("/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/galleries/myGalleryName/applications/myGalleryApplicationName/versions/1.0.0"), // Location: to.Ptr("West US"), // Properties: &armcompute.GalleryApplicationVersionProperties{ // ProvisioningState: to.Ptr(armcompute.GalleryProvisioningStateSucceeded), // PublishingProfile: &armcompute.GalleryApplicationVersionPublishingProfile{ // EndOfLifeDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2019-07-01T07:00:00.000Z"); return t}()), // ExcludeFromLatest: to.Ptr(false), // PublishedDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2019-06-21T17:13:57.597Z"); return t}()), // ReplicaCount: to.Ptr[int32](1), // StorageAccountType: to.Ptr(armcompute.StorageAccountTypeStandardLRS), // TargetRegions: []*armcompute.TargetRegion{ // { // Name: to.Ptr("West US"), // ExcludeFromLatest: to.Ptr(false), // RegionalReplicaCount: to.Ptr[int32](1), // StorageAccountType: to.Ptr(armcompute.StorageAccountTypeStandardLRS), // }}, // AdvancedSettings: map[string]*string{ // "timeout": to.Ptr("300"), // "user": to.Ptr("root"), // }, // CustomActions: []*armcompute.GalleryApplicationCustomAction{ // { // Name: to.Ptr("myCustomAction"), // Description: to.Ptr("This is the custom action description."), // Parameters: []*armcompute.GalleryApplicationCustomActionParameter{ // { // Name: to.Ptr("myCustomActionParameter"), // Type: to.Ptr(armcompute.GalleryApplicationCustomActionParameterTypeString), // Description: to.Ptr("This is the description of the parameter"), // DefaultValue: to.Ptr("default value of parameter."), // Required: to.Ptr(false), // }}, // Script: to.Ptr("myCustomActionScript"), // }}, // EnableHealthCheck: to.Ptr(false), // ManageActions: &armcompute.UserArtifactManage{ // Install: to.Ptr("powershell -command \"Expand-Archive -Path package.zip -DestinationPath C:\\package\""), // Remove: to.Ptr("del C:\\package "), // }, // Settings: &armcompute.UserArtifactSettings{ // ConfigFileName: to.Ptr("configuration.cfg"), // PackageFileName: to.Ptr("package.zip"), // }, // Source: &armcompute.UserArtifactSource{ // MediaLink: to.Ptr("https://mystorageaccount.blob.core.windows.net/mycontainer/package.zip?{sasKey}"), // }, // }, // ReplicationStatus: &armcompute.ReplicationStatus{ // AggregatedState: to.Ptr(armcompute.AggregatedReplicationStateCompleted), // Summary: []*armcompute.RegionalReplicationStatus{ // { // Progress: to.Ptr[int32](100), // Region: to.Ptr("West US"), // State: to.Ptr(armcompute.ReplicationStateCompleted), // Details: to.Ptr(""), // }}, // }, // SafetyProfile: &armcompute.GalleryApplicationVersionSafetyProfile{ // AllowDeletionOfReplicatedLocations: to.Ptr(false), // }, // }, // }
Output:
func (*GalleryApplicationVersionsClient) NewListByGalleryApplicationPager ¶
func (client *GalleryApplicationVersionsClient) NewListByGalleryApplicationPager(resourceGroupName string, galleryName string, galleryApplicationName string, options *GalleryApplicationVersionsClientListByGalleryApplicationOptions) *runtime.Pager[GalleryApplicationVersionsClientListByGalleryApplicationResponse]
NewListByGalleryApplicationPager - List gallery Application Versions in a gallery Application Definition.
Generated from API version 2023-07-03
- resourceGroupName - The name of the resource group.
- galleryName - The name of the Shared Application Gallery in which the Application Definition resides.
- galleryApplicationName - The name of the Shared Application Gallery Application Definition from which the Application Versions are to be listed.
- options - GalleryApplicationVersionsClientListByGalleryApplicationOptions contains the optional parameters for the GalleryApplicationVersionsClient.NewListByGalleryApplicationPager method.
Example ¶
Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/92de53a5f1e0e03c94b40475d2135d97148ed014/specification/compute/resource-manager/Microsoft.Compute/GalleryRP/stable/2023-07-03/examples/galleryExamples/GalleryApplicationVersion_ListByGalleryApplication.json
cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() clientFactory, err := armcompute.NewClientFactory("<subscription-id>", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } pager := clientFactory.NewGalleryApplicationVersionsClient().NewListByGalleryApplicationPager("myResourceGroup", "myGalleryName", "myGalleryApplicationName", nil) for pager.More() { page, err := pager.NextPage(ctx) if err != nil { log.Fatalf("failed to advance page: %v", err) } for _, v := range page.Value { // You could use page here. We use blank identifier for just demo purposes. _ = v } // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. // page.GalleryApplicationVersionList = armcompute.GalleryApplicationVersionList{ // Value: []*armcompute.GalleryApplicationVersion{ // { // Name: to.Ptr("1.0.0"), // Type: to.Ptr("Microsoft.Compute/galleries/applications/versions"), // ID: to.Ptr("/subscriptions/01523d7c-60da-455e-adef-521b547922c4/resourceGroups/galleryPsTestRg98/providers/Microsoft.Compute/galleries/galleryPsTestGallery6165/applications/galleryPsTestGalleryApplication7825/versions/1.0.0"), // Location: to.Ptr("West US"), // Properties: &armcompute.GalleryApplicationVersionProperties{ // ProvisioningState: to.Ptr(armcompute.GalleryProvisioningStateSucceeded), // PublishingProfile: &armcompute.GalleryApplicationVersionPublishingProfile{ // EndOfLifeDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2019-07-01T07:00:00.000Z"); return t}()), // ExcludeFromLatest: to.Ptr(false), // PublishedDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2019-06-21T17:13:57.597Z"); return t}()), // ReplicaCount: to.Ptr[int32](1), // StorageAccountType: to.Ptr(armcompute.StorageAccountTypeStandardLRS), // TargetRegions: []*armcompute.TargetRegion{ // { // Name: to.Ptr("West US"), // ExcludeFromLatest: to.Ptr(false), // RegionalReplicaCount: to.Ptr[int32](1), // StorageAccountType: to.Ptr(armcompute.StorageAccountTypeStandardLRS), // }}, // CustomActions: []*armcompute.GalleryApplicationCustomAction{ // { // Name: to.Ptr("myCustomAction"), // Description: to.Ptr("This is the custom action description."), // Parameters: []*armcompute.GalleryApplicationCustomActionParameter{ // { // Name: to.Ptr("myCustomActionParameter"), // Type: to.Ptr(armcompute.GalleryApplicationCustomActionParameterTypeString), // Description: to.Ptr("This is the description of the parameter"), // DefaultValue: to.Ptr("default value of parameter."), // Required: to.Ptr(false), // }}, // Script: to.Ptr("myCustomActionScript"), // }}, // EnableHealthCheck: to.Ptr(false), // ManageActions: &armcompute.UserArtifactManage{ // Install: to.Ptr("powershell -command \"Expand-Archive -Path package.zip -DestinationPath C:\\package\""), // Remove: to.Ptr("del C:\\package "), // }, // Source: &armcompute.UserArtifactSource{ // MediaLink: to.Ptr("https://mystorageaccount.blob.core.windows.net/mycontainer/package.zip?{sasKey}"), // }, // }, // SafetyProfile: &armcompute.GalleryApplicationVersionSafetyProfile{ // AllowDeletionOfReplicatedLocations: to.Ptr(false), // }, // }, // }}, // } }
Output:
type GalleryApplicationVersionsClientBeginCreateOrUpdateOptions ¶
type GalleryApplicationVersionsClientBeginCreateOrUpdateOptions struct { // Resumes the LRO from the provided token. ResumeToken string }
GalleryApplicationVersionsClientBeginCreateOrUpdateOptions contains the optional parameters for the GalleryApplicationVersionsClient.BeginCreateOrUpdate method.
type GalleryApplicationVersionsClientBeginDeleteOptions ¶
type GalleryApplicationVersionsClientBeginDeleteOptions struct { // Resumes the LRO from the provided token. ResumeToken string }
GalleryApplicationVersionsClientBeginDeleteOptions contains the optional parameters for the GalleryApplicationVersionsClient.BeginDelete method.
type GalleryApplicationVersionsClientBeginUpdateOptions ¶
type GalleryApplicationVersionsClientBeginUpdateOptions struct { // Resumes the LRO from the provided token. ResumeToken string }
GalleryApplicationVersionsClientBeginUpdateOptions contains the optional parameters for the GalleryApplicationVersionsClient.BeginUpdate method.
type GalleryApplicationVersionsClientCreateOrUpdateResponse ¶
type GalleryApplicationVersionsClientCreateOrUpdateResponse struct { // Specifies information about the gallery Application Version that you want to create or update. GalleryApplicationVersion }
GalleryApplicationVersionsClientCreateOrUpdateResponse contains the response from method GalleryApplicationVersionsClient.BeginCreateOrUpdate.
type GalleryApplicationVersionsClientDeleteResponse ¶
type GalleryApplicationVersionsClientDeleteResponse struct { }
GalleryApplicationVersionsClientDeleteResponse contains the response from method GalleryApplicationVersionsClient.BeginDelete.
type GalleryApplicationVersionsClientGetOptions ¶
type GalleryApplicationVersionsClientGetOptions struct { // The expand expression to apply on the operation. Expand *ReplicationStatusTypes }
GalleryApplicationVersionsClientGetOptions contains the optional parameters for the GalleryApplicationVersionsClient.Get method.
type GalleryApplicationVersionsClientGetResponse ¶
type GalleryApplicationVersionsClientGetResponse struct { // Specifies information about the gallery Application Version that you want to create or update. GalleryApplicationVersion }
GalleryApplicationVersionsClientGetResponse contains the response from method GalleryApplicationVersionsClient.Get.
type GalleryApplicationVersionsClientListByGalleryApplicationOptions ¶
type GalleryApplicationVersionsClientListByGalleryApplicationOptions struct { }
GalleryApplicationVersionsClientListByGalleryApplicationOptions contains the optional parameters for the GalleryApplicationVersionsClient.NewListByGalleryApplicationPager method.
type GalleryApplicationVersionsClientListByGalleryApplicationResponse ¶
type GalleryApplicationVersionsClientListByGalleryApplicationResponse struct { // The List Gallery Application version operation response. GalleryApplicationVersionList }
GalleryApplicationVersionsClientListByGalleryApplicationResponse contains the response from method GalleryApplicationVersionsClient.NewListByGalleryApplicationPager.
type GalleryApplicationVersionsClientUpdateResponse ¶
type GalleryApplicationVersionsClientUpdateResponse struct { // Specifies information about the gallery Application Version that you want to create or update. GalleryApplicationVersion }
GalleryApplicationVersionsClientUpdateResponse contains the response from method GalleryApplicationVersionsClient.BeginUpdate.
type GalleryApplicationsClient ¶
type GalleryApplicationsClient struct {
// contains filtered or unexported fields
}
GalleryApplicationsClient contains the methods for the GalleryApplications group. Don't use this type directly, use NewGalleryApplicationsClient() instead.
func NewGalleryApplicationsClient ¶
func NewGalleryApplicationsClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*GalleryApplicationsClient, error)
NewGalleryApplicationsClient creates a new instance of GalleryApplicationsClient 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 (*GalleryApplicationsClient) BeginCreateOrUpdate ¶
func (client *GalleryApplicationsClient) BeginCreateOrUpdate(ctx context.Context, resourceGroupName string, galleryName string, galleryApplicationName string, galleryApplication GalleryApplication, options *GalleryApplicationsClientBeginCreateOrUpdateOptions) (*runtime.Poller[GalleryApplicationsClientCreateOrUpdateResponse], error)
BeginCreateOrUpdate - Create or update a gallery Application Definition. If the operation fails it returns an *azcore.ResponseError type.
Generated from API version 2023-07-03
- resourceGroupName - The name of the resource group.
- galleryName - The name of the Shared Application Gallery in which the Application Definition is to be created.
- galleryApplicationName - The name of the gallery Application Definition to be created or updated. The allowed characters are alphabets and numbers with dots, dashes, and periods allowed in the middle. The maximum length is 80 characters.
- galleryApplication - Parameters supplied to the create or update gallery Application operation.
- options - GalleryApplicationsClientBeginCreateOrUpdateOptions contains the optional parameters for the GalleryApplicationsClient.BeginCreateOrUpdate method.
Example ¶
Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/92de53a5f1e0e03c94b40475d2135d97148ed014/specification/compute/resource-manager/Microsoft.Compute/GalleryRP/stable/2023-07-03/examples/galleryExamples/GalleryApplication_Create.json
cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() clientFactory, err := armcompute.NewClientFactory("<subscription-id>", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } poller, err := clientFactory.NewGalleryApplicationsClient().BeginCreateOrUpdate(ctx, "myResourceGroup", "myGalleryName", "myGalleryApplicationName", armcompute.GalleryApplication{ Location: to.Ptr("West US"), Properties: &armcompute.GalleryApplicationProperties{ Description: to.Ptr("This is the gallery application description."), CustomActions: []*armcompute.GalleryApplicationCustomAction{ { Name: to.Ptr("myCustomAction"), Description: to.Ptr("This is the custom action description."), Parameters: []*armcompute.GalleryApplicationCustomActionParameter{ { Name: to.Ptr("myCustomActionParameter"), Type: to.Ptr(armcompute.GalleryApplicationCustomActionParameterTypeString), Description: to.Ptr("This is the description of the parameter"), DefaultValue: to.Ptr("default value of parameter."), Required: to.Ptr(false), }}, Script: to.Ptr("myCustomActionScript"), }}, Eula: to.Ptr("This is the gallery application EULA."), PrivacyStatementURI: to.Ptr("myPrivacyStatementUri}"), ReleaseNoteURI: to.Ptr("myReleaseNoteUri"), SupportedOSType: to.Ptr(armcompute.OperatingSystemTypesWindows), }, }, nil) if err != nil { log.Fatalf("failed to finish the request: %v", err) } res, err := poller.PollUntilDone(ctx, nil) if err != nil { log.Fatalf("failed to pull the result: %v", err) } // You could use response here. We use blank identifier for just demo purposes. _ = res // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. // res.GalleryApplication = armcompute.GalleryApplication{ // Name: to.Ptr("myGalleryApplicationName"), // Type: to.Ptr("Microsoft.Compute/galleries"), // ID: to.Ptr("/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/galleries/myGalleryName/applications/myGalleryApplicationName"), // Location: to.Ptr("West US"), // Properties: &armcompute.GalleryApplicationProperties{ // Description: to.Ptr("This is the gallery application description."), // CustomActions: []*armcompute.GalleryApplicationCustomAction{ // { // Name: to.Ptr("myCustomAction"), // Description: to.Ptr("This is the custom action description."), // Parameters: []*armcompute.GalleryApplicationCustomActionParameter{ // { // Name: to.Ptr("myCustomActionParameter"), // Type: to.Ptr(armcompute.GalleryApplicationCustomActionParameterTypeString), // Description: to.Ptr("This is the description of the parameter"), // DefaultValue: to.Ptr("default value of parameter."), // Required: to.Ptr(false), // }}, // Script: to.Ptr("myCustomActionScript"), // }}, // Eula: to.Ptr("This is the gallery application EULA."), // PrivacyStatementURI: to.Ptr("myPrivacyStatementUri}"), // ReleaseNoteURI: to.Ptr("myReleaseNoteUri"), // SupportedOSType: to.Ptr(armcompute.OperatingSystemTypesWindows), // }, // }
Output:
func (*GalleryApplicationsClient) BeginDelete ¶
func (client *GalleryApplicationsClient) BeginDelete(ctx context.Context, resourceGroupName string, galleryName string, galleryApplicationName string, options *GalleryApplicationsClientBeginDeleteOptions) (*runtime.Poller[GalleryApplicationsClientDeleteResponse], error)
BeginDelete - Delete a gallery Application. If the operation fails it returns an *azcore.ResponseError type.
Generated from API version 2023-07-03
- resourceGroupName - The name of the resource group.
- galleryName - The name of the Shared Application Gallery in which the Application Definition is to be deleted.
- galleryApplicationName - The name of the gallery Application Definition to be deleted.
- options - GalleryApplicationsClientBeginDeleteOptions contains the optional parameters for the GalleryApplicationsClient.BeginDelete method.
Example ¶
Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/92de53a5f1e0e03c94b40475d2135d97148ed014/specification/compute/resource-manager/Microsoft.Compute/GalleryRP/stable/2023-07-03/examples/galleryExamples/GalleryApplication_Delete.json
cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() clientFactory, err := armcompute.NewClientFactory("<subscription-id>", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } poller, err := clientFactory.NewGalleryApplicationsClient().BeginDelete(ctx, "myResourceGroup", "myGalleryName", "myGalleryApplicationName", nil) if err != nil { log.Fatalf("failed to finish the request: %v", err) } _, err = poller.PollUntilDone(ctx, nil) if err != nil { log.Fatalf("failed to pull the result: %v", err) }
Output:
func (*GalleryApplicationsClient) BeginUpdate ¶
func (client *GalleryApplicationsClient) BeginUpdate(ctx context.Context, resourceGroupName string, galleryName string, galleryApplicationName string, galleryApplication GalleryApplicationUpdate, options *GalleryApplicationsClientBeginUpdateOptions) (*runtime.Poller[GalleryApplicationsClientUpdateResponse], error)
BeginUpdate - Update a gallery Application Definition. If the operation fails it returns an *azcore.ResponseError type.
Generated from API version 2023-07-03
- resourceGroupName - The name of the resource group.
- galleryName - The name of the Shared Application Gallery in which the Application Definition is to be updated.
- galleryApplicationName - The name of the gallery Application Definition to be updated. The allowed characters are alphabets and numbers with dots, dashes, and periods allowed in the middle. The maximum length is 80 characters.
- galleryApplication - Parameters supplied to the update gallery Application operation.
- options - GalleryApplicationsClientBeginUpdateOptions contains the optional parameters for the GalleryApplicationsClient.BeginUpdate method.
Example ¶
Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/92de53a5f1e0e03c94b40475d2135d97148ed014/specification/compute/resource-manager/Microsoft.Compute/GalleryRP/stable/2023-07-03/examples/galleryExamples/GalleryApplication_Update.json
cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() clientFactory, err := armcompute.NewClientFactory("<subscription-id>", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } poller, err := clientFactory.NewGalleryApplicationsClient().BeginUpdate(ctx, "myResourceGroup", "myGalleryName", "myGalleryApplicationName", armcompute.GalleryApplicationUpdate{ Properties: &armcompute.GalleryApplicationProperties{ Description: to.Ptr("This is the gallery application description."), CustomActions: []*armcompute.GalleryApplicationCustomAction{ { Name: to.Ptr("myCustomAction"), Description: to.Ptr("This is the custom action description."), Parameters: []*armcompute.GalleryApplicationCustomActionParameter{ { Name: to.Ptr("myCustomActionParameter"), Type: to.Ptr(armcompute.GalleryApplicationCustomActionParameterTypeString), Description: to.Ptr("This is the description of the parameter"), DefaultValue: to.Ptr("default value of parameter."), Required: to.Ptr(false), }}, Script: to.Ptr("myCustomActionScript"), }}, Eula: to.Ptr("This is the gallery application EULA."), PrivacyStatementURI: to.Ptr("myPrivacyStatementUri}"), ReleaseNoteURI: to.Ptr("myReleaseNoteUri"), SupportedOSType: to.Ptr(armcompute.OperatingSystemTypesWindows), }, }, nil) if err != nil { log.Fatalf("failed to finish the request: %v", err) } res, err := poller.PollUntilDone(ctx, nil) if err != nil { log.Fatalf("failed to pull the result: %v", err) } // You could use response here. We use blank identifier for just demo purposes. _ = res // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. // res.GalleryApplication = armcompute.GalleryApplication{ // Name: to.Ptr("myGalleryApplicationName"), // Type: to.Ptr("Microsoft.Compute/galleries"), // ID: to.Ptr("/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/galleries/myGalleryName/applications/myGalleryApplicationName"), // Location: to.Ptr("West US"), // Properties: &armcompute.GalleryApplicationProperties{ // Description: to.Ptr("This is the gallery application description."), // CustomActions: []*armcompute.GalleryApplicationCustomAction{ // { // Name: to.Ptr("myCustomAction"), // Description: to.Ptr("This is the custom action description."), // Parameters: []*armcompute.GalleryApplicationCustomActionParameter{ // { // Name: to.Ptr("myCustomActionParameter"), // Type: to.Ptr(armcompute.GalleryApplicationCustomActionParameterTypeString), // Description: to.Ptr("This is the description of the parameter"), // DefaultValue: to.Ptr("default value of parameter."), // Required: to.Ptr(false), // }}, // Script: to.Ptr("myCustomActionScript"), // }}, // Eula: to.Ptr("This is the gallery application EULA."), // PrivacyStatementURI: to.Ptr("myPrivacyStatementUri}"), // ReleaseNoteURI: to.Ptr("myReleaseNoteUri"), // SupportedOSType: to.Ptr(armcompute.OperatingSystemTypesWindows), // }, // }
Output:
func (*GalleryApplicationsClient) Get ¶
func (client *GalleryApplicationsClient) Get(ctx context.Context, resourceGroupName string, galleryName string, galleryApplicationName string, options *GalleryApplicationsClientGetOptions) (GalleryApplicationsClientGetResponse, error)
Get - Retrieves information about a gallery Application Definition. If the operation fails it returns an *azcore.ResponseError type.
Generated from API version 2023-07-03
- resourceGroupName - The name of the resource group.
- galleryName - The name of the Shared Application Gallery from which the Application Definitions are to be retrieved.
- galleryApplicationName - The name of the gallery Application Definition to be retrieved.
- options - GalleryApplicationsClientGetOptions contains the optional parameters for the GalleryApplicationsClient.Get method.
Example ¶
Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/92de53a5f1e0e03c94b40475d2135d97148ed014/specification/compute/resource-manager/Microsoft.Compute/GalleryRP/stable/2023-07-03/examples/galleryExamples/GalleryApplication_Get.json
cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() clientFactory, err := armcompute.NewClientFactory("<subscription-id>", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } res, err := clientFactory.NewGalleryApplicationsClient().Get(ctx, "myResourceGroup", "myGalleryName", "myGalleryApplicationName", nil) if err != nil { log.Fatalf("failed to finish the request: %v", err) } // You could use response here. We use blank identifier for just demo purposes. _ = res // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. // res.GalleryApplication = armcompute.GalleryApplication{ // Name: to.Ptr("myGalleryApplicationName"), // ID: to.Ptr("/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/galleries/myGalleryName/applications/myGalleryApplicationName"), // Location: to.Ptr("West US"), // Properties: &armcompute.GalleryApplicationProperties{ // Description: to.Ptr("This is the gallery application description."), // CustomActions: []*armcompute.GalleryApplicationCustomAction{ // { // Name: to.Ptr("myCustomAction"), // Description: to.Ptr("This is the custom action description."), // Parameters: []*armcompute.GalleryApplicationCustomActionParameter{ // { // Name: to.Ptr("myCustomActionParameter"), // Type: to.Ptr(armcompute.GalleryApplicationCustomActionParameterTypeString), // Description: to.Ptr("This is the description of the parameter"), // DefaultValue: to.Ptr("default value of parameter."), // Required: to.Ptr(false), // }}, // Script: to.Ptr("myCustomActionScript"), // }}, // Eula: to.Ptr("This is the gallery application EULA."), // PrivacyStatementURI: to.Ptr("myPrivacyStatementUri}"), // ReleaseNoteURI: to.Ptr("myReleaseNoteUri"), // SupportedOSType: to.Ptr(armcompute.OperatingSystemTypesWindows), // }, // }
Output:
func (*GalleryApplicationsClient) NewListByGalleryPager ¶
func (client *GalleryApplicationsClient) NewListByGalleryPager(resourceGroupName string, galleryName string, options *GalleryApplicationsClientListByGalleryOptions) *runtime.Pager[GalleryApplicationsClientListByGalleryResponse]
NewListByGalleryPager - List gallery Application Definitions in a gallery.
Generated from API version 2023-07-03
- resourceGroupName - The name of the resource group.
- galleryName - The name of the Shared Application Gallery from which Application Definitions are to be listed.
- options - GalleryApplicationsClientListByGalleryOptions contains the optional parameters for the GalleryApplicationsClient.NewListByGalleryPager method.
Example ¶
Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/92de53a5f1e0e03c94b40475d2135d97148ed014/specification/compute/resource-manager/Microsoft.Compute/GalleryRP/stable/2023-07-03/examples/galleryExamples/GalleryApplication_ListByGallery.json
cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() clientFactory, err := armcompute.NewClientFactory("<subscription-id>", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } pager := clientFactory.NewGalleryApplicationsClient().NewListByGalleryPager("myResourceGroup", "myGalleryName", nil) for pager.More() { page, err := pager.NextPage(ctx) if err != nil { log.Fatalf("failed to advance page: %v", err) } for _, v := range page.Value { // You could use page here. We use blank identifier for just demo purposes. _ = v } // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. // page.GalleryApplicationList = armcompute.GalleryApplicationList{ // Value: []*armcompute.GalleryApplication{ // { // Name: to.Ptr("myGalleryApplicationName"), // ID: to.Ptr("/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/galleries/myGalleryName/applications/myGalleryApplicationName"), // Location: to.Ptr("West US"), // Properties: &armcompute.GalleryApplicationProperties{ // Description: to.Ptr("This is the gallery application description."), // CustomActions: []*armcompute.GalleryApplicationCustomAction{ // { // Name: to.Ptr("myCustomAction"), // Description: to.Ptr("This is the custom action description."), // Parameters: []*armcompute.GalleryApplicationCustomActionParameter{ // { // Name: to.Ptr("myCustomActionParameter"), // Type: to.Ptr(armcompute.GalleryApplicationCustomActionParameterTypeString), // Description: to.Ptr("This is the description of the parameter"), // DefaultValue: to.Ptr("default value of parameter."), // Required: to.Ptr(false), // }}, // Script: to.Ptr("myCustomActionScript"), // }}, // Eula: to.Ptr("This is the gallery application EULA."), // PrivacyStatementURI: to.Ptr("myPrivacyStatementUri}"), // ReleaseNoteURI: to.Ptr("myReleaseNoteUri"), // SupportedOSType: to.Ptr(armcompute.OperatingSystemTypesWindows), // }, // }}, // } }
Output:
type GalleryApplicationsClientBeginCreateOrUpdateOptions ¶
type GalleryApplicationsClientBeginCreateOrUpdateOptions struct { // Resumes the LRO from the provided token. ResumeToken string }
GalleryApplicationsClientBeginCreateOrUpdateOptions contains the optional parameters for the GalleryApplicationsClient.BeginCreateOrUpdate method.
type GalleryApplicationsClientBeginDeleteOptions ¶
type GalleryApplicationsClientBeginDeleteOptions struct { // Resumes the LRO from the provided token. ResumeToken string }
GalleryApplicationsClientBeginDeleteOptions contains the optional parameters for the GalleryApplicationsClient.BeginDelete method.
type GalleryApplicationsClientBeginUpdateOptions ¶
type GalleryApplicationsClientBeginUpdateOptions struct { // Resumes the LRO from the provided token. ResumeToken string }
GalleryApplicationsClientBeginUpdateOptions contains the optional parameters for the GalleryApplicationsClient.BeginUpdate method.
type GalleryApplicationsClientCreateOrUpdateResponse ¶
type GalleryApplicationsClientCreateOrUpdateResponse struct { // Specifies information about the gallery Application Definition that you want to create or update. GalleryApplication }
GalleryApplicationsClientCreateOrUpdateResponse contains the response from method GalleryApplicationsClient.BeginCreateOrUpdate.
type GalleryApplicationsClientDeleteResponse ¶
type GalleryApplicationsClientDeleteResponse struct { }
GalleryApplicationsClientDeleteResponse contains the response from method GalleryApplicationsClient.BeginDelete.
type GalleryApplicationsClientGetOptions ¶
type GalleryApplicationsClientGetOptions struct { }
GalleryApplicationsClientGetOptions contains the optional parameters for the GalleryApplicationsClient.Get method.
type GalleryApplicationsClientGetResponse ¶
type GalleryApplicationsClientGetResponse struct { // Specifies information about the gallery Application Definition that you want to create or update. GalleryApplication }
GalleryApplicationsClientGetResponse contains the response from method GalleryApplicationsClient.Get.
type GalleryApplicationsClientListByGalleryOptions ¶
type GalleryApplicationsClientListByGalleryOptions struct { }
GalleryApplicationsClientListByGalleryOptions contains the optional parameters for the GalleryApplicationsClient.NewListByGalleryPager method.
type GalleryApplicationsClientListByGalleryResponse ¶
type GalleryApplicationsClientListByGalleryResponse struct { // The List Gallery Applications operation response. GalleryApplicationList }
GalleryApplicationsClientListByGalleryResponse contains the response from method GalleryApplicationsClient.NewListByGalleryPager.
type GalleryApplicationsClientUpdateResponse ¶
type GalleryApplicationsClientUpdateResponse struct { // Specifies information about the gallery Application Definition that you want to create or update. GalleryApplication }
GalleryApplicationsClientUpdateResponse contains the response from method GalleryApplicationsClient.BeginUpdate.
type GalleryArtifactPublishingProfileBase ¶
type GalleryArtifactPublishingProfileBase struct { // The end of life date of the gallery image version. This property can be used for decommissioning purposes. This property // is updatable. EndOfLifeDate *time.Time // If set to true, Virtual Machines deployed from the latest version of the Image Definition won't use this Image Version. ExcludeFromLatest *bool // The number of replicas of the Image Version to be created per region. This property would take effect for a region when // regionalReplicaCount is not specified. This property is updatable. ReplicaCount *int32 // Optional parameter which specifies the mode to be used for replication. This property is not updatable. ReplicationMode *ReplicationMode // Specifies the storage account type to be used to store the image. This property is not updatable. StorageAccountType *StorageAccountType // The target extended locations where the Image Version is going to be replicated to. This property is updatable. TargetExtendedLocations []*GalleryTargetExtendedLocation // The target regions where the Image Version is going to be replicated to. This property is updatable. TargetRegions []*TargetRegion // READ-ONLY; The timestamp for when the gallery image version is published. PublishedDate *time.Time }
GalleryArtifactPublishingProfileBase - Describes the basic gallery artifact publishing profile.
func (GalleryArtifactPublishingProfileBase) MarshalJSON ¶
func (g GalleryArtifactPublishingProfileBase) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type GalleryArtifactPublishingProfileBase.
func (*GalleryArtifactPublishingProfileBase) UnmarshalJSON ¶
func (g *GalleryArtifactPublishingProfileBase) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type GalleryArtifactPublishingProfileBase.
type GalleryArtifactSafetyProfileBase ¶
type GalleryArtifactSafetyProfileBase struct { // Indicates whether or not removing this Gallery Image Version from replicated regions is allowed. AllowDeletionOfReplicatedLocations *bool }
GalleryArtifactSafetyProfileBase - This is the safety profile of the Gallery Artifact Version.
func (GalleryArtifactSafetyProfileBase) MarshalJSON ¶
func (g GalleryArtifactSafetyProfileBase) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type GalleryArtifactSafetyProfileBase.
func (*GalleryArtifactSafetyProfileBase) UnmarshalJSON ¶
func (g *GalleryArtifactSafetyProfileBase) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type GalleryArtifactSafetyProfileBase.
type GalleryArtifactSource ¶
type GalleryArtifactSource struct { // REQUIRED; The managed artifact. ManagedImage *ManagedArtifact }
GalleryArtifactSource - The source image from which the Image Version is going to be created.
func (GalleryArtifactSource) MarshalJSON ¶
func (g GalleryArtifactSource) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type GalleryArtifactSource.
func (*GalleryArtifactSource) UnmarshalJSON ¶
func (g *GalleryArtifactSource) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type GalleryArtifactSource.
type GalleryArtifactVersionFullSource ¶
type GalleryArtifactVersionFullSource struct { // The resource Id of the source Community Gallery Image. Only required when using Community Gallery Image as a source. CommunityGalleryImageID *string // The id of the gallery artifact version source. ID *string // The resource Id of the source virtual machine. Only required when capturing a virtual machine to source this Gallery Image // Version. VirtualMachineID *string }
GalleryArtifactVersionFullSource - The source of the gallery artifact version.
func (GalleryArtifactVersionFullSource) MarshalJSON ¶
func (g GalleryArtifactVersionFullSource) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type GalleryArtifactVersionFullSource.
func (*GalleryArtifactVersionFullSource) UnmarshalJSON ¶
func (g *GalleryArtifactVersionFullSource) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type GalleryArtifactVersionFullSource.
type GalleryArtifactVersionSource ¶
type GalleryArtifactVersionSource struct { // The id of the gallery artifact version source. ID *string }
GalleryArtifactVersionSource - The gallery artifact version source.
func (GalleryArtifactVersionSource) MarshalJSON ¶
func (g GalleryArtifactVersionSource) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type GalleryArtifactVersionSource.
func (*GalleryArtifactVersionSource) UnmarshalJSON ¶
func (g *GalleryArtifactVersionSource) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type GalleryArtifactVersionSource.
type GalleryDataDiskImage ¶
type GalleryDataDiskImage struct { // REQUIRED; This property specifies the logical unit number of the data disk. This value is used to identify data disks within // the Virtual Machine and therefore must be unique for each data disk attached to the // Virtual Machine. Lun *int32 // The host caching of the disk. Valid values are 'None', 'ReadOnly', and 'ReadWrite' HostCaching *HostCaching // The source for the disk image. Source *GalleryDiskImageSource // READ-ONLY; This property indicates the size of the VHD to be created. SizeInGB *int32 }
GalleryDataDiskImage - This is the data disk image.
func (GalleryDataDiskImage) MarshalJSON ¶
func (g GalleryDataDiskImage) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type GalleryDataDiskImage.
func (*GalleryDataDiskImage) UnmarshalJSON ¶
func (g *GalleryDataDiskImage) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type GalleryDataDiskImage.
type GalleryDiskImage ¶
type GalleryDiskImage struct { // The host caching of the disk. Valid values are 'None', 'ReadOnly', and 'ReadWrite' HostCaching *HostCaching // The source for the disk image. Source *GalleryDiskImageSource // READ-ONLY; This property indicates the size of the VHD to be created. SizeInGB *int32 }
GalleryDiskImage - This is the disk image base class.
func (GalleryDiskImage) MarshalJSON ¶
func (g GalleryDiskImage) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type GalleryDiskImage.
func (*GalleryDiskImage) UnmarshalJSON ¶
func (g *GalleryDiskImage) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type GalleryDiskImage.
type GalleryDiskImageSource ¶
type GalleryDiskImageSource struct { // The id of the gallery artifact version source. ID *string // The Storage Account Id that contains the vhd blob being used as a source for this artifact version. StorageAccountID *string // The uri of the gallery artifact version source. Currently used to specify vhd/blob source. URI *string }
GalleryDiskImageSource - The source for the disk image.
func (GalleryDiskImageSource) MarshalJSON ¶
func (g GalleryDiskImageSource) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type GalleryDiskImageSource.
func (*GalleryDiskImageSource) UnmarshalJSON ¶
func (g *GalleryDiskImageSource) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type GalleryDiskImageSource.
type GalleryExpandParams ¶
type GalleryExpandParams string
const (
GalleryExpandParamsSharingProfileGroups GalleryExpandParams = "SharingProfile/Groups"
)
func PossibleGalleryExpandParamsValues ¶
func PossibleGalleryExpandParamsValues() []GalleryExpandParams
PossibleGalleryExpandParamsValues returns the possible values for the GalleryExpandParams const type.
type GalleryExtendedLocation ¶
type GalleryExtendedLocation struct { Name *string // It is type of the extended location. Type *GalleryExtendedLocationType }
GalleryExtendedLocation - The name of the extended location.
func (GalleryExtendedLocation) MarshalJSON ¶
func (g GalleryExtendedLocation) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type GalleryExtendedLocation.
func (*GalleryExtendedLocation) UnmarshalJSON ¶
func (g *GalleryExtendedLocation) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type GalleryExtendedLocation.
type GalleryExtendedLocationType ¶
type GalleryExtendedLocationType string
GalleryExtendedLocationType - It is type of the extended location.
const ( GalleryExtendedLocationTypeEdgeZone GalleryExtendedLocationType = "EdgeZone" GalleryExtendedLocationTypeUnknown GalleryExtendedLocationType = "Unknown" )
func PossibleGalleryExtendedLocationTypeValues ¶
func PossibleGalleryExtendedLocationTypeValues() []GalleryExtendedLocationType
PossibleGalleryExtendedLocationTypeValues returns the possible values for the GalleryExtendedLocationType const type.
type GalleryIdentifier ¶
type GalleryIdentifier struct { // READ-ONLY; The unique name of the Shared Image Gallery. This name is generated automatically by Azure. UniqueName *string }
GalleryIdentifier - Describes the gallery unique name.
func (GalleryIdentifier) MarshalJSON ¶
func (g GalleryIdentifier) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type GalleryIdentifier.
func (*GalleryIdentifier) UnmarshalJSON ¶
func (g *GalleryIdentifier) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type GalleryIdentifier.
type GalleryImage ¶
type GalleryImage struct { // REQUIRED; Resource location Location *string // Describes the properties of a gallery image definition. Properties *GalleryImageProperties // Resource tags Tags map[string]*string // READ-ONLY; Resource Id ID *string // READ-ONLY; Resource name Name *string // READ-ONLY; Resource type Type *string }
GalleryImage - Specifies information about the gallery image definition that you want to create or update.
func (GalleryImage) MarshalJSON ¶
func (g GalleryImage) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type GalleryImage.
func (*GalleryImage) UnmarshalJSON ¶
func (g *GalleryImage) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type GalleryImage.
type GalleryImageFeature ¶
type GalleryImageFeature struct { // The name of the gallery image feature. Name *string // The value of the gallery image feature. Value *string }
GalleryImageFeature - A feature for gallery image.
func (GalleryImageFeature) MarshalJSON ¶
func (g GalleryImageFeature) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type GalleryImageFeature.
func (*GalleryImageFeature) UnmarshalJSON ¶
func (g *GalleryImageFeature) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type GalleryImageFeature.
type GalleryImageIdentifier ¶
type GalleryImageIdentifier struct { // REQUIRED; The name of the gallery image definition offer. Offer *string // REQUIRED; The name of the gallery image definition publisher. Publisher *string // REQUIRED; The name of the gallery image definition SKU. SKU *string }
GalleryImageIdentifier - This is the gallery image definition identifier.
func (GalleryImageIdentifier) MarshalJSON ¶
func (g GalleryImageIdentifier) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type GalleryImageIdentifier.
func (*GalleryImageIdentifier) UnmarshalJSON ¶
func (g *GalleryImageIdentifier) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type GalleryImageIdentifier.
type GalleryImageList ¶
type GalleryImageList struct { // REQUIRED; A list of Shared Image Gallery images. Value []*GalleryImage // The uri to fetch the next page of Image Definitions in the Shared Image Gallery. Call ListNext() with this to fetch the // next page of gallery image definitions. NextLink *string }
GalleryImageList - The List Gallery Images operation response.
func (GalleryImageList) MarshalJSON ¶
func (g GalleryImageList) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type GalleryImageList.
func (*GalleryImageList) UnmarshalJSON ¶
func (g *GalleryImageList) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type GalleryImageList.
type GalleryImageProperties ¶
type GalleryImageProperties struct { // REQUIRED; This is the gallery image definition identifier. Identifier *GalleryImageIdentifier // REQUIRED; This property allows the user to specify whether the virtual machines created under this image are 'Generalized' // or 'Specialized'. OSState *OperatingSystemStateTypes // REQUIRED; This property allows you to specify the type of the OS that is included in the disk when creating a VM from a // managed image. Possible values are: Windows, Linux. OSType *OperatingSystemTypes // The architecture of the image. Applicable to OS disks only. Architecture *Architecture // The description of this gallery image definition resource. This property is updatable. Description *string // Describes the disallowed disk types. Disallowed *Disallowed // The end of life date of the gallery image definition. This property can be used for decommissioning purposes. This property // is updatable. EndOfLifeDate *time.Time // The Eula agreement for the gallery image definition. Eula *string // A list of gallery image features. Features []*GalleryImageFeature // The hypervisor generation of the Virtual Machine. Applicable to OS disks only. HyperVGeneration *HyperVGeneration // The privacy statement uri. PrivacyStatementURI *string // Describes the gallery image definition purchase plan. This is used by marketplace images. PurchasePlan *ImagePurchasePlan // The properties describe the recommended machine configuration for this Image Definition. These properties are updatable. Recommended *RecommendedMachineConfiguration // The release note uri. ReleaseNoteURI *string // READ-ONLY; The provisioning state, which only appears in the response. ProvisioningState *GalleryProvisioningState }
GalleryImageProperties - Describes the properties of a gallery image definition.
func (GalleryImageProperties) MarshalJSON ¶
func (g GalleryImageProperties) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type GalleryImageProperties.
func (*GalleryImageProperties) UnmarshalJSON ¶
func (g *GalleryImageProperties) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type GalleryImageProperties.
type GalleryImageUpdate ¶
type GalleryImageUpdate struct { // Describes the properties of a gallery image definition. Properties *GalleryImageProperties // Resource tags Tags map[string]*string // READ-ONLY; Resource Id ID *string // READ-ONLY; Resource name Name *string // READ-ONLY; Resource type Type *string }
GalleryImageUpdate - Specifies information about the gallery image definition that you want to update.
func (GalleryImageUpdate) MarshalJSON ¶
func (g GalleryImageUpdate) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type GalleryImageUpdate.
func (*GalleryImageUpdate) UnmarshalJSON ¶
func (g *GalleryImageUpdate) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type GalleryImageUpdate.
type GalleryImageVersion ¶
type GalleryImageVersion struct { // REQUIRED; Resource location Location *string // Describes the properties of a gallery image version. Properties *GalleryImageVersionProperties // Resource tags Tags map[string]*string // READ-ONLY; Resource Id ID *string // READ-ONLY; Resource name Name *string // READ-ONLY; Resource type Type *string }
GalleryImageVersion - Specifies information about the gallery image version that you want to create or update.
func (GalleryImageVersion) MarshalJSON ¶
func (g GalleryImageVersion) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type GalleryImageVersion.
func (*GalleryImageVersion) UnmarshalJSON ¶
func (g *GalleryImageVersion) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type GalleryImageVersion.
type GalleryImageVersionList ¶
type GalleryImageVersionList struct { // REQUIRED; A list of gallery image versions. Value []*GalleryImageVersion // The uri to fetch the next page of gallery image versions. Call ListNext() with this to fetch the next page of gallery image // versions. NextLink *string }
GalleryImageVersionList - The List Gallery Image version operation response.
func (GalleryImageVersionList) MarshalJSON ¶
func (g GalleryImageVersionList) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type GalleryImageVersionList.
func (*GalleryImageVersionList) UnmarshalJSON ¶
func (g *GalleryImageVersionList) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type GalleryImageVersionList.
type GalleryImageVersionProperties ¶
type GalleryImageVersionProperties struct { // REQUIRED; This is the storage profile of a Gallery Image Version. StorageProfile *GalleryImageVersionStorageProfile // The publishing profile of a gallery image Version. PublishingProfile *GalleryImageVersionPublishingProfile // This is the safety profile of the Gallery Image Version. SafetyProfile *GalleryImageVersionSafetyProfile // The security profile of a gallery image version SecurityProfile *ImageVersionSecurityProfile // READ-ONLY; The provisioning state, which only appears in the response. ProvisioningState *GalleryProvisioningState // READ-ONLY; This is the replication status of the gallery image version. ReplicationStatus *ReplicationStatus }
GalleryImageVersionProperties - Describes the properties of a gallery image version.
func (GalleryImageVersionProperties) MarshalJSON ¶
func (g GalleryImageVersionProperties) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type GalleryImageVersionProperties.
func (*GalleryImageVersionProperties) UnmarshalJSON ¶
func (g *GalleryImageVersionProperties) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type GalleryImageVersionProperties.
type GalleryImageVersionPublishingProfile ¶
type GalleryImageVersionPublishingProfile struct { // The end of life date of the gallery image version. This property can be used for decommissioning purposes. This property // is updatable. EndOfLifeDate *time.Time // If set to true, Virtual Machines deployed from the latest version of the Image Definition won't use this Image Version. ExcludeFromLatest *bool // The number of replicas of the Image Version to be created per region. This property would take effect for a region when // regionalReplicaCount is not specified. This property is updatable. ReplicaCount *int32 // Optional parameter which specifies the mode to be used for replication. This property is not updatable. ReplicationMode *ReplicationMode // Specifies the storage account type to be used to store the image. This property is not updatable. StorageAccountType *StorageAccountType // The target extended locations where the Image Version is going to be replicated to. This property is updatable. TargetExtendedLocations []*GalleryTargetExtendedLocation // The target regions where the Image Version is going to be replicated to. This property is updatable. TargetRegions []*TargetRegion // READ-ONLY; The timestamp for when the gallery image version is published. PublishedDate *time.Time }
GalleryImageVersionPublishingProfile - The publishing profile of a gallery image Version.
func (GalleryImageVersionPublishingProfile) MarshalJSON ¶
func (g GalleryImageVersionPublishingProfile) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type GalleryImageVersionPublishingProfile.
func (*GalleryImageVersionPublishingProfile) UnmarshalJSON ¶
func (g *GalleryImageVersionPublishingProfile) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type GalleryImageVersionPublishingProfile.
type GalleryImageVersionSafetyProfile ¶
type GalleryImageVersionSafetyProfile struct { // Indicates whether or not removing this Gallery Image Version from replicated regions is allowed. AllowDeletionOfReplicatedLocations *bool // READ-ONLY; A list of Policy Violations that have been reported for this Gallery Image Version. PolicyViolations []*PolicyViolation // READ-ONLY; Indicates whether this image has been reported as violating Microsoft's policies. ReportedForPolicyViolation *bool }
GalleryImageVersionSafetyProfile - This is the safety profile of the Gallery Image Version.
func (GalleryImageVersionSafetyProfile) MarshalJSON ¶
func (g GalleryImageVersionSafetyProfile) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type GalleryImageVersionSafetyProfile.
func (*GalleryImageVersionSafetyProfile) UnmarshalJSON ¶
func (g *GalleryImageVersionSafetyProfile) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type GalleryImageVersionSafetyProfile.
type GalleryImageVersionStorageProfile ¶
type GalleryImageVersionStorageProfile struct { // A list of data disk images. DataDiskImages []*GalleryDataDiskImage // This is the OS disk image. OSDiskImage *GalleryOSDiskImage // The source of the gallery artifact version. Source *GalleryArtifactVersionFullSource }
GalleryImageVersionStorageProfile - This is the storage profile of a Gallery Image Version.
func (GalleryImageVersionStorageProfile) MarshalJSON ¶
func (g GalleryImageVersionStorageProfile) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type GalleryImageVersionStorageProfile.
func (*GalleryImageVersionStorageProfile) UnmarshalJSON ¶
func (g *GalleryImageVersionStorageProfile) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type GalleryImageVersionStorageProfile.
type GalleryImageVersionUefiSettings ¶ added in v5.4.0
type GalleryImageVersionUefiSettings struct { // Additional UEFI key signatures that will be added to the image in addition to the signature templates AdditionalSignatures *UefiKeySignatures // The name of the template(s) that contains default UEFI key signatures that will be added to the image. SignatureTemplateNames []*UefiSignatureTemplateName }
GalleryImageVersionUefiSettings - Contains UEFI settings for the image version.
func (GalleryImageVersionUefiSettings) MarshalJSON ¶ added in v5.4.0
func (g GalleryImageVersionUefiSettings) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type GalleryImageVersionUefiSettings.
func (*GalleryImageVersionUefiSettings) UnmarshalJSON ¶ added in v5.4.0
func (g *GalleryImageVersionUefiSettings) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type GalleryImageVersionUefiSettings.
type GalleryImageVersionUpdate ¶
type GalleryImageVersionUpdate struct { // Describes the properties of a gallery image version. Properties *GalleryImageVersionProperties // Resource tags Tags map[string]*string // READ-ONLY; Resource Id ID *string // READ-ONLY; Resource name Name *string // READ-ONLY; Resource type Type *string }
GalleryImageVersionUpdate - Specifies information about the gallery image version that you want to update.
func (GalleryImageVersionUpdate) MarshalJSON ¶
func (g GalleryImageVersionUpdate) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type GalleryImageVersionUpdate.
func (*GalleryImageVersionUpdate) UnmarshalJSON ¶
func (g *GalleryImageVersionUpdate) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type GalleryImageVersionUpdate.
type GalleryImageVersionsClient ¶
type GalleryImageVersionsClient struct {
// contains filtered or unexported fields
}
GalleryImageVersionsClient contains the methods for the GalleryImageVersions group. Don't use this type directly, use NewGalleryImageVersionsClient() instead.
func NewGalleryImageVersionsClient ¶
func NewGalleryImageVersionsClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*GalleryImageVersionsClient, error)
NewGalleryImageVersionsClient creates a new instance of GalleryImageVersionsClient 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 (*GalleryImageVersionsClient) BeginCreateOrUpdate ¶
func (client *GalleryImageVersionsClient) BeginCreateOrUpdate(ctx context.Context, resourceGroupName string, galleryName string, galleryImageName string, galleryImageVersionName string, galleryImageVersion GalleryImageVersion, options *GalleryImageVersionsClientBeginCreateOrUpdateOptions) (*runtime.Poller[GalleryImageVersionsClientCreateOrUpdateResponse], error)
BeginCreateOrUpdate - Create or update a gallery image version. If the operation fails it returns an *azcore.ResponseError type.
Generated from API version 2023-07-03
- resourceGroupName - The name of the resource group.
- galleryName - The name of the Shared Image Gallery in which the Image Definition resides.
- galleryImageName - The name of the gallery image definition in which the Image Version is to be created.
- galleryImageVersionName - The name of the gallery image version to be created. Needs to follow semantic version name pattern: The allowed characters are digit and period. Digits must be within the range of a 32-bit integer. Format: ..
- galleryImageVersion - Parameters supplied to the create or update gallery image version operation.
- options - GalleryImageVersionsClientBeginCreateOrUpdateOptions contains the optional parameters for the GalleryImageVersionsClient.BeginCreateOrUpdate method.
Example (CreateOrUpdateASimpleGalleryImageVersionUsingCommunityGalleryImageAsSource) ¶
Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/92de53a5f1e0e03c94b40475d2135d97148ed014/specification/compute/resource-manager/Microsoft.Compute/GalleryRP/stable/2023-07-03/examples/galleryExamples/GalleryImageVersion_Create_WithCommunityImageVersionAsSource.json
cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() clientFactory, err := armcompute.NewClientFactory("<subscription-id>", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } poller, err := clientFactory.NewGalleryImageVersionsClient().BeginCreateOrUpdate(ctx, "myResourceGroup", "myGalleryName", "myGalleryImageName", "1.0.0", armcompute.GalleryImageVersion{ Location: to.Ptr("West US"), Properties: &armcompute.GalleryImageVersionProperties{ PublishingProfile: &armcompute.GalleryImageVersionPublishingProfile{ TargetRegions: []*armcompute.TargetRegion{ { Name: to.Ptr("West US"), Encryption: &armcompute.EncryptionImages{ DataDiskImages: []*armcompute.DataDiskImageEncryption{ { DiskEncryptionSetID: to.Ptr("/subscriptions/{subscriptionId}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/diskEncryptionSet/myOtherWestUSDiskEncryptionSet"), Lun: to.Ptr[int32](0), }, { DiskEncryptionSetID: to.Ptr("/subscriptions/{subscriptionId}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/diskEncryptionSet/myWestUSDiskEncryptionSet"), Lun: to.Ptr[int32](1), }}, OSDiskImage: &armcompute.OSDiskImageEncryption{ DiskEncryptionSetID: to.Ptr("/subscriptions/{subscriptionId}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/diskEncryptionSet/myWestUSDiskEncryptionSet"), }, }, ExcludeFromLatest: to.Ptr(false), RegionalReplicaCount: to.Ptr[int32](1), }, { Name: to.Ptr("East US"), Encryption: &armcompute.EncryptionImages{ DataDiskImages: []*armcompute.DataDiskImageEncryption{ { DiskEncryptionSetID: to.Ptr("/subscriptions/{subscriptionId}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/diskEncryptionSet/myOtherEastUSDiskEncryptionSet"), Lun: to.Ptr[int32](0), }, { DiskEncryptionSetID: to.Ptr("/subscriptions/{subscriptionId}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/diskEncryptionSet/myEastUSDiskEncryptionSet"), Lun: to.Ptr[int32](1), }}, OSDiskImage: &armcompute.OSDiskImageEncryption{ DiskEncryptionSetID: to.Ptr("/subscriptions/{subscriptionId}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/diskEncryptionSet/myEastUSDiskEncryptionSet"), }, }, ExcludeFromLatest: to.Ptr(false), RegionalReplicaCount: to.Ptr[int32](2), StorageAccountType: to.Ptr(armcompute.StorageAccountTypeStandardZRS), }}, }, SafetyProfile: &armcompute.GalleryImageVersionSafetyProfile{ AllowDeletionOfReplicatedLocations: to.Ptr(false), }, StorageProfile: &armcompute.GalleryImageVersionStorageProfile{ Source: &armcompute.GalleryArtifactVersionFullSource{ CommunityGalleryImageID: to.Ptr("/communityGalleries/{communityGalleryName}/images/{communityGalleryImageName}"), }, }, }, }, nil) if err != nil { log.Fatalf("failed to finish the request: %v", err) } res, err := poller.PollUntilDone(ctx, nil) if err != nil { log.Fatalf("failed to pull the result: %v", err) } // You could use response here. We use blank identifier for just demo purposes. _ = res // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. // res.GalleryImageVersion = armcompute.GalleryImageVersion{ // Name: to.Ptr("1.0.0"), // ID: to.Ptr("/providers/Microsoft.Compute/locations/westus/Galleries/myGalleryName/Images/myGalleryImageName/Versions/1.0.0"), // Location: to.Ptr("West US"), // Properties: &armcompute.GalleryImageVersionProperties{ // ProvisioningState: to.Ptr(armcompute.GalleryProvisioningStateSucceeded), // PublishingProfile: &armcompute.GalleryImageVersionPublishingProfile{ // PublishedDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2018-01-01T00:00:00.000Z"); return t}()), // ReplicaCount: to.Ptr[int32](1), // StorageAccountType: to.Ptr(armcompute.StorageAccountTypeStandardLRS), // TargetRegions: []*armcompute.TargetRegion{ // { // Name: to.Ptr("West US"), // Encryption: &armcompute.EncryptionImages{ // DataDiskImages: []*armcompute.DataDiskImageEncryption{ // { // DiskEncryptionSetID: to.Ptr("/subscriptions/{subscriptionId}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/diskEncryptionSet/myOtherWestUSDiskEncryptionSet"), // Lun: to.Ptr[int32](0), // }, // { // DiskEncryptionSetID: to.Ptr("/subscriptions/{subscriptionId}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/diskEncryptionSet/myWestUSDiskEncryptionSet"), // Lun: to.Ptr[int32](1), // }}, // OSDiskImage: &armcompute.OSDiskImageEncryption{ // DiskEncryptionSetID: to.Ptr("/subscriptions/{subscriptionId}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/diskEncryptionSet/myWestUSDiskEncryptionSet"), // }, // }, // ExcludeFromLatest: to.Ptr(false), // RegionalReplicaCount: to.Ptr[int32](1), // StorageAccountType: to.Ptr(armcompute.StorageAccountTypeStandardLRS), // }, // { // Name: to.Ptr("East US"), // Encryption: &armcompute.EncryptionImages{ // DataDiskImages: []*armcompute.DataDiskImageEncryption{ // { // DiskEncryptionSetID: to.Ptr("/subscriptions/{subscriptionId}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/diskEncryptionSet/myOtherEastUSDiskEncryptionSet"), // Lun: to.Ptr[int32](0), // }, // { // DiskEncryptionSetID: to.Ptr("/subscriptions/{subscriptionId}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/diskEncryptionSet/myEastUSDiskEncryptionSet"), // Lun: to.Ptr[int32](1), // }}, // OSDiskImage: &armcompute.OSDiskImageEncryption{ // DiskEncryptionSetID: to.Ptr("/subscriptions/{subscriptionId}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/diskEncryptionSet/myEastUSDiskEncryptionSet"), // }, // }, // ExcludeFromLatest: to.Ptr(false), // RegionalReplicaCount: to.Ptr[int32](2), // StorageAccountType: to.Ptr(armcompute.StorageAccountTypeStandardZRS), // }}, // }, // SafetyProfile: &armcompute.GalleryImageVersionSafetyProfile{ // AllowDeletionOfReplicatedLocations: to.Ptr(false), // PolicyViolations: []*armcompute.PolicyViolation{ // { // Category: to.Ptr(armcompute.PolicyViolationCategoryImageFlaggedUnsafe), // Details: to.Ptr("This is the policy violation details."), // }}, // ReportedForPolicyViolation: to.Ptr(true), // }, // StorageProfile: &armcompute.GalleryImageVersionStorageProfile{ // DataDiskImages: []*armcompute.GalleryDataDiskImage{ // { // HostCaching: to.Ptr(armcompute.HostCachingNone), // SizeInGB: to.Ptr[int32](10), // Lun: to.Ptr[int32](1), // }}, // OSDiskImage: &armcompute.GalleryOSDiskImage{ // HostCaching: to.Ptr(armcompute.HostCachingReadOnly), // SizeInGB: to.Ptr[int32](10), // }, // Source: &armcompute.GalleryArtifactVersionFullSource{ // CommunityGalleryImageID: to.Ptr("/communityGalleries/{communityGalleryName}/images/{communityGalleryImageName}"), // }, // }, // }, // }
Output:
Example (CreateOrUpdateASimpleGalleryImageVersionUsingManagedImageAsSource) ¶
Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/92de53a5f1e0e03c94b40475d2135d97148ed014/specification/compute/resource-manager/Microsoft.Compute/GalleryRP/stable/2023-07-03/examples/galleryExamples/GalleryImageVersion_Create.json
cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() clientFactory, err := armcompute.NewClientFactory("<subscription-id>", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } poller, err := clientFactory.NewGalleryImageVersionsClient().BeginCreateOrUpdate(ctx, "myResourceGroup", "myGalleryName", "myGalleryImageName", "1.0.0", armcompute.GalleryImageVersion{ Location: to.Ptr("West US"), Properties: &armcompute.GalleryImageVersionProperties{ PublishingProfile: &armcompute.GalleryImageVersionPublishingProfile{ TargetRegions: []*armcompute.TargetRegion{ { Name: to.Ptr("West US"), Encryption: &armcompute.EncryptionImages{ DataDiskImages: []*armcompute.DataDiskImageEncryption{ { DiskEncryptionSetID: to.Ptr("/subscriptions/{subscriptionId}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/diskEncryptionSet/myOtherWestUSDiskEncryptionSet"), Lun: to.Ptr[int32](0), }, { DiskEncryptionSetID: to.Ptr("/subscriptions/{subscriptionId}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/diskEncryptionSet/myWestUSDiskEncryptionSet"), Lun: to.Ptr[int32](1), }}, OSDiskImage: &armcompute.OSDiskImageEncryption{ DiskEncryptionSetID: to.Ptr("/subscriptions/{subscriptionId}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/diskEncryptionSet/myWestUSDiskEncryptionSet"), }, }, ExcludeFromLatest: to.Ptr(false), RegionalReplicaCount: to.Ptr[int32](1), }, { Name: to.Ptr("East US"), Encryption: &armcompute.EncryptionImages{ DataDiskImages: []*armcompute.DataDiskImageEncryption{ { DiskEncryptionSetID: to.Ptr("/subscriptions/{subscriptionId}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/diskEncryptionSet/myOtherEastUSDiskEncryptionSet"), Lun: to.Ptr[int32](0), }, { DiskEncryptionSetID: to.Ptr("/subscriptions/{subscriptionId}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/diskEncryptionSet/myEastUSDiskEncryptionSet"), Lun: to.Ptr[int32](1), }}, OSDiskImage: &armcompute.OSDiskImageEncryption{ DiskEncryptionSetID: to.Ptr("/subscriptions/{subscriptionId}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/diskEncryptionSet/myEastUSDiskEncryptionSet"), }, }, ExcludeFromLatest: to.Ptr(false), RegionalReplicaCount: to.Ptr[int32](2), StorageAccountType: to.Ptr(armcompute.StorageAccountTypeStandardZRS), }}, }, SafetyProfile: &armcompute.GalleryImageVersionSafetyProfile{ AllowDeletionOfReplicatedLocations: to.Ptr(false), }, StorageProfile: &armcompute.GalleryImageVersionStorageProfile{ Source: &armcompute.GalleryArtifactVersionFullSource{ ID: to.Ptr("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroup}/providers/Microsoft.Compute/images/{imageName}"), }, }, }, }, nil) if err != nil { log.Fatalf("failed to finish the request: %v", err) } res, err := poller.PollUntilDone(ctx, nil) if err != nil { log.Fatalf("failed to pull the result: %v", err) } // You could use response here. We use blank identifier for just demo purposes. _ = res // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. // res.GalleryImageVersion = armcompute.GalleryImageVersion{ // Name: to.Ptr("1.0.0"), // ID: to.Ptr("/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/locations/westus/Galleries/myGalleryName/Images/myGalleryImageName/Versions/1.0.0"), // Location: to.Ptr("West US"), // Properties: &armcompute.GalleryImageVersionProperties{ // ProvisioningState: to.Ptr(armcompute.GalleryProvisioningStateSucceeded), // PublishingProfile: &armcompute.GalleryImageVersionPublishingProfile{ // PublishedDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2018-01-01T00:00:00.000Z"); return t}()), // ReplicaCount: to.Ptr[int32](1), // StorageAccountType: to.Ptr(armcompute.StorageAccountTypeStandardLRS), // TargetRegions: []*armcompute.TargetRegion{ // { // Name: to.Ptr("West US"), // Encryption: &armcompute.EncryptionImages{ // DataDiskImages: []*armcompute.DataDiskImageEncryption{ // { // DiskEncryptionSetID: to.Ptr("/subscriptions/{subscriptionId}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/diskEncryptionSet/myOtherWestUSDiskEncryptionSet"), // Lun: to.Ptr[int32](0), // }, // { // DiskEncryptionSetID: to.Ptr("/subscriptions/{subscriptionId}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/diskEncryptionSet/myWestUSDiskEncryptionSet"), // Lun: to.Ptr[int32](1), // }}, // OSDiskImage: &armcompute.OSDiskImageEncryption{ // DiskEncryptionSetID: to.Ptr("/subscriptions/{subscriptionId}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/diskEncryptionSet/myWestUSDiskEncryptionSet"), // }, // }, // ExcludeFromLatest: to.Ptr(false), // RegionalReplicaCount: to.Ptr[int32](1), // StorageAccountType: to.Ptr(armcompute.StorageAccountTypeStandardLRS), // }, // { // Name: to.Ptr("East US"), // Encryption: &armcompute.EncryptionImages{ // DataDiskImages: []*armcompute.DataDiskImageEncryption{ // { // DiskEncryptionSetID: to.Ptr("/subscriptions/{subscriptionId}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/diskEncryptionSet/myOtherEastUSDiskEncryptionSet"), // Lun: to.Ptr[int32](0), // }, // { // DiskEncryptionSetID: to.Ptr("/subscriptions/{subscriptionId}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/diskEncryptionSet/myEastUSDiskEncryptionSet"), // Lun: to.Ptr[int32](1), // }}, // OSDiskImage: &armcompute.OSDiskImageEncryption{ // DiskEncryptionSetID: to.Ptr("/subscriptions/{subscriptionId}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/diskEncryptionSet/myEastUSDiskEncryptionSet"), // }, // }, // ExcludeFromLatest: to.Ptr(false), // RegionalReplicaCount: to.Ptr[int32](2), // StorageAccountType: to.Ptr(armcompute.StorageAccountTypeStandardZRS), // }}, // }, // SafetyProfile: &armcompute.GalleryImageVersionSafetyProfile{ // AllowDeletionOfReplicatedLocations: to.Ptr(false), // PolicyViolations: []*armcompute.PolicyViolation{ // { // Category: to.Ptr(armcompute.PolicyViolationCategoryImageFlaggedUnsafe), // Details: to.Ptr("This is the policy violation details."), // }}, // ReportedForPolicyViolation: to.Ptr(true), // }, // StorageProfile: &armcompute.GalleryImageVersionStorageProfile{ // DataDiskImages: []*armcompute.GalleryDataDiskImage{ // { // HostCaching: to.Ptr(armcompute.HostCachingNone), // SizeInGB: to.Ptr[int32](10), // Lun: to.Ptr[int32](1), // }}, // OSDiskImage: &armcompute.GalleryOSDiskImage{ // HostCaching: to.Ptr(armcompute.HostCachingReadOnly), // SizeInGB: to.Ptr[int32](10), // }, // Source: &armcompute.GalleryArtifactVersionFullSource{ // ID: to.Ptr("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroup}/providers/Microsoft.Compute/images/{imageName}"), // }, // }, // }, // }
Output:
Example (CreateOrUpdateASimpleGalleryImageVersionUsingMixOfDisksAndSnapshotsAsASource) ¶
Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/92de53a5f1e0e03c94b40475d2135d97148ed014/specification/compute/resource-manager/Microsoft.Compute/GalleryRP/stable/2023-07-03/examples/galleryExamples/GalleryImageVersion_Create_WithSnapshotsAsSource.json
cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() clientFactory, err := armcompute.NewClientFactory("<subscription-id>", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } poller, err := clientFactory.NewGalleryImageVersionsClient().BeginCreateOrUpdate(ctx, "myResourceGroup", "myGalleryName", "myGalleryImageName", "1.0.0", armcompute.GalleryImageVersion{ Location: to.Ptr("West US"), Properties: &armcompute.GalleryImageVersionProperties{ PublishingProfile: &armcompute.GalleryImageVersionPublishingProfile{ TargetRegions: []*armcompute.TargetRegion{ { Name: to.Ptr("West US"), Encryption: &armcompute.EncryptionImages{ DataDiskImages: []*armcompute.DataDiskImageEncryption{ { DiskEncryptionSetID: to.Ptr("/subscriptions/{subscriptionId}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/diskEncryptionSet/myWestUSDiskEncryptionSet"), Lun: to.Ptr[int32](1), }}, OSDiskImage: &armcompute.OSDiskImageEncryption{ DiskEncryptionSetID: to.Ptr("/subscriptions/{subscriptionId}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/diskEncryptionSet/myWestUSDiskEncryptionSet"), }, }, ExcludeFromLatest: to.Ptr(false), RegionalReplicaCount: to.Ptr[int32](1), }, { Name: to.Ptr("East US"), Encryption: &armcompute.EncryptionImages{ DataDiskImages: []*armcompute.DataDiskImageEncryption{ { DiskEncryptionSetID: to.Ptr("/subscriptions/{subscriptionId}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/diskEncryptionSet/myEastUSDiskEncryptionSet"), Lun: to.Ptr[int32](1), }}, OSDiskImage: &armcompute.OSDiskImageEncryption{ DiskEncryptionSetID: to.Ptr("/subscriptions/{subscriptionId}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/diskEncryptionSet/myEastUSDiskEncryptionSet"), }, }, ExcludeFromLatest: to.Ptr(false), RegionalReplicaCount: to.Ptr[int32](2), StorageAccountType: to.Ptr(armcompute.StorageAccountTypeStandardZRS), }}, }, SafetyProfile: &armcompute.GalleryImageVersionSafetyProfile{ AllowDeletionOfReplicatedLocations: to.Ptr(false), }, StorageProfile: &armcompute.GalleryImageVersionStorageProfile{ DataDiskImages: []*armcompute.GalleryDataDiskImage{ { HostCaching: to.Ptr(armcompute.HostCachingNone), Source: &armcompute.GalleryDiskImageSource{ ID: to.Ptr("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroup}/providers/Microsoft.Compute/disks/{dataDiskName}"), }, Lun: to.Ptr[int32](1), }}, OSDiskImage: &armcompute.GalleryOSDiskImage{ HostCaching: to.Ptr(armcompute.HostCachingReadOnly), Source: &armcompute.GalleryDiskImageSource{ ID: to.Ptr("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroup}/providers/Microsoft.Compute/snapshots/{osSnapshotName}"), }, }, }, }, }, nil) if err != nil { log.Fatalf("failed to finish the request: %v", err) } res, err := poller.PollUntilDone(ctx, nil) if err != nil { log.Fatalf("failed to pull the result: %v", err) } // You could use response here. We use blank identifier for just demo purposes. _ = res // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. // res.GalleryImageVersion = armcompute.GalleryImageVersion{ // Name: to.Ptr("1.0.0"), // ID: to.Ptr("/providers/Microsoft.Compute/locations/westus/Galleries/myGalleryName/Images/myGalleryImageName/Versions/1.0.0"), // Location: to.Ptr("West US"), // Properties: &armcompute.GalleryImageVersionProperties{ // ProvisioningState: to.Ptr(armcompute.GalleryProvisioningStateSucceeded), // PublishingProfile: &armcompute.GalleryImageVersionPublishingProfile{ // PublishedDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2018-01-01T00:00:00.000Z"); return t}()), // ReplicaCount: to.Ptr[int32](1), // StorageAccountType: to.Ptr(armcompute.StorageAccountTypeStandardLRS), // TargetRegions: []*armcompute.TargetRegion{ // { // Name: to.Ptr("West US"), // Encryption: &armcompute.EncryptionImages{ // DataDiskImages: []*armcompute.DataDiskImageEncryption{ // { // DiskEncryptionSetID: to.Ptr("/subscriptions/{subscriptionId}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/diskEncryptionSet/myWestUSDiskEncryptionSet"), // Lun: to.Ptr[int32](1), // }}, // OSDiskImage: &armcompute.OSDiskImageEncryption{ // DiskEncryptionSetID: to.Ptr("/subscriptions/{subscriptionId}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/diskEncryptionSet/myWestUSDiskEncryptionSet"), // }, // }, // ExcludeFromLatest: to.Ptr(false), // RegionalReplicaCount: to.Ptr[int32](1), // StorageAccountType: to.Ptr(armcompute.StorageAccountTypeStandardLRS), // }, // { // Name: to.Ptr("East US"), // Encryption: &armcompute.EncryptionImages{ // DataDiskImages: []*armcompute.DataDiskImageEncryption{ // { // DiskEncryptionSetID: to.Ptr("/subscriptions/{subscriptionId}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/diskEncryptionSet/myEastUSDiskEncryptionSet"), // Lun: to.Ptr[int32](1), // }}, // OSDiskImage: &armcompute.OSDiskImageEncryption{ // DiskEncryptionSetID: to.Ptr("/subscriptions/{subscriptionId}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/diskEncryptionSet/myEastUSDiskEncryptionSet"), // }, // }, // ExcludeFromLatest: to.Ptr(false), // RegionalReplicaCount: to.Ptr[int32](2), // StorageAccountType: to.Ptr(armcompute.StorageAccountTypeStandardZRS), // }}, // }, // SafetyProfile: &armcompute.GalleryImageVersionSafetyProfile{ // AllowDeletionOfReplicatedLocations: to.Ptr(false), // PolicyViolations: []*armcompute.PolicyViolation{ // { // Category: to.Ptr(armcompute.PolicyViolationCategoryImageFlaggedUnsafe), // Details: to.Ptr("This is the policy violation details."), // }}, // ReportedForPolicyViolation: to.Ptr(true), // }, // StorageProfile: &armcompute.GalleryImageVersionStorageProfile{ // DataDiskImages: []*armcompute.GalleryDataDiskImage{ // { // HostCaching: to.Ptr(armcompute.HostCachingNone), // SizeInGB: to.Ptr[int32](10), // Source: &armcompute.GalleryDiskImageSource{ // ID: to.Ptr("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroup}/providers/Microsoft.Compute/disks/{dataDiskName}"), // }, // Lun: to.Ptr[int32](1), // }}, // OSDiskImage: &armcompute.GalleryOSDiskImage{ // HostCaching: to.Ptr(armcompute.HostCachingReadOnly), // SizeInGB: to.Ptr[int32](10), // Source: &armcompute.GalleryDiskImageSource{ // ID: to.Ptr("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroup}/providers/Microsoft.Compute/snapshots/{osSnapshotName}"), // }, // }, // }, // }, // }
Output:
Example (CreateOrUpdateASimpleGalleryImageVersionUsingShallowReplicationMode) ¶
Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/92de53a5f1e0e03c94b40475d2135d97148ed014/specification/compute/resource-manager/Microsoft.Compute/GalleryRP/stable/2023-07-03/examples/galleryExamples/GalleryImageVersion_Create_WithShallowReplicationMode.json
cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() clientFactory, err := armcompute.NewClientFactory("<subscription-id>", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } poller, err := clientFactory.NewGalleryImageVersionsClient().BeginCreateOrUpdate(ctx, "myResourceGroup", "myGalleryName", "myGalleryImageName", "1.0.0", armcompute.GalleryImageVersion{ Location: to.Ptr("West US"), Properties: &armcompute.GalleryImageVersionProperties{ PublishingProfile: &armcompute.GalleryImageVersionPublishingProfile{ ReplicationMode: to.Ptr(armcompute.ReplicationModeShallow), TargetRegions: []*armcompute.TargetRegion{ { Name: to.Ptr("West US"), ExcludeFromLatest: to.Ptr(false), RegionalReplicaCount: to.Ptr[int32](1), }}, }, SafetyProfile: &armcompute.GalleryImageVersionSafetyProfile{ AllowDeletionOfReplicatedLocations: to.Ptr(false), }, StorageProfile: &armcompute.GalleryImageVersionStorageProfile{ Source: &armcompute.GalleryArtifactVersionFullSource{ ID: to.Ptr("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroup}/providers/Microsoft.Compute/images/{imageName}"), }, }, }, }, nil) if err != nil { log.Fatalf("failed to finish the request: %v", err) } res, err := poller.PollUntilDone(ctx, nil) if err != nil { log.Fatalf("failed to pull the result: %v", err) } // You could use response here. We use blank identifier for just demo purposes. _ = res // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. // res.GalleryImageVersion = armcompute.GalleryImageVersion{ // Name: to.Ptr("1.0.0"), // ID: to.Ptr("/providers/Microsoft.Compute/locations/westus/Galleries/myGalleryName/Images/myGalleryImageName/Versions/1.0.0"), // Location: to.Ptr("West US"), // Properties: &armcompute.GalleryImageVersionProperties{ // ProvisioningState: to.Ptr(armcompute.GalleryProvisioningStateSucceeded), // PublishingProfile: &armcompute.GalleryImageVersionPublishingProfile{ // PublishedDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2018-01-01T00:00:00.000Z"); return t}()), // ReplicaCount: to.Ptr[int32](1), // ReplicationMode: to.Ptr(armcompute.ReplicationModeShallow), // StorageAccountType: to.Ptr(armcompute.StorageAccountTypeStandardLRS), // TargetRegions: []*armcompute.TargetRegion{ // { // Name: to.Ptr("West US"), // ExcludeFromLatest: to.Ptr(false), // RegionalReplicaCount: to.Ptr[int32](1), // StorageAccountType: to.Ptr(armcompute.StorageAccountTypeStandardLRS), // }}, // }, // SafetyProfile: &armcompute.GalleryImageVersionSafetyProfile{ // AllowDeletionOfReplicatedLocations: to.Ptr(false), // PolicyViolations: []*armcompute.PolicyViolation{ // { // Category: to.Ptr(armcompute.PolicyViolationCategoryImageFlaggedUnsafe), // Details: to.Ptr("This is the policy violation details."), // }}, // ReportedForPolicyViolation: to.Ptr(true), // }, // StorageProfile: &armcompute.GalleryImageVersionStorageProfile{ // DataDiskImages: []*armcompute.GalleryDataDiskImage{ // { // HostCaching: to.Ptr(armcompute.HostCachingNone), // SizeInGB: to.Ptr[int32](10), // Lun: to.Ptr[int32](1), // }}, // OSDiskImage: &armcompute.GalleryOSDiskImage{ // HostCaching: to.Ptr(armcompute.HostCachingReadOnly), // SizeInGB: to.Ptr[int32](10), // }, // Source: &armcompute.GalleryArtifactVersionFullSource{ // ID: to.Ptr("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroup}/providers/Microsoft.Compute/images/{imageName}"), // }, // }, // }, // }
Output:
Example (CreateOrUpdateASimpleGalleryImageVersionUsingVhdAsASource) ¶
Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/92de53a5f1e0e03c94b40475d2135d97148ed014/specification/compute/resource-manager/Microsoft.Compute/GalleryRP/stable/2023-07-03/examples/galleryExamples/GalleryImageVersion_Create_WithVHD.json
cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() clientFactory, err := armcompute.NewClientFactory("<subscription-id>", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } poller, err := clientFactory.NewGalleryImageVersionsClient().BeginCreateOrUpdate(ctx, "myResourceGroup", "myGalleryName", "myGalleryImageName", "1.0.0", armcompute.GalleryImageVersion{ Location: to.Ptr("West US"), Properties: &armcompute.GalleryImageVersionProperties{ PublishingProfile: &armcompute.GalleryImageVersionPublishingProfile{ TargetRegions: []*armcompute.TargetRegion{ { Name: to.Ptr("West US"), Encryption: &armcompute.EncryptionImages{ DataDiskImages: []*armcompute.DataDiskImageEncryption{ { DiskEncryptionSetID: to.Ptr("/subscriptions/{subscriptionId}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/diskEncryptionSet/myOtherDiskEncryptionSet"), Lun: to.Ptr[int32](1), }}, OSDiskImage: &armcompute.OSDiskImageEncryption{ DiskEncryptionSetID: to.Ptr("/subscriptions/{subscriptionId}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/diskEncryptionSet/myDiskEncryptionSet"), }, }, ExcludeFromLatest: to.Ptr(false), RegionalReplicaCount: to.Ptr[int32](1), }, { Name: to.Ptr("East US"), ExcludeFromLatest: to.Ptr(false), RegionalReplicaCount: to.Ptr[int32](2), StorageAccountType: to.Ptr(armcompute.StorageAccountTypeStandardZRS), }}, }, SafetyProfile: &armcompute.GalleryImageVersionSafetyProfile{ AllowDeletionOfReplicatedLocations: to.Ptr(false), }, StorageProfile: &armcompute.GalleryImageVersionStorageProfile{ DataDiskImages: []*armcompute.GalleryDataDiskImage{ { HostCaching: to.Ptr(armcompute.HostCachingNone), Source: &armcompute.GalleryDiskImageSource{ StorageAccountID: to.Ptr("/subscriptions/{subscriptionId}/resourceGroups/myResourceGroup/providers/Microsoft.Storage/storageAccounts/{storageAccount}"), URI: to.Ptr("https://gallerysourcencus.blob.core.windows.net/myvhds/Windows-Server-2012-R2-20171216-en.us-128GB.vhd"), }, Lun: to.Ptr[int32](1), }}, OSDiskImage: &armcompute.GalleryOSDiskImage{ HostCaching: to.Ptr(armcompute.HostCachingReadOnly), Source: &armcompute.GalleryDiskImageSource{ StorageAccountID: to.Ptr("/subscriptions/{subscriptionId}/resourceGroups/myResourceGroup/providers/Microsoft.Storage/storageAccounts/{storageAccount}"), URI: to.Ptr("https://gallerysourcencus.blob.core.windows.net/myvhds/Windows-Server-2012-R2-20171216-en.us-128GB.vhd"), }, }, }, }, }, nil) if err != nil { log.Fatalf("failed to finish the request: %v", err) } res, err := poller.PollUntilDone(ctx, nil) if err != nil { log.Fatalf("failed to pull the result: %v", err) } // You could use response here. We use blank identifier for just demo purposes. _ = res // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. // res.GalleryImageVersion = armcompute.GalleryImageVersion{ // Name: to.Ptr("1.0.0"), // ID: to.Ptr("/providers/Microsoft.Compute/locations/westus/Galleries/myGalleryName/Images/myGalleryImageName/Versions/1.0.0"), // Location: to.Ptr("West US"), // Properties: &armcompute.GalleryImageVersionProperties{ // ProvisioningState: to.Ptr(armcompute.GalleryProvisioningStateSucceeded), // PublishingProfile: &armcompute.GalleryImageVersionPublishingProfile{ // PublishedDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2018-01-01T00:00:00.000Z"); return t}()), // ReplicaCount: to.Ptr[int32](1), // StorageAccountType: to.Ptr(armcompute.StorageAccountTypeStandardLRS), // TargetRegions: []*armcompute.TargetRegion{ // { // Name: to.Ptr("West US"), // Encryption: &armcompute.EncryptionImages{ // DataDiskImages: []*armcompute.DataDiskImageEncryption{ // { // DiskEncryptionSetID: to.Ptr("/subscriptions/{subscriptionId}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/diskEncryptionSet/myOtherDiskEncryptionSet"), // Lun: to.Ptr[int32](1), // }}, // OSDiskImage: &armcompute.OSDiskImageEncryption{ // DiskEncryptionSetID: to.Ptr("/subscriptions/{subscriptionId}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/diskEncryptionSet/myDiskEncryptionSet"), // }, // }, // ExcludeFromLatest: to.Ptr(false), // RegionalReplicaCount: to.Ptr[int32](1), // StorageAccountType: to.Ptr(armcompute.StorageAccountTypeStandardLRS), // }, // { // Name: to.Ptr("East US"), // ExcludeFromLatest: to.Ptr(false), // RegionalReplicaCount: to.Ptr[int32](2), // StorageAccountType: to.Ptr(armcompute.StorageAccountTypeStandardZRS), // }}, // }, // SafetyProfile: &armcompute.GalleryImageVersionSafetyProfile{ // AllowDeletionOfReplicatedLocations: to.Ptr(false), // PolicyViolations: []*armcompute.PolicyViolation{ // { // Category: to.Ptr(armcompute.PolicyViolationCategoryImageFlaggedUnsafe), // Details: to.Ptr("This is the policy violation details."), // }}, // ReportedForPolicyViolation: to.Ptr(true), // }, // StorageProfile: &armcompute.GalleryImageVersionStorageProfile{ // DataDiskImages: []*armcompute.GalleryDataDiskImage{ // { // HostCaching: to.Ptr(armcompute.HostCachingNone), // Source: &armcompute.GalleryDiskImageSource{ // StorageAccountID: to.Ptr("/subscriptions/{subscriptionId}/resourceGroups/myResourceGroup/providers/Microsoft.Storage/storageAccounts/{storageAccount}"), // URI: to.Ptr("https://gallerysourcencus.blob.core.windows.net/myvhds/Windows-Server-2012-R2-20171216-en.us-128GB.vhd"), // }, // Lun: to.Ptr[int32](1), // }}, // OSDiskImage: &armcompute.GalleryOSDiskImage{ // HostCaching: to.Ptr(armcompute.HostCachingReadOnly), // Source: &armcompute.GalleryDiskImageSource{ // StorageAccountID: to.Ptr("/subscriptions/{subscriptionId}/resourceGroups/myResourceGroup/providers/Microsoft.Storage/storageAccounts/{storageAccount}"), // URI: to.Ptr("https://gallerysourcencus.blob.core.windows.net/myvhds/Windows-Server-2012-R2-20171216-en.us-128GB.vhd"), // }, // }, // }, // }, // }
Output:
Example (CreateOrUpdateASimpleGalleryImageVersionUsingVhdAsASourceWithCustomUefiKeys) ¶
Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/92de53a5f1e0e03c94b40475d2135d97148ed014/specification/compute/resource-manager/Microsoft.Compute/GalleryRP/stable/2023-07-03/examples/galleryExamples/GalleryImageVersion_Create_WithVHD_UefiSettings.json
cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() clientFactory, err := armcompute.NewClientFactory("<subscription-id>", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } poller, err := clientFactory.NewGalleryImageVersionsClient().BeginCreateOrUpdate(ctx, "myResourceGroup", "myGalleryName", "myGalleryImageName", "1.0.0", armcompute.GalleryImageVersion{ Location: to.Ptr("West US"), Properties: &armcompute.GalleryImageVersionProperties{ PublishingProfile: &armcompute.GalleryImageVersionPublishingProfile{ TargetRegions: []*armcompute.TargetRegion{ { Name: to.Ptr("West US"), Encryption: &armcompute.EncryptionImages{ DataDiskImages: []*armcompute.DataDiskImageEncryption{ { DiskEncryptionSetID: to.Ptr("/subscriptions/{subscriptionId}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/diskEncryptionSet/myOtherDiskEncryptionSet"), Lun: to.Ptr[int32](1), }}, OSDiskImage: &armcompute.OSDiskImageEncryption{ DiskEncryptionSetID: to.Ptr("/subscriptions/{subscriptionId}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/diskEncryptionSet/myDiskEncryptionSet"), }, }, ExcludeFromLatest: to.Ptr(false), RegionalReplicaCount: to.Ptr[int32](1), }, { Name: to.Ptr("East US"), ExcludeFromLatest: to.Ptr(false), RegionalReplicaCount: to.Ptr[int32](2), StorageAccountType: to.Ptr(armcompute.StorageAccountTypeStandardZRS), }}, }, SafetyProfile: &armcompute.GalleryImageVersionSafetyProfile{ AllowDeletionOfReplicatedLocations: to.Ptr(false), }, SecurityProfile: &armcompute.ImageVersionSecurityProfile{ UefiSettings: &armcompute.GalleryImageVersionUefiSettings{ AdditionalSignatures: &armcompute.UefiKeySignatures{ Db: []*armcompute.UefiKey{ { Type: to.Ptr(armcompute.UefiKeyTypeX509), Value: []*string{ to.Ptr("<x509 value>")}, }}, Dbx: []*armcompute.UefiKey{ { Type: to.Ptr(armcompute.UefiKeyTypeX509), Value: []*string{ to.Ptr("<x509 value>")}, }}, Kek: []*armcompute.UefiKey{ { Type: to.Ptr(armcompute.UefiKeyTypeSHA256), Value: []*string{ to.Ptr("<sha256 value>")}, }}, }, SignatureTemplateNames: []*armcompute.UefiSignatureTemplateName{ to.Ptr(armcompute.UefiSignatureTemplateNameMicrosoftUefiCertificateAuthorityTemplate)}, }, }, StorageProfile: &armcompute.GalleryImageVersionStorageProfile{ DataDiskImages: []*armcompute.GalleryDataDiskImage{ { HostCaching: to.Ptr(armcompute.HostCachingNone), Source: &armcompute.GalleryDiskImageSource{ StorageAccountID: to.Ptr("/subscriptions/{subscriptionId}/resourceGroups/myResourceGroup/providers/Microsoft.Storage/storageAccounts/{storageAccount}"), URI: to.Ptr("https://gallerysourcencus.blob.core.windows.net/myvhds/Windows-Server-2012-R2-20171216-en.us-128GB.vhd"), }, Lun: to.Ptr[int32](1), }}, OSDiskImage: &armcompute.GalleryOSDiskImage{ HostCaching: to.Ptr(armcompute.HostCachingReadOnly), Source: &armcompute.GalleryDiskImageSource{ StorageAccountID: to.Ptr("/subscriptions/{subscriptionId}/resourceGroups/myResourceGroup/providers/Microsoft.Storage/storageAccounts/{storageAccount}"), URI: to.Ptr("https://gallerysourcencus.blob.core.windows.net/myvhds/Windows-Server-2012-R2-20171216-en.us-128GB.vhd"), }, }, }, }, }, nil) if err != nil { log.Fatalf("failed to finish the request: %v", err) } res, err := poller.PollUntilDone(ctx, nil) if err != nil { log.Fatalf("failed to pull the result: %v", err) } // You could use response here. We use blank identifier for just demo purposes. _ = res // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. // res.GalleryImageVersion = armcompute.GalleryImageVersion{ // Name: to.Ptr("1.0.0"), // ID: to.Ptr("/providers/Microsoft.Compute/locations/westus/Galleries/myGalleryName/Images/myGalleryImageName/Versions/1.0.0"), // Location: to.Ptr("West US"), // Properties: &armcompute.GalleryImageVersionProperties{ // ProvisioningState: to.Ptr(armcompute.GalleryProvisioningStateSucceeded), // PublishingProfile: &armcompute.GalleryImageVersionPublishingProfile{ // PublishedDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2018-01-01T00:00:00.000Z"); return t}()), // ReplicaCount: to.Ptr[int32](1), // StorageAccountType: to.Ptr(armcompute.StorageAccountTypeStandardLRS), // TargetRegions: []*armcompute.TargetRegion{ // { // Name: to.Ptr("West US"), // Encryption: &armcompute.EncryptionImages{ // DataDiskImages: []*armcompute.DataDiskImageEncryption{ // { // DiskEncryptionSetID: to.Ptr("/subscriptions/{subscriptionId}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/diskEncryptionSet/myOtherDiskEncryptionSet"), // Lun: to.Ptr[int32](1), // }}, // OSDiskImage: &armcompute.OSDiskImageEncryption{ // DiskEncryptionSetID: to.Ptr("/subscriptions/{subscriptionId}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/diskEncryptionSet/myDiskEncryptionSet"), // }, // }, // ExcludeFromLatest: to.Ptr(false), // RegionalReplicaCount: to.Ptr[int32](1), // StorageAccountType: to.Ptr(armcompute.StorageAccountTypeStandardLRS), // }, // { // Name: to.Ptr("East US"), // ExcludeFromLatest: to.Ptr(false), // RegionalReplicaCount: to.Ptr[int32](2), // StorageAccountType: to.Ptr(armcompute.StorageAccountTypeStandardZRS), // }}, // }, // SafetyProfile: &armcompute.GalleryImageVersionSafetyProfile{ // AllowDeletionOfReplicatedLocations: to.Ptr(false), // PolicyViolations: []*armcompute.PolicyViolation{ // { // Category: to.Ptr(armcompute.PolicyViolationCategoryImageFlaggedUnsafe), // Details: to.Ptr("This is the policy violation details."), // }}, // ReportedForPolicyViolation: to.Ptr(true), // }, // SecurityProfile: &armcompute.ImageVersionSecurityProfile{ // UefiSettings: &armcompute.GalleryImageVersionUefiSettings{ // AdditionalSignatures: &armcompute.UefiKeySignatures{ // Db: []*armcompute.UefiKey{ // { // Type: to.Ptr(armcompute.UefiKeyTypeX509), // Value: []*string{ // to.Ptr("<x509 value>")}, // }}, // Dbx: []*armcompute.UefiKey{ // { // Type: to.Ptr(armcompute.UefiKeyTypeX509), // Value: []*string{ // to.Ptr("<x509 value>")}, // }}, // Kek: []*armcompute.UefiKey{ // { // Type: to.Ptr(armcompute.UefiKeyTypeSHA256), // Value: []*string{ // to.Ptr("<sha256 value>")}, // }}, // }, // SignatureTemplateNames: []*armcompute.UefiSignatureTemplateName{ // to.Ptr(armcompute.UefiSignatureTemplateNameMicrosoftUefiCertificateAuthorityTemplate)}, // }, // }, // StorageProfile: &armcompute.GalleryImageVersionStorageProfile{ // DataDiskImages: []*armcompute.GalleryDataDiskImage{ // { // HostCaching: to.Ptr(armcompute.HostCachingNone), // Source: &armcompute.GalleryDiskImageSource{ // StorageAccountID: to.Ptr("/subscriptions/{subscriptionId}/resourceGroups/myResourceGroup/providers/Microsoft.Storage/storageAccounts/{storageAccount}"), // URI: to.Ptr("https://gallerysourcencus.blob.core.windows.net/myvhds/Windows-Server-2012-R2-20171216-en.us-128GB.vhd"), // }, // Lun: to.Ptr[int32](1), // }}, // OSDiskImage: &armcompute.GalleryOSDiskImage{ // HostCaching: to.Ptr(armcompute.HostCachingReadOnly), // Source: &armcompute.GalleryDiskImageSource{ // StorageAccountID: to.Ptr("/subscriptions/{subscriptionId}/resourceGroups/myResourceGroup/providers/Microsoft.Storage/storageAccounts/{storageAccount}"), // URI: to.Ptr("https://gallerysourcencus.blob.core.windows.net/myvhds/Windows-Server-2012-R2-20171216-en.us-128GB.vhd"), // }, // }, // }, // }, // }
Output:
Example (CreateOrUpdateASimpleGalleryImageVersionUsingVmAsSource) ¶
Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/92de53a5f1e0e03c94b40475d2135d97148ed014/specification/compute/resource-manager/Microsoft.Compute/GalleryRP/stable/2023-07-03/examples/galleryExamples/GalleryImageVersion_Create_WithVmAsSource.json
cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() clientFactory, err := armcompute.NewClientFactory("<subscription-id>", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } poller, err := clientFactory.NewGalleryImageVersionsClient().BeginCreateOrUpdate(ctx, "myResourceGroup", "myGalleryName", "myGalleryImageName", "1.0.0", armcompute.GalleryImageVersion{ Location: to.Ptr("West US"), Properties: &armcompute.GalleryImageVersionProperties{ PublishingProfile: &armcompute.GalleryImageVersionPublishingProfile{ TargetRegions: []*armcompute.TargetRegion{ { Name: to.Ptr("West US"), Encryption: &armcompute.EncryptionImages{ DataDiskImages: []*armcompute.DataDiskImageEncryption{ { DiskEncryptionSetID: to.Ptr("/subscriptions/{subscriptionId}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/diskEncryptionSet/myOtherWestUSDiskEncryptionSet"), Lun: to.Ptr[int32](0), }, { DiskEncryptionSetID: to.Ptr("/subscriptions/{subscriptionId}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/diskEncryptionSet/myWestUSDiskEncryptionSet"), Lun: to.Ptr[int32](1), }}, OSDiskImage: &armcompute.OSDiskImageEncryption{ DiskEncryptionSetID: to.Ptr("/subscriptions/{subscriptionId}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/diskEncryptionSet/myWestUSDiskEncryptionSet"), }, }, ExcludeFromLatest: to.Ptr(false), RegionalReplicaCount: to.Ptr[int32](2), }, { Name: to.Ptr("East US"), Encryption: &armcompute.EncryptionImages{ DataDiskImages: []*armcompute.DataDiskImageEncryption{ { DiskEncryptionSetID: to.Ptr("/subscriptions/{subscriptionId}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/diskEncryptionSet/myOtherEastUSDiskEncryptionSet"), Lun: to.Ptr[int32](0), }, { DiskEncryptionSetID: to.Ptr("/subscriptions/{subscriptionId}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/diskEncryptionSet/myEastUSDiskEncryptionSet"), Lun: to.Ptr[int32](1), }}, OSDiskImage: &armcompute.OSDiskImageEncryption{ DiskEncryptionSetID: to.Ptr("/subscriptions/{subscriptionId}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/diskEncryptionSet/myEastUSDiskEncryptionSet"), }, }, ExcludeFromLatest: to.Ptr(false), RegionalReplicaCount: to.Ptr[int32](2), StorageAccountType: to.Ptr(armcompute.StorageAccountTypeStandardZRS), }}, }, SafetyProfile: &armcompute.GalleryImageVersionSafetyProfile{ AllowDeletionOfReplicatedLocations: to.Ptr(false), }, StorageProfile: &armcompute.GalleryImageVersionStorageProfile{ Source: &armcompute.GalleryArtifactVersionFullSource{ VirtualMachineID: to.Ptr("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroup}/providers/Microsoft.Compute/virtualMachines/{vmName}"), }, }, }, }, nil) if err != nil { log.Fatalf("failed to finish the request: %v", err) } res, err := poller.PollUntilDone(ctx, nil) if err != nil { log.Fatalf("failed to pull the result: %v", err) } // You could use response here. We use blank identifier for just demo purposes. _ = res // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. // res.GalleryImageVersion = armcompute.GalleryImageVersion{ // Name: to.Ptr("1.0.0"), // ID: to.Ptr("/providers/Microsoft.Compute/locations/westus/Galleries/myGalleryName/Images/myGalleryImageName/Versions/1.0.0"), // Location: to.Ptr("West US"), // Properties: &armcompute.GalleryImageVersionProperties{ // ProvisioningState: to.Ptr(armcompute.GalleryProvisioningStateSucceeded), // PublishingProfile: &armcompute.GalleryImageVersionPublishingProfile{ // PublishedDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2018-01-01T00:00:00.000Z"); return t}()), // ReplicaCount: to.Ptr[int32](1), // StorageAccountType: to.Ptr(armcompute.StorageAccountTypeStandardLRS), // TargetRegions: []*armcompute.TargetRegion{ // { // Name: to.Ptr("West US"), // Encryption: &armcompute.EncryptionImages{ // DataDiskImages: []*armcompute.DataDiskImageEncryption{ // { // DiskEncryptionSetID: to.Ptr("/subscriptions/{subscriptionId}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/diskEncryptionSet/myOtherWestUSDiskEncryptionSet"), // Lun: to.Ptr[int32](0), // }, // { // DiskEncryptionSetID: to.Ptr("/subscriptions/{subscriptionId}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/diskEncryptionSet/myWestUSDiskEncryptionSet"), // Lun: to.Ptr[int32](1), // }}, // OSDiskImage: &armcompute.OSDiskImageEncryption{ // DiskEncryptionSetID: to.Ptr("/subscriptions/{subscriptionId}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/diskEncryptionSet/myWestUSDiskEncryptionSet"), // }, // }, // ExcludeFromLatest: to.Ptr(false), // RegionalReplicaCount: to.Ptr[int32](2), // StorageAccountType: to.Ptr(armcompute.StorageAccountTypeStandardLRS), // }, // { // Name: to.Ptr("East US"), // Encryption: &armcompute.EncryptionImages{ // DataDiskImages: []*armcompute.DataDiskImageEncryption{ // { // DiskEncryptionSetID: to.Ptr("/subscriptions/{subscriptionId}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/diskEncryptionSet/myOtherEastUSDiskEncryptionSet"), // Lun: to.Ptr[int32](0), // }, // { // DiskEncryptionSetID: to.Ptr("/subscriptions/{subscriptionId}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/diskEncryptionSet/myEastUSDiskEncryptionSet"), // Lun: to.Ptr[int32](1), // }}, // OSDiskImage: &armcompute.OSDiskImageEncryption{ // DiskEncryptionSetID: to.Ptr("/subscriptions/{subscriptionId}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/diskEncryptionSet/myEastUSDiskEncryptionSet"), // }, // }, // ExcludeFromLatest: to.Ptr(false), // RegionalReplicaCount: to.Ptr[int32](2), // StorageAccountType: to.Ptr(armcompute.StorageAccountTypeStandardZRS), // }}, // }, // SafetyProfile: &armcompute.GalleryImageVersionSafetyProfile{ // AllowDeletionOfReplicatedLocations: to.Ptr(false), // PolicyViolations: []*armcompute.PolicyViolation{ // { // Category: to.Ptr(armcompute.PolicyViolationCategoryImageFlaggedUnsafe), // Details: to.Ptr("This is the policy violation details."), // }}, // ReportedForPolicyViolation: to.Ptr(true), // }, // StorageProfile: &armcompute.GalleryImageVersionStorageProfile{ // DataDiskImages: []*armcompute.GalleryDataDiskImage{ // { // HostCaching: to.Ptr(armcompute.HostCachingNone), // SizeInGB: to.Ptr[int32](10), // Lun: to.Ptr[int32](1), // }}, // OSDiskImage: &armcompute.GalleryOSDiskImage{ // HostCaching: to.Ptr(armcompute.HostCachingReadOnly), // SizeInGB: to.Ptr[int32](10), // }, // Source: &armcompute.GalleryArtifactVersionFullSource{ // VirtualMachineID: to.Ptr("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroup}/providers/Microsoft.Compute/virtualMachines/{vmName}"), // }, // }, // }, // }
Output:
Example (CreateOrUpdateASimpleGalleryImageVersionWithTargetExtendedLocationsSpecified) ¶
Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/92de53a5f1e0e03c94b40475d2135d97148ed014/specification/compute/resource-manager/Microsoft.Compute/GalleryRP/stable/2023-07-03/examples/galleryExamples/GalleryImageVersion_Create_WithTargetExtendedLocations.json
cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() clientFactory, err := armcompute.NewClientFactory("<subscription-id>", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } poller, err := clientFactory.NewGalleryImageVersionsClient().BeginCreateOrUpdate(ctx, "myResourceGroup", "myGalleryName", "myGalleryImageName", "1.0.0", armcompute.GalleryImageVersion{ Location: to.Ptr("West US"), Properties: &armcompute.GalleryImageVersionProperties{ PublishingProfile: &armcompute.GalleryImageVersionPublishingProfile{ TargetRegions: []*armcompute.TargetRegion{ { Name: to.Ptr("West US"), Encryption: &armcompute.EncryptionImages{ DataDiskImages: []*armcompute.DataDiskImageEncryption{ { DiskEncryptionSetID: to.Ptr("/subscriptions/{subscriptionId}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/diskEncryptionSet/myOtherWestUSDiskEncryptionSet"), Lun: to.Ptr[int32](0), }, { DiskEncryptionSetID: to.Ptr("/subscriptions/{subscriptionId}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/diskEncryptionSet/myWestUSDiskEncryptionSet"), Lun: to.Ptr[int32](1), }}, OSDiskImage: &armcompute.OSDiskImageEncryption{ DiskEncryptionSetID: to.Ptr("/subscriptions/{subscriptionId}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/diskEncryptionSet/myWestUSDiskEncryptionSet"), }, }, ExcludeFromLatest: to.Ptr(false), RegionalReplicaCount: to.Ptr[int32](1), }, { Name: to.Ptr("East US"), Encryption: &armcompute.EncryptionImages{ DataDiskImages: []*armcompute.DataDiskImageEncryption{ { DiskEncryptionSetID: to.Ptr("/subscriptions/{subscriptionId}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/diskEncryptionSet/myOtherEastUSDiskEncryptionSet"), Lun: to.Ptr[int32](0), }, { DiskEncryptionSetID: to.Ptr("/subscriptions/{subscriptionId}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/diskEncryptionSet/myEastUSDiskEncryptionSet"), Lun: to.Ptr[int32](1), }}, OSDiskImage: &armcompute.OSDiskImageEncryption{ DiskEncryptionSetID: to.Ptr("/subscriptions/{subscriptionId}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/diskEncryptionSet/myEastUSDiskEncryptionSet"), }, }, ExcludeFromLatest: to.Ptr(false), RegionalReplicaCount: to.Ptr[int32](2), StorageAccountType: to.Ptr(armcompute.StorageAccountTypeStandardZRS), }}, }, SafetyProfile: &armcompute.GalleryImageVersionSafetyProfile{ AllowDeletionOfReplicatedLocations: to.Ptr(false), }, StorageProfile: &armcompute.GalleryImageVersionStorageProfile{ Source: &armcompute.GalleryArtifactVersionFullSource{ ID: to.Ptr("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroup}/providers/Microsoft.Compute/images/{imageName}"), }, }, }, }, nil) if err != nil { log.Fatalf("failed to finish the request: %v", err) } res, err := poller.PollUntilDone(ctx, nil) if err != nil { log.Fatalf("failed to pull the result: %v", err) } // You could use response here. We use blank identifier for just demo purposes. _ = res // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. // res.GalleryImageVersion = armcompute.GalleryImageVersion{ // Name: to.Ptr("1.0.0"), // ID: to.Ptr("/providers/Microsoft.Compute/locations/westus/Galleries/myGalleryName/Images/myGalleryImageName/Versions/1.0.0"), // Location: to.Ptr("West US"), // Properties: &armcompute.GalleryImageVersionProperties{ // ProvisioningState: to.Ptr(armcompute.GalleryProvisioningStateSucceeded), // PublishingProfile: &armcompute.GalleryImageVersionPublishingProfile{ // PublishedDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2018-01-01T00:00:00.000Z"); return t}()), // ReplicaCount: to.Ptr[int32](1), // StorageAccountType: to.Ptr(armcompute.StorageAccountTypeStandardLRS), // TargetExtendedLocations: []*armcompute.GalleryTargetExtendedLocation{ // { // Name: to.Ptr("West US"), // Encryption: &armcompute.EncryptionImages{ // DataDiskImages: []*armcompute.DataDiskImageEncryption{ // { // DiskEncryptionSetID: to.Ptr("/subscriptions/{subscriptionId}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/diskEncryptionSet/myWestUSDiskEncryptionSet"), // Lun: to.Ptr[int32](0), // }}, // OSDiskImage: &armcompute.OSDiskImageEncryption{ // DiskEncryptionSetID: to.Ptr("/subscriptions/{subscriptionId}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/diskEncryptionSet/myWestUSDiskEncryptionSet"), // }, // }, // ExtendedLocation: &armcompute.GalleryExtendedLocation{ // Name: to.Ptr("microsoftlosangeles1"), // Type: to.Ptr(armcompute.GalleryExtendedLocationTypeEdgeZone), // }, // ExtendedLocationReplicaCount: to.Ptr[int32](1), // StorageAccountType: to.Ptr(armcompute.EdgeZoneStorageAccountType("StandardSSD_LRS(default)")), // }, // { // Name: to.Ptr("East US"), // Encryption: &armcompute.EncryptionImages{ // DataDiskImages: []*armcompute.DataDiskImageEncryption{ // { // DiskEncryptionSetID: to.Ptr("/subscriptions/{subscriptionId}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/diskEncryptionSet/myEastUSDiskEncryptionSet"), // Lun: to.Ptr[int32](0), // }}, // OSDiskImage: &armcompute.OSDiskImageEncryption{ // DiskEncryptionSetID: to.Ptr("/subscriptions/{subscriptionId}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/diskEncryptionSet/myEastUSDiskEncryptionSet"), // }, // }, // ExtendedLocation: &armcompute.GalleryExtendedLocation{ // Name: to.Ptr("microsoftnewyork1"), // Type: to.Ptr(armcompute.GalleryExtendedLocationTypeEdgeZone), // }, // ExtendedLocationReplicaCount: to.Ptr[int32](1), // StorageAccountType: to.Ptr(armcompute.EdgeZoneStorageAccountType("StandardSSD_LRS(default)")), // }}, // TargetRegions: []*armcompute.TargetRegion{ // { // Name: to.Ptr("West US"), // Encryption: &armcompute.EncryptionImages{ // DataDiskImages: []*armcompute.DataDiskImageEncryption{ // { // DiskEncryptionSetID: to.Ptr("/subscriptions/{subscriptionId}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/diskEncryptionSet/myOtherWestUSDiskEncryptionSet"), // Lun: to.Ptr[int32](0), // }, // { // DiskEncryptionSetID: to.Ptr("/subscriptions/{subscriptionId}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/diskEncryptionSet/myWestUSDiskEncryptionSet"), // Lun: to.Ptr[int32](1), // }}, // OSDiskImage: &armcompute.OSDiskImageEncryption{ // DiskEncryptionSetID: to.Ptr("/subscriptions/{subscriptionId}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/diskEncryptionSet/myWestUSDiskEncryptionSet"), // }, // }, // ExcludeFromLatest: to.Ptr(false), // RegionalReplicaCount: to.Ptr[int32](1), // StorageAccountType: to.Ptr(armcompute.StorageAccountTypeStandardLRS), // }, // { // Name: to.Ptr("East US"), // Encryption: &armcompute.EncryptionImages{ // DataDiskImages: []*armcompute.DataDiskImageEncryption{ // { // DiskEncryptionSetID: to.Ptr("/subscriptions/{subscriptionId}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/diskEncryptionSet/myOtherEastUSDiskEncryptionSet"), // Lun: to.Ptr[int32](0), // }, // { // DiskEncryptionSetID: to.Ptr("/subscriptions/{subscriptionId}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/diskEncryptionSet/myEastUSDiskEncryptionSet"), // Lun: to.Ptr[int32](1), // }}, // OSDiskImage: &armcompute.OSDiskImageEncryption{ // DiskEncryptionSetID: to.Ptr("/subscriptions/{subscriptionId}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/diskEncryptionSet/myEastUSDiskEncryptionSet"), // }, // }, // ExcludeFromLatest: to.Ptr(false), // RegionalReplicaCount: to.Ptr[int32](2), // StorageAccountType: to.Ptr(armcompute.StorageAccountTypeStandardZRS), // }}, // }, // SafetyProfile: &armcompute.GalleryImageVersionSafetyProfile{ // AllowDeletionOfReplicatedLocations: to.Ptr(false), // PolicyViolations: []*armcompute.PolicyViolation{ // { // Category: to.Ptr(armcompute.PolicyViolationCategoryImageFlaggedUnsafe), // Details: to.Ptr("This is the policy violation details."), // }}, // ReportedForPolicyViolation: to.Ptr(true), // }, // StorageProfile: &armcompute.GalleryImageVersionStorageProfile{ // DataDiskImages: []*armcompute.GalleryDataDiskImage{ // { // HostCaching: to.Ptr(armcompute.HostCachingNone), // SizeInGB: to.Ptr[int32](10), // Lun: to.Ptr[int32](1), // }}, // OSDiskImage: &armcompute.GalleryOSDiskImage{ // HostCaching: to.Ptr(armcompute.HostCachingReadOnly), // SizeInGB: to.Ptr[int32](10), // }, // Source: &armcompute.GalleryArtifactVersionFullSource{ // ID: to.Ptr("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroup}/providers/Microsoft.Compute/images/{imageName}"), // }, // }, // }, // }
Output:
func (*GalleryImageVersionsClient) BeginDelete ¶
func (client *GalleryImageVersionsClient) BeginDelete(ctx context.Context, resourceGroupName string, galleryName string, galleryImageName string, galleryImageVersionName string, options *GalleryImageVersionsClientBeginDeleteOptions) (*runtime.Poller[GalleryImageVersionsClientDeleteResponse], error)
BeginDelete - Delete a gallery image version. If the operation fails it returns an *azcore.ResponseError type.
Generated from API version 2023-07-03
- resourceGroupName - The name of the resource group.
- galleryName - The name of the Shared Image Gallery in which the Image Definition resides.
- galleryImageName - The name of the gallery image definition in which the Image Version resides.
- galleryImageVersionName - The name of the gallery image version to be deleted.
- options - GalleryImageVersionsClientBeginDeleteOptions contains the optional parameters for the GalleryImageVersionsClient.BeginDelete method.
Example ¶
Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/92de53a5f1e0e03c94b40475d2135d97148ed014/specification/compute/resource-manager/Microsoft.Compute/GalleryRP/stable/2023-07-03/examples/galleryExamples/GalleryImageVersion_Delete.json
cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() clientFactory, err := armcompute.NewClientFactory("<subscription-id>", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } poller, err := clientFactory.NewGalleryImageVersionsClient().BeginDelete(ctx, "myResourceGroup", "myGalleryName", "myGalleryImageName", "1.0.0", nil) if err != nil { log.Fatalf("failed to finish the request: %v", err) } _, err = poller.PollUntilDone(ctx, nil) if err != nil { log.Fatalf("failed to pull the result: %v", err) }
Output:
func (*GalleryImageVersionsClient) BeginUpdate ¶
func (client *GalleryImageVersionsClient) BeginUpdate(ctx context.Context, resourceGroupName string, galleryName string, galleryImageName string, galleryImageVersionName string, galleryImageVersion GalleryImageVersionUpdate, options *GalleryImageVersionsClientBeginUpdateOptions) (*runtime.Poller[GalleryImageVersionsClientUpdateResponse], error)
BeginUpdate - Update a gallery image version. If the operation fails it returns an *azcore.ResponseError type.
Generated from API version 2023-07-03
- resourceGroupName - The name of the resource group.
- galleryName - The name of the Shared Image Gallery in which the Image Definition resides.
- galleryImageName - The name of the gallery image definition in which the Image Version is to be updated.
- galleryImageVersionName - The name of the gallery image version to be updated. Needs to follow semantic version name pattern: The allowed characters are digit and period. Digits must be within the range of a 32-bit integer. Format: ..
- galleryImageVersion - Parameters supplied to the update gallery image version operation.
- options - GalleryImageVersionsClientBeginUpdateOptions contains the optional parameters for the GalleryImageVersionsClient.BeginUpdate method.
Example (UpdateASimpleGalleryImageVersionManagedImageAsSource) ¶
Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/92de53a5f1e0e03c94b40475d2135d97148ed014/specification/compute/resource-manager/Microsoft.Compute/GalleryRP/stable/2023-07-03/examples/galleryExamples/GalleryImageVersion_Update.json
cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() clientFactory, err := armcompute.NewClientFactory("<subscription-id>", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } poller, err := clientFactory.NewGalleryImageVersionsClient().BeginUpdate(ctx, "myResourceGroup", "myGalleryName", "myGalleryImageName", "1.0.0", armcompute.GalleryImageVersionUpdate{ Properties: &armcompute.GalleryImageVersionProperties{ PublishingProfile: &armcompute.GalleryImageVersionPublishingProfile{ TargetRegions: []*armcompute.TargetRegion{ { Name: to.Ptr("West US"), RegionalReplicaCount: to.Ptr[int32](1), }, { Name: to.Ptr("East US"), RegionalReplicaCount: to.Ptr[int32](2), StorageAccountType: to.Ptr(armcompute.StorageAccountTypeStandardZRS), }}, }, StorageProfile: &armcompute.GalleryImageVersionStorageProfile{ Source: &armcompute.GalleryArtifactVersionFullSource{ ID: to.Ptr("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroup}/providers/Microsoft.Compute/images/{imageName}"), }, }, }, }, nil) if err != nil { log.Fatalf("failed to finish the request: %v", err) } res, err := poller.PollUntilDone(ctx, nil) if err != nil { log.Fatalf("failed to pull the result: %v", err) } // You could use response here. We use blank identifier for just demo purposes. _ = res // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. // res.GalleryImageVersion = armcompute.GalleryImageVersion{ // Name: to.Ptr("1.0.0"), // Location: to.Ptr("West US"), // Properties: &armcompute.GalleryImageVersionProperties{ // ProvisioningState: to.Ptr(armcompute.GalleryProvisioningStateSucceeded), // PublishingProfile: &armcompute.GalleryImageVersionPublishingProfile{ // PublishedDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2018-01-01T00:00:00.000Z"); return t}()), // ReplicaCount: to.Ptr[int32](1), // StorageAccountType: to.Ptr(armcompute.StorageAccountTypeStandardLRS), // TargetRegions: []*armcompute.TargetRegion{ // { // Name: to.Ptr("West US"), // Encryption: &armcompute.EncryptionImages{ // DataDiskImages: []*armcompute.DataDiskImageEncryption{ // { // DiskEncryptionSetID: to.Ptr("/subscriptions/{subscriptionId}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/diskEncryptionSet/myDiskEncryptionSet"), // Lun: to.Ptr[int32](1), // }}, // OSDiskImage: &armcompute.OSDiskImageEncryption{ // DiskEncryptionSetID: to.Ptr("/subscriptions/{subscriptionId}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/diskEncryptionSet/myDiskEncryptionSet"), // }, // }, // ExcludeFromLatest: to.Ptr(false), // RegionalReplicaCount: to.Ptr[int32](1), // StorageAccountType: to.Ptr(armcompute.StorageAccountTypeStandardLRS), // }, // { // Name: to.Ptr("East US"), // ExcludeFromLatest: to.Ptr(false), // RegionalReplicaCount: to.Ptr[int32](2), // StorageAccountType: to.Ptr(armcompute.StorageAccountTypeStandardZRS), // }}, // }, // StorageProfile: &armcompute.GalleryImageVersionStorageProfile{ // DataDiskImages: []*armcompute.GalleryDataDiskImage{ // { // HostCaching: to.Ptr(armcompute.HostCachingNone), // SizeInGB: to.Ptr[int32](10), // Lun: to.Ptr[int32](1), // }}, // OSDiskImage: &armcompute.GalleryOSDiskImage{ // HostCaching: to.Ptr(armcompute.HostCachingReadOnly), // SizeInGB: to.Ptr[int32](10), // }, // Source: &armcompute.GalleryArtifactVersionFullSource{ // ID: to.Ptr("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroup}/providers/Microsoft.Compute/images/{imageName}"), // }, // }, // }, // }
Output:
Example (UpdateASimpleGalleryImageVersionWithoutSourceId) ¶
Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/92de53a5f1e0e03c94b40475d2135d97148ed014/specification/compute/resource-manager/Microsoft.Compute/GalleryRP/stable/2023-07-03/examples/galleryExamples/GalleryImageVersion_Update_WithoutSourceId.json
cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() clientFactory, err := armcompute.NewClientFactory("<subscription-id>", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } poller, err := clientFactory.NewGalleryImageVersionsClient().BeginUpdate(ctx, "myResourceGroup", "myGalleryName", "myGalleryImageName", "1.0.0", armcompute.GalleryImageVersionUpdate{ Properties: &armcompute.GalleryImageVersionProperties{ PublishingProfile: &armcompute.GalleryImageVersionPublishingProfile{ TargetRegions: []*armcompute.TargetRegion{ { Name: to.Ptr("West US"), RegionalReplicaCount: to.Ptr[int32](1), }, { Name: to.Ptr("East US"), RegionalReplicaCount: to.Ptr[int32](2), StorageAccountType: to.Ptr(armcompute.StorageAccountTypeStandardZRS), }}, }, StorageProfile: &armcompute.GalleryImageVersionStorageProfile{}, }, }, nil) if err != nil { log.Fatalf("failed to finish the request: %v", err) } res, err := poller.PollUntilDone(ctx, nil) if err != nil { log.Fatalf("failed to pull the result: %v", err) } // You could use response here. We use blank identifier for just demo purposes. _ = res // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. // res.GalleryImageVersion = armcompute.GalleryImageVersion{ // Name: to.Ptr("1.0.0"), // Location: to.Ptr("West US"), // Properties: &armcompute.GalleryImageVersionProperties{ // ProvisioningState: to.Ptr(armcompute.GalleryProvisioningStateSucceeded), // PublishingProfile: &armcompute.GalleryImageVersionPublishingProfile{ // PublishedDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2018-01-01T00:00:00.000Z"); return t}()), // ReplicaCount: to.Ptr[int32](1), // StorageAccountType: to.Ptr(armcompute.StorageAccountTypeStandardLRS), // TargetRegions: []*armcompute.TargetRegion{ // { // Name: to.Ptr("West US"), // Encryption: &armcompute.EncryptionImages{ // DataDiskImages: []*armcompute.DataDiskImageEncryption{ // { // DiskEncryptionSetID: to.Ptr("/subscriptions/{subscriptionId}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/diskEncryptionSet/myDiskEncryptionSet"), // Lun: to.Ptr[int32](1), // }}, // OSDiskImage: &armcompute.OSDiskImageEncryption{ // DiskEncryptionSetID: to.Ptr("/subscriptions/{subscriptionId}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/diskEncryptionSet/myDiskEncryptionSet"), // }, // }, // ExcludeFromLatest: to.Ptr(false), // RegionalReplicaCount: to.Ptr[int32](1), // StorageAccountType: to.Ptr(armcompute.StorageAccountTypeStandardLRS), // }, // { // Name: to.Ptr("East US"), // ExcludeFromLatest: to.Ptr(false), // RegionalReplicaCount: to.Ptr[int32](2), // StorageAccountType: to.Ptr(armcompute.StorageAccountTypeStandardZRS), // }}, // }, // StorageProfile: &armcompute.GalleryImageVersionStorageProfile{ // DataDiskImages: []*armcompute.GalleryDataDiskImage{ // { // HostCaching: to.Ptr(armcompute.HostCachingNone), // SizeInGB: to.Ptr[int32](10), // Lun: to.Ptr[int32](1), // }}, // OSDiskImage: &armcompute.GalleryOSDiskImage{ // HostCaching: to.Ptr(armcompute.HostCachingReadOnly), // SizeInGB: to.Ptr[int32](10), // }, // Source: &armcompute.GalleryArtifactVersionFullSource{ // ID: to.Ptr("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroup}/providers/Microsoft.Compute/images/{imageName}"), // }, // }, // }, // }
Output:
func (*GalleryImageVersionsClient) Get ¶
func (client *GalleryImageVersionsClient) Get(ctx context.Context, resourceGroupName string, galleryName string, galleryImageName string, galleryImageVersionName string, options *GalleryImageVersionsClientGetOptions) (GalleryImageVersionsClientGetResponse, error)
Get - Retrieves information about a gallery image version. If the operation fails it returns an *azcore.ResponseError type.
Generated from API version 2023-07-03
- resourceGroupName - The name of the resource group.
- galleryName - The name of the Shared Image Gallery in which the Image Definition resides.
- galleryImageName - The name of the gallery image definition in which the Image Version resides.
- galleryImageVersionName - The name of the gallery image version to be retrieved.
- options - GalleryImageVersionsClientGetOptions contains the optional parameters for the GalleryImageVersionsClient.Get method.
Example (GetAGalleryImageVersion) ¶
Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/92de53a5f1e0e03c94b40475d2135d97148ed014/specification/compute/resource-manager/Microsoft.Compute/GalleryRP/stable/2023-07-03/examples/galleryExamples/GalleryImageVersion_Get.json
cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() clientFactory, err := armcompute.NewClientFactory("<subscription-id>", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } res, err := clientFactory.NewGalleryImageVersionsClient().Get(ctx, "myResourceGroup", "myGalleryName", "myGalleryImageName", "1.0.0", &armcompute.GalleryImageVersionsClientGetOptions{Expand: nil}) if err != nil { log.Fatalf("failed to finish the request: %v", err) } // You could use response here. We use blank identifier for just demo purposes. _ = res // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. // res.GalleryImageVersion = armcompute.GalleryImageVersion{ // Name: to.Ptr("1.0.0"), // ID: to.Ptr("/providers/Microsoft.Compute/locations/westus/Galleries/myGalleryName/Images/myGalleryImageName/Versions/1.0.0"), // Location: to.Ptr("West US"), // Properties: &armcompute.GalleryImageVersionProperties{ // ProvisioningState: to.Ptr(armcompute.GalleryProvisioningStateSucceeded), // PublishingProfile: &armcompute.GalleryImageVersionPublishingProfile{ // PublishedDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2018-01-01T00:00:00.000Z"); return t}()), // ReplicaCount: to.Ptr[int32](1), // StorageAccountType: to.Ptr(armcompute.StorageAccountTypeStandardLRS), // TargetRegions: []*armcompute.TargetRegion{ // { // Name: to.Ptr("West US"), // Encryption: &armcompute.EncryptionImages{ // DataDiskImages: []*armcompute.DataDiskImageEncryption{ // { // DiskEncryptionSetID: to.Ptr("/subscriptions/{subscriptionId}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/diskEncryptionSet/myOtherDiskEncryptionSet"), // Lun: to.Ptr[int32](0), // }, // { // DiskEncryptionSetID: to.Ptr("/subscriptions/{subscriptionId}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/diskEncryptionSet/myDiskEncryptionSet"), // Lun: to.Ptr[int32](1), // }}, // OSDiskImage: &armcompute.OSDiskImageEncryption{ // DiskEncryptionSetID: to.Ptr("/subscriptions/{subscriptionId}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/diskEncryptionSet/myDiskEncryptionSet"), // }, // }, // ExcludeFromLatest: to.Ptr(false), // RegionalReplicaCount: to.Ptr[int32](1), // StorageAccountType: to.Ptr(armcompute.StorageAccountTypeStandardLRS), // }, // { // Name: to.Ptr("East US"), // ExcludeFromLatest: to.Ptr(false), // RegionalReplicaCount: to.Ptr[int32](2), // StorageAccountType: to.Ptr(armcompute.StorageAccountTypeStandardLRS), // }}, // }, // SafetyProfile: &armcompute.GalleryImageVersionSafetyProfile{ // AllowDeletionOfReplicatedLocations: to.Ptr(false), // PolicyViolations: []*armcompute.PolicyViolation{ // { // Category: to.Ptr(armcompute.PolicyViolationCategoryImageFlaggedUnsafe), // Details: to.Ptr("This is the policy violation details."), // }}, // ReportedForPolicyViolation: to.Ptr(true), // }, // StorageProfile: &armcompute.GalleryImageVersionStorageProfile{ // DataDiskImages: []*armcompute.GalleryDataDiskImage{ // { // HostCaching: to.Ptr(armcompute.HostCachingNone), // SizeInGB: to.Ptr[int32](10), // Lun: to.Ptr[int32](1), // }}, // OSDiskImage: &armcompute.GalleryOSDiskImage{ // HostCaching: to.Ptr(armcompute.HostCachingReadOnly), // SizeInGB: to.Ptr[int32](10), // }, // Source: &armcompute.GalleryArtifactVersionFullSource{ // ID: to.Ptr("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroup}/providers/Microsoft.Compute/images/{imageName}"), // }, // }, // }, // }
Output:
Example (GetAGalleryImageVersionWithReplicationStatus) ¶
Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/92de53a5f1e0e03c94b40475d2135d97148ed014/specification/compute/resource-manager/Microsoft.Compute/GalleryRP/stable/2023-07-03/examples/galleryExamples/GalleryImageVersion_Get_WithReplicationStatus.json
cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() clientFactory, err := armcompute.NewClientFactory("<subscription-id>", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } res, err := clientFactory.NewGalleryImageVersionsClient().Get(ctx, "myResourceGroup", "myGalleryName", "myGalleryImageName", "1.0.0", &armcompute.GalleryImageVersionsClientGetOptions{Expand: to.Ptr(armcompute.ReplicationStatusTypesReplicationStatus)}) if err != nil { log.Fatalf("failed to finish the request: %v", err) } // You could use response here. We use blank identifier for just demo purposes. _ = res // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. // res.GalleryImageVersion = armcompute.GalleryImageVersion{ // Name: to.Ptr("1.0.0"), // ID: to.Ptr("/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/locations/westus/Galleries/myGalleryName/Images/myGalleryImageName/Versions/1.0.0"), // Location: to.Ptr("West US"), // Properties: &armcompute.GalleryImageVersionProperties{ // ProvisioningState: to.Ptr(armcompute.GalleryProvisioningStateSucceeded), // PublishingProfile: &armcompute.GalleryImageVersionPublishingProfile{ // PublishedDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2018-01-01T00:00:00.000Z"); return t}()), // ReplicaCount: to.Ptr[int32](1), // StorageAccountType: to.Ptr(armcompute.StorageAccountTypeStandardLRS), // TargetRegions: []*armcompute.TargetRegion{ // { // Name: to.Ptr("West US"), // Encryption: &armcompute.EncryptionImages{ // DataDiskImages: []*armcompute.DataDiskImageEncryption{ // { // DiskEncryptionSetID: to.Ptr("/subscriptions/{subscriptionId}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/diskEncryptionSet/myOtherDiskEncryptionSet"), // Lun: to.Ptr[int32](0), // }, // { // DiskEncryptionSetID: to.Ptr("/subscriptions/{subscriptionId}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/diskEncryptionSet/myDiskEncryptionSet"), // Lun: to.Ptr[int32](1), // }}, // OSDiskImage: &armcompute.OSDiskImageEncryption{ // DiskEncryptionSetID: to.Ptr("/subscriptions/{subscriptionId}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/diskEncryptionSet/myDiskEncryptionSet"), // }, // }, // ExcludeFromLatest: to.Ptr(false), // RegionalReplicaCount: to.Ptr[int32](1), // StorageAccountType: to.Ptr(armcompute.StorageAccountTypeStandardLRS), // }, // { // Name: to.Ptr("East US"), // ExcludeFromLatest: to.Ptr(false), // RegionalReplicaCount: to.Ptr[int32](2), // StorageAccountType: to.Ptr(armcompute.StorageAccountTypeStandardLRS), // }}, // }, // ReplicationStatus: &armcompute.ReplicationStatus{ // AggregatedState: to.Ptr(armcompute.AggregatedReplicationStateCompleted), // Summary: []*armcompute.RegionalReplicationStatus{ // { // Progress: to.Ptr[int32](100), // Region: to.Ptr("West US"), // State: to.Ptr(armcompute.ReplicationStateCompleted), // Details: to.Ptr(""), // }, // { // Progress: to.Ptr[int32](100), // Region: to.Ptr("East US"), // State: to.Ptr(armcompute.ReplicationStateCompleted), // Details: to.Ptr(""), // }}, // }, // SafetyProfile: &armcompute.GalleryImageVersionSafetyProfile{ // AllowDeletionOfReplicatedLocations: to.Ptr(false), // PolicyViolations: []*armcompute.PolicyViolation{ // { // Category: to.Ptr(armcompute.PolicyViolationCategoryImageFlaggedUnsafe), // Details: to.Ptr("This is the policy violation details."), // }}, // ReportedForPolicyViolation: to.Ptr(true), // }, // StorageProfile: &armcompute.GalleryImageVersionStorageProfile{ // DataDiskImages: []*armcompute.GalleryDataDiskImage{ // { // HostCaching: to.Ptr(armcompute.HostCachingNone), // SizeInGB: to.Ptr[int32](10), // Lun: to.Ptr[int32](1), // }}, // OSDiskImage: &armcompute.GalleryOSDiskImage{ // HostCaching: to.Ptr(armcompute.HostCachingReadOnly), // SizeInGB: to.Ptr[int32](10), // }, // Source: &armcompute.GalleryArtifactVersionFullSource{ // ID: to.Ptr("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroup}/providers/Microsoft.Compute/images/{imageName}"), // }, // }, // }, // }
Output:
Example (GetAGalleryImageVersionWithSnapshotsAsASource) ¶
Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/92de53a5f1e0e03c94b40475d2135d97148ed014/specification/compute/resource-manager/Microsoft.Compute/GalleryRP/stable/2023-07-03/examples/galleryExamples/GalleryImageVersion_Get_WithSnapshotsAsSource.json
cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() clientFactory, err := armcompute.NewClientFactory("<subscription-id>", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } res, err := clientFactory.NewGalleryImageVersionsClient().Get(ctx, "myResourceGroup", "myGalleryName", "myGalleryImageName", "1.0.0", &armcompute.GalleryImageVersionsClientGetOptions{Expand: nil}) if err != nil { log.Fatalf("failed to finish the request: %v", err) } // You could use response here. We use blank identifier for just demo purposes. _ = res // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. // res.GalleryImageVersion = armcompute.GalleryImageVersion{ // Name: to.Ptr("1.0.0"), // ID: to.Ptr("/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/locations/westus/Galleries/myGalleryName/Images/myGalleryImageName/Versions/1.0.0"), // Location: to.Ptr("West US"), // Properties: &armcompute.GalleryImageVersionProperties{ // ProvisioningState: to.Ptr(armcompute.GalleryProvisioningStateSucceeded), // PublishingProfile: &armcompute.GalleryImageVersionPublishingProfile{ // PublishedDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2018-01-01T00:00:00.000Z"); return t}()), // ReplicaCount: to.Ptr[int32](1), // StorageAccountType: to.Ptr(armcompute.StorageAccountTypeStandardLRS), // TargetRegions: []*armcompute.TargetRegion{ // { // Name: to.Ptr("West US"), // Encryption: &armcompute.EncryptionImages{ // DataDiskImages: []*armcompute.DataDiskImageEncryption{ // { // DiskEncryptionSetID: to.Ptr("/subscriptions/{subscriptionId}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/diskEncryptionSet/myDiskEncryptionSet"), // Lun: to.Ptr[int32](1), // }}, // OSDiskImage: &armcompute.OSDiskImageEncryption{ // DiskEncryptionSetID: to.Ptr("/subscriptions/{subscriptionId}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/diskEncryptionSet/myDiskEncryptionSet"), // }, // }, // ExcludeFromLatest: to.Ptr(false), // RegionalReplicaCount: to.Ptr[int32](1), // StorageAccountType: to.Ptr(armcompute.StorageAccountTypeStandardLRS), // }, // { // Name: to.Ptr("East US"), // ExcludeFromLatest: to.Ptr(false), // RegionalReplicaCount: to.Ptr[int32](2), // StorageAccountType: to.Ptr(armcompute.StorageAccountTypeStandardLRS), // }}, // }, // SafetyProfile: &armcompute.GalleryImageVersionSafetyProfile{ // AllowDeletionOfReplicatedLocations: to.Ptr(false), // PolicyViolations: []*armcompute.PolicyViolation{ // { // Category: to.Ptr(armcompute.PolicyViolationCategoryImageFlaggedUnsafe), // Details: to.Ptr("This is the policy violation details."), // }}, // ReportedForPolicyViolation: to.Ptr(true), // }, // StorageProfile: &armcompute.GalleryImageVersionStorageProfile{ // DataDiskImages: []*armcompute.GalleryDataDiskImage{ // { // HostCaching: to.Ptr(armcompute.HostCachingNone), // SizeInGB: to.Ptr[int32](10), // Source: &armcompute.GalleryDiskImageSource{ // ID: to.Ptr("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroup}/providers/Microsoft.Compute/snapshots/{diskSnapshotName}"), // }, // Lun: to.Ptr[int32](1), // }}, // OSDiskImage: &armcompute.GalleryOSDiskImage{ // HostCaching: to.Ptr(armcompute.HostCachingReadOnly), // SizeInGB: to.Ptr[int32](10), // Source: &armcompute.GalleryDiskImageSource{ // ID: to.Ptr("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroup}/providers/Microsoft.Compute/snapshots/{snapshotName}"), // }, // }, // }, // }, // }
Output:
Example (GetAGalleryImageVersionWithVhdAsASource) ¶
Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/92de53a5f1e0e03c94b40475d2135d97148ed014/specification/compute/resource-manager/Microsoft.Compute/GalleryRP/stable/2023-07-03/examples/galleryExamples/GalleryImageVersion_Get_WithVhdAsSource.json
cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() clientFactory, err := armcompute.NewClientFactory("<subscription-id>", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } res, err := clientFactory.NewGalleryImageVersionsClient().Get(ctx, "myResourceGroup", "myGalleryName", "myGalleryImageName", "1.0.0", &armcompute.GalleryImageVersionsClientGetOptions{Expand: nil}) if err != nil { log.Fatalf("failed to finish the request: %v", err) } // You could use response here. We use blank identifier for just demo purposes. _ = res // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. // res.GalleryImageVersion = armcompute.GalleryImageVersion{ // Name: to.Ptr("1.0.0"), // ID: to.Ptr("/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/locations/westus/Galleries/myGalleryName/Images/myGalleryImageName/Versions/1.0.0"), // Location: to.Ptr("West US"), // Properties: &armcompute.GalleryImageVersionProperties{ // ProvisioningState: to.Ptr(armcompute.GalleryProvisioningStateSucceeded), // PublishingProfile: &armcompute.GalleryImageVersionPublishingProfile{ // PublishedDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2018-01-01T00:00:00.000Z"); return t}()), // ReplicaCount: to.Ptr[int32](1), // StorageAccountType: to.Ptr(armcompute.StorageAccountTypeStandardLRS), // TargetRegions: []*armcompute.TargetRegion{ // { // Name: to.Ptr("West US"), // Encryption: &armcompute.EncryptionImages{ // DataDiskImages: []*armcompute.DataDiskImageEncryption{ // { // DiskEncryptionSetID: to.Ptr("/subscriptions/{subscriptionId}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/diskEncryptionSet/myDiskEncryptionSet"), // Lun: to.Ptr[int32](1), // }}, // OSDiskImage: &armcompute.OSDiskImageEncryption{ // DiskEncryptionSetID: to.Ptr("/subscriptions/{subscriptionId}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/diskEncryptionSet/myDiskEncryptionSet"), // }, // }, // ExcludeFromLatest: to.Ptr(false), // RegionalReplicaCount: to.Ptr[int32](1), // StorageAccountType: to.Ptr(armcompute.StorageAccountTypeStandardLRS), // }, // { // Name: to.Ptr("East US"), // ExcludeFromLatest: to.Ptr(false), // RegionalReplicaCount: to.Ptr[int32](2), // StorageAccountType: to.Ptr(armcompute.StorageAccountTypeStandardLRS), // }}, // }, // SafetyProfile: &armcompute.GalleryImageVersionSafetyProfile{ // AllowDeletionOfReplicatedLocations: to.Ptr(false), // PolicyViolations: []*armcompute.PolicyViolation{ // { // Category: to.Ptr(armcompute.PolicyViolationCategoryImageFlaggedUnsafe), // Details: to.Ptr("This is the policy violation details."), // }}, // ReportedForPolicyViolation: to.Ptr(true), // }, // StorageProfile: &armcompute.GalleryImageVersionStorageProfile{ // DataDiskImages: []*armcompute.GalleryDataDiskImage{ // { // HostCaching: to.Ptr(armcompute.HostCachingNone), // Source: &armcompute.GalleryDiskImageSource{ // StorageAccountID: to.Ptr("/subscriptions/{subscriptionId}/resourceGroups/myResourceGroup/providers/Microsoft.Storage/storageAccounts/{storageAccount}"), // URI: to.Ptr("https://gallerysourcencus.blob.core.windows.net/myvhds/Windows-Server-2012-R2-20171216-en.us-128GB.vhd"), // }, // Lun: to.Ptr[int32](1), // }}, // OSDiskImage: &armcompute.GalleryOSDiskImage{ // HostCaching: to.Ptr(armcompute.HostCachingReadOnly), // Source: &armcompute.GalleryDiskImageSource{ // StorageAccountID: to.Ptr("/subscriptions/{subscriptionId}/resourceGroups/myResourceGroup/providers/Microsoft.Storage/storageAccounts/{storageAccount}"), // URI: to.Ptr("https://gallerysourcencus.blob.core.windows.net/myvhds/Windows-Server-2012-R2-20171216-en.us-128GB.vhd"), // }, // }, // }, // }, // }
Output:
func (*GalleryImageVersionsClient) NewListByGalleryImagePager ¶
func (client *GalleryImageVersionsClient) NewListByGalleryImagePager(resourceGroupName string, galleryName string, galleryImageName string, options *GalleryImageVersionsClientListByGalleryImageOptions) *runtime.Pager[GalleryImageVersionsClientListByGalleryImageResponse]
NewListByGalleryImagePager - List gallery image versions in a gallery image definition.
Generated from API version 2023-07-03
- resourceGroupName - The name of the resource group.
- galleryName - The name of the Shared Image Gallery in which the Image Definition resides.
- galleryImageName - The name of the Shared Image Gallery Image Definition from which the Image Versions are to be listed.
- options - GalleryImageVersionsClientListByGalleryImageOptions contains the optional parameters for the GalleryImageVersionsClient.NewListByGalleryImagePager method.
Example ¶
Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/92de53a5f1e0e03c94b40475d2135d97148ed014/specification/compute/resource-manager/Microsoft.Compute/GalleryRP/stable/2023-07-03/examples/galleryExamples/GalleryImageVersion_ListByGalleryImage.json
cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() clientFactory, err := armcompute.NewClientFactory("<subscription-id>", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } pager := clientFactory.NewGalleryImageVersionsClient().NewListByGalleryImagePager("myResourceGroup", "myGalleryName", "myGalleryImageName", nil) for pager.More() { page, err := pager.NextPage(ctx) if err != nil { log.Fatalf("failed to advance page: %v", err) } for _, v := range page.Value { // You could use page here. We use blank identifier for just demo purposes. _ = v } // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. // page.GalleryImageVersionList = armcompute.GalleryImageVersionList{ // Value: []*armcompute.GalleryImageVersion{ // { // Name: to.Ptr("1.0.0"), // ID: to.Ptr("/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/locations/westus/Galleries/myGalleryName/Images/myGalleryImageName/Versions/1.0.0"), // Location: to.Ptr("West US"), // Properties: &armcompute.GalleryImageVersionProperties{ // ProvisioningState: to.Ptr(armcompute.GalleryProvisioningStateSucceeded), // PublishingProfile: &armcompute.GalleryImageVersionPublishingProfile{ // PublishedDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2018-01-01T00:00:00.000Z"); return t}()), // ReplicaCount: to.Ptr[int32](1), // StorageAccountType: to.Ptr(armcompute.StorageAccountTypeStandardLRS), // TargetRegions: []*armcompute.TargetRegion{ // { // Name: to.Ptr("West US"), // Encryption: &armcompute.EncryptionImages{ // DataDiskImages: []*armcompute.DataDiskImageEncryption{ // { // DiskEncryptionSetID: to.Ptr("/subscriptions/{subscriptionId}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/diskEncryptionSet/myOtherDiskEncryptionSet"), // Lun: to.Ptr[int32](0), // }, // { // DiskEncryptionSetID: to.Ptr("/subscriptions/{subscriptionId}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/diskEncryptionSet/myDiskEncryptionSet"), // Lun: to.Ptr[int32](1), // }}, // OSDiskImage: &armcompute.OSDiskImageEncryption{ // DiskEncryptionSetID: to.Ptr("/subscriptions/{subscriptionId}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/diskEncryptionSet/myDiskEncryptionSet"), // }, // }, // ExcludeFromLatest: to.Ptr(false), // RegionalReplicaCount: to.Ptr[int32](1), // StorageAccountType: to.Ptr(armcompute.StorageAccountTypeStandardLRS), // }, // { // Name: to.Ptr("East US"), // ExcludeFromLatest: to.Ptr(false), // RegionalReplicaCount: to.Ptr[int32](2), // StorageAccountType: to.Ptr(armcompute.StorageAccountTypeStandardLRS), // }}, // }, // SafetyProfile: &armcompute.GalleryImageVersionSafetyProfile{ // AllowDeletionOfReplicatedLocations: to.Ptr(false), // PolicyViolations: []*armcompute.PolicyViolation{ // { // Category: to.Ptr(armcompute.PolicyViolationCategoryImageFlaggedUnsafe), // Details: to.Ptr("This is the policy violation details."), // }}, // ReportedForPolicyViolation: to.Ptr(true), // }, // StorageProfile: &armcompute.GalleryImageVersionStorageProfile{ // DataDiskImages: []*armcompute.GalleryDataDiskImage{ // { // HostCaching: to.Ptr(armcompute.HostCachingNone), // SizeInGB: to.Ptr[int32](10), // Lun: to.Ptr[int32](1), // }}, // OSDiskImage: &armcompute.GalleryOSDiskImage{ // HostCaching: to.Ptr(armcompute.HostCachingReadOnly), // SizeInGB: to.Ptr[int32](10), // }, // Source: &armcompute.GalleryArtifactVersionFullSource{ // ID: to.Ptr("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroup}/providers/Microsoft.Compute/images/{imageName}"), // }, // }, // }, // }}, // } }
Output:
type GalleryImageVersionsClientBeginCreateOrUpdateOptions ¶
type GalleryImageVersionsClientBeginCreateOrUpdateOptions struct { // Resumes the LRO from the provided token. ResumeToken string }
GalleryImageVersionsClientBeginCreateOrUpdateOptions contains the optional parameters for the GalleryImageVersionsClient.BeginCreateOrUpdate method.
type GalleryImageVersionsClientBeginDeleteOptions ¶
type GalleryImageVersionsClientBeginDeleteOptions struct { // Resumes the LRO from the provided token. ResumeToken string }
GalleryImageVersionsClientBeginDeleteOptions contains the optional parameters for the GalleryImageVersionsClient.BeginDelete method.
type GalleryImageVersionsClientBeginUpdateOptions ¶
type GalleryImageVersionsClientBeginUpdateOptions struct { // Resumes the LRO from the provided token. ResumeToken string }
GalleryImageVersionsClientBeginUpdateOptions contains the optional parameters for the GalleryImageVersionsClient.BeginUpdate method.
type GalleryImageVersionsClientCreateOrUpdateResponse ¶
type GalleryImageVersionsClientCreateOrUpdateResponse struct { // Specifies information about the gallery image version that you want to create or update. GalleryImageVersion }
GalleryImageVersionsClientCreateOrUpdateResponse contains the response from method GalleryImageVersionsClient.BeginCreateOrUpdate.
type GalleryImageVersionsClientDeleteResponse ¶
type GalleryImageVersionsClientDeleteResponse struct { }
GalleryImageVersionsClientDeleteResponse contains the response from method GalleryImageVersionsClient.BeginDelete.
type GalleryImageVersionsClientGetOptions ¶
type GalleryImageVersionsClientGetOptions struct { // The expand expression to apply on the operation. Expand *ReplicationStatusTypes }
GalleryImageVersionsClientGetOptions contains the optional parameters for the GalleryImageVersionsClient.Get method.
type GalleryImageVersionsClientGetResponse ¶
type GalleryImageVersionsClientGetResponse struct { // Specifies information about the gallery image version that you want to create or update. GalleryImageVersion }
GalleryImageVersionsClientGetResponse contains the response from method GalleryImageVersionsClient.Get.
type GalleryImageVersionsClientListByGalleryImageOptions ¶
type GalleryImageVersionsClientListByGalleryImageOptions struct { }
GalleryImageVersionsClientListByGalleryImageOptions contains the optional parameters for the GalleryImageVersionsClient.NewListByGalleryImagePager method.
type GalleryImageVersionsClientListByGalleryImageResponse ¶
type GalleryImageVersionsClientListByGalleryImageResponse struct { // The List Gallery Image version operation response. GalleryImageVersionList }
GalleryImageVersionsClientListByGalleryImageResponse contains the response from method GalleryImageVersionsClient.NewListByGalleryImagePager.
type GalleryImageVersionsClientUpdateResponse ¶
type GalleryImageVersionsClientUpdateResponse struct { // Specifies information about the gallery image version that you want to create or update. GalleryImageVersion }
GalleryImageVersionsClientUpdateResponse contains the response from method GalleryImageVersionsClient.BeginUpdate.
type GalleryImagesClient ¶
type GalleryImagesClient struct {
// contains filtered or unexported fields
}
GalleryImagesClient contains the methods for the GalleryImages group. Don't use this type directly, use NewGalleryImagesClient() instead.
func NewGalleryImagesClient ¶
func NewGalleryImagesClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*GalleryImagesClient, error)
NewGalleryImagesClient creates a new instance of GalleryImagesClient 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 (*GalleryImagesClient) BeginCreateOrUpdate ¶
func (client *GalleryImagesClient) BeginCreateOrUpdate(ctx context.Context, resourceGroupName string, galleryName string, galleryImageName string, galleryImage GalleryImage, options *GalleryImagesClientBeginCreateOrUpdateOptions) (*runtime.Poller[GalleryImagesClientCreateOrUpdateResponse], error)
BeginCreateOrUpdate - Create or update a gallery image definition. If the operation fails it returns an *azcore.ResponseError type.
Generated from API version 2023-07-03
- resourceGroupName - The name of the resource group.
- galleryName - The name of the Shared Image Gallery in which the Image Definition is to be created.
- galleryImageName - The name of the gallery image definition to be created or updated. The allowed characters are alphabets and numbers with dots, dashes, and periods allowed in the middle. The maximum length is 80 characters.
- galleryImage - Parameters supplied to the create or update gallery image operation.
- options - GalleryImagesClientBeginCreateOrUpdateOptions contains the optional parameters for the GalleryImagesClient.BeginCreateOrUpdate method.
Example ¶
Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/92de53a5f1e0e03c94b40475d2135d97148ed014/specification/compute/resource-manager/Microsoft.Compute/GalleryRP/stable/2023-07-03/examples/galleryExamples/GalleryImage_Create.json
cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() clientFactory, err := armcompute.NewClientFactory("<subscription-id>", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } poller, err := clientFactory.NewGalleryImagesClient().BeginCreateOrUpdate(ctx, "myResourceGroup", "myGalleryName", "myGalleryImageName", armcompute.GalleryImage{ Location: to.Ptr("West US"), Properties: &armcompute.GalleryImageProperties{ HyperVGeneration: to.Ptr(armcompute.HyperVGenerationV1), Identifier: &armcompute.GalleryImageIdentifier{ Offer: to.Ptr("myOfferName"), Publisher: to.Ptr("myPublisherName"), SKU: to.Ptr("mySkuName"), }, OSState: to.Ptr(armcompute.OperatingSystemStateTypesGeneralized), OSType: to.Ptr(armcompute.OperatingSystemTypesWindows), }, }, nil) if err != nil { log.Fatalf("failed to finish the request: %v", err) } res, err := poller.PollUntilDone(ctx, nil) if err != nil { log.Fatalf("failed to pull the result: %v", err) } // You could use response here. We use blank identifier for just demo purposes. _ = res // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. // res.GalleryImage = armcompute.GalleryImage{ // Name: to.Ptr("myGalleryImageName"), // ID: to.Ptr("/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/galleries/myGallery/Images/myGalleryImageName"), // Location: to.Ptr("West US"), // Properties: &armcompute.GalleryImageProperties{ // HyperVGeneration: to.Ptr(armcompute.HyperVGenerationV1), // Identifier: &armcompute.GalleryImageIdentifier{ // Offer: to.Ptr("myOfferName"), // Publisher: to.Ptr("myPublisherName"), // SKU: to.Ptr("mySkuName"), // }, // OSState: to.Ptr(armcompute.OperatingSystemStateTypesGeneralized), // OSType: to.Ptr(armcompute.OperatingSystemTypesWindows), // ProvisioningState: to.Ptr(armcompute.GalleryProvisioningStateSucceeded), // }, // }
Output:
func (*GalleryImagesClient) BeginDelete ¶
func (client *GalleryImagesClient) BeginDelete(ctx context.Context, resourceGroupName string, galleryName string, galleryImageName string, options *GalleryImagesClientBeginDeleteOptions) (*runtime.Poller[GalleryImagesClientDeleteResponse], error)
BeginDelete - Delete a gallery image. If the operation fails it returns an *azcore.ResponseError type.
Generated from API version 2023-07-03
- resourceGroupName - The name of the resource group.
- galleryName - The name of the Shared Image Gallery in which the Image Definition is to be deleted.
- galleryImageName - The name of the gallery image definition to be deleted.
- options - GalleryImagesClientBeginDeleteOptions contains the optional parameters for the GalleryImagesClient.BeginDelete method.
Example ¶
Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/92de53a5f1e0e03c94b40475d2135d97148ed014/specification/compute/resource-manager/Microsoft.Compute/GalleryRP/stable/2023-07-03/examples/galleryExamples/GalleryImage_Delete.json
cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() clientFactory, err := armcompute.NewClientFactory("<subscription-id>", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } poller, err := clientFactory.NewGalleryImagesClient().BeginDelete(ctx, "myResourceGroup", "myGalleryName", "myGalleryImageName", nil) if err != nil { log.Fatalf("failed to finish the request: %v", err) } _, err = poller.PollUntilDone(ctx, nil) if err != nil { log.Fatalf("failed to pull the result: %v", err) }
Output:
func (*GalleryImagesClient) BeginUpdate ¶
func (client *GalleryImagesClient) BeginUpdate(ctx context.Context, resourceGroupName string, galleryName string, galleryImageName string, galleryImage GalleryImageUpdate, options *GalleryImagesClientBeginUpdateOptions) (*runtime.Poller[GalleryImagesClientUpdateResponse], error)
BeginUpdate - Update a gallery image definition. If the operation fails it returns an *azcore.ResponseError type.
Generated from API version 2023-07-03
- resourceGroupName - The name of the resource group.
- galleryName - The name of the Shared Image Gallery in which the Image Definition is to be updated.
- galleryImageName - The name of the gallery image definition to be updated. The allowed characters are alphabets and numbers with dots, dashes, and periods allowed in the middle. The maximum length is 80 characters.
- galleryImage - Parameters supplied to the update gallery image operation.
- options - GalleryImagesClientBeginUpdateOptions contains the optional parameters for the GalleryImagesClient.BeginUpdate method.
Example ¶
Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/92de53a5f1e0e03c94b40475d2135d97148ed014/specification/compute/resource-manager/Microsoft.Compute/GalleryRP/stable/2023-07-03/examples/galleryExamples/GalleryImage_Update.json
cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() clientFactory, err := armcompute.NewClientFactory("<subscription-id>", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } poller, err := clientFactory.NewGalleryImagesClient().BeginUpdate(ctx, "myResourceGroup", "myGalleryName", "myGalleryImageName", armcompute.GalleryImageUpdate{ Properties: &armcompute.GalleryImageProperties{ HyperVGeneration: to.Ptr(armcompute.HyperVGenerationV1), Identifier: &armcompute.GalleryImageIdentifier{ Offer: to.Ptr("myOfferName"), Publisher: to.Ptr("myPublisherName"), SKU: to.Ptr("mySkuName"), }, OSState: to.Ptr(armcompute.OperatingSystemStateTypesGeneralized), OSType: to.Ptr(armcompute.OperatingSystemTypesWindows), }, }, nil) if err != nil { log.Fatalf("failed to finish the request: %v", err) } res, err := poller.PollUntilDone(ctx, nil) if err != nil { log.Fatalf("failed to pull the result: %v", err) } // You could use response here. We use blank identifier for just demo purposes. _ = res // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. // res.GalleryImage = armcompute.GalleryImage{ // Name: to.Ptr("myGalleryImageName"), // Location: to.Ptr("West US"), // Properties: &armcompute.GalleryImageProperties{ // HyperVGeneration: to.Ptr(armcompute.HyperVGenerationV1), // Identifier: &armcompute.GalleryImageIdentifier{ // Offer: to.Ptr("myOfferName"), // Publisher: to.Ptr("myPublisherName"), // SKU: to.Ptr("mySkuName"), // }, // OSState: to.Ptr(armcompute.OperatingSystemStateTypesGeneralized), // OSType: to.Ptr(armcompute.OperatingSystemTypesWindows), // ProvisioningState: to.Ptr(armcompute.GalleryProvisioningStateSucceeded), // }, // }
Output:
func (*GalleryImagesClient) Get ¶
func (client *GalleryImagesClient) Get(ctx context.Context, resourceGroupName string, galleryName string, galleryImageName string, options *GalleryImagesClientGetOptions) (GalleryImagesClientGetResponse, error)
Get - Retrieves information about a gallery image definition. If the operation fails it returns an *azcore.ResponseError type.
Generated from API version 2023-07-03
- resourceGroupName - The name of the resource group.
- galleryName - The name of the Shared Image Gallery from which the Image Definitions are to be retrieved.
- galleryImageName - The name of the gallery image definition to be retrieved.
- options - GalleryImagesClientGetOptions contains the optional parameters for the GalleryImagesClient.Get method.
Example ¶
Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/92de53a5f1e0e03c94b40475d2135d97148ed014/specification/compute/resource-manager/Microsoft.Compute/GalleryRP/stable/2023-07-03/examples/galleryExamples/GalleryImage_Get.json
cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() clientFactory, err := armcompute.NewClientFactory("<subscription-id>", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } res, err := clientFactory.NewGalleryImagesClient().Get(ctx, "myResourceGroup", "myGalleryName", "myGalleryImageName", nil) if err != nil { log.Fatalf("failed to finish the request: %v", err) } // You could use response here. We use blank identifier for just demo purposes. _ = res // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. // res.GalleryImage = armcompute.GalleryImage{ // Name: to.Ptr("myGalleryImageName"), // ID: to.Ptr("/providers/Microsoft.Compute/galleries/myGallery/Images/myGalleryImageName"), // Location: to.Ptr("West US"), // Properties: &armcompute.GalleryImageProperties{ // HyperVGeneration: to.Ptr(armcompute.HyperVGenerationV1), // Identifier: &armcompute.GalleryImageIdentifier{ // Offer: to.Ptr("myOfferName"), // Publisher: to.Ptr("myPublisherName"), // SKU: to.Ptr("mySkuName"), // }, // OSState: to.Ptr(armcompute.OperatingSystemStateTypesGeneralized), // OSType: to.Ptr(armcompute.OperatingSystemTypesWindows), // ProvisioningState: to.Ptr(armcompute.GalleryProvisioningStateSucceeded), // }, // }
Output:
func (*GalleryImagesClient) NewListByGalleryPager ¶
func (client *GalleryImagesClient) NewListByGalleryPager(resourceGroupName string, galleryName string, options *GalleryImagesClientListByGalleryOptions) *runtime.Pager[GalleryImagesClientListByGalleryResponse]
NewListByGalleryPager - List gallery image definitions in a gallery.
Generated from API version 2023-07-03
- resourceGroupName - The name of the resource group.
- galleryName - The name of the Shared Image Gallery from which Image Definitions are to be listed.
- options - GalleryImagesClientListByGalleryOptions contains the optional parameters for the GalleryImagesClient.NewListByGalleryPager method.
Example ¶
Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/92de53a5f1e0e03c94b40475d2135d97148ed014/specification/compute/resource-manager/Microsoft.Compute/GalleryRP/stable/2023-07-03/examples/galleryExamples/GalleryImage_ListByGallery.json
cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() clientFactory, err := armcompute.NewClientFactory("<subscription-id>", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } pager := clientFactory.NewGalleryImagesClient().NewListByGalleryPager("myResourceGroup", "myGalleryName", nil) for pager.More() { page, err := pager.NextPage(ctx) if err != nil { log.Fatalf("failed to advance page: %v", err) } for _, v := range page.Value { // You could use page here. We use blank identifier for just demo purposes. _ = v } // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. // page.GalleryImageList = armcompute.GalleryImageList{ // Value: []*armcompute.GalleryImage{ // { // Name: to.Ptr("myGalleryImageName"), // ID: to.Ptr("/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/locations/westus/Galleries/myGalleryName/Images/myGalleryImageName"), // Location: to.Ptr("West US"), // Properties: &armcompute.GalleryImageProperties{ // HyperVGeneration: to.Ptr(armcompute.HyperVGenerationV1), // Identifier: &armcompute.GalleryImageIdentifier{ // Offer: to.Ptr("myOfferName"), // Publisher: to.Ptr("myPublisherName"), // SKU: to.Ptr("mySkuName"), // }, // OSState: to.Ptr(armcompute.OperatingSystemStateTypesGeneralized), // OSType: to.Ptr(armcompute.OperatingSystemTypesWindows), // ProvisioningState: to.Ptr(armcompute.GalleryProvisioningStateSucceeded), // }, // }}, // } }
Output:
type GalleryImagesClientBeginCreateOrUpdateOptions ¶
type GalleryImagesClientBeginCreateOrUpdateOptions struct { // Resumes the LRO from the provided token. ResumeToken string }
GalleryImagesClientBeginCreateOrUpdateOptions contains the optional parameters for the GalleryImagesClient.BeginCreateOrUpdate method.
type GalleryImagesClientBeginDeleteOptions ¶
type GalleryImagesClientBeginDeleteOptions struct { // Resumes the LRO from the provided token. ResumeToken string }
GalleryImagesClientBeginDeleteOptions contains the optional parameters for the GalleryImagesClient.BeginDelete method.
type GalleryImagesClientBeginUpdateOptions ¶
type GalleryImagesClientBeginUpdateOptions struct { // Resumes the LRO from the provided token. ResumeToken string }
GalleryImagesClientBeginUpdateOptions contains the optional parameters for the GalleryImagesClient.BeginUpdate method.
type GalleryImagesClientCreateOrUpdateResponse ¶
type GalleryImagesClientCreateOrUpdateResponse struct { // Specifies information about the gallery image definition that you want to create or update. GalleryImage }
GalleryImagesClientCreateOrUpdateResponse contains the response from method GalleryImagesClient.BeginCreateOrUpdate.
type GalleryImagesClientDeleteResponse ¶
type GalleryImagesClientDeleteResponse struct { }
GalleryImagesClientDeleteResponse contains the response from method GalleryImagesClient.BeginDelete.
type GalleryImagesClientGetOptions ¶
type GalleryImagesClientGetOptions struct { }
GalleryImagesClientGetOptions contains the optional parameters for the GalleryImagesClient.Get method.
type GalleryImagesClientGetResponse ¶
type GalleryImagesClientGetResponse struct { // Specifies information about the gallery image definition that you want to create or update. GalleryImage }
GalleryImagesClientGetResponse contains the response from method GalleryImagesClient.Get.
type GalleryImagesClientListByGalleryOptions ¶
type GalleryImagesClientListByGalleryOptions struct { }
GalleryImagesClientListByGalleryOptions contains the optional parameters for the GalleryImagesClient.NewListByGalleryPager method.
type GalleryImagesClientListByGalleryResponse ¶
type GalleryImagesClientListByGalleryResponse struct { // The List Gallery Images operation response. GalleryImageList }
GalleryImagesClientListByGalleryResponse contains the response from method GalleryImagesClient.NewListByGalleryPager.
type GalleryImagesClientUpdateResponse ¶
type GalleryImagesClientUpdateResponse struct { // Specifies information about the gallery image definition that you want to create or update. GalleryImage }
GalleryImagesClientUpdateResponse contains the response from method GalleryImagesClient.BeginUpdate.
type GalleryList ¶
type GalleryList struct { // REQUIRED; A list of galleries. Value []*Gallery // The uri to fetch the next page of galleries. Call ListNext() with this to fetch the next page of galleries. NextLink *string }
GalleryList - The List Galleries operation response.
func (GalleryList) MarshalJSON ¶
func (g GalleryList) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type GalleryList.
func (*GalleryList) UnmarshalJSON ¶
func (g *GalleryList) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type GalleryList.
type GalleryOSDiskImage ¶
type GalleryOSDiskImage struct { // The host caching of the disk. Valid values are 'None', 'ReadOnly', and 'ReadWrite' HostCaching *HostCaching // The source for the disk image. Source *GalleryDiskImageSource // READ-ONLY; This property indicates the size of the VHD to be created. SizeInGB *int32 }
GalleryOSDiskImage - This is the OS disk image.
func (GalleryOSDiskImage) MarshalJSON ¶
func (g GalleryOSDiskImage) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type GalleryOSDiskImage.
func (*GalleryOSDiskImage) UnmarshalJSON ¶
func (g *GalleryOSDiskImage) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type GalleryOSDiskImage.
type GalleryProperties ¶
type GalleryProperties struct { // The description of this Shared Image Gallery resource. This property is updatable. Description *string // Describes the gallery unique name. Identifier *GalleryIdentifier // Profile for gallery sharing to subscription or tenant SharingProfile *SharingProfile // Contains information about the soft deletion policy of the gallery. SoftDeletePolicy *SoftDeletePolicy // READ-ONLY; The provisioning state, which only appears in the response. ProvisioningState *GalleryProvisioningState // READ-ONLY; Sharing status of current gallery. SharingStatus *SharingStatus }
GalleryProperties - Describes the properties of a Shared Image Gallery.
func (GalleryProperties) MarshalJSON ¶
func (g GalleryProperties) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type GalleryProperties.
func (*GalleryProperties) UnmarshalJSON ¶
func (g *GalleryProperties) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type GalleryProperties.
type GalleryProvisioningState ¶
type GalleryProvisioningState string
GalleryProvisioningState - The provisioning state, which only appears in the response.
const ( GalleryProvisioningStateCreating GalleryProvisioningState = "Creating" GalleryProvisioningStateDeleting GalleryProvisioningState = "Deleting" GalleryProvisioningStateFailed GalleryProvisioningState = "Failed" GalleryProvisioningStateMigrating GalleryProvisioningState = "Migrating" GalleryProvisioningStateSucceeded GalleryProvisioningState = "Succeeded" GalleryProvisioningStateUpdating GalleryProvisioningState = "Updating" )
func PossibleGalleryProvisioningStateValues ¶
func PossibleGalleryProvisioningStateValues() []GalleryProvisioningState
PossibleGalleryProvisioningStateValues returns the possible values for the GalleryProvisioningState const type.
type GallerySharingPermissionTypes ¶
type GallerySharingPermissionTypes string
GallerySharingPermissionTypes - This property allows you to specify the permission of sharing gallery. Possible values are: Private, Groups, Community.
const ( GallerySharingPermissionTypesCommunity GallerySharingPermissionTypes = "Community" GallerySharingPermissionTypesGroups GallerySharingPermissionTypes = "Groups" GallerySharingPermissionTypesPrivate GallerySharingPermissionTypes = "Private" )
func PossibleGallerySharingPermissionTypesValues ¶
func PossibleGallerySharingPermissionTypesValues() []GallerySharingPermissionTypes
PossibleGallerySharingPermissionTypesValues returns the possible values for the GallerySharingPermissionTypes const type.
type GallerySharingProfileClient ¶
type GallerySharingProfileClient struct {
// contains filtered or unexported fields
}
GallerySharingProfileClient contains the methods for the GallerySharingProfile group. Don't use this type directly, use NewGallerySharingProfileClient() instead.
func NewGallerySharingProfileClient ¶
func NewGallerySharingProfileClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*GallerySharingProfileClient, error)
NewGallerySharingProfileClient creates a new instance of GallerySharingProfileClient 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 (*GallerySharingProfileClient) BeginUpdate ¶
func (client *GallerySharingProfileClient) BeginUpdate(ctx context.Context, resourceGroupName string, galleryName string, sharingUpdate SharingUpdate, options *GallerySharingProfileClientBeginUpdateOptions) (*runtime.Poller[GallerySharingProfileClientUpdateResponse], error)
BeginUpdate - Update sharing profile of a gallery. If the operation fails it returns an *azcore.ResponseError type.
Generated from API version 2023-07-03
- resourceGroupName - The name of the resource group.
- galleryName - The name of the Shared Image Gallery.
- sharingUpdate - Parameters supplied to the update gallery sharing profile.
- options - GallerySharingProfileClientBeginUpdateOptions contains the optional parameters for the GallerySharingProfileClient.BeginUpdate method.
Example (AddSharingIdToTheSharingProfileOfAGallery) ¶
Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/92de53a5f1e0e03c94b40475d2135d97148ed014/specification/compute/resource-manager/Microsoft.Compute/GalleryRP/stable/2023-07-03/examples/galleryExamples/Gallery_AddToSharingProfile.json
cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() clientFactory, err := armcompute.NewClientFactory("<subscription-id>", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } poller, err := clientFactory.NewGallerySharingProfileClient().BeginUpdate(ctx, "myResourceGroup", "myGalleryName", armcompute.SharingUpdate{ Groups: []*armcompute.SharingProfileGroup{ { Type: to.Ptr(armcompute.SharingProfileGroupTypesSubscriptions), IDs: []*string{ to.Ptr("34a4ab42-0d72-47d9-bd1a-aed207386dac"), to.Ptr("380fd389-260b-41aa-bad9-0a83108c370b")}, }, { Type: to.Ptr(armcompute.SharingProfileGroupTypesAADTenants), IDs: []*string{ to.Ptr("c24c76aa-8897-4027-9b03-8f7928b54ff6")}, }}, OperationType: to.Ptr(armcompute.SharingUpdateOperationTypesAdd), }, nil) if err != nil { log.Fatalf("failed to finish the request: %v", err) } res, err := poller.PollUntilDone(ctx, nil) if err != nil { log.Fatalf("failed to pull the result: %v", err) } // You could use response here. We use blank identifier for just demo purposes. _ = res // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. // res.SharingUpdate = armcompute.SharingUpdate{ // Groups: []*armcompute.SharingProfileGroup{ // { // Type: to.Ptr(armcompute.SharingProfileGroupTypesSubscriptions), // IDs: []*string{ // to.Ptr("34a4ab42-0d72-47d9-bd1a-aed207386dac"), // to.Ptr("380fd389-260b-41aa-bad9-0a83108c370b")}, // }, // { // Type: to.Ptr(armcompute.SharingProfileGroupTypesAADTenants), // IDs: []*string{ // to.Ptr("c24c76aa-8897-4027-9b03-8f7928b54ff6")}, // }}, // OperationType: to.Ptr(armcompute.SharingUpdateOperationTypesAdd), // }
Output:
Example (ResetSharingProfileOfAGallery) ¶
Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/92de53a5f1e0e03c94b40475d2135d97148ed014/specification/compute/resource-manager/Microsoft.Compute/GalleryRP/stable/2023-07-03/examples/galleryExamples/Gallery_ResetSharingProfile.json
cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() clientFactory, err := armcompute.NewClientFactory("<subscription-id>", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } poller, err := clientFactory.NewGallerySharingProfileClient().BeginUpdate(ctx, "myResourceGroup", "myGalleryName", armcompute.SharingUpdate{ OperationType: to.Ptr(armcompute.SharingUpdateOperationTypesReset), }, nil) if err != nil { log.Fatalf("failed to finish the request: %v", err) } res, err := poller.PollUntilDone(ctx, nil) if err != nil { log.Fatalf("failed to pull the result: %v", err) } // You could use response here. We use blank identifier for just demo purposes. _ = res // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. // res.SharingUpdate = armcompute.SharingUpdate{ // OperationType: to.Ptr(armcompute.SharingUpdateOperationTypesReset), // }
Output:
type GallerySharingProfileClientBeginUpdateOptions ¶
type GallerySharingProfileClientBeginUpdateOptions struct { // Resumes the LRO from the provided token. ResumeToken string }
GallerySharingProfileClientBeginUpdateOptions contains the optional parameters for the GallerySharingProfileClient.BeginUpdate method.
type GallerySharingProfileClientUpdateResponse ¶
type GallerySharingProfileClientUpdateResponse struct { // Specifies information about the gallery sharing profile update. SharingUpdate }
GallerySharingProfileClientUpdateResponse contains the response from method GallerySharingProfileClient.BeginUpdate.
type GalleryTargetExtendedLocation ¶
type GalleryTargetExtendedLocation struct { // Optional. Allows users to provide customer managed keys for encrypting the OS and data disks in the gallery artifact. Encryption *EncryptionImages // The name of the extended location. ExtendedLocation *GalleryExtendedLocation // The number of replicas of the Image Version to be created per extended location. This property is updatable. ExtendedLocationReplicaCount *int32 // The name of the region. Name *string // Specifies the storage account type to be used to store the image. This property is not updatable. StorageAccountType *EdgeZoneStorageAccountType }
func (GalleryTargetExtendedLocation) MarshalJSON ¶
func (g GalleryTargetExtendedLocation) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type GalleryTargetExtendedLocation.
func (*GalleryTargetExtendedLocation) UnmarshalJSON ¶
func (g *GalleryTargetExtendedLocation) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type GalleryTargetExtendedLocation.
type GalleryUpdate ¶
type GalleryUpdate struct { // Describes the properties of a Shared Image Gallery. Properties *GalleryProperties // Resource tags Tags map[string]*string // READ-ONLY; Resource Id ID *string // READ-ONLY; Resource name Name *string // READ-ONLY; Resource type Type *string }
GalleryUpdate - Specifies information about the Shared Image Gallery that you want to update.
func (GalleryUpdate) MarshalJSON ¶
func (g GalleryUpdate) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type GalleryUpdate.
func (*GalleryUpdate) UnmarshalJSON ¶
func (g *GalleryUpdate) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type GalleryUpdate.
type GrantAccessData ¶
type GrantAccessData struct { // REQUIRED Access *AccessLevel // REQUIRED; Time duration in seconds until the SAS access expires. DurationInSeconds *int32 // Used to specify the file format when making request for SAS on a VHDX file format snapshot FileFormat *FileFormat // Set this flag to true to get additional SAS for VM guest state GetSecureVMGuestStateSAS *bool }
GrantAccessData - Data used for requesting a SAS.
func (GrantAccessData) MarshalJSON ¶
func (g GrantAccessData) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type GrantAccessData.
func (*GrantAccessData) UnmarshalJSON ¶
func (g *GrantAccessData) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type GrantAccessData.
type HardwareProfile ¶
type HardwareProfile struct { // Specifies the size of the virtual machine. The enum data type is currently deprecated and will be removed by December 23rd // 2023. The recommended way to get the list of available sizes is using these // APIs: List all available virtual machine sizes in an availability set [https://docs.microsoft.com/rest/api/compute/availabilitysets/listavailablesizes], // List all available virtual machine sizes in a // region [https://docs.microsoft.com/rest/api/compute/resourceskus/list], List all available virtual machine sizes for resizing // [https://docs.microsoft.com/rest/api/compute/virtualmachines/listavailablesizes]. For more information about virtual machine // sizes, see Sizes for virtual machines // [https://docs.microsoft.com/azure/virtual-machines/sizes]. The available VM sizes depend on region and availability set. VMSize *VirtualMachineSizeTypes // Specifies the properties for customizing the size of the virtual machine. Minimum api-version: 2021-07-01. This feature // is still in preview mode and is not supported for VirtualMachineScaleSet. Please // follow the instructions in VM Customization [https://aka.ms/vmcustomization] for more details. VMSizeProperties *VMSizeProperties }
HardwareProfile - Specifies the hardware settings for the virtual machine.
func (HardwareProfile) MarshalJSON ¶
func (h HardwareProfile) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type HardwareProfile.
func (*HardwareProfile) UnmarshalJSON ¶
func (h *HardwareProfile) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type HardwareProfile.
type HostCaching ¶
type HostCaching string
HostCaching - The host caching of the disk. Valid values are 'None', 'ReadOnly', and 'ReadWrite'
const ( HostCachingNone HostCaching = "None" HostCachingReadOnly HostCaching = "ReadOnly" HostCachingReadWrite HostCaching = "ReadWrite" )
func PossibleHostCachingValues ¶
func PossibleHostCachingValues() []HostCaching
PossibleHostCachingValues returns the possible values for the HostCaching const type.
type HyperVGeneration ¶
type HyperVGeneration string
HyperVGeneration - The hypervisor generation of the Virtual Machine. Applicable to OS disks only.
const ( HyperVGenerationV1 HyperVGeneration = "V1" HyperVGenerationV2 HyperVGeneration = "V2" )
func PossibleHyperVGenerationValues ¶
func PossibleHyperVGenerationValues() []HyperVGeneration
PossibleHyperVGenerationValues returns the possible values for the HyperVGeneration const type.
type HyperVGenerationType ¶
type HyperVGenerationType string
HyperVGenerationType - Specifies the HyperVGeneration Type associated with a resource
const ( HyperVGenerationTypeV1 HyperVGenerationType = "V1" HyperVGenerationTypeV2 HyperVGenerationType = "V2" )
func PossibleHyperVGenerationTypeValues ¶
func PossibleHyperVGenerationTypeValues() []HyperVGenerationType
PossibleHyperVGenerationTypeValues returns the possible values for the HyperVGenerationType const type.
type HyperVGenerationTypes ¶
type HyperVGenerationTypes string
HyperVGenerationTypes - Specifies the HyperVGeneration Type
const ( HyperVGenerationTypesV1 HyperVGenerationTypes = "V1" HyperVGenerationTypesV2 HyperVGenerationTypes = "V2" )
func PossibleHyperVGenerationTypesValues ¶
func PossibleHyperVGenerationTypesValues() []HyperVGenerationTypes
PossibleHyperVGenerationTypesValues returns the possible values for the HyperVGenerationTypes const type.
type IPVersion ¶
type IPVersion string
IPVersion - Available from Api-Version 2017-03-30 onwards, it represents whether the specific ipconfiguration is IPv4 or IPv6. Default is taken as IPv4. Possible values are: 'IPv4' and 'IPv6'.
func PossibleIPVersionValues ¶
func PossibleIPVersionValues() []IPVersion
PossibleIPVersionValues returns the possible values for the IPVersion const type.
type IPVersions ¶
type IPVersions string
IPVersions - Available from Api-Version 2019-07-01 onwards, it represents whether the specific ipconfiguration is IPv4 or IPv6. Default is taken as IPv4. Possible values are: 'IPv4' and 'IPv6'.
const ( IPVersionsIPv4 IPVersions = "IPv4" IPVersionsIPv6 IPVersions = "IPv6" )
func PossibleIPVersionsValues ¶
func PossibleIPVersionsValues() []IPVersions
PossibleIPVersionsValues returns the possible values for the IPVersions const type.
type Image ¶
type Image struct { // REQUIRED; Resource location Location *string // The extended location of the Image. ExtendedLocation *ExtendedLocation // Describes the properties of an Image. Properties *ImageProperties // Resource tags Tags map[string]*string // READ-ONLY; Resource Id ID *string // READ-ONLY; Resource name Name *string // READ-ONLY; Resource type Type *string }
Image - The source user image virtual hard disk. The virtual hard disk will be copied before being attached to the virtual machine. If SourceImage is provided, the destination virtual hard drive must not exist.
func (Image) MarshalJSON ¶
MarshalJSON implements the json.Marshaller interface for type Image.
func (*Image) UnmarshalJSON ¶
UnmarshalJSON implements the json.Unmarshaller interface for type Image.
type ImageDataDisk ¶
type ImageDataDisk struct { // REQUIRED; Specifies the logical unit number of the data disk. This value is used to identify data disks within the VM and // therefore must be unique for each data disk attached to a VM. Lun *int32 // The Virtual Hard Disk. BlobURI *string // Specifies the caching requirements. Possible values are: None, ReadOnly, ReadWrite. The default values are: None for Standard // storage. ReadOnly for Premium storage. Caching *CachingTypes // Specifies the customer managed disk encryption set resource id for the managed image disk. DiskEncryptionSet *DiskEncryptionSetParameters // Specifies the size of empty data disks in gigabytes. This element can be used to overwrite the name of the disk in a virtual // machine image. This value cannot be larger than 1023 GB. DiskSizeGB *int32 // The managedDisk. ManagedDisk *SubResource // The snapshot. Snapshot *SubResource // Specifies the storage account type for the managed disk. NOTE: UltraSSD_LRS can only be used with data disks, it cannot // be used with OS Disk. StorageAccountType *StorageAccountTypes }
ImageDataDisk - Describes a data disk.
func (ImageDataDisk) MarshalJSON ¶
func (i ImageDataDisk) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type ImageDataDisk.
func (*ImageDataDisk) UnmarshalJSON ¶
func (i *ImageDataDisk) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type ImageDataDisk.
type ImageDeprecationStatus ¶
type ImageDeprecationStatus struct { // Describes the alternative option specified by the Publisher for this image when this image is deprecated. AlternativeOption *AlternativeOption // Describes the state of the image. ImageState *ImageState // The time, in future, at which this image will be marked as deprecated. This scheduled time is chosen by the Publisher. ScheduledDeprecationTime *time.Time }
ImageDeprecationStatus - Describes image deprecation status properties on the image.
func (ImageDeprecationStatus) MarshalJSON ¶
func (i ImageDeprecationStatus) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type ImageDeprecationStatus.
func (*ImageDeprecationStatus) UnmarshalJSON ¶
func (i *ImageDeprecationStatus) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type ImageDeprecationStatus.
type ImageDisk ¶
type ImageDisk struct { // The Virtual Hard Disk. BlobURI *string // Specifies the caching requirements. Possible values are: None, ReadOnly, ReadWrite. The default values are: None for Standard // storage. ReadOnly for Premium storage. Caching *CachingTypes // Specifies the customer managed disk encryption set resource id for the managed image disk. DiskEncryptionSet *DiskEncryptionSetParameters // Specifies the size of empty data disks in gigabytes. This element can be used to overwrite the name of the disk in a virtual // machine image. This value cannot be larger than 1023 GB. DiskSizeGB *int32 // The managedDisk. ManagedDisk *SubResource // The snapshot. Snapshot *SubResource // Specifies the storage account type for the managed disk. NOTE: UltraSSD_LRS can only be used with data disks, it cannot // be used with OS Disk. StorageAccountType *StorageAccountTypes }
ImageDisk - Describes a image disk.
func (ImageDisk) MarshalJSON ¶
MarshalJSON implements the json.Marshaller interface for type ImageDisk.
func (*ImageDisk) UnmarshalJSON ¶
UnmarshalJSON implements the json.Unmarshaller interface for type ImageDisk.
type ImageDiskReference ¶
type ImageDiskReference struct { // A relative uri containing a community Azure Compute Gallery image reference. CommunityGalleryImageID *string // A relative uri containing either a Platform Image Repository, user image, or Azure Compute Gallery image reference. ID *string // If the disk is created from an image's data disk, this is an index that indicates which of the data disks in the image // to use. For OS disks, this field is null. Lun *int32 SharedGalleryImageID *string }
ImageDiskReference - The source image used for creating the disk.
func (ImageDiskReference) MarshalJSON ¶
func (i ImageDiskReference) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type ImageDiskReference.
func (*ImageDiskReference) UnmarshalJSON ¶
func (i *ImageDiskReference) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type ImageDiskReference.
type ImageListResult ¶
type ImageListResult struct { // REQUIRED; The list of Images. Value []*Image // The uri to fetch the next page of Images. Call ListNext() with this to fetch the next page of Images. NextLink *string }
ImageListResult - The List Image operation response.
func (ImageListResult) MarshalJSON ¶
func (i ImageListResult) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type ImageListResult.
func (*ImageListResult) UnmarshalJSON ¶
func (i *ImageListResult) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type ImageListResult.
type ImageOSDisk ¶
type ImageOSDisk struct { // REQUIRED; The OS State. For managed images, use Generalized. OSState *OperatingSystemStateTypes // REQUIRED; This property allows you to specify the type of the OS that is included in the disk if creating a VM from a custom // image. Possible values are: Windows, Linux. OSType *OperatingSystemTypes // The Virtual Hard Disk. BlobURI *string // Specifies the caching requirements. Possible values are: None, ReadOnly, ReadWrite. The default values are: None for Standard // storage. ReadOnly for Premium storage. Caching *CachingTypes // Specifies the customer managed disk encryption set resource id for the managed image disk. DiskEncryptionSet *DiskEncryptionSetParameters // Specifies the size of empty data disks in gigabytes. This element can be used to overwrite the name of the disk in a virtual // machine image. This value cannot be larger than 1023 GB. DiskSizeGB *int32 // The managedDisk. ManagedDisk *SubResource // The snapshot. Snapshot *SubResource // Specifies the storage account type for the managed disk. NOTE: UltraSSD_LRS can only be used with data disks, it cannot // be used with OS Disk. StorageAccountType *StorageAccountTypes }
ImageOSDisk - Describes an Operating System disk.
func (ImageOSDisk) MarshalJSON ¶
func (i ImageOSDisk) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type ImageOSDisk.
func (*ImageOSDisk) UnmarshalJSON ¶
func (i *ImageOSDisk) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type ImageOSDisk.
type ImageProperties ¶
type ImageProperties struct { // Specifies the HyperVGenerationType of the VirtualMachine created from the image. From API Version 2019-03-01 if the image // source is a blob, then we need the user to specify the value, if the source is // managed resource like disk or snapshot, we may require the user to specify the property if we cannot deduce it from the // source managed resource. HyperVGeneration *HyperVGenerationTypes // The source virtual machine from which Image is created. SourceVirtualMachine *SubResource // Specifies the storage settings for the virtual machine disks. StorageProfile *ImageStorageProfile // READ-ONLY; The provisioning state. ProvisioningState *string }
ImageProperties - Describes the properties of an Image.
func (ImageProperties) MarshalJSON ¶
func (i ImageProperties) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type ImageProperties.
func (*ImageProperties) UnmarshalJSON ¶
func (i *ImageProperties) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type ImageProperties.
type ImagePurchasePlan ¶
type ImagePurchasePlan struct { // The plan ID. Name *string // The product ID. Product *string // The publisher ID. Publisher *string }
ImagePurchasePlan - Describes the gallery image definition purchase plan. This is used by marketplace images.
func (ImagePurchasePlan) MarshalJSON ¶
func (i ImagePurchasePlan) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type ImagePurchasePlan.
func (*ImagePurchasePlan) UnmarshalJSON ¶
func (i *ImagePurchasePlan) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type ImagePurchasePlan.
type ImageReference ¶
type ImageReference struct { // Specified the community gallery image unique id for vm deployment. This can be fetched from community gallery image GET // call. CommunityGalleryImageID *string // Resource Id ID *string // Specifies the offer of the platform image or marketplace image used to create the virtual machine. Offer *string // The image publisher. Publisher *string // The image SKU. SKU *string SharedGalleryImageID *string // Specifies the version of the platform image or marketplace image used to create the virtual machine. The allowed formats // are Major.Minor.Build or 'latest'. Major, Minor, and Build are decimal numbers. // Specify 'latest' to use the latest version of an image available at deploy time. Even if you use 'latest', the VM image // will not automatically update after deploy time even if a new version becomes // available. Please do not use field 'version' for gallery image deployment, gallery image should always use 'id' field for // deployment, to use 'latest' version of gallery image, just set // '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/galleries/{galleryName}/images/{imageName}' // in the 'id' field without version input. Version *string // READ-ONLY; Specifies in decimal numbers, the version of platform image or marketplace image used to create the virtual // machine. This readonly field differs from 'version', only if the value specified in // 'version' field is 'latest'. ExactVersion *string }
ImageReference - Specifies information about the image to use. You can specify information about platform images, marketplace images, or virtual machine images. This element is required when you want to use a platform image, marketplace image, or virtual machine image, but is not used in other creation operations. NOTE: Image reference publisher and offer can only be set when you create the scale set.
func (ImageReference) MarshalJSON ¶
func (i ImageReference) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type ImageReference.
func (*ImageReference) UnmarshalJSON ¶
func (i *ImageReference) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type ImageReference.
type ImageState ¶
type ImageState string
ImageState - Describes the state of the image.
const ( ImageStateActive ImageState = "Active" ImageStateDeprecated ImageState = "Deprecated" ImageStateScheduledForDeprecation ImageState = "ScheduledForDeprecation" )
func PossibleImageStateValues ¶
func PossibleImageStateValues() []ImageState
PossibleImageStateValues returns the possible values for the ImageState const type.
type ImageStorageProfile ¶
type ImageStorageProfile struct { // Specifies the parameters that are used to add a data disk to a virtual machine. // For more information about disks, see About disks and VHDs for Azure virtual machines [https://docs.microsoft.com/azure/virtual-machines/managed-disks-overview]. DataDisks []*ImageDataDisk // Specifies information about the operating system disk used by the virtual machine. // For more information about disks, see About disks and VHDs for Azure virtual machines [https://docs.microsoft.com/azure/virtual-machines/managed-disks-overview]. OSDisk *ImageOSDisk // Specifies whether an image is zone resilient or not. Default is false. Zone resilient images can be created only in regions // that provide Zone Redundant Storage (ZRS). ZoneResilient *bool }
ImageStorageProfile - Describes a storage profile.
func (ImageStorageProfile) MarshalJSON ¶
func (i ImageStorageProfile) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type ImageStorageProfile.
func (*ImageStorageProfile) UnmarshalJSON ¶
func (i *ImageStorageProfile) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type ImageStorageProfile.
type ImageUpdate ¶
type ImageUpdate struct { // Describes the properties of an Image. Properties *ImageProperties // Resource tags Tags map[string]*string }
ImageUpdate - The source user image virtual hard disk. Only tags may be updated.
func (ImageUpdate) MarshalJSON ¶
func (i ImageUpdate) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type ImageUpdate.
func (*ImageUpdate) UnmarshalJSON ¶
func (i *ImageUpdate) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type ImageUpdate.
type ImageVersionSecurityProfile ¶ added in v5.4.0
type ImageVersionSecurityProfile struct { // Contains UEFI settings for the image version. UefiSettings *GalleryImageVersionUefiSettings }
ImageVersionSecurityProfile - The security profile of a gallery image version
func (ImageVersionSecurityProfile) MarshalJSON ¶ added in v5.4.0
func (i ImageVersionSecurityProfile) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type ImageVersionSecurityProfile.
func (*ImageVersionSecurityProfile) UnmarshalJSON ¶ added in v5.4.0
func (i *ImageVersionSecurityProfile) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type ImageVersionSecurityProfile.
type ImagesClient ¶
type ImagesClient struct {
// contains filtered or unexported fields
}
ImagesClient contains the methods for the Images group. Don't use this type directly, use NewImagesClient() instead.
func NewImagesClient ¶
func NewImagesClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*ImagesClient, error)
NewImagesClient creates a new instance of ImagesClient 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 (*ImagesClient) BeginCreateOrUpdate ¶
func (client *ImagesClient) BeginCreateOrUpdate(ctx context.Context, resourceGroupName string, imageName string, parameters Image, options *ImagesClientBeginCreateOrUpdateOptions) (*runtime.Poller[ImagesClientCreateOrUpdateResponse], error)
BeginCreateOrUpdate - Create or update an image. If the operation fails it returns an *azcore.ResponseError type.
Generated from API version 2024-03-01
- resourceGroupName - The name of the resource group.
- imageName - The name of the image.
- parameters - Parameters supplied to the Create Image operation.
- options - ImagesClientBeginCreateOrUpdateOptions contains the optional parameters for the ImagesClient.BeginCreateOrUpdate method.
Example (CreateAVirtualMachineImageFromABlob) ¶
Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/92de53a5f1e0e03c94b40475d2135d97148ed014/specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-03-01/examples/imageExamples/Image_CreateFromABlob.json
cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() clientFactory, err := armcompute.NewClientFactory("<subscription-id>", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } poller, err := clientFactory.NewImagesClient().BeginCreateOrUpdate(ctx, "myResourceGroup", "myImage", armcompute.Image{ Location: to.Ptr("West US"), Properties: &armcompute.ImageProperties{ StorageProfile: &armcompute.ImageStorageProfile{ OSDisk: &armcompute.ImageOSDisk{ BlobURI: to.Ptr("https://mystorageaccount.blob.core.windows.net/osimages/osimage.vhd"), OSState: to.Ptr(armcompute.OperatingSystemStateTypesGeneralized), OSType: to.Ptr(armcompute.OperatingSystemTypesLinux), }, ZoneResilient: to.Ptr(true), }, }, }, nil) if err != nil { log.Fatalf("failed to finish the request: %v", err) } res, err := poller.PollUntilDone(ctx, nil) if err != nil { log.Fatalf("failed to pull the result: %v", err) } // You could use response here. We use blank identifier for just demo purposes. _ = res // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. // res.Image = armcompute.Image{ // Name: to.Ptr("myImage"), // Type: to.Ptr("Microsoft.Compute/images"), // ID: to.Ptr("/subscriptions/{subscription-id}/resourceGroups/disk/providers/Microsoft.Compute/images/myImage"), // Location: to.Ptr("westus"), // Properties: &armcompute.ImageProperties{ // ProvisioningState: to.Ptr("Succeeded"), // StorageProfile: &armcompute.ImageStorageProfile{ // DataDisks: []*armcompute.ImageDataDisk{ // }, // OSDisk: &armcompute.ImageOSDisk{ // BlobURI: to.Ptr("https://mystorageaccount.blob.core.windows.net/osimages/osimage.vhd"), // Caching: to.Ptr(armcompute.CachingTypesReadWrite), // OSState: to.Ptr(armcompute.OperatingSystemStateTypesGeneralized), // OSType: to.Ptr(armcompute.OperatingSystemTypesLinux), // }, // ZoneResilient: to.Ptr(true), // }, // }, // }
Output:
Example (CreateAVirtualMachineImageFromABlobWithDiskEncryptionSetResource) ¶
Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/92de53a5f1e0e03c94b40475d2135d97148ed014/specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-03-01/examples/imageExamples/Image_CreateFromABlobWithDiskEncryptionSet.json
cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() clientFactory, err := armcompute.NewClientFactory("<subscription-id>", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } poller, err := clientFactory.NewImagesClient().BeginCreateOrUpdate(ctx, "myResourceGroup", "myImage", armcompute.Image{ Location: to.Ptr("West US"), Properties: &armcompute.ImageProperties{ StorageProfile: &armcompute.ImageStorageProfile{ OSDisk: &armcompute.ImageOSDisk{ BlobURI: to.Ptr("https://mystorageaccount.blob.core.windows.net/osimages/osimage.vhd"), DiskEncryptionSet: &armcompute.DiskEncryptionSetParameters{ ID: to.Ptr("/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/diskEncryptionSets/{existing-diskEncryptionSet-name}"), }, OSState: to.Ptr(armcompute.OperatingSystemStateTypesGeneralized), OSType: to.Ptr(armcompute.OperatingSystemTypesLinux), }, }, }, }, nil) if err != nil { log.Fatalf("failed to finish the request: %v", err) } res, err := poller.PollUntilDone(ctx, nil) if err != nil { log.Fatalf("failed to pull the result: %v", err) } // You could use response here. We use blank identifier for just demo purposes. _ = res // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. // res.Image = armcompute.Image{ // Name: to.Ptr("myImage"), // Type: to.Ptr("Microsoft.Compute/images"), // ID: to.Ptr("/subscriptions/{subscription-id}/resourceGroups/disk/providers/Microsoft.Compute/images/myImage"), // Location: to.Ptr("westus"), // Properties: &armcompute.ImageProperties{ // ProvisioningState: to.Ptr("Succeeded"), // StorageProfile: &armcompute.ImageStorageProfile{ // DataDisks: []*armcompute.ImageDataDisk{ // }, // OSDisk: &armcompute.ImageOSDisk{ // BlobURI: to.Ptr("https://mystorageaccount.blob.core.windows.net/osimages/osimage.vhd"), // Caching: to.Ptr(armcompute.CachingTypesReadWrite), // DiskEncryptionSet: &armcompute.DiskEncryptionSetParameters{ // ID: to.Ptr("/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/diskEncryptionSets/{existing-diskEncryptionSet-name}"), // }, // OSState: to.Ptr(armcompute.OperatingSystemStateTypesGeneralized), // OSType: to.Ptr(armcompute.OperatingSystemTypesLinux), // }, // }, // }, // }
Output:
Example (CreateAVirtualMachineImageFromAManagedDisk) ¶
Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/92de53a5f1e0e03c94b40475d2135d97148ed014/specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-03-01/examples/imageExamples/Image_CreateFromAManagedDisk.json
cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() clientFactory, err := armcompute.NewClientFactory("<subscription-id>", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } poller, err := clientFactory.NewImagesClient().BeginCreateOrUpdate(ctx, "myResourceGroup", "myImage", armcompute.Image{ Location: to.Ptr("West US"), Properties: &armcompute.ImageProperties{ StorageProfile: &armcompute.ImageStorageProfile{ OSDisk: &armcompute.ImageOSDisk{ ManagedDisk: &armcompute.SubResource{ ID: to.Ptr("subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/disks/myManagedDisk"), }, OSState: to.Ptr(armcompute.OperatingSystemStateTypesGeneralized), OSType: to.Ptr(armcompute.OperatingSystemTypesLinux), }, ZoneResilient: to.Ptr(true), }, }, }, nil) if err != nil { log.Fatalf("failed to finish the request: %v", err) } res, err := poller.PollUntilDone(ctx, nil) if err != nil { log.Fatalf("failed to pull the result: %v", err) } // You could use response here. We use blank identifier for just demo purposes. _ = res // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. // res.Image = armcompute.Image{ // Name: to.Ptr("myImage"), // Type: to.Ptr("Microsoft.Compute/images"), // ID: to.Ptr("/subscriptions/{subscription-id}/resourceGroups/disk/providers/Microsoft.Compute/images/myImage"), // Location: to.Ptr("westus"), // Properties: &armcompute.ImageProperties{ // ProvisioningState: to.Ptr("Succeeded"), // StorageProfile: &armcompute.ImageStorageProfile{ // DataDisks: []*armcompute.ImageDataDisk{ // }, // OSDisk: &armcompute.ImageOSDisk{ // Caching: to.Ptr(armcompute.CachingTypesReadWrite), // ManagedDisk: &armcompute.SubResource{ // ID: to.Ptr("subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/disks/myManagedDisk"), // }, // OSState: to.Ptr(armcompute.OperatingSystemStateTypesGeneralized), // OSType: to.Ptr(armcompute.OperatingSystemTypesLinux), // }, // ZoneResilient: to.Ptr(true), // }, // }, // }
Output:
Example (CreateAVirtualMachineImageFromAManagedDiskWithDiskEncryptionSetResource) ¶
Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/92de53a5f1e0e03c94b40475d2135d97148ed014/specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-03-01/examples/imageExamples/Image_CreateFromAManagedDiskWithDiskEncryptionSet.json
cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() clientFactory, err := armcompute.NewClientFactory("<subscription-id>", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } poller, err := clientFactory.NewImagesClient().BeginCreateOrUpdate(ctx, "myResourceGroup", "myImage", armcompute.Image{ Location: to.Ptr("West US"), Properties: &armcompute.ImageProperties{ StorageProfile: &armcompute.ImageStorageProfile{ OSDisk: &armcompute.ImageOSDisk{ DiskEncryptionSet: &armcompute.DiskEncryptionSetParameters{ ID: to.Ptr("/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/diskEncryptionSets/{existing-diskEncryptionSet-name}"), }, Snapshot: &armcompute.SubResource{ ID: to.Ptr("subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/snapshots/mySnapshot"), }, OSState: to.Ptr(armcompute.OperatingSystemStateTypesGeneralized), OSType: to.Ptr(armcompute.OperatingSystemTypesLinux), }, }, }, }, nil) if err != nil { log.Fatalf("failed to finish the request: %v", err) } res, err := poller.PollUntilDone(ctx, nil) if err != nil { log.Fatalf("failed to pull the result: %v", err) } // You could use response here. We use blank identifier for just demo purposes. _ = res // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. // res.Image = armcompute.Image{ // Name: to.Ptr("myImage"), // Type: to.Ptr("Microsoft.Compute/images"), // ID: to.Ptr("/subscriptions/{subscription-id}/resourceGroups/disk/providers/Microsoft.Compute/images/myImage"), // Location: to.Ptr("westus"), // Properties: &armcompute.ImageProperties{ // ProvisioningState: to.Ptr("Succeeded"), // StorageProfile: &armcompute.ImageStorageProfile{ // DataDisks: []*armcompute.ImageDataDisk{ // }, // OSDisk: &armcompute.ImageOSDisk{ // Caching: to.Ptr(armcompute.CachingTypesReadWrite), // DiskEncryptionSet: &armcompute.DiskEncryptionSetParameters{ // ID: to.Ptr("/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/diskEncryptionSets/{existing-diskEncryptionSet-name}"), // }, // Snapshot: &armcompute.SubResource{ // ID: to.Ptr("subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/snapshots/mySnapshot"), // }, // OSState: to.Ptr(armcompute.OperatingSystemStateTypesGeneralized), // OSType: to.Ptr(armcompute.OperatingSystemTypesLinux), // }, // }, // }, // }
Output:
Example (CreateAVirtualMachineImageFromASnapshot) ¶
Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/92de53a5f1e0e03c94b40475d2135d97148ed014/specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-03-01/examples/imageExamples/Image_CreateFromASnapshot.json
cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() clientFactory, err := armcompute.NewClientFactory("<subscription-id>", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } poller, err := clientFactory.NewImagesClient().BeginCreateOrUpdate(ctx, "myResourceGroup", "myImage", armcompute.Image{ Location: to.Ptr("West US"), Properties: &armcompute.ImageProperties{ StorageProfile: &armcompute.ImageStorageProfile{ OSDisk: &armcompute.ImageOSDisk{ Snapshot: &armcompute.SubResource{ ID: to.Ptr("subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/snapshots/mySnapshot"), }, OSState: to.Ptr(armcompute.OperatingSystemStateTypesGeneralized), OSType: to.Ptr(armcompute.OperatingSystemTypesLinux), }, ZoneResilient: to.Ptr(false), }, }, }, nil) if err != nil { log.Fatalf("failed to finish the request: %v", err) } res, err := poller.PollUntilDone(ctx, nil) if err != nil { log.Fatalf("failed to pull the result: %v", err) } // You could use response here. We use blank identifier for just demo purposes. _ = res // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. // res.Image = armcompute.Image{ // Name: to.Ptr("myImage"), // Type: to.Ptr("Microsoft.Compute/images"), // ID: to.Ptr("/subscriptions/{subscription-id}/resourceGroups/disk/providers/Microsoft.Compute/images/myImage"), // Location: to.Ptr("westus"), // Properties: &armcompute.ImageProperties{ // ProvisioningState: to.Ptr("Succeeded"), // StorageProfile: &armcompute.ImageStorageProfile{ // DataDisks: []*armcompute.ImageDataDisk{ // }, // OSDisk: &armcompute.ImageOSDisk{ // Caching: to.Ptr(armcompute.CachingTypesReadWrite), // Snapshot: &armcompute.SubResource{ // ID: to.Ptr("subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/snapshots/mySnapshot"), // }, // OSState: to.Ptr(armcompute.OperatingSystemStateTypesGeneralized), // OSType: to.Ptr(armcompute.OperatingSystemTypesLinux), // }, // ZoneResilient: to.Ptr(false), // }, // }, // }
Output:
Example (CreateAVirtualMachineImageFromASnapshotWithDiskEncryptionSetResource) ¶
Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/92de53a5f1e0e03c94b40475d2135d97148ed014/specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-03-01/examples/imageExamples/Image_CreateFromASnapshotWithDiskEncryptionSet.json
cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() clientFactory, err := armcompute.NewClientFactory("<subscription-id>", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } poller, err := clientFactory.NewImagesClient().BeginCreateOrUpdate(ctx, "myResourceGroup", "myImage", armcompute.Image{ Location: to.Ptr("West US"), Properties: &armcompute.ImageProperties{ StorageProfile: &armcompute.ImageStorageProfile{ OSDisk: &armcompute.ImageOSDisk{ DiskEncryptionSet: &armcompute.DiskEncryptionSetParameters{ ID: to.Ptr("/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/diskEncryptionSets/{existing-diskEncryptionSet-name}"), }, ManagedDisk: &armcompute.SubResource{ ID: to.Ptr("subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/disks/myManagedDisk"), }, OSState: to.Ptr(armcompute.OperatingSystemStateTypesGeneralized), OSType: to.Ptr(armcompute.OperatingSystemTypesLinux), }, }, }, }, nil) if err != nil { log.Fatalf("failed to finish the request: %v", err) } res, err := poller.PollUntilDone(ctx, nil) if err != nil { log.Fatalf("failed to pull the result: %v", err) } // You could use response here. We use blank identifier for just demo purposes. _ = res // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. // res.Image = armcompute.Image{ // Name: to.Ptr("myImage"), // Type: to.Ptr("Microsoft.Compute/images"), // ID: to.Ptr("/subscriptions/{subscription-id}/resourceGroups/disk/providers/Microsoft.Compute/images/myImage"), // Location: to.Ptr("westus"), // Properties: &armcompute.ImageProperties{ // ProvisioningState: to.Ptr("Succeeded"), // StorageProfile: &armcompute.ImageStorageProfile{ // DataDisks: []*armcompute.ImageDataDisk{ // }, // OSDisk: &armcompute.ImageOSDisk{ // Caching: to.Ptr(armcompute.CachingTypesReadWrite), // DiskEncryptionSet: &armcompute.DiskEncryptionSetParameters{ // ID: to.Ptr("/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/diskEncryptionSets/{existing-diskEncryptionSet-name}"), // }, // ManagedDisk: &armcompute.SubResource{ // ID: to.Ptr("subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/disks/myManagedDisk"), // }, // OSState: to.Ptr(armcompute.OperatingSystemStateTypesGeneralized), // OSType: to.Ptr(armcompute.OperatingSystemTypesLinux), // }, // }, // }, // }
Output:
Example (CreateAVirtualMachineImageFromAnExistingVirtualMachine) ¶
Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/92de53a5f1e0e03c94b40475d2135d97148ed014/specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-03-01/examples/imageExamples/Image_CreateFromAVM.json
cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() clientFactory, err := armcompute.NewClientFactory("<subscription-id>", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } poller, err := clientFactory.NewImagesClient().BeginCreateOrUpdate(ctx, "myResourceGroup", "myImage", armcompute.Image{ Location: to.Ptr("West US"), Properties: &armcompute.ImageProperties{ SourceVirtualMachine: &armcompute.SubResource{ ID: to.Ptr("/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/virtualMachines/myVM"), }, }, }, nil) if err != nil { log.Fatalf("failed to finish the request: %v", err) } res, err := poller.PollUntilDone(ctx, nil) if err != nil { log.Fatalf("failed to pull the result: %v", err) } // You could use response here. We use blank identifier for just demo purposes. _ = res // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. // res.Image = armcompute.Image{ // Name: to.Ptr("myImage"), // Type: to.Ptr("Microsoft.Compute/images"), // ID: to.Ptr("/subscriptions/{subscription-id}/resourceGroups/disk/providers/Microsoft.Compute/images/myImage"), // Location: to.Ptr("westus"), // Properties: &armcompute.ImageProperties{ // ProvisioningState: to.Ptr("Succeeded"), // SourceVirtualMachine: &armcompute.SubResource{ // ID: to.Ptr("/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/virtualMachines/myVM"), // }, // StorageProfile: &armcompute.ImageStorageProfile{ // DataDisks: []*armcompute.ImageDataDisk{ // }, // OSDisk: &armcompute.ImageOSDisk{ // Caching: to.Ptr(armcompute.CachingTypesReadWrite), // ManagedDisk: &armcompute.SubResource{ // ID: to.Ptr("/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/disks/myVM_OsDisk_1_6dc293b7d811433196903acf92665022"), // }, // OSState: to.Ptr(armcompute.OperatingSystemStateTypesGeneralized), // OSType: to.Ptr(armcompute.OperatingSystemTypesLinux), // }, // ZoneResilient: to.Ptr(false), // }, // }, // }
Output:
Example (CreateAVirtualMachineImageThatIncludesADataDiskFromABlob) ¶
Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/92de53a5f1e0e03c94b40475d2135d97148ed014/specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-03-01/examples/imageExamples/Image_Create_DataDiskFromABlobIncluded.json
cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() clientFactory, err := armcompute.NewClientFactory("<subscription-id>", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } poller, err := clientFactory.NewImagesClient().BeginCreateOrUpdate(ctx, "myResourceGroup", "myImage", armcompute.Image{ Location: to.Ptr("West US"), Properties: &armcompute.ImageProperties{ StorageProfile: &armcompute.ImageStorageProfile{ DataDisks: []*armcompute.ImageDataDisk{ { BlobURI: to.Ptr("https://mystorageaccount.blob.core.windows.net/dataimages/dataimage.vhd"), Lun: to.Ptr[int32](1), }}, OSDisk: &armcompute.ImageOSDisk{ BlobURI: to.Ptr("https://mystorageaccount.blob.core.windows.net/osimages/osimage.vhd"), OSState: to.Ptr(armcompute.OperatingSystemStateTypesGeneralized), OSType: to.Ptr(armcompute.OperatingSystemTypesLinux), }, ZoneResilient: to.Ptr(false), }, }, }, nil) if err != nil { log.Fatalf("failed to finish the request: %v", err) } res, err := poller.PollUntilDone(ctx, nil) if err != nil { log.Fatalf("failed to pull the result: %v", err) } // You could use response here. We use blank identifier for just demo purposes. _ = res // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. // res.Image = armcompute.Image{ // Name: to.Ptr("myImage"), // Type: to.Ptr("Microsoft.Compute/images"), // ID: to.Ptr("/subscriptions/{subscription-id}/resourceGroups/disk/providers/Microsoft.Compute/images/myImage"), // Location: to.Ptr("westus"), // Properties: &armcompute.ImageProperties{ // ProvisioningState: to.Ptr("Succeeded"), // StorageProfile: &armcompute.ImageStorageProfile{ // DataDisks: []*armcompute.ImageDataDisk{ // { // BlobURI: to.Ptr("https://mystorageaccount.blob.core.windows.net/dataimages/dataimage.vhd"), // Lun: to.Ptr[int32](1), // }}, // OSDisk: &armcompute.ImageOSDisk{ // BlobURI: to.Ptr("https://mystorageaccount.blob.core.windows.net/osimages/osimage.vhd"), // Caching: to.Ptr(armcompute.CachingTypesReadWrite), // OSState: to.Ptr(armcompute.OperatingSystemStateTypesGeneralized), // OSType: to.Ptr(armcompute.OperatingSystemTypesLinux), // }, // ZoneResilient: to.Ptr(false), // }, // }, // }
Output:
Example (CreateAVirtualMachineImageThatIncludesADataDiskFromAManagedDisk) ¶
Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/92de53a5f1e0e03c94b40475d2135d97148ed014/specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-03-01/examples/imageExamples/Image_Create_DataDiskFromAManagedDiskIncluded.json
cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() clientFactory, err := armcompute.NewClientFactory("<subscription-id>", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } poller, err := clientFactory.NewImagesClient().BeginCreateOrUpdate(ctx, "myResourceGroup", "myImage", armcompute.Image{ Location: to.Ptr("West US"), Properties: &armcompute.ImageProperties{ StorageProfile: &armcompute.ImageStorageProfile{ DataDisks: []*armcompute.ImageDataDisk{ { ManagedDisk: &armcompute.SubResource{ ID: to.Ptr("subscriptions/{subscriptionId}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/disks/myManagedDisk2"), }, Lun: to.Ptr[int32](1), }}, OSDisk: &armcompute.ImageOSDisk{ ManagedDisk: &armcompute.SubResource{ ID: to.Ptr("subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/disks/myManagedDisk"), }, OSState: to.Ptr(armcompute.OperatingSystemStateTypesGeneralized), OSType: to.Ptr(armcompute.OperatingSystemTypesLinux), }, ZoneResilient: to.Ptr(false), }, }, }, nil) if err != nil { log.Fatalf("failed to finish the request: %v", err) } res, err := poller.PollUntilDone(ctx, nil) if err != nil { log.Fatalf("failed to pull the result: %v", err) } // You could use response here. We use blank identifier for just demo purposes. _ = res // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. // res.Image = armcompute.Image{ // Name: to.Ptr("myImage"), // Type: to.Ptr("Microsoft.Compute/images"), // ID: to.Ptr("/subscriptions/{subscription-id}/resourceGroups/disk/providers/Microsoft.Compute/images/myImage"), // Location: to.Ptr("westus"), // Properties: &armcompute.ImageProperties{ // ProvisioningState: to.Ptr("Succeeded"), // StorageProfile: &armcompute.ImageStorageProfile{ // DataDisks: []*armcompute.ImageDataDisk{ // { // ManagedDisk: &armcompute.SubResource{ // ID: to.Ptr("subscriptions/{subscriptionId}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/disks/myManagedDisk2"), // }, // Lun: to.Ptr[int32](1), // }}, // OSDisk: &armcompute.ImageOSDisk{ // Caching: to.Ptr(armcompute.CachingTypesReadWrite), // ManagedDisk: &armcompute.SubResource{ // ID: to.Ptr("subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/disks/myManagedDisk"), // }, // OSState: to.Ptr(armcompute.OperatingSystemStateTypesGeneralized), // OSType: to.Ptr(armcompute.OperatingSystemTypesLinux), // }, // ZoneResilient: to.Ptr(false), // }, // }, // }
Output:
Example (CreateAVirtualMachineImageThatIncludesADataDiskFromASnapshot) ¶
Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/92de53a5f1e0e03c94b40475d2135d97148ed014/specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-03-01/examples/imageExamples/Image_Create_DataDiskFromASnapshotIncluded.json
cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() clientFactory, err := armcompute.NewClientFactory("<subscription-id>", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } poller, err := clientFactory.NewImagesClient().BeginCreateOrUpdate(ctx, "myResourceGroup", "myImage", armcompute.Image{ Location: to.Ptr("West US"), Properties: &armcompute.ImageProperties{ StorageProfile: &armcompute.ImageStorageProfile{ DataDisks: []*armcompute.ImageDataDisk{ { Snapshot: &armcompute.SubResource{ ID: to.Ptr("subscriptions/{subscriptionId}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/snapshots/mySnapshot2"), }, Lun: to.Ptr[int32](1), }}, OSDisk: &armcompute.ImageOSDisk{ Snapshot: &armcompute.SubResource{ ID: to.Ptr("subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/snapshots/mySnapshot"), }, OSState: to.Ptr(armcompute.OperatingSystemStateTypesGeneralized), OSType: to.Ptr(armcompute.OperatingSystemTypesLinux), }, ZoneResilient: to.Ptr(true), }, }, }, nil) if err != nil { log.Fatalf("failed to finish the request: %v", err) } res, err := poller.PollUntilDone(ctx, nil) if err != nil { log.Fatalf("failed to pull the result: %v", err) } // You could use response here. We use blank identifier for just demo purposes. _ = res // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. // res.Image = armcompute.Image{ // Name: to.Ptr("myImage"), // Type: to.Ptr("Microsoft.Compute/images"), // ID: to.Ptr("/subscriptions/{subscription-id}/resourceGroups/disk/providers/Microsoft.Compute/images/myImage"), // Location: to.Ptr("westus"), // Properties: &armcompute.ImageProperties{ // ProvisioningState: to.Ptr("Succeeded"), // StorageProfile: &armcompute.ImageStorageProfile{ // DataDisks: []*armcompute.ImageDataDisk{ // { // Snapshot: &armcompute.SubResource{ // ID: to.Ptr("subscriptions/{subscriptionId}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/snapshots/mySnapshot2"), // }, // Lun: to.Ptr[int32](1), // }}, // OSDisk: &armcompute.ImageOSDisk{ // Caching: to.Ptr(armcompute.CachingTypesReadWrite), // Snapshot: &armcompute.SubResource{ // ID: to.Ptr("subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/snapshots/mySnapshot"), // }, // OSState: to.Ptr(armcompute.OperatingSystemStateTypesGeneralized), // OSType: to.Ptr(armcompute.OperatingSystemTypesLinux), // }, // ZoneResilient: to.Ptr(true), // }, // }, // }
Output:
func (*ImagesClient) BeginDelete ¶
func (client *ImagesClient) BeginDelete(ctx context.Context, resourceGroupName string, imageName string, options *ImagesClientBeginDeleteOptions) (*runtime.Poller[ImagesClientDeleteResponse], error)
BeginDelete - Deletes an Image. If the operation fails it returns an *azcore.ResponseError type.
Generated from API version 2024-03-01
- resourceGroupName - The name of the resource group.
- imageName - The name of the image.
- options - ImagesClientBeginDeleteOptions contains the optional parameters for the ImagesClient.BeginDelete method.
Example (ImageDeleteMaximumSetGen) ¶
Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/92de53a5f1e0e03c94b40475d2135d97148ed014/specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-03-01/examples/imageExamples/Images_Delete_MaximumSet_Gen.json
cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() clientFactory, err := armcompute.NewClientFactory("<subscription-id>", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } poller, err := clientFactory.NewImagesClient().BeginDelete(ctx, "rgcompute", "aaaaaaaaaaaaaaaaaaaaaaaaaaa", nil) if err != nil { log.Fatalf("failed to finish the request: %v", err) } _, err = poller.PollUntilDone(ctx, nil) if err != nil { log.Fatalf("failed to pull the result: %v", err) }
Output:
Example (ImageDeleteMinimumSetGen) ¶
Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/92de53a5f1e0e03c94b40475d2135d97148ed014/specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-03-01/examples/imageExamples/Images_Delete_MinimumSet_Gen.json
cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() clientFactory, err := armcompute.NewClientFactory("<subscription-id>", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } poller, err := clientFactory.NewImagesClient().BeginDelete(ctx, "rgcompute", "aaaaaaaaaaaaaaaaaaaaaaaaaaaa", nil) if err != nil { log.Fatalf("failed to finish the request: %v", err) } _, err = poller.PollUntilDone(ctx, nil) if err != nil { log.Fatalf("failed to pull the result: %v", err) }
Output:
func (*ImagesClient) BeginUpdate ¶
func (client *ImagesClient) BeginUpdate(ctx context.Context, resourceGroupName string, imageName string, parameters ImageUpdate, options *ImagesClientBeginUpdateOptions) (*runtime.Poller[ImagesClientUpdateResponse], error)
BeginUpdate - Update an image. If the operation fails it returns an *azcore.ResponseError type.
Generated from API version 2024-03-01
- resourceGroupName - The name of the resource group.
- imageName - The name of the image.
- parameters - Parameters supplied to the Update Image operation.
- options - ImagesClientBeginUpdateOptions contains the optional parameters for the ImagesClient.BeginUpdate method.
Example ¶
Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/92de53a5f1e0e03c94b40475d2135d97148ed014/specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-03-01/examples/imageExamples/Image_Update.json
cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() clientFactory, err := armcompute.NewClientFactory("<subscription-id>", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } poller, err := clientFactory.NewImagesClient().BeginUpdate(ctx, "myResourceGroup", "myImage", armcompute.ImageUpdate{ Tags: map[string]*string{ "department": to.Ptr("HR"), }, Properties: &armcompute.ImageProperties{ HyperVGeneration: to.Ptr(armcompute.HyperVGenerationTypesV1), SourceVirtualMachine: &armcompute.SubResource{ ID: to.Ptr("/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/virtualMachines/myVM"), }, }, }, nil) if err != nil { log.Fatalf("failed to finish the request: %v", err) } res, err := poller.PollUntilDone(ctx, nil) if err != nil { log.Fatalf("failed to pull the result: %v", err) } // You could use response here. We use blank identifier for just demo purposes. _ = res // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. // res.Image = armcompute.Image{ // Name: to.Ptr("myImage"), // Type: to.Ptr("Microsoft.Compute/images"), // ID: to.Ptr("/subscriptions/{subscriptionId}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/images/myImage"), // Location: to.Ptr("West US"), // Tags: map[string]*string{ // "department": to.Ptr("HR"), // }, // Properties: &armcompute.ImageProperties{ // ProvisioningState: to.Ptr("Succeeded"), // StorageProfile: &armcompute.ImageStorageProfile{ // DataDisks: []*armcompute.ImageDataDisk{ // { // BlobURI: to.Ptr("https://mystorageaccount.blob.core.windows.net/dataimages/dataimage.vhd"), // ManagedDisk: &armcompute.SubResource{ // ID: to.Ptr("subscriptions/{subscriptionId}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/disks/myManagedDisk2"), // }, // Snapshot: &armcompute.SubResource{ // ID: to.Ptr("subscriptions/{subscriptionId}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/snapshots/mySnapshot2"), // }, // StorageAccountType: to.Ptr(armcompute.StorageAccountTypesStandardLRS), // Lun: to.Ptr[int32](1), // }}, // OSDisk: &armcompute.ImageOSDisk{ // BlobURI: to.Ptr("https://mystorageaccount.blob.core.windows.net/osimages/osimage.vhd"), // DiskSizeGB: to.Ptr[int32](20), // ManagedDisk: &armcompute.SubResource{ // ID: to.Ptr("subscriptions/{subscriptionId}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/disks/myManagedDisk1"), // }, // Snapshot: &armcompute.SubResource{ // ID: to.Ptr("subscriptions/{subscriptionId}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/snapshots/mySnapshot1"), // }, // StorageAccountType: to.Ptr(armcompute.StorageAccountTypesStandardLRS), // OSState: to.Ptr(armcompute.OperatingSystemStateTypesGeneralized), // OSType: to.Ptr(armcompute.OperatingSystemTypesWindows), // }, // ZoneResilient: to.Ptr(true), // }, // }, // }
Output:
func (*ImagesClient) Get ¶
func (client *ImagesClient) Get(ctx context.Context, resourceGroupName string, imageName string, options *ImagesClientGetOptions) (ImagesClientGetResponse, error)
Get - Gets an image. If the operation fails it returns an *azcore.ResponseError type.
Generated from API version 2024-03-01
- resourceGroupName - The name of the resource group.
- imageName - The name of the image.
- options - ImagesClientGetOptions contains the optional parameters for the ImagesClient.Get method.
Example ¶
Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/92de53a5f1e0e03c94b40475d2135d97148ed014/specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-03-01/examples/imageExamples/Image_Get.json
cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() clientFactory, err := armcompute.NewClientFactory("<subscription-id>", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } res, err := clientFactory.NewImagesClient().Get(ctx, "myResourceGroup", "myImage", &armcompute.ImagesClientGetOptions{Expand: nil}) if err != nil { log.Fatalf("failed to finish the request: %v", err) } // You could use response here. We use blank identifier for just demo purposes. _ = res // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. // res.Image = armcompute.Image{ // Name: to.Ptr("myImage"), // Type: to.Ptr("Microsoft.Compute/images"), // ID: to.Ptr("/subscriptions/{subscriptionId}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/images/myImage"), // Location: to.Ptr("West US"), // Properties: &armcompute.ImageProperties{ // ProvisioningState: to.Ptr("Succeeded"), // StorageProfile: &armcompute.ImageStorageProfile{ // DataDisks: []*armcompute.ImageDataDisk{ // { // BlobURI: to.Ptr("https://mystorageaccount.blob.core.windows.net/dataimages/dataimage.vhd"), // ManagedDisk: &armcompute.SubResource{ // ID: to.Ptr("subscriptions/{subscriptionId}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/disks/myManagedDisk2"), // }, // Snapshot: &armcompute.SubResource{ // ID: to.Ptr("subscriptions/{subscriptionId}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/snapshots/mySnapshot2"), // }, // StorageAccountType: to.Ptr(armcompute.StorageAccountTypesStandardLRS), // Lun: to.Ptr[int32](1), // }}, // OSDisk: &armcompute.ImageOSDisk{ // BlobURI: to.Ptr("https://mystorageaccount.blob.core.windows.net/osimages/osimage.vhd"), // DiskSizeGB: to.Ptr[int32](20), // ManagedDisk: &armcompute.SubResource{ // ID: to.Ptr("subscriptions/{subscriptionId}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/disks/myManagedDisk1"), // }, // Snapshot: &armcompute.SubResource{ // ID: to.Ptr("subscriptions/{subscriptionId}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/snapshots/mySnapshot1"), // }, // StorageAccountType: to.Ptr(armcompute.StorageAccountTypesStandardLRS), // OSState: to.Ptr(armcompute.OperatingSystemStateTypesGeneralized), // OSType: to.Ptr(armcompute.OperatingSystemTypesWindows), // }, // ZoneResilient: to.Ptr(true), // }, // }, // }
Output:
func (*ImagesClient) NewListByResourceGroupPager ¶
func (client *ImagesClient) NewListByResourceGroupPager(resourceGroupName string, options *ImagesClientListByResourceGroupOptions) *runtime.Pager[ImagesClientListByResourceGroupResponse]
NewListByResourceGroupPager - Gets the list of images under a resource group. Use nextLink property in the response to get the next page of Images. Do this till nextLink is null to fetch all the Images.
Generated from API version 2024-03-01
- resourceGroupName - The name of the resource group.
- options - ImagesClientListByResourceGroupOptions contains the optional parameters for the ImagesClient.NewListByResourceGroupPager method.
Example ¶
Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/92de53a5f1e0e03c94b40475d2135d97148ed014/specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-03-01/examples/imageExamples/Image_ListByResourceGroup.json
cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() clientFactory, err := armcompute.NewClientFactory("<subscription-id>", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } pager := clientFactory.NewImagesClient().NewListByResourceGroupPager("myResourceGroup", nil) for pager.More() { page, err := pager.NextPage(ctx) if err != nil { log.Fatalf("failed to advance page: %v", err) } for _, v := range page.Value { // You could use page here. We use blank identifier for just demo purposes. _ = v } // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. // page.ImageListResult = armcompute.ImageListResult{ // Value: []*armcompute.Image{ // { // Name: to.Ptr("myImage"), // Type: to.Ptr("Microsoft.Compute/images"), // ID: to.Ptr("/subscriptions/{subscriptionId}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/images/myImage"), // Location: to.Ptr("West US"), // Properties: &armcompute.ImageProperties{ // ProvisioningState: to.Ptr("Succeeded"), // StorageProfile: &armcompute.ImageStorageProfile{ // DataDisks: []*armcompute.ImageDataDisk{ // { // BlobURI: to.Ptr("https://mystorageaccount.blob.core.windows.net/dataimages/dataimage.vhd"), // ManagedDisk: &armcompute.SubResource{ // ID: to.Ptr("subscriptions/{subscriptionId}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/disks/myManagedDisk2"), // }, // Snapshot: &armcompute.SubResource{ // ID: to.Ptr("subscriptions/{subscriptionId}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/snapshots/mySnapshot2"), // }, // StorageAccountType: to.Ptr(armcompute.StorageAccountTypesStandardLRS), // Lun: to.Ptr[int32](1), // }}, // OSDisk: &armcompute.ImageOSDisk{ // BlobURI: to.Ptr("https://mystorageaccount.blob.core.windows.net/osimages/osimage.vhd"), // ManagedDisk: &armcompute.SubResource{ // ID: to.Ptr("subscriptions/{subscriptionId}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/disks/myManagedDisk1"), // }, // Snapshot: &armcompute.SubResource{ // ID: to.Ptr("subscriptions/{subscriptionId}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/snapshots/mySnapshot1"), // }, // StorageAccountType: to.Ptr(armcompute.StorageAccountTypesStandardLRS), // OSState: to.Ptr(armcompute.OperatingSystemStateTypesGeneralized), // OSType: to.Ptr(armcompute.OperatingSystemTypesWindows), // }, // }, // }, // }}, // } }
Output:
func (*ImagesClient) NewListPager ¶
func (client *ImagesClient) NewListPager(options *ImagesClientListOptions) *runtime.Pager[ImagesClientListResponse]
NewListPager - Gets the list of Images in the subscription. Use nextLink property in the response to get the next page of Images. Do this till nextLink is null to fetch all the Images.
Generated from API version 2024-03-01
- options - ImagesClientListOptions contains the optional parameters for the ImagesClient.NewListPager method.
Example ¶
Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/92de53a5f1e0e03c94b40475d2135d97148ed014/specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-03-01/examples/imageExamples/Image_ListBySubscription.json
cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() clientFactory, err := armcompute.NewClientFactory("<subscription-id>", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } pager := clientFactory.NewImagesClient().NewListPager(nil) for pager.More() { page, err := pager.NextPage(ctx) if err != nil { log.Fatalf("failed to advance page: %v", err) } for _, v := range page.Value { // You could use page here. We use blank identifier for just demo purposes. _ = v } // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. // page.ImageListResult = armcompute.ImageListResult{ // Value: []*armcompute.Image{ // { // Name: to.Ptr("myImage"), // Type: to.Ptr("Microsoft.Compute/images"), // ID: to.Ptr("/subscriptions/{subscriptionId}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/images/myImage"), // Location: to.Ptr("West US"), // Properties: &armcompute.ImageProperties{ // ProvisioningState: to.Ptr("Succeeded"), // StorageProfile: &armcompute.ImageStorageProfile{ // DataDisks: []*armcompute.ImageDataDisk{ // { // BlobURI: to.Ptr("https://mystorageaccount.blob.core.windows.net/dataimages/dataimage.vhd"), // ManagedDisk: &armcompute.SubResource{ // ID: to.Ptr("subscriptions/{subscriptionId}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/disks/myManagedDisk2"), // }, // Snapshot: &armcompute.SubResource{ // ID: to.Ptr("subscriptions/{subscriptionId}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/snapshots/mySnapshot2"), // }, // StorageAccountType: to.Ptr(armcompute.StorageAccountTypesStandardLRS), // Lun: to.Ptr[int32](1), // }}, // OSDisk: &armcompute.ImageOSDisk{ // BlobURI: to.Ptr("https://mystorageaccount.blob.core.windows.net/osimages/osimage.vhd"), // ManagedDisk: &armcompute.SubResource{ // ID: to.Ptr("subscriptions/{subscriptionId}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/disks/myManagedDisk1"), // }, // Snapshot: &armcompute.SubResource{ // ID: to.Ptr("subscriptions/{subscriptionId}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/snapshots/mySnapshot1"), // }, // StorageAccountType: to.Ptr(armcompute.StorageAccountTypesStandardLRS), // OSState: to.Ptr(armcompute.OperatingSystemStateTypesGeneralized), // OSType: to.Ptr(armcompute.OperatingSystemTypesWindows), // }, // }, // }, // }}, // } }
Output:
type ImagesClientBeginCreateOrUpdateOptions ¶
type ImagesClientBeginCreateOrUpdateOptions struct { // Resumes the LRO from the provided token. ResumeToken string }
ImagesClientBeginCreateOrUpdateOptions contains the optional parameters for the ImagesClient.BeginCreateOrUpdate method.
type ImagesClientBeginDeleteOptions ¶
type ImagesClientBeginDeleteOptions struct { // Resumes the LRO from the provided token. ResumeToken string }
ImagesClientBeginDeleteOptions contains the optional parameters for the ImagesClient.BeginDelete method.
type ImagesClientBeginUpdateOptions ¶
type ImagesClientBeginUpdateOptions struct { // Resumes the LRO from the provided token. ResumeToken string }
ImagesClientBeginUpdateOptions contains the optional parameters for the ImagesClient.BeginUpdate method.
type ImagesClientCreateOrUpdateResponse ¶
type ImagesClientCreateOrUpdateResponse struct { // The source user image virtual hard disk. The virtual hard disk will be copied before being attached to the virtual machine. // If SourceImage is provided, the destination virtual hard drive must not exist. Image }
ImagesClientCreateOrUpdateResponse contains the response from method ImagesClient.BeginCreateOrUpdate.
type ImagesClientDeleteResponse ¶
type ImagesClientDeleteResponse struct { }
ImagesClientDeleteResponse contains the response from method ImagesClient.BeginDelete.
type ImagesClientGetOptions ¶
type ImagesClientGetOptions struct { // The expand expression to apply on the operation. Expand *string }
ImagesClientGetOptions contains the optional parameters for the ImagesClient.Get method.
type ImagesClientGetResponse ¶
type ImagesClientGetResponse struct { // The source user image virtual hard disk. The virtual hard disk will be copied before being attached to the virtual machine. // If SourceImage is provided, the destination virtual hard drive must not exist. Image }
ImagesClientGetResponse contains the response from method ImagesClient.Get.
type ImagesClientListByResourceGroupOptions ¶
type ImagesClientListByResourceGroupOptions struct { }
ImagesClientListByResourceGroupOptions contains the optional parameters for the ImagesClient.NewListByResourceGroupPager method.
type ImagesClientListByResourceGroupResponse ¶
type ImagesClientListByResourceGroupResponse struct { // The List Image operation response. ImageListResult }
ImagesClientListByResourceGroupResponse contains the response from method ImagesClient.NewListByResourceGroupPager.
type ImagesClientListOptions ¶
type ImagesClientListOptions struct { }
ImagesClientListOptions contains the optional parameters for the ImagesClient.NewListPager method.
type ImagesClientListResponse ¶
type ImagesClientListResponse struct { // The List Image operation response. ImageListResult }
ImagesClientListResponse contains the response from method ImagesClient.NewListPager.
type ImagesClientUpdateResponse ¶
type ImagesClientUpdateResponse struct { // The source user image virtual hard disk. The virtual hard disk will be copied before being attached to the virtual machine. // If SourceImage is provided, the destination virtual hard drive must not exist. Image }
ImagesClientUpdateResponse contains the response from method ImagesClient.BeginUpdate.
type InnerError ¶
type InnerError struct { // The internal error message or exception dump. Errordetail *string // The exception type. Exceptiontype *string }
InnerError - Inner error details.
func (InnerError) MarshalJSON ¶
func (i InnerError) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type InnerError.
func (*InnerError) UnmarshalJSON ¶
func (i *InnerError) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type InnerError.
type InstanceSKU ¶
type InstanceSKU struct { // READ-ONLY; The sku name. Name *string // READ-ONLY; The tier of the cloud service role instance. Tier *string }
InstanceSKU - The role instance SKU.
func (InstanceSKU) MarshalJSON ¶
func (i InstanceSKU) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type InstanceSKU.
func (*InstanceSKU) UnmarshalJSON ¶
func (i *InstanceSKU) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type InstanceSKU.
type InstanceViewStatus ¶
type InstanceViewStatus struct { // The status code. Code *string // The short localizable label for the status. DisplayStatus *string // The level code. Level *StatusLevelTypes // The detailed status message, including for alerts and error messages. Message *string // The time of the status. Time *time.Time }
InstanceViewStatus - Instance view status.
func (InstanceViewStatus) MarshalJSON ¶
func (i InstanceViewStatus) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type InstanceViewStatus.
func (*InstanceViewStatus) UnmarshalJSON ¶
func (i *InstanceViewStatus) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type InstanceViewStatus.
type InstanceViewStatusesSummary ¶
type InstanceViewStatusesSummary struct { // READ-ONLY; The summary. StatusesSummary []*StatusCodeCount }
InstanceViewStatusesSummary - Instance view statuses.
func (InstanceViewStatusesSummary) MarshalJSON ¶
func (i InstanceViewStatusesSummary) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type InstanceViewStatusesSummary.
func (*InstanceViewStatusesSummary) UnmarshalJSON ¶
func (i *InstanceViewStatusesSummary) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type InstanceViewStatusesSummary.
type InstanceViewTypes ¶
type InstanceViewTypes string
const ( InstanceViewTypesInstanceView InstanceViewTypes = "instanceView" InstanceViewTypesUserData InstanceViewTypes = "userData" )
func PossibleInstanceViewTypesValues ¶
func PossibleInstanceViewTypesValues() []InstanceViewTypes
PossibleInstanceViewTypesValues returns the possible values for the InstanceViewTypes const type.
type IntervalInMins ¶
type IntervalInMins string
IntervalInMins - Interval value in minutes used to create LogAnalytics call rate logs.
const ( IntervalInMinsFiveMins IntervalInMins = "FiveMins" IntervalInMinsSixtyMins IntervalInMins = "SixtyMins" IntervalInMinsThirtyMins IntervalInMins = "ThirtyMins" IntervalInMinsThreeMins IntervalInMins = "ThreeMins" )
func PossibleIntervalInMinsValues ¶
func PossibleIntervalInMinsValues() []IntervalInMins
PossibleIntervalInMinsValues returns the possible values for the IntervalInMins const type.
type KeyForDiskEncryptionSet ¶
type KeyForDiskEncryptionSet struct { // REQUIRED; Fully versioned Key Url pointing to a key in KeyVault. Version segment of the Url is required regardless of rotationToLatestKeyVersionEnabled // value. KeyURL *string // Resource id of the KeyVault containing the key or secret. This property is optional and cannot be used if the KeyVault // subscription is not the same as the Disk Encryption Set subscription. SourceVault *SourceVault }
KeyForDiskEncryptionSet - Key Vault Key Url to be used for server side encryption of Managed Disks and Snapshots
func (KeyForDiskEncryptionSet) MarshalJSON ¶
func (k KeyForDiskEncryptionSet) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type KeyForDiskEncryptionSet.
func (*KeyForDiskEncryptionSet) UnmarshalJSON ¶
func (k *KeyForDiskEncryptionSet) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type KeyForDiskEncryptionSet.
type KeyVaultAndKeyReference ¶
type KeyVaultAndKeyReference struct { // REQUIRED; Url pointing to a key or secret in KeyVault KeyURL *string // REQUIRED; Resource id of the KeyVault containing the key or secret SourceVault *SourceVault }
KeyVaultAndKeyReference - Key Vault Key Url and vault id of KeK, KeK is optional and when provided is used to unwrap the encryptionKey
func (KeyVaultAndKeyReference) MarshalJSON ¶
func (k KeyVaultAndKeyReference) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type KeyVaultAndKeyReference.
func (*KeyVaultAndKeyReference) UnmarshalJSON ¶
func (k *KeyVaultAndKeyReference) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type KeyVaultAndKeyReference.
type KeyVaultAndSecretReference ¶
type KeyVaultAndSecretReference struct { // REQUIRED; Url pointing to a key or secret in KeyVault SecretURL *string // REQUIRED; Resource id of the KeyVault containing the key or secret SourceVault *SourceVault }
KeyVaultAndSecretReference - Key Vault Secret Url and vault id of the encryption key
func (KeyVaultAndSecretReference) MarshalJSON ¶
func (k KeyVaultAndSecretReference) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type KeyVaultAndSecretReference.
func (*KeyVaultAndSecretReference) UnmarshalJSON ¶
func (k *KeyVaultAndSecretReference) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type KeyVaultAndSecretReference.
type KeyVaultKeyReference ¶
type KeyVaultKeyReference struct { // REQUIRED; The URL referencing a key encryption key in Key Vault. KeyURL *string // REQUIRED; The relative URL of the Key Vault containing the key. SourceVault *SubResource }
KeyVaultKeyReference - Describes a reference to Key Vault Key
func (KeyVaultKeyReference) MarshalJSON ¶
func (k KeyVaultKeyReference) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type KeyVaultKeyReference.
func (*KeyVaultKeyReference) UnmarshalJSON ¶
func (k *KeyVaultKeyReference) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type KeyVaultKeyReference.
type KeyVaultSecretReference ¶
type KeyVaultSecretReference struct { // REQUIRED; The URL referencing a secret in a Key Vault. SecretURL *string // REQUIRED; The relative URL of the Key Vault containing the secret. SourceVault *SubResource }
KeyVaultSecretReference - Describes a reference to Key Vault Secret
func (KeyVaultSecretReference) MarshalJSON ¶
func (k KeyVaultSecretReference) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type KeyVaultSecretReference.
func (*KeyVaultSecretReference) UnmarshalJSON ¶
func (k *KeyVaultSecretReference) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type KeyVaultSecretReference.
type LastPatchInstallationSummary ¶
type LastPatchInstallationSummary struct { // READ-ONLY; The errors that were encountered during execution of the operation. The details array contains the list of them. Error *APIError // READ-ONLY; The number of all available patches but excluded explicitly by a customer-specified exclusion list match. ExcludedPatchCount *int32 // READ-ONLY; The count of patches that failed installation. FailedPatchCount *int32 // READ-ONLY; The activity ID of the operation that produced this result. It is used to correlate across CRP and extension // logs. InstallationActivityID *string // READ-ONLY; The count of patches that successfully installed. InstalledPatchCount *int32 // READ-ONLY; The UTC timestamp when the operation began. LastModifiedTime *time.Time // READ-ONLY; Describes whether the operation ran out of time before it completed all its intended actions MaintenanceWindowExceeded *bool // READ-ONLY; The number of all available patches but not going to be installed because it didn't match a classification or // inclusion list entry. NotSelectedPatchCount *int32 // READ-ONLY; The number of all available patches expected to be installed over the course of the patch installation operation. PendingPatchCount *int32 // READ-ONLY; The UTC timestamp when the operation began. StartTime *time.Time // READ-ONLY; The overall success or failure status of the operation. It remains "InProgress" until the operation completes. // At that point it will become "Unknown", "Failed", "Succeeded", or // "CompletedWithWarnings." Status *PatchOperationStatus }
LastPatchInstallationSummary - Describes the properties of the last installed patch summary.
func (LastPatchInstallationSummary) MarshalJSON ¶
func (l LastPatchInstallationSummary) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type LastPatchInstallationSummary.
func (*LastPatchInstallationSummary) UnmarshalJSON ¶
func (l *LastPatchInstallationSummary) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type LastPatchInstallationSummary.
type LatestGalleryImageVersion ¶
type LatestGalleryImageVersion struct { // The name of the latest version in the region. LatestVersionName *string // region of the Gallery Image Version. Location *string }
LatestGalleryImageVersion - The gallery image version with latest version in a particular region.
func (LatestGalleryImageVersion) MarshalJSON ¶
func (l LatestGalleryImageVersion) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type LatestGalleryImageVersion.
func (*LatestGalleryImageVersion) UnmarshalJSON ¶
func (l *LatestGalleryImageVersion) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type LatestGalleryImageVersion.
type LinuxConfiguration ¶
type LinuxConfiguration struct { // Specifies whether password authentication should be disabled. DisablePasswordAuthentication *bool // Indicates whether VMAgent Platform Updates is enabled for the Linux virtual machine. Default value is false. EnableVMAgentPlatformUpdates *bool // [Preview Feature] Specifies settings related to VM Guest Patching on Linux. PatchSettings *LinuxPatchSettings // Indicates whether virtual machine agent should be provisioned on the virtual machine. When this property is not specified // in the request body, default behavior is to set it to true. This will ensure // that VM Agent is installed on the VM so that extensions can be added to the VM later. ProvisionVMAgent *bool // Specifies the ssh key configuration for a Linux OS. SSH *SSHConfiguration }
LinuxConfiguration - Specifies the Linux operating system settings on the virtual machine. For a list of supported Linux distributions, see Linux on Azure-Endorsed Distributions [https://docs.microsoft.com/azure/virtual-machines/linux/endorsed-distros].
func (LinuxConfiguration) MarshalJSON ¶
func (l LinuxConfiguration) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type LinuxConfiguration.
func (*LinuxConfiguration) UnmarshalJSON ¶
func (l *LinuxConfiguration) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type LinuxConfiguration.
type LinuxParameters ¶
type LinuxParameters struct { // The update classifications to select when installing patches for Linux. ClassificationsToInclude []*VMGuestPatchClassificationLinux // This is used as a maintenance run identifier for Auto VM Guest Patching in Linux. MaintenanceRunID *string // packages to exclude in the patch operation. Format: packageName_packageVersion PackageNameMasksToExclude []*string // packages to include in the patch operation. Format: packageName_packageVersion PackageNameMasksToInclude []*string }
LinuxParameters - Input for InstallPatches on a Linux VM, as directly received by the API
func (LinuxParameters) MarshalJSON ¶
func (l LinuxParameters) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type LinuxParameters.
func (*LinuxParameters) UnmarshalJSON ¶
func (l *LinuxParameters) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type LinuxParameters.
type LinuxPatchAssessmentMode ¶
type LinuxPatchAssessmentMode string
LinuxPatchAssessmentMode - Specifies the mode of VM Guest Patch Assessment for the IaaS virtual machine. Possible values are: ImageDefault - You control the timing of patch assessments on a virtual machine. AutomaticByPlatform - The platform will trigger periodic patch assessments. The property provisionVMAgent must be true.
const ( LinuxPatchAssessmentModeAutomaticByPlatform LinuxPatchAssessmentMode = "AutomaticByPlatform" LinuxPatchAssessmentModeImageDefault LinuxPatchAssessmentMode = "ImageDefault" )
func PossibleLinuxPatchAssessmentModeValues ¶
func PossibleLinuxPatchAssessmentModeValues() []LinuxPatchAssessmentMode
PossibleLinuxPatchAssessmentModeValues returns the possible values for the LinuxPatchAssessmentMode const type.
type LinuxPatchSettings ¶
type LinuxPatchSettings struct { // Specifies the mode of VM Guest Patch Assessment for the IaaS virtual machine. // Possible values are: // ImageDefault - You control the timing of patch assessments on a virtual machine. // AutomaticByPlatform - The platform will trigger periodic patch assessments. The property provisionVMAgent must be true. AssessmentMode *LinuxPatchAssessmentMode // Specifies additional settings for patch mode AutomaticByPlatform in VM Guest Patching on Linux. AutomaticByPlatformSettings *LinuxVMGuestPatchAutomaticByPlatformSettings // Specifies the mode of VM Guest Patching to IaaS virtual machine or virtual machines associated to virtual machine scale // set with OrchestrationMode as Flexible. // Possible values are: // ImageDefault - The virtual machine's default patching configuration is used. // AutomaticByPlatform - The virtual machine will be automatically updated by the platform. The property provisionVMAgent // must be true PatchMode *LinuxVMGuestPatchMode }
LinuxPatchSettings - Specifies settings related to VM Guest Patching on Linux.
func (LinuxPatchSettings) MarshalJSON ¶
func (l LinuxPatchSettings) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type LinuxPatchSettings.
func (*LinuxPatchSettings) UnmarshalJSON ¶
func (l *LinuxPatchSettings) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type LinuxPatchSettings.
type LinuxVMGuestPatchAutomaticByPlatformRebootSetting ¶
type LinuxVMGuestPatchAutomaticByPlatformRebootSetting string
LinuxVMGuestPatchAutomaticByPlatformRebootSetting - Specifies the reboot setting for all AutomaticByPlatform patch installation operations.
const ( LinuxVMGuestPatchAutomaticByPlatformRebootSettingAlways LinuxVMGuestPatchAutomaticByPlatformRebootSetting = "Always" LinuxVMGuestPatchAutomaticByPlatformRebootSettingIfRequired LinuxVMGuestPatchAutomaticByPlatformRebootSetting = "IfRequired" LinuxVMGuestPatchAutomaticByPlatformRebootSettingNever LinuxVMGuestPatchAutomaticByPlatformRebootSetting = "Never" LinuxVMGuestPatchAutomaticByPlatformRebootSettingUnknown LinuxVMGuestPatchAutomaticByPlatformRebootSetting = "Unknown" )
func PossibleLinuxVMGuestPatchAutomaticByPlatformRebootSettingValues ¶
func PossibleLinuxVMGuestPatchAutomaticByPlatformRebootSettingValues() []LinuxVMGuestPatchAutomaticByPlatformRebootSetting
PossibleLinuxVMGuestPatchAutomaticByPlatformRebootSettingValues returns the possible values for the LinuxVMGuestPatchAutomaticByPlatformRebootSetting const type.
type LinuxVMGuestPatchAutomaticByPlatformSettings ¶
type LinuxVMGuestPatchAutomaticByPlatformSettings struct { // Enables customer to schedule patching without accidental upgrades BypassPlatformSafetyChecksOnUserSchedule *bool // Specifies the reboot setting for all AutomaticByPlatform patch installation operations. RebootSetting *LinuxVMGuestPatchAutomaticByPlatformRebootSetting }
LinuxVMGuestPatchAutomaticByPlatformSettings - Specifies additional settings to be applied when patch mode AutomaticByPlatform is selected in Linux patch settings.
func (LinuxVMGuestPatchAutomaticByPlatformSettings) MarshalJSON ¶
func (l LinuxVMGuestPatchAutomaticByPlatformSettings) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type LinuxVMGuestPatchAutomaticByPlatformSettings.
func (*LinuxVMGuestPatchAutomaticByPlatformSettings) UnmarshalJSON ¶
func (l *LinuxVMGuestPatchAutomaticByPlatformSettings) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type LinuxVMGuestPatchAutomaticByPlatformSettings.
type LinuxVMGuestPatchMode ¶
type LinuxVMGuestPatchMode string
LinuxVMGuestPatchMode - Specifies the mode of VM Guest Patching to IaaS virtual machine or virtual machines associated to virtual machine scale set with OrchestrationMode as Flexible. Possible values are: ImageDefault - The virtual machine's default patching configuration is used. AutomaticByPlatform - The virtual machine will be automatically updated by the platform. The property provisionVMAgent must be true
const ( LinuxVMGuestPatchModeAutomaticByPlatform LinuxVMGuestPatchMode = "AutomaticByPlatform" LinuxVMGuestPatchModeImageDefault LinuxVMGuestPatchMode = "ImageDefault" )
func PossibleLinuxVMGuestPatchModeValues ¶
func PossibleLinuxVMGuestPatchModeValues() []LinuxVMGuestPatchMode
PossibleLinuxVMGuestPatchModeValues returns the possible values for the LinuxVMGuestPatchMode const type.
type ListUsagesResult ¶
type ListUsagesResult struct { // REQUIRED; The list of compute resource usages. Value []*Usage // The URI to fetch the next page of compute resource usage information. Call ListNext() with this to fetch the next page // of compute resource usage information. NextLink *string }
ListUsagesResult - The List Usages operation response.
func (ListUsagesResult) MarshalJSON ¶
func (l ListUsagesResult) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type ListUsagesResult.
func (*ListUsagesResult) UnmarshalJSON ¶
func (l *ListUsagesResult) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type ListUsagesResult.
type LoadBalancerConfiguration ¶
type LoadBalancerConfiguration struct { // REQUIRED; The name of the Load balancer Name *string // REQUIRED; Properties of the load balancer configuration. Properties *LoadBalancerConfigurationProperties // Resource Id ID *string }
LoadBalancerConfiguration - Describes the load balancer configuration.
func (LoadBalancerConfiguration) MarshalJSON ¶
func (l LoadBalancerConfiguration) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type LoadBalancerConfiguration.
func (*LoadBalancerConfiguration) UnmarshalJSON ¶
func (l *LoadBalancerConfiguration) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type LoadBalancerConfiguration.
type LoadBalancerConfigurationProperties ¶
type LoadBalancerConfigurationProperties struct { // REQUIRED; Specifies the frontend IP to be used for the load balancer. Only IPv4 frontend IP address is supported. Each // load balancer configuration must have exactly one frontend IP configuration. FrontendIPConfigurations []*LoadBalancerFrontendIPConfiguration }
LoadBalancerConfigurationProperties - Describes the properties of the load balancer configuration.
func (LoadBalancerConfigurationProperties) MarshalJSON ¶
func (l LoadBalancerConfigurationProperties) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type LoadBalancerConfigurationProperties.
func (*LoadBalancerConfigurationProperties) UnmarshalJSON ¶
func (l *LoadBalancerConfigurationProperties) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type LoadBalancerConfigurationProperties.
type LoadBalancerFrontendIPConfiguration ¶
type LoadBalancerFrontendIPConfiguration struct { // REQUIRED; The name of the resource that is unique within the set of frontend IP configurations used by the load balancer. // This name can be used to access the resource. Name *string // REQUIRED; Properties of load balancer frontend ip configuration. Properties *LoadBalancerFrontendIPConfigurationProperties }
LoadBalancerFrontendIPConfiguration - Specifies the frontend IP to be used for the load balancer. Only IPv4 frontend IP address is supported. Each load balancer configuration must have exactly one frontend IP configuration.
func (LoadBalancerFrontendIPConfiguration) MarshalJSON ¶
func (l LoadBalancerFrontendIPConfiguration) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type LoadBalancerFrontendIPConfiguration.
func (*LoadBalancerFrontendIPConfiguration) UnmarshalJSON ¶
func (l *LoadBalancerFrontendIPConfiguration) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type LoadBalancerFrontendIPConfiguration.
type LoadBalancerFrontendIPConfigurationProperties ¶
type LoadBalancerFrontendIPConfigurationProperties struct { // The virtual network private IP address of the IP configuration. PrivateIPAddress *string // The reference to the public ip address resource. PublicIPAddress *SubResource // The reference to the virtual network subnet resource. Subnet *SubResource }
LoadBalancerFrontendIPConfigurationProperties - Describes a cloud service IP Configuration
func (LoadBalancerFrontendIPConfigurationProperties) MarshalJSON ¶
func (l LoadBalancerFrontendIPConfigurationProperties) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type LoadBalancerFrontendIPConfigurationProperties.
func (*LoadBalancerFrontendIPConfigurationProperties) UnmarshalJSON ¶
func (l *LoadBalancerFrontendIPConfigurationProperties) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type LoadBalancerFrontendIPConfigurationProperties.
type LogAnalyticsClient ¶
type LogAnalyticsClient struct {
// contains filtered or unexported fields
}
LogAnalyticsClient contains the methods for the LogAnalytics group. Don't use this type directly, use NewLogAnalyticsClient() instead.
func NewLogAnalyticsClient ¶
func NewLogAnalyticsClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*LogAnalyticsClient, error)
NewLogAnalyticsClient creates a new instance of LogAnalyticsClient 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 (*LogAnalyticsClient) BeginExportRequestRateByInterval ¶
func (client *LogAnalyticsClient) BeginExportRequestRateByInterval(ctx context.Context, location string, parameters RequestRateByIntervalInput, options *LogAnalyticsClientBeginExportRequestRateByIntervalOptions) (*runtime.Poller[LogAnalyticsClientExportRequestRateByIntervalResponse], error)
BeginExportRequestRateByInterval - Export logs that show Api requests made by this subscription in the given time window to show throttling activities. If the operation fails it returns an *azcore.ResponseError type.
Generated from API version 2024-03-01
- location - The location upon which virtual-machine-sizes is queried.
- parameters - Parameters supplied to the LogAnalytics getRequestRateByInterval Api.
- options - LogAnalyticsClientBeginExportRequestRateByIntervalOptions contains the optional parameters for the LogAnalyticsClient.BeginExportRequestRateByInterval method.
Example ¶
Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/92de53a5f1e0e03c94b40475d2135d97148ed014/specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-03-01/examples/logAnalyticExamples/LogAnalytics_RequestRateByInterval.json
cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() clientFactory, err := armcompute.NewClientFactory("<subscription-id>", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } poller, err := clientFactory.NewLogAnalyticsClient().BeginExportRequestRateByInterval(ctx, "westus", armcompute.RequestRateByIntervalInput{ BlobContainerSasURI: to.Ptr("https://somesasuri"), FromTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2018-01-21T01:54:06.862Z"); return t }()), GroupByResourceName: to.Ptr(true), ToTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2018-01-23T01:54:06.862Z"); return t }()), IntervalLength: to.Ptr(armcompute.IntervalInMinsFiveMins), }, nil) if err != nil { log.Fatalf("failed to finish the request: %v", err) } res, err := poller.PollUntilDone(ctx, nil) if err != nil { log.Fatalf("failed to pull the result: %v", err) } // You could use response here. We use blank identifier for just demo purposes. _ = res // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. // res.LogAnalyticsOperationResult = armcompute.LogAnalyticsOperationResult{ // Properties: &armcompute.LogAnalyticsOutput{
Output:
func (*LogAnalyticsClient) BeginExportThrottledRequests ¶
func (client *LogAnalyticsClient) BeginExportThrottledRequests(ctx context.Context, location string, parameters ThrottledRequestsInput, options *LogAnalyticsClientBeginExportThrottledRequestsOptions) (*runtime.Poller[LogAnalyticsClientExportThrottledRequestsResponse], error)
BeginExportThrottledRequests - Export logs that show total throttled Api requests for this subscription in the given time window. If the operation fails it returns an *azcore.ResponseError type.
Generated from API version 2024-03-01
- location - The location upon which virtual-machine-sizes is queried.
- parameters - Parameters supplied to the LogAnalytics getThrottledRequests Api.
- options - LogAnalyticsClientBeginExportThrottledRequestsOptions contains the optional parameters for the LogAnalyticsClient.BeginExportThrottledRequests method.
Example ¶
Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/92de53a5f1e0e03c94b40475d2135d97148ed014/specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-03-01/examples/logAnalyticExamples/LogAnalytics_ThrottledRequests.json
cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() clientFactory, err := armcompute.NewClientFactory("<subscription-id>", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } poller, err := clientFactory.NewLogAnalyticsClient().BeginExportThrottledRequests(ctx, "westus", armcompute.ThrottledRequestsInput{ BlobContainerSasURI: to.Ptr("https://somesasuri"), FromTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2018-01-21T01:54:06.862Z"); return t }()), GroupByClientApplicationID: to.Ptr(false), GroupByOperationName: to.Ptr(true), GroupByResourceName: to.Ptr(false), GroupByUserAgent: to.Ptr(false), ToTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2018-01-23T01:54:06.862Z"); return t }()), }, nil) if err != nil { log.Fatalf("failed to finish the request: %v", err) } res, err := poller.PollUntilDone(ctx, nil) if err != nil { log.Fatalf("failed to pull the result: %v", err) } // You could use response here. We use blank identifier for just demo purposes. _ = res // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. // res.LogAnalyticsOperationResult = armcompute.LogAnalyticsOperationResult{ // Properties: &armcompute.LogAnalyticsOutput{
Output:
type LogAnalyticsClientBeginExportRequestRateByIntervalOptions ¶
type LogAnalyticsClientBeginExportRequestRateByIntervalOptions struct { // Resumes the LRO from the provided token. ResumeToken string }
LogAnalyticsClientBeginExportRequestRateByIntervalOptions contains the optional parameters for the LogAnalyticsClient.BeginExportRequestRateByInterval method.
type LogAnalyticsClientBeginExportThrottledRequestsOptions ¶
type LogAnalyticsClientBeginExportThrottledRequestsOptions struct { // Resumes the LRO from the provided token. ResumeToken string }
LogAnalyticsClientBeginExportThrottledRequestsOptions contains the optional parameters for the LogAnalyticsClient.BeginExportThrottledRequests method.
type LogAnalyticsClientExportRequestRateByIntervalResponse ¶
type LogAnalyticsClientExportRequestRateByIntervalResponse struct { // LogAnalytics operation status response LogAnalyticsOperationResult }
LogAnalyticsClientExportRequestRateByIntervalResponse contains the response from method LogAnalyticsClient.BeginExportRequestRateByInterval.
type LogAnalyticsClientExportThrottledRequestsResponse ¶
type LogAnalyticsClientExportThrottledRequestsResponse struct { // LogAnalytics operation status response LogAnalyticsOperationResult }
LogAnalyticsClientExportThrottledRequestsResponse contains the response from method LogAnalyticsClient.BeginExportThrottledRequests.
type LogAnalyticsInputBase ¶
type LogAnalyticsInputBase struct { // REQUIRED; SAS Uri of the logging blob container to which LogAnalytics Api writes output logs to. BlobContainerSasURI *string // REQUIRED; From time of the query FromTime *time.Time // REQUIRED; To time of the query ToTime *time.Time // Group query result by Client Application ID. GroupByClientApplicationID *bool // Group query result by Operation Name. GroupByOperationName *bool // Group query result by Resource Name. GroupByResourceName *bool // Group query result by Throttle Policy applied. GroupByThrottlePolicy *bool // Group query result by User Agent. GroupByUserAgent *bool }
LogAnalyticsInputBase - Api input base class for LogAnalytics Api.
func (LogAnalyticsInputBase) MarshalJSON ¶
func (l LogAnalyticsInputBase) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type LogAnalyticsInputBase.
func (*LogAnalyticsInputBase) UnmarshalJSON ¶
func (l *LogAnalyticsInputBase) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type LogAnalyticsInputBase.
type LogAnalyticsOperationResult ¶
type LogAnalyticsOperationResult struct { // READ-ONLY; LogAnalyticsOutput Properties *LogAnalyticsOutput }
LogAnalyticsOperationResult - LogAnalytics operation status response
func (LogAnalyticsOperationResult) MarshalJSON ¶
func (l LogAnalyticsOperationResult) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type LogAnalyticsOperationResult.
func (*LogAnalyticsOperationResult) UnmarshalJSON ¶
func (l *LogAnalyticsOperationResult) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type LogAnalyticsOperationResult.
type LogAnalyticsOutput ¶
type LogAnalyticsOutput struct { // READ-ONLY; Output file Uri path to blob container. Output *string }
LogAnalyticsOutput - LogAnalytics output properties
func (LogAnalyticsOutput) MarshalJSON ¶
func (l LogAnalyticsOutput) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type LogAnalyticsOutput.
func (*LogAnalyticsOutput) UnmarshalJSON ¶
func (l *LogAnalyticsOutput) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type LogAnalyticsOutput.
type MaintenanceOperationResultCodeTypes ¶
type MaintenanceOperationResultCodeTypes string
MaintenanceOperationResultCodeTypes - The Last Maintenance Operation Result Code.
const ( MaintenanceOperationResultCodeTypesMaintenanceAborted MaintenanceOperationResultCodeTypes = "MaintenanceAborted" MaintenanceOperationResultCodeTypesMaintenanceCompleted MaintenanceOperationResultCodeTypes = "MaintenanceCompleted" MaintenanceOperationResultCodeTypesNone MaintenanceOperationResultCodeTypes = "None" MaintenanceOperationResultCodeTypesRetryLater MaintenanceOperationResultCodeTypes = "RetryLater" )
func PossibleMaintenanceOperationResultCodeTypesValues ¶
func PossibleMaintenanceOperationResultCodeTypesValues() []MaintenanceOperationResultCodeTypes
PossibleMaintenanceOperationResultCodeTypesValues returns the possible values for the MaintenanceOperationResultCodeTypes const type.
type MaintenanceRedeployStatus ¶
type MaintenanceRedeployStatus struct { // True, if customer is allowed to perform Maintenance. IsCustomerInitiatedMaintenanceAllowed *bool // Message returned for the last Maintenance Operation. LastOperationMessage *string // The Last Maintenance Operation Result Code. LastOperationResultCode *MaintenanceOperationResultCodeTypes // End Time for the Maintenance Window. MaintenanceWindowEndTime *time.Time // Start Time for the Maintenance Window. MaintenanceWindowStartTime *time.Time // End Time for the Pre Maintenance Window. PreMaintenanceWindowEndTime *time.Time // Start Time for the Pre Maintenance Window. PreMaintenanceWindowStartTime *time.Time }
MaintenanceRedeployStatus - Maintenance Operation Status.
func (MaintenanceRedeployStatus) MarshalJSON ¶
func (m MaintenanceRedeployStatus) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type MaintenanceRedeployStatus.
func (*MaintenanceRedeployStatus) UnmarshalJSON ¶
func (m *MaintenanceRedeployStatus) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type MaintenanceRedeployStatus.
type ManagedArtifact ¶
type ManagedArtifact struct { // REQUIRED; The managed artifact id. ID *string }
ManagedArtifact - The managed artifact.
func (ManagedArtifact) MarshalJSON ¶
func (m ManagedArtifact) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type ManagedArtifact.
func (*ManagedArtifact) UnmarshalJSON ¶
func (m *ManagedArtifact) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type ManagedArtifact.
type ManagedDiskParameters ¶
type ManagedDiskParameters struct { // Specifies the customer managed disk encryption set resource id for the managed disk. DiskEncryptionSet *DiskEncryptionSetParameters // Resource Id ID *string // Specifies the security profile for the managed disk. SecurityProfile *VMDiskSecurityProfile // Specifies the storage account type for the managed disk. NOTE: UltraSSD_LRS can only be used with data disks, it cannot // be used with OS Disk. StorageAccountType *StorageAccountTypes }
ManagedDiskParameters - The parameters of a managed disk.
func (ManagedDiskParameters) MarshalJSON ¶
func (m ManagedDiskParameters) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type ManagedDiskParameters.
func (*ManagedDiskParameters) UnmarshalJSON ¶
func (m *ManagedDiskParameters) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type ManagedDiskParameters.
type Mode ¶ added in v5.4.0
type Mode string
Mode - Specifies the mode that ProxyAgent will execute on if the feature is enabled. ProxyAgent will start to audit or monitor but not enforce access control over requests to host endpoints in Audit mode, while in Enforce mode it will enforce access control. The default value is Enforce mode.
func PossibleModeValues ¶ added in v5.4.0
func PossibleModeValues() []Mode
PossibleModeValues returns the possible values for the Mode const type.
type NetworkAPIVersion ¶
type NetworkAPIVersion string
NetworkAPIVersion - specifies the Microsoft.Network API version used when creating networking resources in the Network Interface Configurations
const (
NetworkAPIVersionTwoThousandTwenty1101 NetworkAPIVersion = "2020-11-01"
)
func PossibleNetworkAPIVersionValues ¶
func PossibleNetworkAPIVersionValues() []NetworkAPIVersion
PossibleNetworkAPIVersionValues returns the possible values for the NetworkAPIVersion const type.
type NetworkAccessPolicy ¶
type NetworkAccessPolicy string
NetworkAccessPolicy - Policy for accessing the disk via network.
const ( // NetworkAccessPolicyAllowAll - The disk can be exported or uploaded to from any network. NetworkAccessPolicyAllowAll NetworkAccessPolicy = "AllowAll" // NetworkAccessPolicyAllowPrivate - The disk can be exported or uploaded to using a DiskAccess resource's private endpoints. NetworkAccessPolicyAllowPrivate NetworkAccessPolicy = "AllowPrivate" // NetworkAccessPolicyDenyAll - The disk cannot be exported. NetworkAccessPolicyDenyAll NetworkAccessPolicy = "DenyAll" )
func PossibleNetworkAccessPolicyValues ¶
func PossibleNetworkAccessPolicyValues() []NetworkAccessPolicy
PossibleNetworkAccessPolicyValues returns the possible values for the NetworkAccessPolicy const type.
type NetworkInterfaceAuxiliaryMode ¶ added in v5.2.0
type NetworkInterfaceAuxiliaryMode string
NetworkInterfaceAuxiliaryMode - Specifies whether the Auxiliary mode is enabled for the Network Interface resource.
const ( NetworkInterfaceAuxiliaryModeAcceleratedConnections NetworkInterfaceAuxiliaryMode = "AcceleratedConnections" NetworkInterfaceAuxiliaryModeFloating NetworkInterfaceAuxiliaryMode = "Floating" NetworkInterfaceAuxiliaryModeNone NetworkInterfaceAuxiliaryMode = "None" )
func PossibleNetworkInterfaceAuxiliaryModeValues ¶ added in v5.2.0
func PossibleNetworkInterfaceAuxiliaryModeValues() []NetworkInterfaceAuxiliaryMode
PossibleNetworkInterfaceAuxiliaryModeValues returns the possible values for the NetworkInterfaceAuxiliaryMode const type.
type NetworkInterfaceAuxiliarySKU ¶ added in v5.2.0
type NetworkInterfaceAuxiliarySKU string
NetworkInterfaceAuxiliarySKU - Specifies whether the Auxiliary sku is enabled for the Network Interface resource.
const ( NetworkInterfaceAuxiliarySKUA1 NetworkInterfaceAuxiliarySKU = "A1" NetworkInterfaceAuxiliarySKUA2 NetworkInterfaceAuxiliarySKU = "A2" NetworkInterfaceAuxiliarySKUA4 NetworkInterfaceAuxiliarySKU = "A4" NetworkInterfaceAuxiliarySKUA8 NetworkInterfaceAuxiliarySKU = "A8" NetworkInterfaceAuxiliarySKUNone NetworkInterfaceAuxiliarySKU = "None" )
func PossibleNetworkInterfaceAuxiliarySKUValues ¶ added in v5.2.0
func PossibleNetworkInterfaceAuxiliarySKUValues() []NetworkInterfaceAuxiliarySKU
PossibleNetworkInterfaceAuxiliarySKUValues returns the possible values for the NetworkInterfaceAuxiliarySKU const type.
type NetworkInterfaceReference ¶
type NetworkInterfaceReference struct { // Resource Id ID *string // Describes a network interface reference properties. Properties *NetworkInterfaceReferenceProperties }
NetworkInterfaceReference - Describes a network interface reference.
func (NetworkInterfaceReference) MarshalJSON ¶
func (n NetworkInterfaceReference) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type NetworkInterfaceReference.
func (*NetworkInterfaceReference) UnmarshalJSON ¶
func (n *NetworkInterfaceReference) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type NetworkInterfaceReference.
type NetworkInterfaceReferenceProperties ¶
type NetworkInterfaceReferenceProperties struct { // Specify what happens to the network interface when the VM is deleted DeleteOption *DeleteOptions // Specifies the primary network interface in case the virtual machine has more than 1 network interface. Primary *bool }
NetworkInterfaceReferenceProperties - Describes a network interface reference properties.
func (NetworkInterfaceReferenceProperties) MarshalJSON ¶
func (n NetworkInterfaceReferenceProperties) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type NetworkInterfaceReferenceProperties.
func (*NetworkInterfaceReferenceProperties) UnmarshalJSON ¶
func (n *NetworkInterfaceReferenceProperties) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type NetworkInterfaceReferenceProperties.
type NetworkProfile ¶
type NetworkProfile struct { // specifies the Microsoft.Network API version used when creating networking resources in the Network Interface Configurations NetworkAPIVersion *NetworkAPIVersion // Specifies the networking configurations that will be used to create the virtual machine networking resources. NetworkInterfaceConfigurations []*VirtualMachineNetworkInterfaceConfiguration // Specifies the list of resource Ids for the network interfaces associated with the virtual machine. NetworkInterfaces []*NetworkInterfaceReference }
NetworkProfile - Specifies the network interfaces or the networking configuration of the virtual machine.
func (NetworkProfile) MarshalJSON ¶
func (n NetworkProfile) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type NetworkProfile.
func (*NetworkProfile) UnmarshalJSON ¶
func (n *NetworkProfile) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type NetworkProfile.
type OSDisk ¶
type OSDisk struct { // REQUIRED; Specifies how the virtual machine disk should be created. Possible values are Attach: This value is used when // you are using a specialized disk to create the virtual machine. FromImage: This value is // used when you are using an image to create the virtual machine. If you are using a platform image, you should also use // the imageReference element described above. If you are using a marketplace image, // you should also use the plan element previously described. CreateOption *DiskCreateOptionTypes // Specifies the caching requirements. Possible values are: None, ReadOnly, ReadWrite. The defaulting behavior is: None for // Standard storage. ReadOnly for Premium storage. Caching *CachingTypes // Specifies whether OS Disk should be deleted or detached upon VM deletion. Possible values are: Delete. If this value is // used, the OS disk is deleted when VM is deleted. Detach. If this value is used, // the os disk is retained after VM is deleted. The default value is set to Detach. For an ephemeral OS Disk, the default // value is set to Delete. The user cannot change the delete option for an ephemeral // OS Disk. DeleteOption *DiskDeleteOptionTypes // Specifies the ephemeral Disk Settings for the operating system disk used by the virtual machine. DiffDiskSettings *DiffDiskSettings // Specifies the size of an empty data disk in gigabytes. This element can be used to overwrite the size of the disk in a // virtual machine image. The property 'diskSizeGB' is the number of bytes x 1024^3 // for the disk and the value cannot be larger than 1023. DiskSizeGB *int32 // Specifies the encryption settings for the OS Disk. Minimum api-version: 2015-06-15. EncryptionSettings *DiskEncryptionSettings // The source user image virtual hard disk. The virtual hard disk will be copied before being attached to the virtual machine. // If SourceImage is provided, the destination virtual hard drive must not // exist. Image *VirtualHardDisk // The managed disk parameters. ManagedDisk *ManagedDiskParameters // The disk name. Name *string // This property allows you to specify the type of the OS that is included in the disk if creating a VM from user-image or // a specialized VHD. Possible values are: Windows, Linux. OSType *OperatingSystemTypes // The virtual hard disk. Vhd *VirtualHardDisk // Specifies whether writeAccelerator should be enabled or disabled on the disk. WriteAcceleratorEnabled *bool }
OSDisk - Specifies information about the operating system disk used by the virtual machine. For more information about disks, see About disks and VHDs for Azure virtual machines [https://docs.microsoft.com/azure/virtual-machines/managed-disks-overview].
func (OSDisk) MarshalJSON ¶
MarshalJSON implements the json.Marshaller interface for type OSDisk.
func (*OSDisk) UnmarshalJSON ¶
UnmarshalJSON implements the json.Unmarshaller interface for type OSDisk.
type OSDiskImage ¶
type OSDiskImage struct { // REQUIRED; The operating system of the osDiskImage. OperatingSystem *OperatingSystemTypes }
OSDiskImage - Contains the os disk image information.
func (OSDiskImage) MarshalJSON ¶
func (o OSDiskImage) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type OSDiskImage.
func (*OSDiskImage) UnmarshalJSON ¶
func (o *OSDiskImage) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type OSDiskImage.
type OSDiskImageEncryption ¶
type OSDiskImageEncryption struct { // A relative URI containing the resource ID of the disk encryption set. DiskEncryptionSetID *string // This property specifies the security profile of an OS disk image. SecurityProfile *OSDiskImageSecurityProfile }
OSDiskImageEncryption - Contains encryption settings for an OS disk image.
func (OSDiskImageEncryption) MarshalJSON ¶
func (o OSDiskImageEncryption) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type OSDiskImageEncryption.
func (*OSDiskImageEncryption) UnmarshalJSON ¶
func (o *OSDiskImageEncryption) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type OSDiskImageEncryption.
type OSDiskImageSecurityProfile ¶
type OSDiskImageSecurityProfile struct { // confidential VM encryption types ConfidentialVMEncryptionType *ConfidentialVMEncryptionType // secure VM disk encryption set id SecureVMDiskEncryptionSetID *string }
OSDiskImageSecurityProfile - Contains security profile for an OS disk image.
func (OSDiskImageSecurityProfile) MarshalJSON ¶
func (o OSDiskImageSecurityProfile) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type OSDiskImageSecurityProfile.
func (*OSDiskImageSecurityProfile) UnmarshalJSON ¶
func (o *OSDiskImageSecurityProfile) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type OSDiskImageSecurityProfile.
type OSFamily ¶
type OSFamily struct { // OS family properties. Properties *OSFamilyProperties // READ-ONLY; Resource Id. ID *string // READ-ONLY; Resource location. Location *string // READ-ONLY; Resource name. Name *string // READ-ONLY; Resource type. Type *string }
OSFamily - Describes a cloud service OS family.
func (OSFamily) MarshalJSON ¶
MarshalJSON implements the json.Marshaller interface for type OSFamily.
func (*OSFamily) UnmarshalJSON ¶
UnmarshalJSON implements the json.Unmarshaller interface for type OSFamily.
type OSFamilyListResult ¶
type OSFamilyListResult struct { // REQUIRED; The list of resources. Value []*OSFamily // The URI to fetch the next page of resources. Use this to get the next page of resources. Do this till nextLink is null // to fetch all the resources. NextLink *string }
OSFamilyListResult - The list operation result.
func (OSFamilyListResult) MarshalJSON ¶
func (o OSFamilyListResult) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type OSFamilyListResult.
func (*OSFamilyListResult) UnmarshalJSON ¶
func (o *OSFamilyListResult) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type OSFamilyListResult.
type OSFamilyProperties ¶
type OSFamilyProperties struct { // READ-ONLY; The OS family label. Label *string // READ-ONLY; The OS family name. Name *string // READ-ONLY; List of OS versions belonging to this family. Versions []*OSVersionPropertiesBase }
OSFamilyProperties - OS family properties.
func (OSFamilyProperties) MarshalJSON ¶
func (o OSFamilyProperties) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type OSFamilyProperties.
func (*OSFamilyProperties) UnmarshalJSON ¶
func (o *OSFamilyProperties) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type OSFamilyProperties.
type OSImageNotificationProfile ¶
type OSImageNotificationProfile struct { // Specifies whether the OS Image Scheduled event is enabled or disabled. Enable *bool // Length of time a Virtual Machine being reimaged or having its OS upgraded will have to potentially approve the OS Image // Scheduled Event before the event is auto approved (timed out). The configuration // is specified in ISO 8601 format, and the value must be 15 minutes (PT15M) NotBeforeTimeout *string }
func (OSImageNotificationProfile) MarshalJSON ¶
func (o OSImageNotificationProfile) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type OSImageNotificationProfile.
func (*OSImageNotificationProfile) UnmarshalJSON ¶
func (o *OSImageNotificationProfile) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type OSImageNotificationProfile.
type OSProfile ¶
type OSProfile struct { // Specifies the password of the administrator account. // Minimum-length (Windows): 8 characters // Minimum-length (Linux): 6 characters // Max-length (Windows): 123 characters // Max-length (Linux): 72 characters // Complexity requirements: 3 out of 4 conditions below need to be fulfilled // Has lower characters // Has upper characters // Has a digit // Has a special character (Regex match [\W_]) // Disallowed values: "abc@123", "P@$$w0rd", "P@ssw0rd", "P@ssword123", "Pa$$word", "pass@word1", "Password!", "Password1", // "Password22", "iloveyou!" // For resetting the password, see How to reset the Remote Desktop service or its login password in a Windows VM [https://docs.microsoft.com/troubleshoot/azure/virtual-machines/reset-rdp] // For resetting root password, see Manage users, SSH, and check or repair disks on Azure Linux VMs using the VMAccess Extension // [https://docs.microsoft.com/troubleshoot/azure/virtual-machines/troubleshoot-ssh-connection] AdminPassword *string // Specifies the name of the administrator account. // This property cannot be updated after the VM is created. // Windows-only restriction: Cannot end in "." // Disallowed values: "administrator", "admin", "user", "user1", "test", "user2", "test1", "user3", "admin1", "1", "123", // "a", "actuser", "adm", "admin2", "aspnet", "backup", "console", "david", "guest", // "john", "owner", "root", "server", "sql", "support", "support_388945a0", "sys", "test2", "test3", "user4", "user5". // Minimum-length (Linux): 1 character // Max-length (Linux): 64 characters // Max-length (Windows): 20 characters. AdminUsername *string // Specifies whether extension operations should be allowed on the virtual machine. This may only be set to False when no // extensions are present on the virtual machine. AllowExtensionOperations *bool // Specifies the host OS name of the virtual machine. This name cannot be updated after the VM is created. Max-length (Windows): // 15 characters. Max-length (Linux): 64 characters. For naming conventions // and restrictions see Azure infrastructure services implementation guidelines [https://docs.microsoft.com/azure/azure-resource-manager/management/resource-name-rules]. ComputerName *string // Specifies a base-64 encoded string of custom data. The base-64 encoded string is decoded to a binary array that is saved // as a file on the Virtual Machine. The maximum length of the binary array is // 65535 bytes. Note: Do not pass any secrets or passwords in customData property. This property cannot be updated after the // VM is created. The property 'customData' is passed to the VM to be saved as a // file, for more information see Custom Data on Azure VMs [https://azure.microsoft.com/blog/custom-data-and-cloud-init-on-windows-azure/]. // For using cloud-init for your Linux VM, see Using cloud-init to // customize a Linux VM during creation [https://docs.microsoft.com/azure/virtual-machines/linux/using-cloud-init]. CustomData *string // Specifies the Linux operating system settings on the virtual machine. For a list of supported Linux distributions, see // Linux on Azure-Endorsed Distributions // [https://docs.microsoft.com/azure/virtual-machines/linux/endorsed-distros]. LinuxConfiguration *LinuxConfiguration // Optional property which must either be set to True or omitted. RequireGuestProvisionSignal *bool // Specifies set of certificates that should be installed onto the virtual machine. To install certificates on a virtual machine // it is recommended to use the Azure Key Vault virtual machine extension for // Linux [https://docs.microsoft.com/azure/virtual-machines/extensions/key-vault-linux] or the Azure Key Vault virtual machine // extension for Windows // [https://docs.microsoft.com/azure/virtual-machines/extensions/key-vault-windows]. Secrets []*VaultSecretGroup // Specifies Windows operating system settings on the virtual machine. WindowsConfiguration *WindowsConfiguration }
OSProfile - Specifies the operating system settings for the virtual machine. Some of the settings cannot be changed once VM is provisioned.
func (OSProfile) MarshalJSON ¶
MarshalJSON implements the json.Marshaller interface for type OSProfile.
func (*OSProfile) UnmarshalJSON ¶
UnmarshalJSON implements the json.Unmarshaller interface for type OSProfile.
type OSProfileProvisioningData ¶
type OSProfileProvisioningData struct { // Specifies the password of the administrator account. // Minimum-length (Windows): 8 characters // Minimum-length (Linux): 6 characters // Max-length (Windows): 123 characters // Max-length (Linux): 72 characters // Complexity requirements: 3 out of 4 conditions below need to be fulfilled // Has lower characters // Has upper characters // Has a digit // Has a special character (Regex match [\W_]) // Disallowed values: "abc@123", "P@$$w0rd", "P@ssw0rd", "P@ssword123", "Pa$$word", "pass@word1", "Password!", "Password1", // "Password22", "iloveyou!" // For resetting the password, see How to reset the Remote Desktop service or its login password in a Windows VM [https://docs.microsoft.com/troubleshoot/azure/virtual-machines/reset-rdp] // For resetting root password, see Manage users, SSH, and check or repair disks on Azure Linux VMs using the VMAccess Extension // [https://docs.microsoft.com/troubleshoot/azure/virtual-machines/troubleshoot-ssh-connection] AdminPassword *string // Specifies a base-64 encoded string of custom data. The base-64 encoded string is decoded to a binary array that is saved // as a file on the Virtual Machine. The maximum length of the binary array is // 65535 bytes. Note: Do not pass any secrets or passwords in customData property. This property cannot be updated after the // VM is created. The property customData is passed to the VM to be saved as a // file, for more information see Custom Data on Azure VMs [https://azure.microsoft.com/blog/custom-data-and-cloud-init-on-windows-azure/]. // If using cloud-init for your Linux VM, see Using cloud-init to // customize a Linux VM during creation [https://docs.microsoft.com/azure/virtual-machines/linux/using-cloud-init]. CustomData *string }
OSProfileProvisioningData - Additional parameters for Reimaging Non-Ephemeral Virtual Machine.
func (OSProfileProvisioningData) MarshalJSON ¶
func (o OSProfileProvisioningData) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type OSProfileProvisioningData.
func (*OSProfileProvisioningData) UnmarshalJSON ¶
func (o *OSProfileProvisioningData) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type OSProfileProvisioningData.
type OSVersion ¶
type OSVersion struct { // OS version properties. Properties *OSVersionProperties // READ-ONLY; Resource Id. ID *string // READ-ONLY; Resource location. Location *string // READ-ONLY; Resource name. Name *string // READ-ONLY; Resource type. Type *string }
OSVersion - Describes a cloud service OS version.
func (OSVersion) MarshalJSON ¶
MarshalJSON implements the json.Marshaller interface for type OSVersion.
func (*OSVersion) UnmarshalJSON ¶
UnmarshalJSON implements the json.Unmarshaller interface for type OSVersion.
type OSVersionListResult ¶
type OSVersionListResult struct { // REQUIRED; The list of resources. Value []*OSVersion // The URI to fetch the next page of resources. Use this to get the next page of resources. Do this till nextLink is null // to fetch all the resources. NextLink *string }
OSVersionListResult - The list operation result.
func (OSVersionListResult) MarshalJSON ¶
func (o OSVersionListResult) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type OSVersionListResult.
func (*OSVersionListResult) UnmarshalJSON ¶
func (o *OSVersionListResult) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type OSVersionListResult.
type OSVersionProperties ¶
type OSVersionProperties struct { // READ-ONLY; The family of this OS version. Family *string // READ-ONLY; The family label of this OS version. FamilyLabel *string // READ-ONLY; Specifies whether this OS version is active. IsActive *bool // READ-ONLY; Specifies whether this is the default OS version for its family. IsDefault *bool // READ-ONLY; The OS version label. Label *string // READ-ONLY; The OS version. Version *string }
OSVersionProperties - OS version properties.
func (OSVersionProperties) MarshalJSON ¶
func (o OSVersionProperties) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type OSVersionProperties.
func (*OSVersionProperties) UnmarshalJSON ¶
func (o *OSVersionProperties) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type OSVersionProperties.
type OSVersionPropertiesBase ¶
type OSVersionPropertiesBase struct { // READ-ONLY; Specifies whether this OS version is active. IsActive *bool // READ-ONLY; Specifies whether this is the default OS version for its family. IsDefault *bool // READ-ONLY; The OS version label. Label *string // READ-ONLY; The OS version. Version *string }
OSVersionPropertiesBase - Configuration view of an OS version.
func (OSVersionPropertiesBase) MarshalJSON ¶
func (o OSVersionPropertiesBase) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type OSVersionPropertiesBase.
func (*OSVersionPropertiesBase) UnmarshalJSON ¶
func (o *OSVersionPropertiesBase) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type OSVersionPropertiesBase.
type OperatingSystemStateTypes ¶
type OperatingSystemStateTypes string
OperatingSystemStateTypes - This property allows the user to specify whether the virtual machines created under this image are 'Generalized' or 'Specialized'.
const ( OperatingSystemStateTypesGeneralized OperatingSystemStateTypes = "Generalized" OperatingSystemStateTypesSpecialized OperatingSystemStateTypes = "Specialized" )
func PossibleOperatingSystemStateTypesValues ¶
func PossibleOperatingSystemStateTypesValues() []OperatingSystemStateTypes
PossibleOperatingSystemStateTypesValues returns the possible values for the OperatingSystemStateTypes const type.
type OperatingSystemType ¶
type OperatingSystemType string
OperatingSystemType - Gets the Operating System type.
const ( OperatingSystemTypeLinux OperatingSystemType = "Linux" OperatingSystemTypeWindows OperatingSystemType = "Windows" )
func PossibleOperatingSystemTypeValues ¶
func PossibleOperatingSystemTypeValues() []OperatingSystemType
PossibleOperatingSystemTypeValues returns the possible values for the OperatingSystemType const type.
type OperatingSystemTypes ¶
type OperatingSystemTypes string
OperatingSystemTypes - This property allows you to specify the supported type of the OS that application is built for. Possible values are: Windows, Linux.
const ( OperatingSystemTypesLinux OperatingSystemTypes = "Linux" OperatingSystemTypesWindows OperatingSystemTypes = "Windows" )
func PossibleOperatingSystemTypesValues ¶
func PossibleOperatingSystemTypesValues() []OperatingSystemTypes
PossibleOperatingSystemTypesValues returns the possible values for the OperatingSystemTypes const type.
type OperationListResult ¶
type OperationListResult struct { // READ-ONLY; The list of compute operations Value []*OperationValue }
OperationListResult - The List Compute Operation operation response.
func (OperationListResult) MarshalJSON ¶
func (o OperationListResult) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type OperationListResult.
func (*OperationListResult) UnmarshalJSON ¶
func (o *OperationListResult) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type OperationListResult.
type OperationValue ¶
type OperationValue struct { // Describes the properties of a Compute Operation Value Display. Display *OperationValueDisplay // READ-ONLY; The name of the compute operation. Name *string // READ-ONLY; The origin of the compute operation. Origin *string }
OperationValue - Describes the properties of a Compute Operation value.
func (OperationValue) MarshalJSON ¶
func (o OperationValue) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type OperationValue.
func (*OperationValue) UnmarshalJSON ¶
func (o *OperationValue) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type OperationValue.
type OperationValueDisplay ¶
type OperationValueDisplay struct { // READ-ONLY; The description of the operation. Description *string // READ-ONLY; The display name of the compute operation. Operation *string // READ-ONLY; The resource provider for the operation. Provider *string // READ-ONLY; The display name of the resource the operation applies to. Resource *string }
OperationValueDisplay - Describes the properties of a Compute Operation Value Display.
func (OperationValueDisplay) MarshalJSON ¶
func (o OperationValueDisplay) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type OperationValueDisplay.
func (*OperationValueDisplay) UnmarshalJSON ¶
func (o *OperationValueDisplay) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type OperationValueDisplay.
type OperationsClient ¶
type OperationsClient struct {
// contains filtered or unexported fields
}
OperationsClient contains the methods for the Operations group. Don't use this type directly, use NewOperationsClient() instead.
func NewOperationsClient ¶
func NewOperationsClient(credential azcore.TokenCredential, options *arm.ClientOptions) (*OperationsClient, error)
NewOperationsClient creates a new instance of OperationsClient with the specified values.
- credential - used to authorize requests. Usually a credential from azidentity.
- options - pass nil to accept the default values.
func (*OperationsClient) NewListPager ¶
func (client *OperationsClient) NewListPager(options *OperationsClientListOptions) *runtime.Pager[OperationsClientListResponse]
NewListPager - Gets a list of compute operations.
Generated from API version 2024-03-01
- options - OperationsClientListOptions contains the optional parameters for the OperationsClient.NewListPager method.
Example (OperationsListMaximumSetGen) ¶
Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/92de53a5f1e0e03c94b40475d2135d97148ed014/specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-03-01/examples/computeRPCommonExamples/Operations_List_MaximumSet_Gen.json
cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() clientFactory, err := armcompute.NewClientFactory("<subscription-id>", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } pager := clientFactory.NewOperationsClient().NewListPager(nil) for pager.More() { page, err := pager.NextPage(ctx) if err != nil { log.Fatalf("failed to advance page: %v", err) } for _, v := range page.Value { // You could use page here. We use blank identifier for just demo purposes. _ = v } // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. // page.OperationListResult = armcompute.OperationListResult{ // Value: []*armcompute.OperationValue{ // { // Name: to.Ptr("aaaaaaaaaaaa"), // Display: &armcompute.OperationValueDisplay{ // Description: to.Ptr("aaaaaaaaaaaaaaaaaaaaaa"), // Operation: to.Ptr("aaaaaaaaaaaaaaaaaaaaaa"), // Provider: to.Ptr("aaaaaaaaaaaaaaaaaa"), // Resource: to.Ptr("aaaaaaaaaaaaaaaaaaaaaaaaaaaaa"), // }, // Origin: to.Ptr("aaaaa"), // }}, // } }
Output:
Example (OperationsListMinimumSetGen) ¶
Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/92de53a5f1e0e03c94b40475d2135d97148ed014/specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-03-01/examples/computeRPCommonExamples/Operations_List_MinimumSet_Gen.json
cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() clientFactory, err := armcompute.NewClientFactory("<subscription-id>", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } pager := clientFactory.NewOperationsClient().NewListPager(nil) for pager.More() { page, err := pager.NextPage(ctx) if err != nil { log.Fatalf("failed to advance page: %v", err) } for _, v := range page.Value { // You could use page here. We use blank identifier for just demo purposes. _ = v } // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. // page.OperationListResult = armcompute.OperationListResult{ // } }
Output:
type OperationsClientListOptions ¶
type OperationsClientListOptions struct { }
OperationsClientListOptions contains the optional parameters for the OperationsClient.NewListPager method.
type OperationsClientListResponse ¶
type OperationsClientListResponse struct { // The List Compute Operation operation response. OperationListResult }
OperationsClientListResponse contains the response from method OperationsClient.NewListPager.
type OrchestrationMode ¶
type OrchestrationMode string
OrchestrationMode - Specifies the orchestration mode for the virtual machine scale set.
const ( OrchestrationModeFlexible OrchestrationMode = "Flexible" OrchestrationModeUniform OrchestrationMode = "Uniform" )
func PossibleOrchestrationModeValues ¶
func PossibleOrchestrationModeValues() []OrchestrationMode
PossibleOrchestrationModeValues returns the possible values for the OrchestrationMode const type.
type OrchestrationServiceNames ¶
type OrchestrationServiceNames string
OrchestrationServiceNames - The name of the service.
const (
OrchestrationServiceNamesAutomaticRepairs OrchestrationServiceNames = "AutomaticRepairs"
)
func PossibleOrchestrationServiceNamesValues ¶
func PossibleOrchestrationServiceNamesValues() []OrchestrationServiceNames
PossibleOrchestrationServiceNamesValues returns the possible values for the OrchestrationServiceNames const type.
type OrchestrationServiceState ¶
type OrchestrationServiceState string
OrchestrationServiceState - The current state of the service.
const ( OrchestrationServiceStateNotRunning OrchestrationServiceState = "NotRunning" OrchestrationServiceStateRunning OrchestrationServiceState = "Running" OrchestrationServiceStateSuspended OrchestrationServiceState = "Suspended" )
func PossibleOrchestrationServiceStateValues ¶
func PossibleOrchestrationServiceStateValues() []OrchestrationServiceState
PossibleOrchestrationServiceStateValues returns the possible values for the OrchestrationServiceState const type.
type OrchestrationServiceStateAction ¶
type OrchestrationServiceStateAction string
OrchestrationServiceStateAction - The action to be performed.
const ( OrchestrationServiceStateActionResume OrchestrationServiceStateAction = "Resume" OrchestrationServiceStateActionSuspend OrchestrationServiceStateAction = "Suspend" )
func PossibleOrchestrationServiceStateActionValues ¶
func PossibleOrchestrationServiceStateActionValues() []OrchestrationServiceStateAction
PossibleOrchestrationServiceStateActionValues returns the possible values for the OrchestrationServiceStateAction const type.
type OrchestrationServiceStateInput ¶
type OrchestrationServiceStateInput struct { // REQUIRED; The action to be performed. Action *OrchestrationServiceStateAction // REQUIRED; The name of the service. ServiceName *OrchestrationServiceNames }
OrchestrationServiceStateInput - The input for OrchestrationServiceState
func (OrchestrationServiceStateInput) MarshalJSON ¶
func (o OrchestrationServiceStateInput) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type OrchestrationServiceStateInput.
func (*OrchestrationServiceStateInput) UnmarshalJSON ¶
func (o *OrchestrationServiceStateInput) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type OrchestrationServiceStateInput.
type OrchestrationServiceSummary ¶
type OrchestrationServiceSummary struct { // READ-ONLY; The name of the service. ServiceName *OrchestrationServiceNames // READ-ONLY; The current state of the service. ServiceState *OrchestrationServiceState }
OrchestrationServiceSummary - Summary for an orchestration service of a virtual machine scale set.
func (OrchestrationServiceSummary) MarshalJSON ¶
func (o OrchestrationServiceSummary) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type OrchestrationServiceSummary.
func (*OrchestrationServiceSummary) UnmarshalJSON ¶
func (o *OrchestrationServiceSummary) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type OrchestrationServiceSummary.
type PatchAssessmentState ¶
type PatchAssessmentState string
PatchAssessmentState - Describes the availability of a given patch.
const ( PatchAssessmentStateAvailable PatchAssessmentState = "Available" PatchAssessmentStateUnknown PatchAssessmentState = "Unknown" )
func PossiblePatchAssessmentStateValues ¶
func PossiblePatchAssessmentStateValues() []PatchAssessmentState
PossiblePatchAssessmentStateValues returns the possible values for the PatchAssessmentState const type.
type PatchInstallationDetail ¶
type PatchInstallationDetail struct { // READ-ONLY; The classification(s) of the patch as provided by the patch publisher. Classifications []*string // READ-ONLY; The state of the patch after the installation operation completed. InstallationState *PatchInstallationState // READ-ONLY; The KBID of the patch. Only applies to Windows patches. KbID *string // READ-ONLY; The friendly name of the patch. Name *string // READ-ONLY; A unique identifier for the patch. PatchID *string // READ-ONLY; The version string of the package. It may conform to Semantic Versioning. Only applies to Linux. Version *string }
PatchInstallationDetail - Information about a specific patch that was encountered during an installation action.
func (PatchInstallationDetail) MarshalJSON ¶
func (p PatchInstallationDetail) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type PatchInstallationDetail.
func (*PatchInstallationDetail) UnmarshalJSON ¶
func (p *PatchInstallationDetail) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type PatchInstallationDetail.
type PatchInstallationState ¶
type PatchInstallationState string
PatchInstallationState - The state of the patch after the installation operation completed.
const ( PatchInstallationStateExcluded PatchInstallationState = "Excluded" PatchInstallationStateFailed PatchInstallationState = "Failed" PatchInstallationStateInstalled PatchInstallationState = "Installed" PatchInstallationStateNotSelected PatchInstallationState = "NotSelected" PatchInstallationStatePending PatchInstallationState = "Pending" PatchInstallationStateUnknown PatchInstallationState = "Unknown" )
func PossiblePatchInstallationStateValues ¶
func PossiblePatchInstallationStateValues() []PatchInstallationState
PossiblePatchInstallationStateValues returns the possible values for the PatchInstallationState const type.
type PatchOperationStatus ¶
type PatchOperationStatus string
PatchOperationStatus - The overall success or failure status of the operation. It remains "InProgress" until the operation completes. At that point it will become "Unknown", "Failed", "Succeeded", or "CompletedWithWarnings."
const ( PatchOperationStatusCompletedWithWarnings PatchOperationStatus = "CompletedWithWarnings" PatchOperationStatusFailed PatchOperationStatus = "Failed" PatchOperationStatusInProgress PatchOperationStatus = "InProgress" PatchOperationStatusSucceeded PatchOperationStatus = "Succeeded" PatchOperationStatusUnknown PatchOperationStatus = "Unknown" )
func PossiblePatchOperationStatusValues ¶
func PossiblePatchOperationStatusValues() []PatchOperationStatus
PossiblePatchOperationStatusValues returns the possible values for the PatchOperationStatus const type.
type PatchSettings ¶
type PatchSettings struct { // Specifies the mode of VM Guest patch assessment for the IaaS virtual machine. // Possible values are: // ImageDefault - You control the timing of patch assessments on a virtual machine. // AutomaticByPlatform - The platform will trigger periodic patch assessments. The property provisionVMAgent must be true. AssessmentMode *WindowsPatchAssessmentMode // Specifies additional settings for patch mode AutomaticByPlatform in VM Guest Patching on Windows. AutomaticByPlatformSettings *WindowsVMGuestPatchAutomaticByPlatformSettings // Enables customers to patch their Azure VMs without requiring a reboot. For enableHotpatching, the 'provisionVMAgent' must // be set to true and 'patchMode' must be set to 'AutomaticByPlatform'. EnableHotpatching *bool // Specifies the mode of VM Guest Patching to IaaS virtual machine or virtual machines associated to virtual machine scale // set with OrchestrationMode as Flexible. // Possible values are: // Manual - You control the application of patches to a virtual machine. You do this by applying patches manually inside the // VM. In this mode, automatic updates are disabled; the property // WindowsConfiguration.enableAutomaticUpdates must be false // AutomaticByOS - The virtual machine will automatically be updated by the OS. The property WindowsConfiguration.enableAutomaticUpdates // must be true. // AutomaticByPlatform - the virtual machine will automatically updated by the platform. The properties provisionVMAgent and // WindowsConfiguration.enableAutomaticUpdates must be true PatchMode *WindowsVMGuestPatchMode }
PatchSettings - Specifies settings related to VM Guest Patching on Windows.
func (PatchSettings) MarshalJSON ¶
func (p PatchSettings) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type PatchSettings.
func (*PatchSettings) UnmarshalJSON ¶
func (p *PatchSettings) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type PatchSettings.
type PirCommunityGalleryResource ¶
type PirCommunityGalleryResource struct { // The identifier information of community gallery. Identifier *CommunityGalleryIdentifier // READ-ONLY; Resource location Location *string // READ-ONLY; Resource name Name *string // READ-ONLY; Resource type Type *string }
PirCommunityGalleryResource - Base information about the community gallery resource in azure compute gallery.
func (PirCommunityGalleryResource) MarshalJSON ¶
func (p PirCommunityGalleryResource) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type PirCommunityGalleryResource.
func (*PirCommunityGalleryResource) UnmarshalJSON ¶
func (p *PirCommunityGalleryResource) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type PirCommunityGalleryResource.
type PirResource ¶
type PirResource struct { // READ-ONLY; Resource location Location *string // READ-ONLY; Resource name Name *string }
PirResource - The Resource model definition.
func (PirResource) MarshalJSON ¶
func (p PirResource) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type PirResource.
func (*PirResource) UnmarshalJSON ¶
func (p *PirResource) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type PirResource.
type PirSharedGalleryResource ¶
type PirSharedGalleryResource struct { SharedGalleryIdentifier Location *string Name *string }Identifier *
PirSharedGalleryResource - Base information about the shared gallery resource in pir.
func (PirSharedGalleryResource) MarshalJSON ¶
func (p PirSharedGalleryResource) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type PirSharedGalleryResource.
func (*PirSharedGalleryResource) UnmarshalJSON ¶
func (p *PirSharedGalleryResource) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type PirSharedGalleryResource.
type Plan ¶
type Plan struct { // The plan ID. Name *string // Specifies the product of the image from the marketplace. This is the same value as Offer under the imageReference element. Product *string // The promotion code. PromotionCode *string // The publisher ID. Publisher *string }
Plan - Specifies information about the marketplace image used to create the virtual machine. This element is only used for marketplace images. Before you can use a marketplace image from an API, you must enable the image for programmatic use. In the Azure portal, find the marketplace image that you want to use and then click Want to deploy programmatically, Get Started ->. Enter any required information and then click Save.
func (Plan) MarshalJSON ¶
MarshalJSON implements the json.Marshaller interface for type Plan.
func (*Plan) UnmarshalJSON ¶
UnmarshalJSON implements the json.Unmarshaller interface for type Plan.
type PolicyViolation ¶
type PolicyViolation struct { // Describes the nature of the policy violation. Category *PolicyViolationCategory // Describes specific details about why this policy violation was reported. Details *string }
PolicyViolation - A policy violation reported against a gallery artifact.
func (PolicyViolation) MarshalJSON ¶
func (p PolicyViolation) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type PolicyViolation.
func (*PolicyViolation) UnmarshalJSON ¶
func (p *PolicyViolation) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type PolicyViolation.
type PolicyViolationCategory ¶
type PolicyViolationCategory string
PolicyViolationCategory - Describes the nature of the policy violation.
const ( PolicyViolationCategoryCopyrightValidation PolicyViolationCategory = "CopyrightValidation" PolicyViolationCategoryIPTheft PolicyViolationCategory = "IpTheft" PolicyViolationCategoryImageFlaggedUnsafe PolicyViolationCategory = "ImageFlaggedUnsafe" PolicyViolationCategoryOther PolicyViolationCategory = "Other" )
func PossiblePolicyViolationCategoryValues ¶
func PossiblePolicyViolationCategoryValues() []PolicyViolationCategory
PossiblePolicyViolationCategoryValues returns the possible values for the PolicyViolationCategory const type.
type PriorityMixPolicy ¶
type PriorityMixPolicy struct { // The base number of regular priority VMs that will be created in this scale set as it scales out. BaseRegularPriorityCount *int32 // The percentage of VM instances, after the base regular priority count has been reached, that are expected to use regular // priority. RegularPriorityPercentageAboveBase *int32 }
PriorityMixPolicy - Specifies the target splits for Spot and Regular priority VMs within a scale set with flexible orchestration mode. With this property the customer is able to specify the base number of regular priority VMs created as the VMSS flex instance scales out and the split between Spot and Regular priority VMs after this base target has been reached.
func (PriorityMixPolicy) MarshalJSON ¶
func (p PriorityMixPolicy) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type PriorityMixPolicy.
func (*PriorityMixPolicy) UnmarshalJSON ¶
func (p *PriorityMixPolicy) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type PriorityMixPolicy.
type PrivateEndpoint ¶
type PrivateEndpoint struct { // READ-ONLY; The ARM identifier for Private Endpoint ID *string }
PrivateEndpoint - The Private Endpoint resource.
func (PrivateEndpoint) MarshalJSON ¶
func (p PrivateEndpoint) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type PrivateEndpoint.
func (*PrivateEndpoint) UnmarshalJSON ¶
func (p *PrivateEndpoint) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type PrivateEndpoint.
type PrivateEndpointConnection ¶
type PrivateEndpointConnection struct { // Resource properties. Properties *PrivateEndpointConnectionProperties // READ-ONLY; private endpoint connection Id ID *string // READ-ONLY; private endpoint connection name Name *string // READ-ONLY; private endpoint connection type Type *string }
PrivateEndpointConnection - The Private Endpoint Connection resource.
func (PrivateEndpointConnection) MarshalJSON ¶
func (p PrivateEndpointConnection) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type PrivateEndpointConnection.
func (*PrivateEndpointConnection) UnmarshalJSON ¶
func (p *PrivateEndpointConnection) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type PrivateEndpointConnection.
type PrivateEndpointConnectionListResult ¶
type PrivateEndpointConnectionListResult struct { // The uri to fetch the next page of snapshots. Call ListNext() with this to fetch the next page of snapshots. NextLink *string // Array of private endpoint connections Value []*PrivateEndpointConnection }
PrivateEndpointConnectionListResult - A list of private link resources
func (PrivateEndpointConnectionListResult) MarshalJSON ¶
func (p PrivateEndpointConnectionListResult) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type PrivateEndpointConnectionListResult.
func (*PrivateEndpointConnectionListResult) UnmarshalJSON ¶
func (p *PrivateEndpointConnectionListResult) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type PrivateEndpointConnectionListResult.
type PrivateEndpointConnectionProperties ¶
type PrivateEndpointConnectionProperties struct { // REQUIRED; A collection of information about the state of the connection between DiskAccess and Virtual Network. PrivateLinkServiceConnectionState *PrivateLinkServiceConnectionState // READ-ONLY; The resource of private end point. PrivateEndpoint *PrivateEndpoint // READ-ONLY; The provisioning state of the private endpoint connection resource. ProvisioningState *PrivateEndpointConnectionProvisioningState }
PrivateEndpointConnectionProperties - Properties of the PrivateEndpointConnectProperties.
func (PrivateEndpointConnectionProperties) MarshalJSON ¶
func (p PrivateEndpointConnectionProperties) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type PrivateEndpointConnectionProperties.
func (*PrivateEndpointConnectionProperties) UnmarshalJSON ¶
func (p *PrivateEndpointConnectionProperties) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type PrivateEndpointConnectionProperties.
type PrivateEndpointConnectionProvisioningState ¶
type PrivateEndpointConnectionProvisioningState string
PrivateEndpointConnectionProvisioningState - The current provisioning state.
const ( PrivateEndpointConnectionProvisioningStateCreating PrivateEndpointConnectionProvisioningState = "Creating" PrivateEndpointConnectionProvisioningStateDeleting PrivateEndpointConnectionProvisioningState = "Deleting" PrivateEndpointConnectionProvisioningStateFailed PrivateEndpointConnectionProvisioningState = "Failed" PrivateEndpointConnectionProvisioningStateSucceeded PrivateEndpointConnectionProvisioningState = "Succeeded" )
func PossiblePrivateEndpointConnectionProvisioningStateValues ¶
func PossiblePrivateEndpointConnectionProvisioningStateValues() []PrivateEndpointConnectionProvisioningState
PossiblePrivateEndpointConnectionProvisioningStateValues returns the possible values for the PrivateEndpointConnectionProvisioningState const type.
type PrivateEndpointServiceConnectionStatus ¶
type PrivateEndpointServiceConnectionStatus string
PrivateEndpointServiceConnectionStatus - The private endpoint connection status.
const ( PrivateEndpointServiceConnectionStatusApproved PrivateEndpointServiceConnectionStatus = "Approved" PrivateEndpointServiceConnectionStatusPending PrivateEndpointServiceConnectionStatus = "Pending" PrivateEndpointServiceConnectionStatusRejected PrivateEndpointServiceConnectionStatus = "Rejected" )
func PossiblePrivateEndpointServiceConnectionStatusValues ¶
func PossiblePrivateEndpointServiceConnectionStatusValues() []PrivateEndpointServiceConnectionStatus
PossiblePrivateEndpointServiceConnectionStatusValues returns the possible values for the PrivateEndpointServiceConnectionStatus const type.
type PrivateLinkResource ¶
type PrivateLinkResource struct { // Resource properties. Properties *PrivateLinkResourceProperties // READ-ONLY; private link resource Id ID *string // READ-ONLY; private link resource name Name *string // READ-ONLY; private link resource type Type *string }
PrivateLinkResource - A private link resource
func (PrivateLinkResource) MarshalJSON ¶
func (p PrivateLinkResource) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type PrivateLinkResource.
func (*PrivateLinkResource) UnmarshalJSON ¶
func (p *PrivateLinkResource) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type PrivateLinkResource.
type PrivateLinkResourceListResult ¶
type PrivateLinkResourceListResult struct { // Array of private link resources Value []*PrivateLinkResource }
PrivateLinkResourceListResult - A list of private link resources
func (PrivateLinkResourceListResult) MarshalJSON ¶
func (p PrivateLinkResourceListResult) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type PrivateLinkResourceListResult.
func (*PrivateLinkResourceListResult) UnmarshalJSON ¶
func (p *PrivateLinkResourceListResult) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type PrivateLinkResourceListResult.
type PrivateLinkResourceProperties ¶
type PrivateLinkResourceProperties struct { // The private link resource DNS zone name. RequiredZoneNames []*string // READ-ONLY; The private link resource group id. GroupID *string // READ-ONLY; The private link resource required member names. RequiredMembers []*string }
PrivateLinkResourceProperties - Properties of a private link resource.
func (PrivateLinkResourceProperties) MarshalJSON ¶
func (p PrivateLinkResourceProperties) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type PrivateLinkResourceProperties.
func (*PrivateLinkResourceProperties) UnmarshalJSON ¶
func (p *PrivateLinkResourceProperties) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type PrivateLinkResourceProperties.
type PrivateLinkServiceConnectionState ¶
type PrivateLinkServiceConnectionState struct { // A message indicating if changes on the service provider require any updates on the consumer. ActionsRequired *string // The reason for approval/rejection of the connection. Description *string // Indicates whether the connection has been Approved/Rejected/Removed by the owner of the service. Status *PrivateEndpointServiceConnectionStatus }
PrivateLinkServiceConnectionState - A collection of information about the state of the connection between service consumer and provider.
func (PrivateLinkServiceConnectionState) MarshalJSON ¶
func (p PrivateLinkServiceConnectionState) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type PrivateLinkServiceConnectionState.
func (*PrivateLinkServiceConnectionState) UnmarshalJSON ¶
func (p *PrivateLinkServiceConnectionState) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type PrivateLinkServiceConnectionState.
type PropertyUpdatesInProgress ¶
type PropertyUpdatesInProgress struct { // The target performance tier of the disk if a tier change operation is in progress. TargetTier *string }
PropertyUpdatesInProgress - Properties of the disk for which update is pending.
func (PropertyUpdatesInProgress) MarshalJSON ¶
func (p PropertyUpdatesInProgress) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type PropertyUpdatesInProgress.
func (*PropertyUpdatesInProgress) UnmarshalJSON ¶
func (p *PropertyUpdatesInProgress) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type PropertyUpdatesInProgress.
type ProtocolTypes ¶
type ProtocolTypes string
ProtocolTypes - Specifies the protocol of WinRM listener. Possible values are: http, https.
const ( ProtocolTypesHTTP ProtocolTypes = "Http" ProtocolTypesHTTPS ProtocolTypes = "Https" )
func PossibleProtocolTypesValues ¶
func PossibleProtocolTypesValues() []ProtocolTypes
PossibleProtocolTypesValues returns the possible values for the ProtocolTypes const type.
type ProvisionedBandwidthCopyOption ¶ added in v5.5.0
type ProvisionedBandwidthCopyOption string
ProvisionedBandwidthCopyOption - If this field is set on a snapshot and createOption is CopyStart, the snapshot will be copied at a quicker speed.
const ( ProvisionedBandwidthCopyOptionEnhanced ProvisionedBandwidthCopyOption = "Enhanced" ProvisionedBandwidthCopyOptionNone ProvisionedBandwidthCopyOption = "None" )
func PossibleProvisionedBandwidthCopyOptionValues ¶ added in v5.5.0
func PossibleProvisionedBandwidthCopyOptionValues() []ProvisionedBandwidthCopyOption
PossibleProvisionedBandwidthCopyOptionValues returns the possible values for the ProvisionedBandwidthCopyOption const type.
type ProximityPlacementGroup ¶
type ProximityPlacementGroup struct { // REQUIRED; Resource location Location *string // Describes the properties of a Proximity Placement Group. Properties *ProximityPlacementGroupProperties // Resource tags Tags map[string]*string // Specifies the Availability Zone where virtual machine, virtual machine scale set or availability set associated with the // proximity placement group can be created. Zones []*string // READ-ONLY; Resource Id ID *string // READ-ONLY; Resource name Name *string // READ-ONLY; Resource type Type *string }
ProximityPlacementGroup - Specifies information about the proximity placement group.
func (ProximityPlacementGroup) MarshalJSON ¶
func (p ProximityPlacementGroup) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type ProximityPlacementGroup.
func (*ProximityPlacementGroup) UnmarshalJSON ¶
func (p *ProximityPlacementGroup) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type ProximityPlacementGroup.
type ProximityPlacementGroupListResult ¶
type ProximityPlacementGroupListResult struct { // REQUIRED; The list of proximity placement groups Value []*ProximityPlacementGroup // The URI to fetch the next page of proximity placement groups. NextLink *string }
ProximityPlacementGroupListResult - The List Proximity Placement Group operation response.
func (ProximityPlacementGroupListResult) MarshalJSON ¶
func (p ProximityPlacementGroupListResult) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type ProximityPlacementGroupListResult.
func (*ProximityPlacementGroupListResult) UnmarshalJSON ¶
func (p *ProximityPlacementGroupListResult) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type ProximityPlacementGroupListResult.
type ProximityPlacementGroupProperties ¶
type ProximityPlacementGroupProperties struct { // Describes colocation status of the Proximity Placement Group. ColocationStatus *InstanceViewStatus // Specifies the user intent of the proximity placement group. Intent *ProximityPlacementGroupPropertiesIntent // Specifies the type of the proximity placement group. Possible values are: Standard : Co-locate resources within an Azure // region or Availability Zone. Ultra : For future use. ProximityPlacementGroupType *ProximityPlacementGroupType // READ-ONLY; A list of references to all availability sets in the proximity placement group. AvailabilitySets []*SubResourceWithColocationStatus // READ-ONLY; A list of references to all virtual machine scale sets in the proximity placement group. VirtualMachineScaleSets []*SubResourceWithColocationStatus // READ-ONLY; A list of references to all virtual machines in the proximity placement group. VirtualMachines []*SubResourceWithColocationStatus }
ProximityPlacementGroupProperties - Describes the properties of a Proximity Placement Group.
func (ProximityPlacementGroupProperties) MarshalJSON ¶
func (p ProximityPlacementGroupProperties) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type ProximityPlacementGroupProperties.
func (*ProximityPlacementGroupProperties) UnmarshalJSON ¶
func (p *ProximityPlacementGroupProperties) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type ProximityPlacementGroupProperties.
type ProximityPlacementGroupPropertiesIntent ¶
type ProximityPlacementGroupPropertiesIntent struct { // Specifies possible sizes of virtual machines that can be created in the proximity placement group. VMSizes []*string }
ProximityPlacementGroupPropertiesIntent - Specifies the user intent of the proximity placement group.
func (ProximityPlacementGroupPropertiesIntent) MarshalJSON ¶
func (p ProximityPlacementGroupPropertiesIntent) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type ProximityPlacementGroupPropertiesIntent.
func (*ProximityPlacementGroupPropertiesIntent) UnmarshalJSON ¶
func (p *ProximityPlacementGroupPropertiesIntent) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type ProximityPlacementGroupPropertiesIntent.
type ProximityPlacementGroupType ¶
type ProximityPlacementGroupType string
ProximityPlacementGroupType - Specifies the type of the proximity placement group. Possible values are: Standard : Co-locate resources within an Azure region or Availability Zone. Ultra : For future use.
const ( ProximityPlacementGroupTypeStandard ProximityPlacementGroupType = "Standard" ProximityPlacementGroupTypeUltra ProximityPlacementGroupType = "Ultra" )
func PossibleProximityPlacementGroupTypeValues ¶
func PossibleProximityPlacementGroupTypeValues() []ProximityPlacementGroupType
PossibleProximityPlacementGroupTypeValues returns the possible values for the ProximityPlacementGroupType const type.
type ProximityPlacementGroupUpdate ¶
ProximityPlacementGroupUpdate - Specifies information about the proximity placement group.
func (ProximityPlacementGroupUpdate) MarshalJSON ¶
func (p ProximityPlacementGroupUpdate) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type ProximityPlacementGroupUpdate.
func (*ProximityPlacementGroupUpdate) UnmarshalJSON ¶
func (p *ProximityPlacementGroupUpdate) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type ProximityPlacementGroupUpdate.
type ProximityPlacementGroupsClient ¶
type ProximityPlacementGroupsClient struct {
// contains filtered or unexported fields
}
ProximityPlacementGroupsClient contains the methods for the ProximityPlacementGroups group. Don't use this type directly, use NewProximityPlacementGroupsClient() instead.
func NewProximityPlacementGroupsClient ¶
func NewProximityPlacementGroupsClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*ProximityPlacementGroupsClient, error)
NewProximityPlacementGroupsClient creates a new instance of ProximityPlacementGroupsClient 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 (*ProximityPlacementGroupsClient) CreateOrUpdate ¶
func (client *ProximityPlacementGroupsClient) CreateOrUpdate(ctx context.Context, resourceGroupName string, proximityPlacementGroupName string, parameters ProximityPlacementGroup, options *ProximityPlacementGroupsClientCreateOrUpdateOptions) (ProximityPlacementGroupsClientCreateOrUpdateResponse, error)
CreateOrUpdate - Create or update a proximity placement group. If the operation fails it returns an *azcore.ResponseError type.
Generated from API version 2024-03-01
- resourceGroupName - The name of the resource group.
- proximityPlacementGroupName - The name of the proximity placement group.
- parameters - Parameters supplied to the Create Proximity Placement Group operation.
- options - ProximityPlacementGroupsClientCreateOrUpdateOptions contains the optional parameters for the ProximityPlacementGroupsClient.CreateOrUpdate method.
Example ¶
Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/92de53a5f1e0e03c94b40475d2135d97148ed014/specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-03-01/examples/proximityPlacementGroupExamples/ProximityPlacementGroup_CreateOrUpdate.json
cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() clientFactory, err := armcompute.NewClientFactory("<subscription-id>", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } res, err := clientFactory.NewProximityPlacementGroupsClient().CreateOrUpdate(ctx, "myResourceGroup", "myProximityPlacementGroup", armcompute.ProximityPlacementGroup{ Location: to.Ptr("westus"), Properties: &armcompute.ProximityPlacementGroupProperties{ Intent: &armcompute.ProximityPlacementGroupPropertiesIntent{ VMSizes: []*string{ to.Ptr("Basic_A0"), to.Ptr("Basic_A2")}, }, ProximityPlacementGroupType: to.Ptr(armcompute.ProximityPlacementGroupTypeStandard), }, Zones: []*string{ to.Ptr("1")}, }, nil) if err != nil { log.Fatalf("failed to finish the request: %v", err) } // You could use response here. We use blank identifier for just demo purposes. _ = res // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. // res.ProximityPlacementGroup = armcompute.ProximityPlacementGroup{ // Name: to.Ptr("myProximityPlacementGroup"), // Type: to.Ptr("Microsoft.Compute/proximityPlacementGroups"), // ID: to.Ptr("/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/proximityPlacementGroups/myProximityPlacementGroup"), // Location: to.Ptr("westus"), // Properties: &armcompute.ProximityPlacementGroupProperties{ // Intent: &armcompute.ProximityPlacementGroupPropertiesIntent{ // VMSizes: []*string{ // to.Ptr("Basic_A0"), // to.Ptr("Basic_A2")}, // }, // ProximityPlacementGroupType: to.Ptr(armcompute.ProximityPlacementGroupTypeStandard), // }, // Zones: []*string{ // to.Ptr("1")}, // }
Output:
func (*ProximityPlacementGroupsClient) Delete ¶
func (client *ProximityPlacementGroupsClient) Delete(ctx context.Context, resourceGroupName string, proximityPlacementGroupName string, options *ProximityPlacementGroupsClientDeleteOptions) (ProximityPlacementGroupsClientDeleteResponse, error)
Delete - Delete a proximity placement group. If the operation fails it returns an *azcore.ResponseError type.
Generated from API version 2024-03-01
- resourceGroupName - The name of the resource group.
- proximityPlacementGroupName - The name of the proximity placement group.
- options - ProximityPlacementGroupsClientDeleteOptions contains the optional parameters for the ProximityPlacementGroupsClient.Delete method.
Example ¶
Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/92de53a5f1e0e03c94b40475d2135d97148ed014/specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-03-01/examples/proximityPlacementGroupExamples/ProximityPlacementGroup_Delete.json
cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() clientFactory, err := armcompute.NewClientFactory("<subscription-id>", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } _, err = clientFactory.NewProximityPlacementGroupsClient().Delete(ctx, "myResourceGroup", "myProximityPlacementGroup", nil) if err != nil { log.Fatalf("failed to finish the request: %v", err) }
Output:
func (*ProximityPlacementGroupsClient) Get ¶
func (client *ProximityPlacementGroupsClient) Get(ctx context.Context, resourceGroupName string, proximityPlacementGroupName string, options *ProximityPlacementGroupsClientGetOptions) (ProximityPlacementGroupsClientGetResponse, error)
Get - Retrieves information about a proximity placement group . If the operation fails it returns an *azcore.ResponseError type.
Generated from API version 2024-03-01
- resourceGroupName - The name of the resource group.
- proximityPlacementGroupName - The name of the proximity placement group.
- options - ProximityPlacementGroupsClientGetOptions contains the optional parameters for the ProximityPlacementGroupsClient.Get method.
Example ¶
Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/92de53a5f1e0e03c94b40475d2135d97148ed014/specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-03-01/examples/proximityPlacementGroupExamples/ProximityPlacementGroup_Get.json
cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() clientFactory, err := armcompute.NewClientFactory("<subscription-id>", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } res, err := clientFactory.NewProximityPlacementGroupsClient().Get(ctx, "myResourceGroup", "myProximityPlacementGroup", &armcompute.ProximityPlacementGroupsClientGetOptions{IncludeColocationStatus: nil}) if err != nil { log.Fatalf("failed to finish the request: %v", err) } // You could use response here. We use blank identifier for just demo purposes. _ = res // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. // res.ProximityPlacementGroup = armcompute.ProximityPlacementGroup{ // Name: to.Ptr("myProximityPlacementGroup"), // Type: to.Ptr("Microsoft.Compute/proximityPlacementGroups"), // ID: to.Ptr("/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/proximityPlacementGroups/myProximityPlacementGroup"), // Location: to.Ptr("westus"), // Properties: &armcompute.ProximityPlacementGroupProperties{ // AvailabilitySets: []*armcompute.SubResourceWithColocationStatus{ // { // ID: to.Ptr("string"), // }}, // Intent: &armcompute.ProximityPlacementGroupPropertiesIntent{ // VMSizes: []*string{ // to.Ptr("Basic_A0"), // to.Ptr("Basic_A2")}, // }, // ProximityPlacementGroupType: to.Ptr(armcompute.ProximityPlacementGroupTypeStandard), // VirtualMachineScaleSets: []*armcompute.SubResourceWithColocationStatus{ // { // ID: to.Ptr("string"), // }}, // VirtualMachines: []*armcompute.SubResourceWithColocationStatus{ // { // ID: to.Ptr("string"), // }}, // }, // Zones: []*string{ // to.Ptr("1")}, // }
Output:
func (*ProximityPlacementGroupsClient) NewListByResourceGroupPager ¶
func (client *ProximityPlacementGroupsClient) NewListByResourceGroupPager(resourceGroupName string, options *ProximityPlacementGroupsClientListByResourceGroupOptions) *runtime.Pager[ProximityPlacementGroupsClientListByResourceGroupResponse]
NewListByResourceGroupPager - Lists all proximity placement groups in a resource group.
Generated from API version 2024-03-01
- resourceGroupName - The name of the resource group.
- options - ProximityPlacementGroupsClientListByResourceGroupOptions contains the optional parameters for the ProximityPlacementGroupsClient.NewListByResourceGroupPager method.
Example ¶
Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/92de53a5f1e0e03c94b40475d2135d97148ed014/specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-03-01/examples/proximityPlacementGroupExamples/ProximityPlacementGroup_ListByResourceGroup.json
cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() clientFactory, err := armcompute.NewClientFactory("<subscription-id>", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } pager := clientFactory.NewProximityPlacementGroupsClient().NewListByResourceGroupPager("myResourceGroup", nil) for pager.More() { page, err := pager.NextPage(ctx) if err != nil { log.Fatalf("failed to advance page: %v", err) } for _, v := range page.Value { // You could use page here. We use blank identifier for just demo purposes. _ = v } // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. // page.ProximityPlacementGroupListResult = armcompute.ProximityPlacementGroupListResult{ // Value: []*armcompute.ProximityPlacementGroup{ // { // Name: to.Ptr("myProximityPlacementGroup"), // Type: to.Ptr("Microsoft.Compute/proximityPlacementGroups"), // ID: to.Ptr("/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/proximityPlacementGroups/myProximityPlacementGroup"), // Location: to.Ptr("westus"), // Properties: &armcompute.ProximityPlacementGroupProperties{ // AvailabilitySets: []*armcompute.SubResourceWithColocationStatus{ // { // ID: to.Ptr("string"), // }}, // Intent: &armcompute.ProximityPlacementGroupPropertiesIntent{ // VMSizes: []*string{ // to.Ptr("Basic_A0"), // to.Ptr("Basic_A2")}, // }, // ProximityPlacementGroupType: to.Ptr(armcompute.ProximityPlacementGroupTypeStandard), // VirtualMachineScaleSets: []*armcompute.SubResourceWithColocationStatus{ // { // ID: to.Ptr("string"), // }}, // VirtualMachines: []*armcompute.SubResourceWithColocationStatus{ // { // ID: to.Ptr("string"), // }}, // }, // Zones: []*string{ // to.Ptr("1")}, // }}, // } }
Output:
func (*ProximityPlacementGroupsClient) NewListBySubscriptionPager ¶
func (client *ProximityPlacementGroupsClient) NewListBySubscriptionPager(options *ProximityPlacementGroupsClientListBySubscriptionOptions) *runtime.Pager[ProximityPlacementGroupsClientListBySubscriptionResponse]
NewListBySubscriptionPager - Lists all proximity placement groups in a subscription.
Generated from API version 2024-03-01
- options - ProximityPlacementGroupsClientListBySubscriptionOptions contains the optional parameters for the ProximityPlacementGroupsClient.NewListBySubscriptionPager method.
Example ¶
Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/92de53a5f1e0e03c94b40475d2135d97148ed014/specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-03-01/examples/proximityPlacementGroupExamples/ProximityPlacementGroup_ListBySubscription.json
cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() clientFactory, err := armcompute.NewClientFactory("<subscription-id>", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } pager := clientFactory.NewProximityPlacementGroupsClient().NewListBySubscriptionPager(nil) for pager.More() { page, err := pager.NextPage(ctx) if err != nil { log.Fatalf("failed to advance page: %v", err) } for _, v := range page.Value { // You could use page here. We use blank identifier for just demo purposes. _ = v } // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. // page.ProximityPlacementGroupListResult = armcompute.ProximityPlacementGroupListResult{ // Value: []*armcompute.ProximityPlacementGroup{ // { // Name: to.Ptr("myProximityPlacementGroup"), // Type: to.Ptr("Microsoft.Compute/proximityPlacementGroups"), // ID: to.Ptr("/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/proximityPlacementGroups/myProximityPlacementGroup"), // Location: to.Ptr("westus"), // Properties: &armcompute.ProximityPlacementGroupProperties{ // AvailabilitySets: []*armcompute.SubResourceWithColocationStatus{ // { // ID: to.Ptr("string"), // }}, // Intent: &armcompute.ProximityPlacementGroupPropertiesIntent{ // VMSizes: []*string{ // to.Ptr("Basic_A0"), // to.Ptr("Basic_A2")}, // }, // ProximityPlacementGroupType: to.Ptr(armcompute.ProximityPlacementGroupTypeStandard), // VirtualMachineScaleSets: []*armcompute.SubResourceWithColocationStatus{ // { // ID: to.Ptr("string"), // }}, // VirtualMachines: []*armcompute.SubResourceWithColocationStatus{ // { // ID: to.Ptr("string"), // }}, // }, // Zones: []*string{ // to.Ptr("1")}, // }}, // } }
Output:
func (*ProximityPlacementGroupsClient) Update ¶
func (client *ProximityPlacementGroupsClient) Update(ctx context.Context, resourceGroupName string, proximityPlacementGroupName string, parameters ProximityPlacementGroupUpdate, options *ProximityPlacementGroupsClientUpdateOptions) (ProximityPlacementGroupsClientUpdateResponse, error)
Update - Update a proximity placement group. If the operation fails it returns an *azcore.ResponseError type.
Generated from API version 2024-03-01
- resourceGroupName - The name of the resource group.
- proximityPlacementGroupName - The name of the proximity placement group.
- parameters - Parameters supplied to the Update Proximity Placement Group operation.
- options - ProximityPlacementGroupsClientUpdateOptions contains the optional parameters for the ProximityPlacementGroupsClient.Update method.
Example ¶
Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/92de53a5f1e0e03c94b40475d2135d97148ed014/specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-03-01/examples/proximityPlacementGroupExamples/ProximityPlacementGroup_Patch.json
cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() clientFactory, err := armcompute.NewClientFactory("<subscription-id>", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } res, err := clientFactory.NewProximityPlacementGroupsClient().Update(ctx, "myResourceGroup", "myProximityPlacementGroup", armcompute.ProximityPlacementGroupUpdate{ Tags: map[string]*string{ "additionalProp1": to.Ptr("string"), }, }, nil) if err != nil { log.Fatalf("failed to finish the request: %v", err) } // You could use response here. We use blank identifier for just demo purposes. _ = res // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. // res.ProximityPlacementGroup = armcompute.ProximityPlacementGroup{ // Name: to.Ptr("myProximityPlacementGroup"), // Type: to.Ptr("Microsoft.Compute/proximityPlacementGroups"), // ID: to.Ptr("/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/proximityPlacementGroups/myProximityPlacementGroup"), // Location: to.Ptr("westus"), // Properties: &armcompute.ProximityPlacementGroupProperties{ // ProximityPlacementGroupType: to.Ptr(armcompute.ProximityPlacementGroupTypeStandard), // }, // }
Output:
type ProximityPlacementGroupsClientCreateOrUpdateOptions ¶
type ProximityPlacementGroupsClientCreateOrUpdateOptions struct { }
ProximityPlacementGroupsClientCreateOrUpdateOptions contains the optional parameters for the ProximityPlacementGroupsClient.CreateOrUpdate method.
type ProximityPlacementGroupsClientCreateOrUpdateResponse ¶
type ProximityPlacementGroupsClientCreateOrUpdateResponse struct { // Specifies information about the proximity placement group. ProximityPlacementGroup }
ProximityPlacementGroupsClientCreateOrUpdateResponse contains the response from method ProximityPlacementGroupsClient.CreateOrUpdate.
type ProximityPlacementGroupsClientDeleteOptions ¶
type ProximityPlacementGroupsClientDeleteOptions struct { }
ProximityPlacementGroupsClientDeleteOptions contains the optional parameters for the ProximityPlacementGroupsClient.Delete method.
type ProximityPlacementGroupsClientDeleteResponse ¶
type ProximityPlacementGroupsClientDeleteResponse struct { }
ProximityPlacementGroupsClientDeleteResponse contains the response from method ProximityPlacementGroupsClient.Delete.
type ProximityPlacementGroupsClientGetOptions ¶
type ProximityPlacementGroupsClientGetOptions struct { // includeColocationStatus=true enables fetching the colocation status of all the resources in the proximity placement group. IncludeColocationStatus *string }
ProximityPlacementGroupsClientGetOptions contains the optional parameters for the ProximityPlacementGroupsClient.Get method.
type ProximityPlacementGroupsClientGetResponse ¶
type ProximityPlacementGroupsClientGetResponse struct { // Specifies information about the proximity placement group. ProximityPlacementGroup }
ProximityPlacementGroupsClientGetResponse contains the response from method ProximityPlacementGroupsClient.Get.
type ProximityPlacementGroupsClientListByResourceGroupOptions ¶
type ProximityPlacementGroupsClientListByResourceGroupOptions struct { }
ProximityPlacementGroupsClientListByResourceGroupOptions contains the optional parameters for the ProximityPlacementGroupsClient.NewListByResourceGroupPager method.
type ProximityPlacementGroupsClientListByResourceGroupResponse ¶
type ProximityPlacementGroupsClientListByResourceGroupResponse struct { // The List Proximity Placement Group operation response. ProximityPlacementGroupListResult }
ProximityPlacementGroupsClientListByResourceGroupResponse contains the response from method ProximityPlacementGroupsClient.NewListByResourceGroupPager.
type ProximityPlacementGroupsClientListBySubscriptionOptions ¶
type ProximityPlacementGroupsClientListBySubscriptionOptions struct { }
ProximityPlacementGroupsClientListBySubscriptionOptions contains the optional parameters for the ProximityPlacementGroupsClient.NewListBySubscriptionPager method.
type ProximityPlacementGroupsClientListBySubscriptionResponse ¶
type ProximityPlacementGroupsClientListBySubscriptionResponse struct { // The List Proximity Placement Group operation response. ProximityPlacementGroupListResult }
ProximityPlacementGroupsClientListBySubscriptionResponse contains the response from method ProximityPlacementGroupsClient.NewListBySubscriptionPager.
type ProximityPlacementGroupsClientUpdateOptions ¶
type ProximityPlacementGroupsClientUpdateOptions struct { }
ProximityPlacementGroupsClientUpdateOptions contains the optional parameters for the ProximityPlacementGroupsClient.Update method.
type ProximityPlacementGroupsClientUpdateResponse ¶
type ProximityPlacementGroupsClientUpdateResponse struct { // Specifies information about the proximity placement group. ProximityPlacementGroup }
ProximityPlacementGroupsClientUpdateResponse contains the response from method ProximityPlacementGroupsClient.Update.
type ProxyAgentSettings ¶ added in v5.4.0
type ProxyAgentSettings struct { // Specifies whether ProxyAgent feature should be enabled on the virtual machine or virtual machine scale set. Enabled *bool // Increase the value of this property allows user to reset the key used for securing communication channel between guest // and host. KeyIncarnationID *int32 // Specifies the mode that ProxyAgent will execute on if the feature is enabled. ProxyAgent will start to audit or monitor // but not enforce access control over requests to host endpoints in Audit mode, // while in Enforce mode it will enforce access control. The default value is Enforce mode. Mode *Mode }
ProxyAgentSettings - Specifies ProxyAgent settings while creating the virtual machine. Minimum api-version: 2024-03-01.
func (ProxyAgentSettings) MarshalJSON ¶ added in v5.4.0
func (p ProxyAgentSettings) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type ProxyAgentSettings.
func (*ProxyAgentSettings) UnmarshalJSON ¶ added in v5.4.0
func (p *ProxyAgentSettings) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type ProxyAgentSettings.
type ProxyOnlyResource ¶
type ProxyOnlyResource struct { // READ-ONLY; Resource Id ID *string // READ-ONLY; Resource name Name *string // READ-ONLY; Resource type Type *string }
ProxyOnlyResource - The ProxyOnly Resource model definition.
func (ProxyOnlyResource) MarshalJSON ¶
func (p ProxyOnlyResource) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type ProxyOnlyResource.
func (*ProxyOnlyResource) UnmarshalJSON ¶
func (p *ProxyOnlyResource) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type ProxyOnlyResource.
type ProxyResource ¶
type ProxyResource struct { // READ-ONLY; Resource Id ID *string // READ-ONLY; Resource name Name *string // READ-ONLY; Resource type Type *string }
ProxyResource - The resource model definition for an Azure Resource Manager proxy resource. It will not have tags and a location
func (ProxyResource) MarshalJSON ¶
func (p ProxyResource) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type ProxyResource.
func (*ProxyResource) UnmarshalJSON ¶
func (p *ProxyResource) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type ProxyResource.
type PublicIPAddressSKU ¶
type PublicIPAddressSKU struct { // Specify public IP sku name Name *PublicIPAddressSKUName // Specify public IP sku tier Tier *PublicIPAddressSKUTier }
PublicIPAddressSKU - Describes the public IP Sku. It can only be set with OrchestrationMode as Flexible.
func (PublicIPAddressSKU) MarshalJSON ¶
func (p PublicIPAddressSKU) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type PublicIPAddressSKU.
func (*PublicIPAddressSKU) UnmarshalJSON ¶
func (p *PublicIPAddressSKU) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type PublicIPAddressSKU.
type PublicIPAddressSKUName ¶
type PublicIPAddressSKUName string
PublicIPAddressSKUName - Specify public IP sku name
const ( PublicIPAddressSKUNameBasic PublicIPAddressSKUName = "Basic" PublicIPAddressSKUNameStandard PublicIPAddressSKUName = "Standard" )
func PossiblePublicIPAddressSKUNameValues ¶
func PossiblePublicIPAddressSKUNameValues() []PublicIPAddressSKUName
PossiblePublicIPAddressSKUNameValues returns the possible values for the PublicIPAddressSKUName const type.
type PublicIPAddressSKUTier ¶
type PublicIPAddressSKUTier string
PublicIPAddressSKUTier - Specify public IP sku tier
const ( PublicIPAddressSKUTierGlobal PublicIPAddressSKUTier = "Global" PublicIPAddressSKUTierRegional PublicIPAddressSKUTier = "Regional" )
func PossiblePublicIPAddressSKUTierValues ¶
func PossiblePublicIPAddressSKUTierValues() []PublicIPAddressSKUTier
PossiblePublicIPAddressSKUTierValues returns the possible values for the PublicIPAddressSKUTier const type.
type PublicIPAllocationMethod ¶
type PublicIPAllocationMethod string
PublicIPAllocationMethod - Specify the public IP allocation type
const ( PublicIPAllocationMethodDynamic PublicIPAllocationMethod = "Dynamic" PublicIPAllocationMethodStatic PublicIPAllocationMethod = "Static" )
func PossiblePublicIPAllocationMethodValues ¶
func PossiblePublicIPAllocationMethodValues() []PublicIPAllocationMethod
PossiblePublicIPAllocationMethodValues returns the possible values for the PublicIPAllocationMethod const type.
type PublicNetworkAccess ¶
type PublicNetworkAccess string
PublicNetworkAccess - Policy for controlling export on the disk.
const ( // PublicNetworkAccessDisabled - You cannot access the underlying data of the disk publicly on the internet even when NetworkAccessPolicy // is set to AllowAll. You can access the data via the SAS URI only from your trusted Azure VNET when NetworkAccessPolicy // is set to AllowPrivate. PublicNetworkAccessDisabled PublicNetworkAccess = "Disabled" // PublicNetworkAccessEnabled - You can generate a SAS URI to access the underlying data of the disk publicly on the internet // when NetworkAccessPolicy is set to AllowAll. You can access the data via the SAS URI only from your trusted Azure VNET // when NetworkAccessPolicy is set to AllowPrivate. PublicNetworkAccessEnabled PublicNetworkAccess = "Enabled" )
func PossiblePublicNetworkAccessValues ¶
func PossiblePublicNetworkAccessValues() []PublicNetworkAccess
PossiblePublicNetworkAccessValues returns the possible values for the PublicNetworkAccess const type.
type PurchasePlan ¶
type PurchasePlan struct { // REQUIRED; The plan ID. Name *string // REQUIRED; Specifies the product of the image from the marketplace. This is the same value as Offer under the imageReference // element. Product *string // REQUIRED; The publisher ID. Publisher *string }
PurchasePlan - Used for establishing the purchase context of any 3rd Party artifact through MarketPlace.
func (PurchasePlan) MarshalJSON ¶
func (p PurchasePlan) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type PurchasePlan.
func (*PurchasePlan) UnmarshalJSON ¶
func (p *PurchasePlan) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type PurchasePlan.
type RecommendedMachineConfiguration ¶
type RecommendedMachineConfiguration struct { // Describes the resource range. Memory *ResourceRange // Describes the resource range. VCPUs *ResourceRange }
RecommendedMachineConfiguration - The properties describe the recommended machine configuration for this Image Definition. These properties are updatable.
func (RecommendedMachineConfiguration) MarshalJSON ¶
func (r RecommendedMachineConfiguration) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type RecommendedMachineConfiguration.
func (*RecommendedMachineConfiguration) UnmarshalJSON ¶
func (r *RecommendedMachineConfiguration) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type RecommendedMachineConfiguration.
type RecoveryWalkResponse ¶
type RecoveryWalkResponse struct { // READ-ONLY; The next update domain that needs to be walked. Null means walk spanning all update domains has been completed NextPlatformUpdateDomain *int32 // READ-ONLY; Whether the recovery walk was performed WalkPerformed *bool }
RecoveryWalkResponse - Response after calling a manual recovery walk
func (RecoveryWalkResponse) MarshalJSON ¶
func (r RecoveryWalkResponse) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type RecoveryWalkResponse.
func (*RecoveryWalkResponse) UnmarshalJSON ¶
func (r *RecoveryWalkResponse) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type RecoveryWalkResponse.
type RegionalReplicationStatus ¶
type RegionalReplicationStatus struct { // READ-ONLY; The details of the replication status. Details *string // READ-ONLY; It indicates progress of the replication job. Progress *int32 // READ-ONLY; The region to which the gallery image version is being replicated to. Region *string // READ-ONLY; This is the regional replication state. State *ReplicationState }
RegionalReplicationStatus - This is the regional replication status.
func (RegionalReplicationStatus) MarshalJSON ¶
func (r RegionalReplicationStatus) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type RegionalReplicationStatus.
func (*RegionalReplicationStatus) UnmarshalJSON ¶
func (r *RegionalReplicationStatus) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type RegionalReplicationStatus.
type RegionalSharingStatus ¶
type RegionalSharingStatus struct { // Details of gallery regional sharing failure. Details *string // Region name Region *string // READ-ONLY; Gallery sharing state in current region State *SharingState }
RegionalSharingStatus - Gallery regional sharing status
func (RegionalSharingStatus) MarshalJSON ¶
func (r RegionalSharingStatus) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type RegionalSharingStatus.
func (*RegionalSharingStatus) UnmarshalJSON ¶
func (r *RegionalSharingStatus) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type RegionalSharingStatus.
type RepairAction ¶
type RepairAction string
RepairAction - Type of repair action (replace, restart, reimage) that will be used for repairing unhealthy virtual machines in the scale set. Default value is replace.
const ( RepairActionReimage RepairAction = "Reimage" RepairActionReplace RepairAction = "Replace" RepairActionRestart RepairAction = "Restart" )
func PossibleRepairActionValues ¶
func PossibleRepairActionValues() []RepairAction
PossibleRepairActionValues returns the possible values for the RepairAction const type.
type ReplicationMode ¶
type ReplicationMode string
ReplicationMode - Optional parameter which specifies the mode to be used for replication. This property is not updatable.
const ( ReplicationModeFull ReplicationMode = "Full" ReplicationModeShallow ReplicationMode = "Shallow" )
func PossibleReplicationModeValues ¶
func PossibleReplicationModeValues() []ReplicationMode
PossibleReplicationModeValues returns the possible values for the ReplicationMode const type.
type ReplicationState ¶
type ReplicationState string
ReplicationState - This is the regional replication state.
const ( ReplicationStateCompleted ReplicationState = "Completed" ReplicationStateFailed ReplicationState = "Failed" ReplicationStateReplicating ReplicationState = "Replicating" ReplicationStateUnknown ReplicationState = "Unknown" )
func PossibleReplicationStateValues ¶
func PossibleReplicationStateValues() []ReplicationState
PossibleReplicationStateValues returns the possible values for the ReplicationState const type.
type ReplicationStatus ¶
type ReplicationStatus struct { // READ-ONLY; This is the aggregated replication status based on all the regional replication status flags. AggregatedState *AggregatedReplicationState // READ-ONLY; This is a summary of replication status for each region. Summary []*RegionalReplicationStatus }
ReplicationStatus - This is the replication status of the gallery image version.
func (ReplicationStatus) MarshalJSON ¶
func (r ReplicationStatus) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type ReplicationStatus.
func (*ReplicationStatus) UnmarshalJSON ¶
func (r *ReplicationStatus) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type ReplicationStatus.
type ReplicationStatusTypes ¶
type ReplicationStatusTypes string
const ( ReplicationStatusTypesReplicationStatus ReplicationStatusTypes = "ReplicationStatus" ReplicationStatusTypesUefiSettings ReplicationStatusTypes = "UefiSettings" )
func PossibleReplicationStatusTypesValues ¶
func PossibleReplicationStatusTypesValues() []ReplicationStatusTypes
PossibleReplicationStatusTypesValues returns the possible values for the ReplicationStatusTypes const type.
type RequestRateByIntervalInput ¶
type RequestRateByIntervalInput struct { // REQUIRED; SAS Uri of the logging blob container to which LogAnalytics Api writes output logs to. BlobContainerSasURI *string // REQUIRED; From time of the query FromTime *time.Time // REQUIRED; Interval value in minutes used to create LogAnalytics call rate logs. IntervalLength *IntervalInMins // REQUIRED; To time of the query ToTime *time.Time // Group query result by Client Application ID. GroupByClientApplicationID *bool // Group query result by Operation Name. GroupByOperationName *bool // Group query result by Resource Name. GroupByResourceName *bool // Group query result by Throttle Policy applied. GroupByThrottlePolicy *bool // Group query result by User Agent. GroupByUserAgent *bool }
RequestRateByIntervalInput - Api request input for LogAnalytics getRequestRateByInterval Api.
func (RequestRateByIntervalInput) MarshalJSON ¶
func (r RequestRateByIntervalInput) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type RequestRateByIntervalInput.
func (*RequestRateByIntervalInput) UnmarshalJSON ¶
func (r *RequestRateByIntervalInput) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type RequestRateByIntervalInput.
type ResiliencyPolicy ¶ added in v5.4.0
type ResiliencyPolicy struct { // The configuration parameters used while performing resilient VM creation. ResilientVMCreationPolicy *ResilientVMCreationPolicy // The configuration parameters used while performing resilient VM deletion. ResilientVMDeletionPolicy *ResilientVMDeletionPolicy }
ResiliencyPolicy - Describes an resiliency policy - resilientVMCreationPolicy and/or resilientVMDeletionPolicy.
func (ResiliencyPolicy) MarshalJSON ¶ added in v5.4.0
func (r ResiliencyPolicy) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type ResiliencyPolicy.
func (*ResiliencyPolicy) UnmarshalJSON ¶ added in v5.4.0
func (r *ResiliencyPolicy) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type ResiliencyPolicy.
type ResilientVMCreationPolicy ¶ added in v5.4.0
type ResilientVMCreationPolicy struct { // Specifies whether resilient VM creation should be enabled on the virtual machine scale set. The default value is false. Enabled *bool }
ResilientVMCreationPolicy - The configuration parameters used while performing resilient VM creation.
func (ResilientVMCreationPolicy) MarshalJSON ¶ added in v5.4.0
func (r ResilientVMCreationPolicy) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type ResilientVMCreationPolicy.
func (*ResilientVMCreationPolicy) UnmarshalJSON ¶ added in v5.4.0
func (r *ResilientVMCreationPolicy) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type ResilientVMCreationPolicy.
type ResilientVMDeletionPolicy ¶ added in v5.4.0
type ResilientVMDeletionPolicy struct { // Specifies whether resilient VM deletion should be enabled on the virtual machine scale set. The default value is false. Enabled *bool }
ResilientVMDeletionPolicy - The configuration parameters used while performing resilient VM deletion.
func (ResilientVMDeletionPolicy) MarshalJSON ¶ added in v5.4.0
func (r ResilientVMDeletionPolicy) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type ResilientVMDeletionPolicy.
func (*ResilientVMDeletionPolicy) UnmarshalJSON ¶ added in v5.4.0
func (r *ResilientVMDeletionPolicy) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type ResilientVMDeletionPolicy.
type Resource ¶
type Resource struct { // REQUIRED; Resource location Location *string // Resource tags Tags map[string]*string // READ-ONLY; Resource Id ID *string // READ-ONLY; Resource name Name *string // READ-ONLY; Resource type Type *string }
Resource - The Resource model definition.
func (Resource) MarshalJSON ¶
MarshalJSON implements the json.Marshaller interface for type Resource.
func (*Resource) UnmarshalJSON ¶
UnmarshalJSON implements the json.Unmarshaller interface for type Resource.
type ResourceIDOptionsForGetCapacityReservationGroups ¶ added in v5.7.0
type ResourceIDOptionsForGetCapacityReservationGroups string
const ( ResourceIDOptionsForGetCapacityReservationGroupsAll ResourceIDOptionsForGetCapacityReservationGroups = "All" ResourceIDOptionsForGetCapacityReservationGroupsCreatedInSubscription ResourceIDOptionsForGetCapacityReservationGroups = "CreatedInSubscription" )
func PossibleResourceIDOptionsForGetCapacityReservationGroupsValues ¶ added in v5.7.0
func PossibleResourceIDOptionsForGetCapacityReservationGroupsValues() []ResourceIDOptionsForGetCapacityReservationGroups
PossibleResourceIDOptionsForGetCapacityReservationGroupsValues returns the possible values for the ResourceIDOptionsForGetCapacityReservationGroups const type.
type ResourceIdentityType ¶
type ResourceIdentityType string
ResourceIdentityType - The type of identity used for the virtual machine scale set. The type 'SystemAssigned, UserAssigned' includes both an implicitly created identity and a set of user assigned identities. The type 'None' will remove any identities from the virtual machine scale set.
const ( ResourceIdentityTypeNone ResourceIdentityType = "None" ResourceIdentityTypeSystemAssigned ResourceIdentityType = "SystemAssigned" ResourceIdentityTypeSystemAssignedUserAssigned ResourceIdentityType = "SystemAssigned, UserAssigned" ResourceIdentityTypeUserAssigned ResourceIdentityType = "UserAssigned" )
func PossibleResourceIdentityTypeValues ¶
func PossibleResourceIdentityTypeValues() []ResourceIdentityType
PossibleResourceIdentityTypeValues returns the possible values for the ResourceIdentityType const type.
type ResourceInstanceViewStatus ¶
type ResourceInstanceViewStatus struct { // The level code. Level *StatusLevelTypes // READ-ONLY; The status code. Code *string // READ-ONLY; The short localizable label for the status. DisplayStatus *string // READ-ONLY; The detailed status message, including for alerts and error messages. Message *string // READ-ONLY; The time of the status. Time *time.Time }
ResourceInstanceViewStatus - Instance view status.
func (ResourceInstanceViewStatus) MarshalJSON ¶
func (r ResourceInstanceViewStatus) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type ResourceInstanceViewStatus.
func (*ResourceInstanceViewStatus) UnmarshalJSON ¶
func (r *ResourceInstanceViewStatus) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type ResourceInstanceViewStatus.
type ResourceRange ¶
type ResourceRange struct { // The maximum number of the resource. Max *int32 // The minimum number of the resource. Min *int32 }
ResourceRange - Describes the resource range.
func (ResourceRange) MarshalJSON ¶
func (r ResourceRange) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type ResourceRange.
func (*ResourceRange) UnmarshalJSON ¶
func (r *ResourceRange) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type ResourceRange.
type ResourceSKU ¶
type ResourceSKU struct { // READ-ONLY; The api versions that support this SKU. APIVersions []*string // READ-ONLY; A name value pair to describe the capability. Capabilities []*ResourceSKUCapabilities // READ-ONLY; Specifies the number of virtual machines in the scale set. Capacity *ResourceSKUCapacity // READ-ONLY; Metadata for retrieving price info. Costs []*ResourceSKUCosts // READ-ONLY; The Family of this particular SKU. Family *string // READ-ONLY; The Kind of resources that are supported in this SKU. Kind *string // READ-ONLY; A list of locations and availability zones in those locations where the SKU is available. LocationInfo []*ResourceSKULocationInfo // READ-ONLY; The set of locations that the SKU is available. Locations []*string // READ-ONLY; The name of SKU. Name *string // READ-ONLY; The type of resource the SKU applies to. ResourceType *string // READ-ONLY; The restrictions because of which SKU cannot be used. This is empty if there are no restrictions. Restrictions []*ResourceSKURestrictions // READ-ONLY; The Size of the SKU. Size *string // READ-ONLY; Specifies the tier of virtual machines in a scale set. // Possible Values: // Standard // Basic Tier *string }
ResourceSKU - Describes an available Compute SKU.
func (ResourceSKU) MarshalJSON ¶
func (r ResourceSKU) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type ResourceSKU.
func (*ResourceSKU) UnmarshalJSON ¶
func (r *ResourceSKU) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type ResourceSKU.
type ResourceSKUCapabilities ¶
type ResourceSKUCapabilities struct { // READ-ONLY; An invariant to describe the feature. Name *string // READ-ONLY; An invariant if the feature is measured by quantity. Value *string }
ResourceSKUCapabilities - Describes The SKU capabilities object.
func (ResourceSKUCapabilities) MarshalJSON ¶
func (r ResourceSKUCapabilities) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type ResourceSKUCapabilities.
func (*ResourceSKUCapabilities) UnmarshalJSON ¶
func (r *ResourceSKUCapabilities) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type ResourceSKUCapabilities.
type ResourceSKUCapacity ¶
type ResourceSKUCapacity struct { // READ-ONLY; The default capacity. Default *int64 // READ-ONLY; The maximum capacity that can be set. Maximum *int64 // READ-ONLY; The minimum capacity. Minimum *int64 // READ-ONLY; The scale type applicable to the sku. ScaleType *ResourceSKUCapacityScaleType }
ResourceSKUCapacity - Describes scaling information of a SKU.
func (ResourceSKUCapacity) MarshalJSON ¶
func (r ResourceSKUCapacity) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type ResourceSKUCapacity.
func (*ResourceSKUCapacity) UnmarshalJSON ¶
func (r *ResourceSKUCapacity) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type ResourceSKUCapacity.
type ResourceSKUCapacityScaleType ¶
type ResourceSKUCapacityScaleType string
ResourceSKUCapacityScaleType - The scale type applicable to the sku.
const ( ResourceSKUCapacityScaleTypeAutomatic ResourceSKUCapacityScaleType = "Automatic" ResourceSKUCapacityScaleTypeManual ResourceSKUCapacityScaleType = "Manual" ResourceSKUCapacityScaleTypeNone ResourceSKUCapacityScaleType = "None" )
func PossibleResourceSKUCapacityScaleTypeValues ¶
func PossibleResourceSKUCapacityScaleTypeValues() []ResourceSKUCapacityScaleType
PossibleResourceSKUCapacityScaleTypeValues returns the possible values for the ResourceSKUCapacityScaleType const type.
type ResourceSKUCosts ¶
type ResourceSKUCosts struct { // READ-ONLY; An invariant to show the extended unit. ExtendedUnit *string // READ-ONLY; Used for querying price from commerce. MeterID *string // READ-ONLY; The multiplier is needed to extend the base metered cost. Quantity *int64 }
ResourceSKUCosts - Describes metadata for retrieving price info.
func (ResourceSKUCosts) MarshalJSON ¶
func (r ResourceSKUCosts) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type ResourceSKUCosts.
func (*ResourceSKUCosts) UnmarshalJSON ¶
func (r *ResourceSKUCosts) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type ResourceSKUCosts.
type ResourceSKULocationInfo ¶
type ResourceSKULocationInfo struct { // READ-ONLY; The names of extended locations. ExtendedLocations []*string // READ-ONLY; Location of the SKU Location *string // READ-ONLY; The type of the extended location. Type *ExtendedLocationType // READ-ONLY; Details of capabilities available to a SKU in specific zones. ZoneDetails []*ResourceSKUZoneDetails // READ-ONLY; List of availability zones where the SKU is supported. Zones []*string }
ResourceSKULocationInfo - Describes an available Compute SKU Location Information.
func (ResourceSKULocationInfo) MarshalJSON ¶
func (r ResourceSKULocationInfo) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type ResourceSKULocationInfo.
func (*ResourceSKULocationInfo) UnmarshalJSON ¶
func (r *ResourceSKULocationInfo) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type ResourceSKULocationInfo.
type ResourceSKURestrictionInfo ¶
type ResourceSKURestrictionInfo struct { // READ-ONLY; Locations where the SKU is restricted Locations []*string // READ-ONLY; List of availability zones where the SKU is restricted. Zones []*string }
ResourceSKURestrictionInfo - Describes an available Compute SKU Restriction Information.
func (ResourceSKURestrictionInfo) MarshalJSON ¶
func (r ResourceSKURestrictionInfo) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type ResourceSKURestrictionInfo.
func (*ResourceSKURestrictionInfo) UnmarshalJSON ¶
func (r *ResourceSKURestrictionInfo) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type ResourceSKURestrictionInfo.
type ResourceSKURestrictions ¶
type ResourceSKURestrictions struct { // READ-ONLY; The reason for restriction. ReasonCode *ResourceSKURestrictionsReasonCode // READ-ONLY; The information about the restriction where the SKU cannot be used. RestrictionInfo *ResourceSKURestrictionInfo // READ-ONLY; The type of restrictions. Type *ResourceSKURestrictionsType // READ-ONLY; The value of restrictions. If the restriction type is set to location. This would be different locations where // the SKU is restricted. Values []*string }
ResourceSKURestrictions - Describes scaling information of a SKU.
func (ResourceSKURestrictions) MarshalJSON ¶
func (r ResourceSKURestrictions) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type ResourceSKURestrictions.
func (*ResourceSKURestrictions) UnmarshalJSON ¶
func (r *ResourceSKURestrictions) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type ResourceSKURestrictions.
type ResourceSKURestrictionsReasonCode ¶
type ResourceSKURestrictionsReasonCode string
ResourceSKURestrictionsReasonCode - The reason for restriction.
const ( ResourceSKURestrictionsReasonCodeNotAvailableForSubscription ResourceSKURestrictionsReasonCode = "NotAvailableForSubscription" ResourceSKURestrictionsReasonCodeQuotaID ResourceSKURestrictionsReasonCode = "QuotaId" )
func PossibleResourceSKURestrictionsReasonCodeValues ¶
func PossibleResourceSKURestrictionsReasonCodeValues() []ResourceSKURestrictionsReasonCode
PossibleResourceSKURestrictionsReasonCodeValues returns the possible values for the ResourceSKURestrictionsReasonCode const type.
type ResourceSKURestrictionsType ¶
type ResourceSKURestrictionsType string
ResourceSKURestrictionsType - The type of restrictions.
const ( ResourceSKURestrictionsTypeLocation ResourceSKURestrictionsType = "Location" ResourceSKURestrictionsTypeZone ResourceSKURestrictionsType = "Zone" )
func PossibleResourceSKURestrictionsTypeValues ¶
func PossibleResourceSKURestrictionsTypeValues() []ResourceSKURestrictionsType
PossibleResourceSKURestrictionsTypeValues returns the possible values for the ResourceSKURestrictionsType const type.
type ResourceSKUZoneDetails ¶
type ResourceSKUZoneDetails struct { // READ-ONLY; A list of capabilities that are available for the SKU in the specified list of zones. Capabilities []*ResourceSKUCapabilities // READ-ONLY; The set of zones that the SKU is available in with the specified capabilities. Name []*string }
ResourceSKUZoneDetails - Describes The zonal capabilities of a SKU.
func (ResourceSKUZoneDetails) MarshalJSON ¶
func (r ResourceSKUZoneDetails) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type ResourceSKUZoneDetails.
func (*ResourceSKUZoneDetails) UnmarshalJSON ¶
func (r *ResourceSKUZoneDetails) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type ResourceSKUZoneDetails.
type ResourceSKUsClient ¶
type ResourceSKUsClient struct {
// contains filtered or unexported fields
}
ResourceSKUsClient contains the methods for the ResourceSKUs group. Don't use this type directly, use NewResourceSKUsClient() instead.
func NewResourceSKUsClient ¶
func NewResourceSKUsClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*ResourceSKUsClient, error)
NewResourceSKUsClient creates a new instance of ResourceSKUsClient 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 (*ResourceSKUsClient) NewListPager ¶
func (client *ResourceSKUsClient) NewListPager(options *ResourceSKUsClientListOptions) *runtime.Pager[ResourceSKUsClientListResponse]
NewListPager - Gets the list of Microsoft.Compute SKUs available for your Subscription.
Generated from API version 2021-07-01
- options - ResourceSKUsClientListOptions contains the optional parameters for the ResourceSKUsClient.NewListPager method.
Example (ListsAllAvailableResourceSkUs) ¶
Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/92de53a5f1e0e03c94b40475d2135d97148ed014/specification/compute/resource-manager/Microsoft.Compute/Skus/stable/2021-07-01/examples/skus/ListAvailableResourceSkus.json
cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() clientFactory, err := armcompute.NewClientFactory("<subscription-id>", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } pager := clientFactory.NewResourceSKUsClient().NewListPager(&armcompute.ResourceSKUsClientListOptions{Filter: nil, IncludeExtendedLocations: nil, }) for pager.More() { page, err := pager.NextPage(ctx) if err != nil { log.Fatalf("failed to advance page: %v", err) } for _, v := range page.Value { // You could use page here. We use blank identifier for just demo purposes. _ = v } // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. // page.ResourceSKUsResult = armcompute.ResourceSKUsResult{ // Value: []*armcompute.ResourceSKU{ // { // Name: to.Ptr("Standard_A0"), // Capabilities: []*armcompute.ResourceSKUCapabilities{ // { // Name: to.Ptr("MaxResourceVolumeMB"), // Value: to.Ptr("20480"), // }, // { // Name: to.Ptr("OSVhdSizeMB"), // Value: to.Ptr("1047552"), // }, // { // Name: to.Ptr("vCPUs"), // Value: to.Ptr("1"), // }, // { // Name: to.Ptr("HyperVGenerations"), // Value: to.Ptr("V1"), // }, // { // Name: to.Ptr("MemoryGB"), // Value: to.Ptr("0.75"), // }, // { // Name: to.Ptr("MaxDataDiskCount"), // Value: to.Ptr("1"), // }, // { // Name: to.Ptr("LowPriorityCapable"), // Value: to.Ptr("False"), // }, // { // Name: to.Ptr("PremiumIO"), // Value: to.Ptr("False"), // }, // { // Name: to.Ptr("vCPUsAvailable"), // Value: to.Ptr("1"), // }, // { // Name: to.Ptr("ACUs"), // Value: to.Ptr("50"), // }, // { // Name: to.Ptr("vCPUsPerCore"), // Value: to.Ptr("1"), // }, // { // Name: to.Ptr("EphemeralOSDiskSupported"), // Value: to.Ptr("False"), // }, // { // Name: to.Ptr("AcceleratedNetworkingEnabled"), // Value: to.Ptr("False"), // }, // { // Name: to.Ptr("RdmaEnabled"), // Value: to.Ptr("False"), // }, // { // Name: to.Ptr("MaxNetworkInterfaces"), // Value: to.Ptr("2"), // }}, // Family: to.Ptr("standardA0_A7Family"), // LocationInfo: []*armcompute.ResourceSKULocationInfo{ // { // Location: to.Ptr("westus"), // ZoneDetails: []*armcompute.ResourceSKUZoneDetails{ // { // Name: []*string{ // to.Ptr("2")}, // Capabilities: []*armcompute.ResourceSKUCapabilities{ // { // Name: to.Ptr("UltraSSDAvailable"), // Value: to.Ptr("True"), // }}, // }}, // Zones: []*string{ // to.Ptr("2"), // to.Ptr("1")}, // }}, // Locations: []*string{ // to.Ptr("westus")}, // ResourceType: to.Ptr("virtualMachines"), // Size: to.Ptr("A0"), // Tier: to.Ptr("Standard"), // }, // { // Name: to.Ptr("Standard_A1"), // Capabilities: []*armcompute.ResourceSKUCapabilities{ // { // Name: to.Ptr("MaxResourceVolumeMB"), // Value: to.Ptr("71680"), // }, // { // Name: to.Ptr("OSVhdSizeMB"), // Value: to.Ptr("1047552"), // }, // { // Name: to.Ptr("vCPUs"), // Value: to.Ptr("1"), // }, // { // Name: to.Ptr("HyperVGenerations"), // Value: to.Ptr("V1"), // }, // { // Name: to.Ptr("MemoryGB"), // Value: to.Ptr("1.75"), // }, // { // Name: to.Ptr("MaxDataDiskCount"), // Value: to.Ptr("2"), // }, // { // Name: to.Ptr("LowPriorityCapable"), // Value: to.Ptr("True"), // }, // { // Name: to.Ptr("PremiumIO"), // Value: to.Ptr("False"), // }, // { // Name: to.Ptr("vCPUsAvailable"), // Value: to.Ptr("1"), // }, // { // Name: to.Ptr("ACUs"), // Value: to.Ptr("100"), // }, // { // Name: to.Ptr("vCPUsPerCore"), // Value: to.Ptr("1"), // }, // { // Name: to.Ptr("EphemeralOSDiskSupported"), // Value: to.Ptr("False"), // }, // { // Name: to.Ptr("AcceleratedNetworkingEnabled"), // Value: to.Ptr("False"), // }, // { // Name: to.Ptr("RdmaEnabled"), // Value: to.Ptr("False"), // }, // { // Name: to.Ptr("MaxNetworkInterfaces"), // Value: to.Ptr("2"), // }}, // Family: to.Ptr("standardA0_A7Family"), // LocationInfo: []*armcompute.ResourceSKULocationInfo{ // { // Location: to.Ptr("westus"), // Zones: []*string{ // to.Ptr("1"), // to.Ptr("2"), // to.Ptr("3")}, // }}, // Locations: []*string{ // to.Ptr("westus")}, // ResourceType: to.Ptr("virtualMachines"), // Size: to.Ptr("A1"), // Tier: to.Ptr("Standard"), // }}, // } }
Output:
Example (ListsAllAvailableResourceSkUsForTheSpecifiedRegion) ¶
Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/92de53a5f1e0e03c94b40475d2135d97148ed014/specification/compute/resource-manager/Microsoft.Compute/Skus/stable/2021-07-01/examples/skus/ListAvailableResourceSkusForARegion.json
cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() clientFactory, err := armcompute.NewClientFactory("<subscription-id>", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } pager := clientFactory.NewResourceSKUsClient().NewListPager(&armcompute.ResourceSKUsClientListOptions{Filter: to.Ptr("location eq 'westus'"), IncludeExtendedLocations: nil, }) for pager.More() { page, err := pager.NextPage(ctx) if err != nil { log.Fatalf("failed to advance page: %v", err) } for _, v := range page.Value { // You could use page here. We use blank identifier for just demo purposes. _ = v } // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. // page.ResourceSKUsResult = armcompute.ResourceSKUsResult{ // Value: []*armcompute.ResourceSKU{ // { // Name: to.Ptr("Standard_A0"), // Capabilities: []*armcompute.ResourceSKUCapabilities{ // { // Name: to.Ptr("MaxResourceVolumeMB"), // Value: to.Ptr("20480"), // }, // { // Name: to.Ptr("OSVhdSizeMB"), // Value: to.Ptr("1047552"), // }, // { // Name: to.Ptr("vCPUs"), // Value: to.Ptr("1"), // }, // { // Name: to.Ptr("HyperVGenerations"), // Value: to.Ptr("V1"), // }, // { // Name: to.Ptr("MemoryGB"), // Value: to.Ptr("0.75"), // }, // { // Name: to.Ptr("MaxDataDiskCount"), // Value: to.Ptr("1"), // }, // { // Name: to.Ptr("LowPriorityCapable"), // Value: to.Ptr("False"), // }, // { // Name: to.Ptr("PremiumIO"), // Value: to.Ptr("False"), // }, // { // Name: to.Ptr("vCPUsAvailable"), // Value: to.Ptr("1"), // }, // { // Name: to.Ptr("ACUs"), // Value: to.Ptr("50"), // }, // { // Name: to.Ptr("vCPUsPerCore"), // Value: to.Ptr("1"), // }, // { // Name: to.Ptr("EphemeralOSDiskSupported"), // Value: to.Ptr("False"), // }, // { // Name: to.Ptr("AcceleratedNetworkingEnabled"), // Value: to.Ptr("False"), // }, // { // Name: to.Ptr("RdmaEnabled"), // Value: to.Ptr("False"), // }, // { // Name: to.Ptr("MaxNetworkInterfaces"), // Value: to.Ptr("2"), // }}, // Family: to.Ptr("standardA0_A7Family"), // LocationInfo: []*armcompute.ResourceSKULocationInfo{ // { // Location: to.Ptr("westus"), // ZoneDetails: []*armcompute.ResourceSKUZoneDetails{ // { // Name: []*string{ // to.Ptr("2")}, // Capabilities: []*armcompute.ResourceSKUCapabilities{ // { // Name: to.Ptr("UltraSSDAvailable"), // Value: to.Ptr("True"), // }}, // }}, // Zones: []*string{ // to.Ptr("2"), // to.Ptr("1")}, // }}, // Locations: []*string{ // to.Ptr("westus")}, // ResourceType: to.Ptr("virtualMachines"), // Size: to.Ptr("A0"), // Tier: to.Ptr("Standard"), // }, // { // Name: to.Ptr("Standard_A1"), // Capabilities: []*armcompute.ResourceSKUCapabilities{ // { // Name: to.Ptr("MaxResourceVolumeMB"), // Value: to.Ptr("71680"), // }, // { // Name: to.Ptr("OSVhdSizeMB"), // Value: to.Ptr("1047552"), // }, // { // Name: to.Ptr("vCPUs"), // Value: to.Ptr("1"), // }, // { // Name: to.Ptr("HyperVGenerations"), // Value: to.Ptr("V1"), // }, // { // Name: to.Ptr("MemoryGB"), // Value: to.Ptr("1.75"), // }, // { // Name: to.Ptr("MaxDataDiskCount"), // Value: to.Ptr("2"), // }, // { // Name: to.Ptr("LowPriorityCapable"), // Value: to.Ptr("True"), // }, // { // Name: to.Ptr("PremiumIO"), // Value: to.Ptr("False"), // }, // { // Name: to.Ptr("vCPUsAvailable"), // Value: to.Ptr("1"), // }, // { // Name: to.Ptr("ACUs"), // Value: to.Ptr("100"), // }, // { // Name: to.Ptr("vCPUsPerCore"), // Value: to.Ptr("1"), // }, // { // Name: to.Ptr("EphemeralOSDiskSupported"), // Value: to.Ptr("False"), // }, // { // Name: to.Ptr("AcceleratedNetworkingEnabled"), // Value: to.Ptr("False"), // }, // { // Name: to.Ptr("RdmaEnabled"), // Value: to.Ptr("False"), // }, // { // Name: to.Ptr("MaxNetworkInterfaces"), // Value: to.Ptr("2"), // }}, // Family: to.Ptr("standardA0_A7Family"), // LocationInfo: []*armcompute.ResourceSKULocationInfo{ // { // Location: to.Ptr("westus"), // Zones: []*string{ // to.Ptr("1"), // to.Ptr("2"), // to.Ptr("3")}, // }}, // Locations: []*string{ // to.Ptr("westus")}, // ResourceType: to.Ptr("virtualMachines"), // Size: to.Ptr("A1"), // Tier: to.Ptr("Standard"), // }}, // } }
Output:
Example (ListsAllAvailableResourceSkUsWithExtendedLocationInformation) ¶
Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/92de53a5f1e0e03c94b40475d2135d97148ed014/specification/compute/resource-manager/Microsoft.Compute/Skus/stable/2021-07-01/examples/skus/ListAvailableResourceSkusWithExtendedLocations.json
cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() clientFactory, err := armcompute.NewClientFactory("<subscription-id>", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } pager := clientFactory.NewResourceSKUsClient().NewListPager(&armcompute.ResourceSKUsClientListOptions{Filter: nil, IncludeExtendedLocations: to.Ptr("true"), }) for pager.More() { page, err := pager.NextPage(ctx) if err != nil { log.Fatalf("failed to advance page: %v", err) } for _, v := range page.Value { // You could use page here. We use blank identifier for just demo purposes. _ = v } // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. // page.ResourceSKUsResult = armcompute.ResourceSKUsResult{ // Value: []*armcompute.ResourceSKU{ // { // Name: to.Ptr("Standard_A0"), // Capabilities: []*armcompute.ResourceSKUCapabilities{ // { // Name: to.Ptr("MaxResourceVolumeMB"), // Value: to.Ptr("20480"), // }, // { // Name: to.Ptr("OSVhdSizeMB"), // Value: to.Ptr("1047552"), // }, // { // Name: to.Ptr("vCPUs"), // Value: to.Ptr("1"), // }, // { // Name: to.Ptr("HyperVGenerations"), // Value: to.Ptr("V1"), // }, // { // Name: to.Ptr("MemoryGB"), // Value: to.Ptr("0.75"), // }, // { // Name: to.Ptr("MaxDataDiskCount"), // Value: to.Ptr("1"), // }, // { // Name: to.Ptr("LowPriorityCapable"), // Value: to.Ptr("False"), // }, // { // Name: to.Ptr("PremiumIO"), // Value: to.Ptr("False"), // }, // { // Name: to.Ptr("vCPUsAvailable"), // Value: to.Ptr("1"), // }, // { // Name: to.Ptr("ACUs"), // Value: to.Ptr("50"), // }, // { // Name: to.Ptr("vCPUsPerCore"), // Value: to.Ptr("1"), // }, // { // Name: to.Ptr("EphemeralOSDiskSupported"), // Value: to.Ptr("False"), // }, // { // Name: to.Ptr("AcceleratedNetworkingEnabled"), // Value: to.Ptr("False"), // }, // { // Name: to.Ptr("RdmaEnabled"), // Value: to.Ptr("False"), // }, // { // Name: to.Ptr("MaxNetworkInterfaces"), // Value: to.Ptr("2"), // }}, // Family: to.Ptr("standardA0_A7Family"), // LocationInfo: []*armcompute.ResourceSKULocationInfo{ // { // Location: to.Ptr("westus"), // ZoneDetails: []*armcompute.ResourceSKUZoneDetails{ // { // Name: []*string{ // to.Ptr("2")}, // Capabilities: []*armcompute.ResourceSKUCapabilities{ // { // Name: to.Ptr("UltraSSDAvailable"), // Value: to.Ptr("True"), // }}, // }}, // Zones: []*string{ // to.Ptr("2"), // to.Ptr("1")}, // }}, // Locations: []*string{ // to.Ptr("westus")}, // ResourceType: to.Ptr("virtualMachines"), // Size: to.Ptr("A0"), // Tier: to.Ptr("Standard"), // }, // { // Name: to.Ptr("Standard_A1"), // Capabilities: []*armcompute.ResourceSKUCapabilities{ // { // Name: to.Ptr("MaxResourceVolumeMB"), // Value: to.Ptr("71680"), // }, // { // Name: to.Ptr("OSVhdSizeMB"), // Value: to.Ptr("1047552"), // }, // { // Name: to.Ptr("vCPUs"), // Value: to.Ptr("1"), // }, // { // Name: to.Ptr("HyperVGenerations"), // Value: to.Ptr("V1"), // }, // { // Name: to.Ptr("MemoryGB"), // Value: to.Ptr("1.75"), // }, // { // Name: to.Ptr("MaxDataDiskCount"), // Value: to.Ptr("2"), // }, // { // Name: to.Ptr("LowPriorityCapable"), // Value: to.Ptr("True"), // }, // { // Name: to.Ptr("PremiumIO"), // Value: to.Ptr("False"), // }, // { // Name: to.Ptr("vCPUsAvailable"), // Value: to.Ptr("1"), // }, // { // Name: to.Ptr("ACUs"), // Value: to.Ptr("100"), // }, // { // Name: to.Ptr("vCPUsPerCore"), // Value: to.Ptr("1"), // }, // { // Name: to.Ptr("EphemeralOSDiskSupported"), // Value: to.Ptr("False"), // }, // { // Name: to.Ptr("AcceleratedNetworkingEnabled"), // Value: to.Ptr("False"), // }, // { // Name: to.Ptr("RdmaEnabled"), // Value: to.Ptr("False"), // }, // { // Name: to.Ptr("MaxNetworkInterfaces"), // Value: to.Ptr("2"), // }}, // Family: to.Ptr("standardA0_A7Family"), // LocationInfo: []*armcompute.ResourceSKULocationInfo{ // { // Location: to.Ptr("westus"), // Zones: []*string{ // to.Ptr("1"), // to.Ptr("2"), // to.Ptr("3")}, // }, // { // Type: to.Ptr(armcompute.ExtendedLocationTypeEdgeZone), // ExtendedLocations: []*string{ // to.Ptr("Las Vegas"), // to.Ptr("Seattle"), // to.Ptr("Portland")}, // Location: to.Ptr("westus"), // }}, // Locations: []*string{ // to.Ptr("westus")}, // ResourceType: to.Ptr("virtualMachines"), // Size: to.Ptr("A1"), // Tier: to.Ptr("Standard"), // }}, // } }
Output:
type ResourceSKUsClientListOptions ¶
type ResourceSKUsClientListOptions struct { // The filter to apply on the operation. Only location filter is supported currently. Filter *string // To Include Extended Locations information or not in the response. IncludeExtendedLocations *string }
ResourceSKUsClientListOptions contains the optional parameters for the ResourceSKUsClient.NewListPager method.
type ResourceSKUsClientListResponse ¶
type ResourceSKUsClientListResponse struct { // The List Resource Skus operation response. ResourceSKUsResult }
ResourceSKUsClientListResponse contains the response from method ResourceSKUsClient.NewListPager.
type ResourceSKUsResult ¶
type ResourceSKUsResult struct { // REQUIRED; The list of skus available for the subscription. Value []*ResourceSKU // The URI to fetch the next page of Resource Skus. Call ListNext() with this URI to fetch the next page of Resource Skus NextLink *string }
ResourceSKUsResult - The List Resource Skus operation response.
func (ResourceSKUsResult) MarshalJSON ¶
func (r ResourceSKUsResult) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type ResourceSKUsResult.
func (*ResourceSKUsResult) UnmarshalJSON ¶
func (r *ResourceSKUsResult) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type ResourceSKUsResult.
type ResourceSharingProfile ¶ added in v5.4.0
type ResourceSharingProfile struct { // Specifies an array of subscription resource IDs that capacity reservation group is shared with. Note: Minimum api-version: // 2024-03-01. Please refer to https://aka.ms/computereservationsharing for more // details. SubscriptionIDs []*SubResource }
func (ResourceSharingProfile) MarshalJSON ¶ added in v5.4.0
func (r ResourceSharingProfile) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type ResourceSharingProfile.
func (*ResourceSharingProfile) UnmarshalJSON ¶ added in v5.4.0
func (r *ResourceSharingProfile) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type ResourceSharingProfile.
type ResourceURIList ¶
type ResourceURIList struct { // REQUIRED; A list of IDs or Owner IDs of resources which are encrypted with the disk encryption set. Value []*string // The uri to fetch the next page of encrypted resources. Call ListNext() with this to fetch the next page of encrypted resources. NextLink *string }
ResourceURIList - The List resources which are encrypted with the disk encryption set.
func (ResourceURIList) MarshalJSON ¶
func (r ResourceURIList) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type ResourceURIList.
func (*ResourceURIList) UnmarshalJSON ¶
func (r *ResourceURIList) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type ResourceURIList.
type ResourceWithOptionalLocation ¶
type ResourceWithOptionalLocation struct { // Resource location Location *string // Resource tags Tags map[string]*string // READ-ONLY; Resource Id ID *string // READ-ONLY; Resource name Name *string // READ-ONLY; Resource type Type *string }
ResourceWithOptionalLocation - The Resource model definition with location property as optional.
func (ResourceWithOptionalLocation) MarshalJSON ¶
func (r ResourceWithOptionalLocation) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type ResourceWithOptionalLocation.
func (*ResourceWithOptionalLocation) UnmarshalJSON ¶
func (r *ResourceWithOptionalLocation) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type ResourceWithOptionalLocation.
type RestorePoint ¶
type RestorePoint struct { // The restore point properties. Properties *RestorePointProperties // READ-ONLY; Resource Id ID *string // READ-ONLY; Resource name Name *string // READ-ONLY; Resource type Type *string }
RestorePoint - Restore Point details.
func (RestorePoint) MarshalJSON ¶
func (r RestorePoint) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type RestorePoint.
func (*RestorePoint) UnmarshalJSON ¶
func (r *RestorePoint) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type RestorePoint.
type RestorePointCollection ¶
type RestorePointCollection struct { // REQUIRED; Resource location Location *string // The restore point collection properties. Properties *RestorePointCollectionProperties // Resource tags Tags map[string]*string // READ-ONLY; Resource Id ID *string // READ-ONLY; Resource name Name *string // READ-ONLY; Resource type Type *string }
RestorePointCollection - Create or update Restore Point collection parameters.
func (RestorePointCollection) MarshalJSON ¶
func (r RestorePointCollection) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type RestorePointCollection.
func (*RestorePointCollection) UnmarshalJSON ¶
func (r *RestorePointCollection) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type RestorePointCollection.
type RestorePointCollectionExpandOptions ¶
type RestorePointCollectionExpandOptions string
const (
RestorePointCollectionExpandOptionsRestorePoints RestorePointCollectionExpandOptions = "restorePoints"
)
func PossibleRestorePointCollectionExpandOptionsValues ¶
func PossibleRestorePointCollectionExpandOptionsValues() []RestorePointCollectionExpandOptions
PossibleRestorePointCollectionExpandOptionsValues returns the possible values for the RestorePointCollectionExpandOptions const type.
type RestorePointCollectionListResult ¶
type RestorePointCollectionListResult struct { // The uri to fetch the next page of RestorePointCollections. Call ListNext() with this to fetch the next page of RestorePointCollections NextLink *string // Gets the list of restore point collections. Value []*RestorePointCollection }
RestorePointCollectionListResult - The List restore point collection operation response.
func (RestorePointCollectionListResult) MarshalJSON ¶
func (r RestorePointCollectionListResult) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type RestorePointCollectionListResult.
func (*RestorePointCollectionListResult) UnmarshalJSON ¶
func (r *RestorePointCollectionListResult) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type RestorePointCollectionListResult.
type RestorePointCollectionProperties ¶
type RestorePointCollectionProperties struct { // The properties of the source resource that this restore point collection is created from. Source *RestorePointCollectionSourceProperties // READ-ONLY; The provisioning state of the restore point collection. ProvisioningState *string // READ-ONLY; The unique id of the restore point collection. RestorePointCollectionID *string // READ-ONLY; A list containing all restore points created under this restore point collection. RestorePoints []*RestorePoint }
RestorePointCollectionProperties - The restore point collection properties.
func (RestorePointCollectionProperties) MarshalJSON ¶
func (r RestorePointCollectionProperties) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type RestorePointCollectionProperties.
func (*RestorePointCollectionProperties) UnmarshalJSON ¶
func (r *RestorePointCollectionProperties) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type RestorePointCollectionProperties.
type RestorePointCollectionSourceProperties ¶
type RestorePointCollectionSourceProperties struct { // Resource Id of the source resource used to create this restore point collection ID *string // READ-ONLY; Location of the source resource used to create this restore point collection. Location *string }
RestorePointCollectionSourceProperties - The properties of the source resource that this restore point collection is created from.
func (RestorePointCollectionSourceProperties) MarshalJSON ¶
func (r RestorePointCollectionSourceProperties) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type RestorePointCollectionSourceProperties.
func (*RestorePointCollectionSourceProperties) UnmarshalJSON ¶
func (r *RestorePointCollectionSourceProperties) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type RestorePointCollectionSourceProperties.
type RestorePointCollectionUpdate ¶
type RestorePointCollectionUpdate struct { // The restore point collection properties. Properties *RestorePointCollectionProperties // Resource tags Tags map[string]*string }
RestorePointCollectionUpdate - Update Restore Point collection parameters.
func (RestorePointCollectionUpdate) MarshalJSON ¶
func (r RestorePointCollectionUpdate) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type RestorePointCollectionUpdate.
func (*RestorePointCollectionUpdate) UnmarshalJSON ¶
func (r *RestorePointCollectionUpdate) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type RestorePointCollectionUpdate.
type RestorePointCollectionsClient ¶
type RestorePointCollectionsClient struct {
// contains filtered or unexported fields
}
RestorePointCollectionsClient contains the methods for the RestorePointCollections group. Don't use this type directly, use NewRestorePointCollectionsClient() instead.
func NewRestorePointCollectionsClient ¶
func NewRestorePointCollectionsClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*RestorePointCollectionsClient, error)
NewRestorePointCollectionsClient creates a new instance of RestorePointCollectionsClient 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 (*RestorePointCollectionsClient) BeginDelete ¶
func (client *RestorePointCollectionsClient) BeginDelete(ctx context.Context, resourceGroupName string, restorePointCollectionName string, options *RestorePointCollectionsClientBeginDeleteOptions) (*runtime.Poller[RestorePointCollectionsClientDeleteResponse], error)
BeginDelete - The operation to delete the restore point collection. This operation will also delete all the contained restore points. If the operation fails it returns an *azcore.ResponseError type.
Generated from API version 2024-03-01
- resourceGroupName - The name of the resource group.
- restorePointCollectionName - The name of the Restore Point Collection.
- options - RestorePointCollectionsClientBeginDeleteOptions contains the optional parameters for the RestorePointCollectionsClient.BeginDelete method.
Example (RestorePointCollectionDeleteMaximumSetGen) ¶
Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/92de53a5f1e0e03c94b40475d2135d97148ed014/specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-03-01/examples/restorePointExamples/RestorePointCollection_Delete_MaximumSet_Gen.json
cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() clientFactory, err := armcompute.NewClientFactory("<subscription-id>", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } poller, err := clientFactory.NewRestorePointCollectionsClient().BeginDelete(ctx, "rgcompute", "aaaaaaaaaaaaaaaaa", nil) if err != nil { log.Fatalf("failed to finish the request: %v", err) } _, err = poller.PollUntilDone(ctx, nil) if err != nil { log.Fatalf("failed to pull the result: %v", err) }
Output:
Example (RestorePointCollectionDeleteMinimumSetGen) ¶
Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/92de53a5f1e0e03c94b40475d2135d97148ed014/specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-03-01/examples/restorePointExamples/RestorePointCollection_Delete_MinimumSet_Gen.json
cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() clientFactory, err := armcompute.NewClientFactory("<subscription-id>", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } poller, err := clientFactory.NewRestorePointCollectionsClient().BeginDelete(ctx, "rgcompute", "aaaaaaaaaaaaaaaaaaaa", nil) if err != nil { log.Fatalf("failed to finish the request: %v", err) } _, err = poller.PollUntilDone(ctx, nil) if err != nil { log.Fatalf("failed to pull the result: %v", err) }
Output:
func (*RestorePointCollectionsClient) CreateOrUpdate ¶
func (client *RestorePointCollectionsClient) CreateOrUpdate(ctx context.Context, resourceGroupName string, restorePointCollectionName string, parameters RestorePointCollection, options *RestorePointCollectionsClientCreateOrUpdateOptions) (RestorePointCollectionsClientCreateOrUpdateResponse, error)
CreateOrUpdate - The operation to create or update the restore point collection. Please refer to https://aka.ms/RestorePoints for more details. When updating a restore point collection, only tags may be modified. If the operation fails it returns an *azcore.ResponseError type.
Generated from API version 2024-03-01
- resourceGroupName - The name of the resource group.
- restorePointCollectionName - The name of the restore point collection.
- parameters - Parameters supplied to the Create or Update restore point collection operation.
- options - RestorePointCollectionsClientCreateOrUpdateOptions contains the optional parameters for the RestorePointCollectionsClient.CreateOrUpdate method.
Example (CreateOrUpdateARestorePointCollection) ¶
Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/92de53a5f1e0e03c94b40475d2135d97148ed014/specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-03-01/examples/restorePointExamples/RestorePointCollection_CreateOrUpdate.json
cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() clientFactory, err := armcompute.NewClientFactory("<subscription-id>", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } res, err := clientFactory.NewRestorePointCollectionsClient().CreateOrUpdate(ctx, "myResourceGroup", "myRpc", armcompute.RestorePointCollection{ Location: to.Ptr("norwayeast"), Tags: map[string]*string{ "myTag1": to.Ptr("tagValue1"), }, Properties: &armcompute.RestorePointCollectionProperties{ Source: &armcompute.RestorePointCollectionSourceProperties{ ID: to.Ptr("/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/virtualMachines/myVM"), }, }, }, nil) if err != nil { log.Fatalf("failed to finish the request: %v", err) } // You could use response here. We use blank identifier for just demo purposes. _ = res // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. // res.RestorePointCollection = armcompute.RestorePointCollection{ // Name: to.Ptr("myRpc"), // Type: to.Ptr("Microsoft.Compute/restorePointCollections"), // ID: to.Ptr("/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/restorePointCollections/myRpc"), // Location: to.Ptr("norwayeast"), // Tags: map[string]*string{ // "myTag1": to.Ptr("tagValue1"), // }, // Properties: &armcompute.RestorePointCollectionProperties{ // ProvisioningState: to.Ptr("Succeeded"), // RestorePointCollectionID: to.Ptr("638f052b-a7c2-450c-89e7-6a3b8f1d6a7c"), // Source: &armcompute.RestorePointCollectionSourceProperties{ // ID: to.Ptr("/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/virtualMachines/myVM"), // Location: to.Ptr("eastus"), // }, // }, // }
Output:
Example (CreateOrUpdateARestorePointCollectionForCrossRegionCopy) ¶
Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/92de53a5f1e0e03c94b40475d2135d97148ed014/specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-03-01/examples/restorePointExamples/RestorePointCollection_CreateOrUpdate_ForCrossRegionCopy.json
cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() clientFactory, err := armcompute.NewClientFactory("<subscription-id>", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } res, err := clientFactory.NewRestorePointCollectionsClient().CreateOrUpdate(ctx, "myResourceGroup", "myRpc", armcompute.RestorePointCollection{ Location: to.Ptr("norwayeast"), Tags: map[string]*string{ "myTag1": to.Ptr("tagValue1"), }, Properties: &armcompute.RestorePointCollectionProperties{ Source: &armcompute.RestorePointCollectionSourceProperties{ ID: to.Ptr("/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/restorePointCollections/sourceRpcName"), }, }, }, nil) if err != nil { log.Fatalf("failed to finish the request: %v", err) } // You could use response here. We use blank identifier for just demo purposes. _ = res // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. // res.RestorePointCollection = armcompute.RestorePointCollection{ // Name: to.Ptr("myRpc"), // Type: to.Ptr("Microsoft.Compute/restorePointCollections"), // ID: to.Ptr("/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/restorePointCollections/myRpc"), // Location: to.Ptr("norwayeast"), // Tags: map[string]*string{ // "myTag1": to.Ptr("tagValue1"), // }, // Properties: &armcompute.RestorePointCollectionProperties{ // ProvisioningState: to.Ptr("Succeeded"), // RestorePointCollectionID: to.Ptr("638f052b-a7c2-450c-89e7-6a3b8f1d6a7c"), // Source: &armcompute.RestorePointCollectionSourceProperties{ // ID: to.Ptr("/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/virtualMachines/myVM"), // Location: to.Ptr("eastus"), // }, // }, // }
Output:
func (*RestorePointCollectionsClient) Get ¶
func (client *RestorePointCollectionsClient) Get(ctx context.Context, resourceGroupName string, restorePointCollectionName string, options *RestorePointCollectionsClientGetOptions) (RestorePointCollectionsClientGetResponse, error)
Get - The operation to get the restore point collection. If the operation fails it returns an *azcore.ResponseError type.
Generated from API version 2024-03-01
- resourceGroupName - The name of the resource group.
- restorePointCollectionName - The name of the restore point collection.
- options - RestorePointCollectionsClientGetOptions contains the optional parameters for the RestorePointCollectionsClient.Get method.
Example (GetARestorePointCollectionButNotTheRestorePointsContainedInTheRestorePointCollection) ¶
Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/92de53a5f1e0e03c94b40475d2135d97148ed014/specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-03-01/examples/restorePointExamples/RestorePointCollection_Get.json
cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() clientFactory, err := armcompute.NewClientFactory("<subscription-id>", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } res, err := clientFactory.NewRestorePointCollectionsClient().Get(ctx, "myResourceGroup", "myRpc", &armcompute.RestorePointCollectionsClientGetOptions{Expand: nil}) if err != nil { log.Fatalf("failed to finish the request: %v", err) } // You could use response here. We use blank identifier for just demo purposes. _ = res // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. // res.RestorePointCollection = armcompute.RestorePointCollection{ // Name: to.Ptr("myRpc"), // Type: to.Ptr("Microsoft.Compute/restorePointCollections"), // ID: to.Ptr("/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/restorePointCollections/myRpc"), // Location: to.Ptr("westus"), // Tags: map[string]*string{ // "myTag1": to.Ptr("tagValue1"), // }, // Properties: &armcompute.RestorePointCollectionProperties{ // ProvisioningState: to.Ptr("Succeeded"), // RestorePointCollectionID: to.Ptr("59f04a5d-f783-4200-a1bd-d3f464e8c4b4"), // Source: &armcompute.RestorePointCollectionSourceProperties{ // ID: to.Ptr("/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/restorePointCollections/myRpc"), // Location: to.Ptr("eastus"), // }, // }, // }
Output:
Example (GetARestorePointCollectionIncludingTheRestorePointsContainedInTheRestorePointCollection) ¶
Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/92de53a5f1e0e03c94b40475d2135d97148ed014/specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-03-01/examples/restorePointExamples/RestorePointCollection_Get_WithContainedRestorePoints.json
cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() clientFactory, err := armcompute.NewClientFactory("<subscription-id>", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } res, err := clientFactory.NewRestorePointCollectionsClient().Get(ctx, "myResourceGroup", "rpcName", &armcompute.RestorePointCollectionsClientGetOptions{Expand: nil}) if err != nil { log.Fatalf("failed to finish the request: %v", err) } // You could use response here. We use blank identifier for just demo purposes. _ = res // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. // res.RestorePointCollection = armcompute.RestorePointCollection{ // Name: to.Ptr("rpcName"), // Type: to.Ptr("Microsoft.Compute/restorePointCollections"), // ID: to.Ptr("/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/restorePointCollections/rpcName"), // Location: to.Ptr("westus"), // Tags: map[string]*string{ // "myTag1": to.Ptr("tagValue1"), // }, // Properties: &armcompute.RestorePointCollectionProperties{ // ProvisioningState: to.Ptr("Succeeded"), // RestorePointCollectionID: to.Ptr("59f04a5d-f783-4200-a1bd-d3f464e8c4b4"), // RestorePoints: []*armcompute.RestorePoint{ // { // Name: to.Ptr("restorePointName"), // ID: to.Ptr("/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/restorePointCollections/rpcName/restorePoints/restorePointName"), // Properties: &armcompute.RestorePointProperties{ // ConsistencyMode: to.Ptr(armcompute.ConsistencyModeTypesApplicationConsistent), // ExcludeDisks: []*armcompute.APIEntityReference{ // { // ID: to.Ptr("/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/disks/vm8768_disk2_fe6ffde4f69b491ca33fb984d5bcd89f"), // }}, // ProvisioningState: to.Ptr("Succeeded"), // SourceMetadata: &armcompute.RestorePointSourceMetadata{ // DiagnosticsProfile: &armcompute.DiagnosticsProfile{ // BootDiagnostics: &armcompute.BootDiagnostics{ // Enabled: to.Ptr(true), // }, // }, // HardwareProfile: &armcompute.HardwareProfile{ // VMSize: to.Ptr(armcompute.VirtualMachineSizeTypesStandardB1S), // }, // Location: to.Ptr("westus"), // OSProfile: &armcompute.OSProfile{ // AdminUsername: to.Ptr("admin"), // AllowExtensionOperations: to.Ptr(true), // ComputerName: to.Ptr("computerName"), // RequireGuestProvisionSignal: to.Ptr(true), // Secrets: []*armcompute.VaultSecretGroup{ // }, // WindowsConfiguration: &armcompute.WindowsConfiguration{ // EnableAutomaticUpdates: to.Ptr(true), // ProvisionVMAgent: to.Ptr(true), // }, // }, // StorageProfile: &armcompute.RestorePointSourceVMStorageProfile{ // DataDisks: []*armcompute.RestorePointSourceVMDataDisk{ // { // Name: to.Ptr("testingexcludedisk_DataDisk_1"), // Caching: to.Ptr(armcompute.CachingTypesNone), // DiskRestorePoint: &armcompute.DiskRestorePointAttributes{ // ID: to.Ptr("/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/restorePointCollections/rpcName/restorePoints/restorePointName/diskRestorePoints/testingexcludedisk_DataDisk_1_68785190-1acb-4d5e-a8ae-705b45f3dca5"), // }, // Lun: to.Ptr[int32](1), // ManagedDisk: &armcompute.ManagedDiskParameters{ // ID: to.Ptr("/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/disks/testingexcludedisk_DataDisk_1"), // StorageAccountType: to.Ptr(armcompute.StorageAccountTypesStandardLRS), // }, // }}, // DiskControllerType: to.Ptr(armcompute.DiskControllerTypesNVMe), // OSDisk: &armcompute.RestorePointSourceVMOSDisk{ // Name: to.Ptr("testingexcludedisk_OsDisk_1_74cdaedcea50483d9833c96adefa100f"), // Caching: to.Ptr(armcompute.CachingTypesReadWrite), // DiskRestorePoint: &armcompute.DiskRestorePointAttributes{ // ID: to.Ptr("/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/restorePointCollections/rpcName/restorePoints/restorePointName/diskRestorePoints/testingexcludedisk_OsDisk_1_74cdaedcea50483d9833c96adefa100f_22b4bdfe-6c54-4f72-84d8-85d8860f0c57"), // }, // ManagedDisk: &armcompute.ManagedDiskParameters{ // ID: to.Ptr("/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/disks/testingexcludedisk_OsDisk_1_74cdaedcea50483d9833c96adefa100f"), // StorageAccountType: to.Ptr(armcompute.StorageAccountTypesStandardLRS), // }, // OSType: to.Ptr(armcompute.OperatingSystemTypeWindows), // }, // }, // VMID: to.Ptr("76d6541e-80bd-4dc1-932b-3cae4cfb80e7"), // }, // TimeCreated: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-01-27T20:35:05.840Z"); return t}()), // }, // }}, // Source: &armcompute.RestorePointCollectionSourceProperties{ // ID: to.Ptr("/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/virtualMachines/myVM"), // Location: to.Ptr("eastus"), // }, // }, // }
Output:
func (*RestorePointCollectionsClient) NewListAllPager ¶
func (client *RestorePointCollectionsClient) NewListAllPager(options *RestorePointCollectionsClientListAllOptions) *runtime.Pager[RestorePointCollectionsClientListAllResponse]
NewListAllPager - Gets the list of restore point collections in the subscription. Use nextLink property in the response to get the next page of restore point collections. Do this till nextLink is not null to fetch all the restore point collections.
Generated from API version 2024-03-01
- options - RestorePointCollectionsClientListAllOptions contains the optional parameters for the RestorePointCollectionsClient.NewListAllPager method.
Example ¶
Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/92de53a5f1e0e03c94b40475d2135d97148ed014/specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-03-01/examples/restorePointExamples/RestorePointCollection_ListBySubscription.json
cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() clientFactory, err := armcompute.NewClientFactory("<subscription-id>", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } pager := clientFactory.NewRestorePointCollectionsClient().NewListAllPager(nil) for pager.More() { page, err := pager.NextPage(ctx) if err != nil { log.Fatalf("failed to advance page: %v", err) } for _, v := range page.Value { // You could use page here. We use blank identifier for just demo purposes. _ = v } // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. // page.RestorePointCollectionListResult = armcompute.RestorePointCollectionListResult{ // Value: []*armcompute.RestorePointCollection{ // { // Name: to.Ptr("restorePointCollection1"), // Type: to.Ptr("Microsoft.Compute/restorePointCollections"), // ID: to.Ptr("/subscriptions/{subscription-id}/resourceGroups/resourceGroup1/providers/Microsoft.Compute/restorePointCollections/restorePointCollection1"), // Location: to.Ptr("westus"), // Tags: map[string]*string{ // "myTag1": to.Ptr("tagValue1"), // }, // Properties: &armcompute.RestorePointCollectionProperties{ // ProvisioningState: to.Ptr("Succeeded"), // RestorePointCollectionID: to.Ptr("59f04a5d-f783-4200-a1bd-d3f464e8c4b4"), // Source: &armcompute.RestorePointCollectionSourceProperties{ // ID: to.Ptr("/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/virtualMachines/VM_Test"), // Location: to.Ptr("westus"), // }, // }, // }, // { // Name: to.Ptr("restorePointCollection2"), // Type: to.Ptr("Microsoft.Compute/restorePointCollections"), // ID: to.Ptr("/subscriptions/{subscription-id}/resourceGroups/resourceGroup2/providers/Microsoft.Compute/restorePointCollections/restorePointCollection2"), // Location: to.Ptr("westus"), // Tags: map[string]*string{ // "myTag1": to.Ptr("tagValue1"), // }, // Properties: &armcompute.RestorePointCollectionProperties{ // ProvisioningState: to.Ptr("Succeeded"), // RestorePointCollectionID: to.Ptr("2875c590-e337-4102-9668-4f5b7e3f98a4"), // Source: &armcompute.RestorePointCollectionSourceProperties{ // ID: to.Ptr("/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/virtualMachines/VM_Prod"), // Location: to.Ptr("westus"), // }, // }, // }}, // } }
Output:
func (*RestorePointCollectionsClient) NewListPager ¶
func (client *RestorePointCollectionsClient) NewListPager(resourceGroupName string, options *RestorePointCollectionsClientListOptions) *runtime.Pager[RestorePointCollectionsClientListResponse]
NewListPager - Gets the list of restore point collections in a resource group.
Generated from API version 2024-03-01
- resourceGroupName - The name of the resource group.
- options - RestorePointCollectionsClientListOptions contains the optional parameters for the RestorePointCollectionsClient.NewListPager method.
Example ¶
Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/92de53a5f1e0e03c94b40475d2135d97148ed014/specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-03-01/examples/restorePointExamples/RestorePointCollection_ListByResourceGroup.json
cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() clientFactory, err := armcompute.NewClientFactory("<subscription-id>", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } pager := clientFactory.NewRestorePointCollectionsClient().NewListPager("myResourceGroup", nil) for pager.More() { page, err := pager.NextPage(ctx) if err != nil { log.Fatalf("failed to advance page: %v", err) } for _, v := range page.Value { // You could use page here. We use blank identifier for just demo purposes. _ = v } // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. // page.RestorePointCollectionListResult = armcompute.RestorePointCollectionListResult{ // Value: []*armcompute.RestorePointCollection{ // { // Name: to.Ptr("restorePointCollection1"), // Type: to.Ptr("Microsoft.Compute/restorePointCollections"), // ID: to.Ptr("/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/restorePointCollections/restorePointCollection1"), // Location: to.Ptr("westus"), // Tags: map[string]*string{ // "myTag1": to.Ptr("tagValue1"), // }, // Properties: &armcompute.RestorePointCollectionProperties{ // ProvisioningState: to.Ptr("Succeeded"), // RestorePointCollectionID: to.Ptr("59f04a5d-f783-4200-a1bd-d3f464e8c4b4"), // Source: &armcompute.RestorePointCollectionSourceProperties{ // ID: to.Ptr("/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/restorePointCollections/restorePointCollection1"), // Location: to.Ptr("westus"), // }, // }, // }, // { // Name: to.Ptr("restorePointCollection2"), // Type: to.Ptr("Microsoft.Compute/restorePointCollections"), // ID: to.Ptr("/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/restorePointCollections/restorePointCollection2"), // Location: to.Ptr("westus"), // Tags: map[string]*string{ // "myTag1": to.Ptr("tagValue1"), // }, // Properties: &armcompute.RestorePointCollectionProperties{ // ProvisioningState: to.Ptr("Succeeded"), // RestorePointCollectionID: to.Ptr("2875c590-e337-4102-9668-4f5b7e3f98a4"), // Source: &armcompute.RestorePointCollectionSourceProperties{ // ID: to.Ptr("/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/restorePointCollections/restorePointCollection2"), // Location: to.Ptr("westus"), // }, // }, // }}, // } }
Output:
func (*RestorePointCollectionsClient) Update ¶
func (client *RestorePointCollectionsClient) Update(ctx context.Context, resourceGroupName string, restorePointCollectionName string, parameters RestorePointCollectionUpdate, options *RestorePointCollectionsClientUpdateOptions) (RestorePointCollectionsClientUpdateResponse, error)
Update - The operation to update the restore point collection. If the operation fails it returns an *azcore.ResponseError type.
Generated from API version 2024-03-01
- resourceGroupName - The name of the resource group.
- restorePointCollectionName - The name of the restore point collection.
- parameters - Parameters supplied to the Update restore point collection operation.
- options - RestorePointCollectionsClientUpdateOptions contains the optional parameters for the RestorePointCollectionsClient.Update method.
Example (RestorePointCollectionUpdateMaximumSetGen) ¶
Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/92de53a5f1e0e03c94b40475d2135d97148ed014/specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-03-01/examples/restorePointExamples/RestorePointCollection_Update_MaximumSet_Gen.json
cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() clientFactory, err := armcompute.NewClientFactory("<subscription-id>", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } res, err := clientFactory.NewRestorePointCollectionsClient().Update(ctx, "rgcompute", "aaaaaaaaaaaaaaaaaaaa", armcompute.RestorePointCollectionUpdate{ Tags: map[string]*string{ "key8536": to.Ptr("aaaaaaaaaaaaaaaaaaa"), }, Properties: &armcompute.RestorePointCollectionProperties{ Source: &armcompute.RestorePointCollectionSourceProperties{ ID: to.Ptr("/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/virtualMachines/myVM"), }, }, }, nil) if err != nil { log.Fatalf("failed to finish the request: %v", err) } // You could use response here. We use blank identifier for just demo purposes. _ = res // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. // res.RestorePointCollection = armcompute.RestorePointCollection{ // Name: to.Ptr("myRpc"), // Type: to.Ptr("Microsoft.Compute/restorePointCollections"), // ID: to.Ptr("/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/restorePointCollections/myRpc"), // Location: to.Ptr("norwayeast"), // Tags: map[string]*string{ // }, // Properties: &armcompute.RestorePointCollectionProperties{ // ProvisioningState: to.Ptr("Succeeded"), // RestorePointCollectionID: to.Ptr("638f052b-a7c2-450c-89e7-6a3b8f1d6a7c"), // RestorePoints: []*armcompute.RestorePoint{ // { // Name: to.Ptr("aaaaaaaaaaaaaaaaaa"), // Type: to.Ptr("aaaaaaaaaaaaaaaaaaaaaaaaa"), // ID: to.Ptr("aaaaaaaaaaa"), // Properties: &armcompute.RestorePointProperties{ // ConsistencyMode: to.Ptr(armcompute.ConsistencyModeTypesCrashConsistent), // ExcludeDisks: []*armcompute.APIEntityReference{ // { // ID: to.Ptr("/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/restorePointCollections/rpcName/restorePoints/restorePointName/diskRestorePoints/testingexcludedisk_OsDisk_1_74cdaedcea50483d9833c96adefa100f_22b4bdfe-6c54-4f72-84d8-85d8860f0c57"), // }}, // ProvisioningState: to.Ptr("Succeeded"), // SourceMetadata: &armcompute.RestorePointSourceMetadata{ // DiagnosticsProfile: &armcompute.DiagnosticsProfile{ // BootDiagnostics: &armcompute.BootDiagnostics{ // Enabled: to.Ptr(true), // StorageURI: to.Ptr("aaaaaaaaaaaaaaaaaaa"), // }, // }, // HardwareProfile: &armcompute.HardwareProfile{ // VMSize: to.Ptr(armcompute.VirtualMachineSizeTypesStandardB1S), // VMSizeProperties: &armcompute.VMSizeProperties{ // VCPUsAvailable: to.Ptr[int32](9), // VCPUsPerCore: to.Ptr[int32](12), // }, // }, // LicenseType: to.Ptr("aaaaaaaaaaaaaaaaaaaaaaaaaaa"), // Location: to.Ptr("westus"), // OSProfile: &armcompute.OSProfile{ // AdminUsername: to.Ptr("admin"), // AllowExtensionOperations: to.Ptr(true), // ComputerName: to.Ptr("computerName"), // CustomData: to.Ptr("aaaaaaaaaaaaaaaaaaaaaaaaaaa"), // LinuxConfiguration: &armcompute.LinuxConfiguration{ // DisablePasswordAuthentication: to.Ptr(true), // PatchSettings: &armcompute.LinuxPatchSettings{ // AssessmentMode: to.Ptr(armcompute.LinuxPatchAssessmentModeImageDefault), // PatchMode: to.Ptr(armcompute.LinuxVMGuestPatchModeImageDefault), // }, // ProvisionVMAgent: to.Ptr(true), // SSH: &armcompute.SSHConfiguration{ // PublicKeys: []*armcompute.SSHPublicKey{ // { // Path: to.Ptr("aaa"), // KeyData: to.Ptr("aaaaaa"), // }}, // }, // }, // RequireGuestProvisionSignal: to.Ptr(true), // Secrets: []*armcompute.VaultSecretGroup{ // { // SourceVault: &armcompute.SubResource{ // ID: to.Ptr("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/availabilitySets/{availabilitySetName}"), // }, // VaultCertificates: []*armcompute.VaultCertificate{ // { // CertificateStore: to.Ptr("aaaaaaaaaaaaaaaaaaaaaaaaa"), // CertificateURL: to.Ptr("aaaaaaa"), // }}, // }}, // WindowsConfiguration: &armcompute.WindowsConfiguration{ // AdditionalUnattendContent: []*armcompute.AdditionalUnattendContent{ // { // ComponentName: to.Ptr("Microsoft-Windows-Shell-Setup"), // Content: to.Ptr("aaaaaaaaaaaaaaaaaaaa"), // PassName: to.Ptr("OobeSystem"), // SettingName: to.Ptr(armcompute.SettingNamesAutoLogon), // }}, // EnableAutomaticUpdates: to.Ptr(true), // PatchSettings: &armcompute.PatchSettings{ // AssessmentMode: to.Ptr(armcompute.WindowsPatchAssessmentModeImageDefault), // EnableHotpatching: to.Ptr(true), // PatchMode: to.Ptr(armcompute.WindowsVMGuestPatchModeManual), // }, // ProvisionVMAgent: to.Ptr(true), // TimeZone: to.Ptr("aaaaaaaaaaaaaaaaaaaaaaaaaaaaa"), // WinRM: &armcompute.WinRMConfiguration{ // Listeners: []*armcompute.WinRMListener{ // { // CertificateURL: to.Ptr("aaaaaaaaaaaaaaaaaaaaaa"), // Protocol: to.Ptr(armcompute.ProtocolTypesHTTP), // }}, // }, // }, // }, // SecurityProfile: &armcompute.SecurityProfile{ // EncryptionAtHost: to.Ptr(true), // SecurityType: to.Ptr(armcompute.SecurityTypesTrustedLaunch), // UefiSettings: &armcompute.UefiSettings{ // SecureBootEnabled: to.Ptr(true), // VTpmEnabled: to.Ptr(true), // }, // }, // StorageProfile: &armcompute.RestorePointSourceVMStorageProfile{ // DataDisks: []*armcompute.RestorePointSourceVMDataDisk{ // { // Name: to.Ptr("testingexcludedisk_DataDisk_1"), // Caching: to.Ptr(armcompute.CachingTypesNone), // DiskRestorePoint: &armcompute.DiskRestorePointAttributes{ // ID: to.Ptr("/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/restorePointCollections/rpcName/restorePoints/restorePointName/diskRestorePoints/testingexcludedisk_DataDisk_1_68785190-1acb-4d5e-a8ae-705b45f3dca5"), // }, // DiskSizeGB: to.Ptr[int32](24), // Lun: to.Ptr[int32](1), // ManagedDisk: &armcompute.ManagedDiskParameters{ // ID: to.Ptr("/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/disks/testingexcludedisk_DataDisk_1"), // DiskEncryptionSet: &armcompute.DiskEncryptionSetParameters{ // ID: to.Ptr("aaaaaaaaaaaa"), // }, // StorageAccountType: to.Ptr(armcompute.StorageAccountTypesStandardLRS), // }, // }}, // DiskControllerType: to.Ptr(armcompute.DiskControllerTypesNVMe), // OSDisk: &armcompute.RestorePointSourceVMOSDisk{ // Name: to.Ptr("testingexcludedisk_OsDisk_1_74cdaedcea50483d9833c96adefa100f"), // Caching: to.Ptr(armcompute.CachingTypesReadWrite), // DiskRestorePoint: &armcompute.DiskRestorePointAttributes{ // ID: to.Ptr("/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/restorePointCollections/rpcName/restorePoints/restorePointName/diskRestorePoints/testingexcludedisk_OsDisk_1_74cdaedcea50483d9833c96adefa100f_22b4bdfe-6c54-4f72-84d8-85d8860f0c57"), // }, // DiskSizeGB: to.Ptr[int32](3), // EncryptionSettings: &armcompute.DiskEncryptionSettings{ // DiskEncryptionKey: &armcompute.KeyVaultSecretReference{ // SecretURL: to.Ptr("aaaaaaaa"), // SourceVault: &armcompute.SubResource{ // ID: to.Ptr("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/availabilitySets/{availabilitySetName}"), // }, // }, // Enabled: to.Ptr(true), // KeyEncryptionKey: &armcompute.KeyVaultKeyReference{ // KeyURL: to.Ptr("aaaaaaaaaaaaaa"), // SourceVault: &armcompute.SubResource{ // ID: to.Ptr("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/availabilitySets/{availabilitySetName}"), // }, // }, // }, // ManagedDisk: &armcompute.ManagedDiskParameters{ // ID: to.Ptr("/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/disks/testingexcludedisk_OsDisk_1_74cdaedcea50483d9833c96adefa100f"), // DiskEncryptionSet: &armcompute.DiskEncryptionSetParameters{ // ID: to.Ptr("aaaaaaaaaaaa"), // }, // StorageAccountType: to.Ptr(armcompute.StorageAccountTypesStandardLRS), // }, // OSType: to.Ptr(armcompute.OperatingSystemTypeWindows), // }, // }, // VMID: to.Ptr("76d6541e-80bd-4dc1-932b-3cae4cfb80e7"), // }, // TimeCreated: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-11-30T12:58:26.593Z"); return t}()), // }, // }}, // Source: &armcompute.RestorePointCollectionSourceProperties{ // ID: to.Ptr("/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/virtualMachines/myVM"), // Location: to.Ptr("eastus"), // }, // }, // }
Output:
Example (RestorePointCollectionUpdateMinimumSetGen) ¶
Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/92de53a5f1e0e03c94b40475d2135d97148ed014/specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-03-01/examples/restorePointExamples/RestorePointCollection_Update_MinimumSet_Gen.json
cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() clientFactory, err := armcompute.NewClientFactory("<subscription-id>", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } res, err := clientFactory.NewRestorePointCollectionsClient().Update(ctx, "rgcompute", "aaaaaaaaaaaaaaaaaa", armcompute.RestorePointCollectionUpdate{}, nil) if err != nil { log.Fatalf("failed to finish the request: %v", err) } // You could use response here. We use blank identifier for just demo purposes. _ = res // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. // res.RestorePointCollection = armcompute.RestorePointCollection{ // Location: to.Ptr("norwayeast"), // }
Output:
type RestorePointCollectionsClientBeginDeleteOptions ¶
type RestorePointCollectionsClientBeginDeleteOptions struct { // Resumes the LRO from the provided token. ResumeToken string }
RestorePointCollectionsClientBeginDeleteOptions contains the optional parameters for the RestorePointCollectionsClient.BeginDelete method.
type RestorePointCollectionsClientCreateOrUpdateOptions ¶
type RestorePointCollectionsClientCreateOrUpdateOptions struct { }
RestorePointCollectionsClientCreateOrUpdateOptions contains the optional parameters for the RestorePointCollectionsClient.CreateOrUpdate method.
type RestorePointCollectionsClientCreateOrUpdateResponse ¶
type RestorePointCollectionsClientCreateOrUpdateResponse struct { // Create or update Restore Point collection parameters. RestorePointCollection }
RestorePointCollectionsClientCreateOrUpdateResponse contains the response from method RestorePointCollectionsClient.CreateOrUpdate.
type RestorePointCollectionsClientDeleteResponse ¶
type RestorePointCollectionsClientDeleteResponse struct { }
RestorePointCollectionsClientDeleteResponse contains the response from method RestorePointCollectionsClient.BeginDelete.
type RestorePointCollectionsClientGetOptions ¶
type RestorePointCollectionsClientGetOptions struct { // The expand expression to apply on the operation. If expand=restorePoints, server will return all contained restore points // in the restorePointCollection. Expand *RestorePointCollectionExpandOptions }
RestorePointCollectionsClientGetOptions contains the optional parameters for the RestorePointCollectionsClient.Get method.
type RestorePointCollectionsClientGetResponse ¶
type RestorePointCollectionsClientGetResponse struct { // Create or update Restore Point collection parameters. RestorePointCollection }
RestorePointCollectionsClientGetResponse contains the response from method RestorePointCollectionsClient.Get.
type RestorePointCollectionsClientListAllOptions ¶
type RestorePointCollectionsClientListAllOptions struct { }
RestorePointCollectionsClientListAllOptions contains the optional parameters for the RestorePointCollectionsClient.NewListAllPager method.
type RestorePointCollectionsClientListAllResponse ¶
type RestorePointCollectionsClientListAllResponse struct { // The List restore point collection operation response. RestorePointCollectionListResult }
RestorePointCollectionsClientListAllResponse contains the response from method RestorePointCollectionsClient.NewListAllPager.
type RestorePointCollectionsClientListOptions ¶
type RestorePointCollectionsClientListOptions struct { }
RestorePointCollectionsClientListOptions contains the optional parameters for the RestorePointCollectionsClient.NewListPager method.
type RestorePointCollectionsClientListResponse ¶
type RestorePointCollectionsClientListResponse struct { // The List restore point collection operation response. RestorePointCollectionListResult }
RestorePointCollectionsClientListResponse contains the response from method RestorePointCollectionsClient.NewListPager.
type RestorePointCollectionsClientUpdateOptions ¶
type RestorePointCollectionsClientUpdateOptions struct { }
RestorePointCollectionsClientUpdateOptions contains the optional parameters for the RestorePointCollectionsClient.Update method.
type RestorePointCollectionsClientUpdateResponse ¶
type RestorePointCollectionsClientUpdateResponse struct { // Create or update Restore Point collection parameters. RestorePointCollection }
RestorePointCollectionsClientUpdateResponse contains the response from method RestorePointCollectionsClient.Update.
type RestorePointEncryption ¶
type RestorePointEncryption struct { // Describes the parameter of customer managed disk encryption set resource id that can be specified for disk. Note: The disk // encryption set resource id can only be specified for managed disk. Please // refer https://aka.ms/mdssewithcmkoverview for more details. DiskEncryptionSet *DiskEncryptionSetParameters // The type of key used to encrypt the data of the disk restore point. Type *RestorePointEncryptionType }
RestorePointEncryption - Encryption at rest settings for disk restore point. It is an optional property that can be specified in the input while creating a restore point.
func (RestorePointEncryption) MarshalJSON ¶
func (r RestorePointEncryption) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type RestorePointEncryption.
func (*RestorePointEncryption) UnmarshalJSON ¶
func (r *RestorePointEncryption) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type RestorePointEncryption.
type RestorePointEncryptionType ¶
type RestorePointEncryptionType string
RestorePointEncryptionType - The type of key used to encrypt the data of the disk restore point.
const ( // RestorePointEncryptionTypeEncryptionAtRestWithCustomerKey - Disk Restore Point is encrypted at rest with Customer managed // key that can be changed and revoked by a customer. RestorePointEncryptionTypeEncryptionAtRestWithCustomerKey RestorePointEncryptionType = "EncryptionAtRestWithCustomerKey" // RestorePointEncryptionTypeEncryptionAtRestWithPlatformAndCustomerKeys - Disk Restore Point is encrypted at rest with 2 // layers of encryption. One of the keys is Customer managed and the other key is Platform managed. RestorePointEncryptionTypeEncryptionAtRestWithPlatformAndCustomerKeys RestorePointEncryptionType = "EncryptionAtRestWithPlatformAndCustomerKeys" // RestorePointEncryptionTypeEncryptionAtRestWithPlatformKey - Disk Restore Point is encrypted at rest with Platform managed // key. RestorePointEncryptionTypeEncryptionAtRestWithPlatformKey RestorePointEncryptionType = "EncryptionAtRestWithPlatformKey" )
func PossibleRestorePointEncryptionTypeValues ¶
func PossibleRestorePointEncryptionTypeValues() []RestorePointEncryptionType
PossibleRestorePointEncryptionTypeValues returns the possible values for the RestorePointEncryptionType const type.
type RestorePointExpandOptions ¶
type RestorePointExpandOptions string
const (
RestorePointExpandOptionsInstanceView RestorePointExpandOptions = "instanceView"
)
func PossibleRestorePointExpandOptionsValues ¶
func PossibleRestorePointExpandOptionsValues() []RestorePointExpandOptions
PossibleRestorePointExpandOptionsValues returns the possible values for the RestorePointExpandOptions const type.
type RestorePointInstanceView ¶
type RestorePointInstanceView struct { // The disk restore points information. DiskRestorePoints []*DiskRestorePointInstanceView // The resource status information. Statuses []*InstanceViewStatus }
RestorePointInstanceView - The instance view of a restore point.
func (RestorePointInstanceView) MarshalJSON ¶
func (r RestorePointInstanceView) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type RestorePointInstanceView.
func (*RestorePointInstanceView) UnmarshalJSON ¶
func (r *RestorePointInstanceView) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type RestorePointInstanceView.
type RestorePointProperties ¶
type RestorePointProperties struct { // ConsistencyMode of the RestorePoint. Can be specified in the input while creating a restore point. For now, only CrashConsistent // is accepted as a valid input. Please refer to // https://aka.ms/RestorePoints for more details. ConsistencyMode *ConsistencyModeTypes // List of disk resource ids that the customer wishes to exclude from the restore point. If no disks are specified, all disks // will be included. ExcludeDisks []*APIEntityReference // Gets the details of the VM captured at the time of the restore point creation. SourceMetadata *RestorePointSourceMetadata // Resource Id of the source restore point from which a copy needs to be created. SourceRestorePoint *APIEntityReference // Gets the creation time of the restore point. TimeCreated *time.Time // READ-ONLY; The restore point instance view. InstanceView *RestorePointInstanceView // READ-ONLY; Gets the provisioning state of the restore point. ProvisioningState *string }
RestorePointProperties - The restore point properties.
func (RestorePointProperties) MarshalJSON ¶
func (r RestorePointProperties) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type RestorePointProperties.
func (*RestorePointProperties) UnmarshalJSON ¶
func (r *RestorePointProperties) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type RestorePointProperties.
type RestorePointSourceMetadata ¶
type RestorePointSourceMetadata struct { // Gets the storage profile. StorageProfile *RestorePointSourceVMStorageProfile // READ-ONLY; Gets the diagnostics profile. DiagnosticsProfile *DiagnosticsProfile // READ-ONLY; Gets the hardware profile. HardwareProfile *HardwareProfile // READ-ONLY; HyperVGeneration of the source VM for which restore point is captured. HyperVGeneration *HyperVGenerationTypes // READ-ONLY; Gets the license type, which is for bring your own license scenario. LicenseType *string // READ-ONLY; Location of the VM from which the restore point was created. Location *string // READ-ONLY; Gets the OS profile. OSProfile *OSProfile // READ-ONLY; Gets the security profile. SecurityProfile *SecurityProfile // READ-ONLY; UserData associated with the source VM for which restore point is captured, which is a base-64 encoded value. UserData *string // READ-ONLY; Gets the virtual machine unique id. VMID *string }
RestorePointSourceMetadata - Describes the properties of the Virtual Machine for which the restore point was created. The properties provided are a subset and the snapshot of the overall Virtual Machine properties captured at the time of the restore point creation.
func (RestorePointSourceMetadata) MarshalJSON ¶
func (r RestorePointSourceMetadata) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type RestorePointSourceMetadata.
func (*RestorePointSourceMetadata) UnmarshalJSON ¶
func (r *RestorePointSourceMetadata) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type RestorePointSourceMetadata.
type RestorePointSourceVMDataDisk ¶
type RestorePointSourceVMDataDisk struct { // Contains Disk Restore Point properties. DiskRestorePoint *DiskRestorePointAttributes // Contains the managed disk details. ManagedDisk *ManagedDiskParameters // READ-ONLY; Gets the caching type. Caching *CachingTypes // READ-ONLY; Gets the initial disk size in GB for blank data disks, and the new desired size for existing OS and Data disks. DiskSizeGB *int32 // READ-ONLY; Gets the logical unit number. Lun *int32 // READ-ONLY; Gets the disk name. Name *string // READ-ONLY; Shows true if the disk is write-accelerator enabled. WriteAcceleratorEnabled *bool }
RestorePointSourceVMDataDisk - Describes a data disk.
func (RestorePointSourceVMDataDisk) MarshalJSON ¶
func (r RestorePointSourceVMDataDisk) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type RestorePointSourceVMDataDisk.
func (*RestorePointSourceVMDataDisk) UnmarshalJSON ¶
func (r *RestorePointSourceVMDataDisk) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type RestorePointSourceVMDataDisk.
type RestorePointSourceVMOSDisk ¶
type RestorePointSourceVMOSDisk struct { // Contains Disk Restore Point properties. DiskRestorePoint *DiskRestorePointAttributes // Gets the managed disk details ManagedDisk *ManagedDiskParameters // READ-ONLY; Gets the caching type. Caching *CachingTypes // READ-ONLY; Gets the disk size in GB. DiskSizeGB *int32 // READ-ONLY; Gets the disk encryption settings. EncryptionSettings *DiskEncryptionSettings // READ-ONLY; Gets the disk name. Name *string // READ-ONLY; Gets the Operating System type. OSType *OperatingSystemType // READ-ONLY; Shows true if the disk is write-accelerator enabled. WriteAcceleratorEnabled *bool }
RestorePointSourceVMOSDisk - Describes an Operating System disk.
func (RestorePointSourceVMOSDisk) MarshalJSON ¶
func (r RestorePointSourceVMOSDisk) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type RestorePointSourceVMOSDisk.
func (*RestorePointSourceVMOSDisk) UnmarshalJSON ¶
func (r *RestorePointSourceVMOSDisk) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type RestorePointSourceVMOSDisk.
type RestorePointSourceVMStorageProfile ¶
type RestorePointSourceVMStorageProfile struct { // Gets the data disks of the VM captured at the time of the restore point creation. DataDisks []*RestorePointSourceVMDataDisk // Gets the OS disk of the VM captured at the time of the restore point creation. OSDisk *RestorePointSourceVMOSDisk // READ-ONLY; Gets the disk controller type of the VM captured at the time of the restore point creation. DiskControllerType *DiskControllerTypes }
RestorePointSourceVMStorageProfile - Describes the storage profile.
func (RestorePointSourceVMStorageProfile) MarshalJSON ¶
func (r RestorePointSourceVMStorageProfile) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type RestorePointSourceVMStorageProfile.
func (*RestorePointSourceVMStorageProfile) UnmarshalJSON ¶
func (r *RestorePointSourceVMStorageProfile) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type RestorePointSourceVMStorageProfile.
type RestorePointsClient ¶
type RestorePointsClient struct {
// contains filtered or unexported fields
}
RestorePointsClient contains the methods for the RestorePoints group. Don't use this type directly, use NewRestorePointsClient() instead.
func NewRestorePointsClient ¶
func NewRestorePointsClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*RestorePointsClient, error)
NewRestorePointsClient creates a new instance of RestorePointsClient 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 (*RestorePointsClient) BeginCreate ¶
func (client *RestorePointsClient) BeginCreate(ctx context.Context, resourceGroupName string, restorePointCollectionName string, restorePointName string, parameters RestorePoint, options *RestorePointsClientBeginCreateOptions) (*runtime.Poller[RestorePointsClientCreateResponse], error)
BeginCreate - The operation to create the restore point. Updating properties of an existing restore point is not allowed If the operation fails it returns an *azcore.ResponseError type.
Generated from API version 2024-03-01
- resourceGroupName - The name of the resource group.
- restorePointCollectionName - The name of the restore point collection.
- restorePointName - The name of the restore point.
- parameters - Parameters supplied to the Create restore point operation.
- options - RestorePointsClientBeginCreateOptions contains the optional parameters for the RestorePointsClient.BeginCreate method.
Example (CopyARestorePointToADifferentRegion) ¶
Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/92de53a5f1e0e03c94b40475d2135d97148ed014/specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-03-01/examples/restorePointExamples/RestorePoint_Copy_BetweenRegions.json
cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() clientFactory, err := armcompute.NewClientFactory("<subscription-id>", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } poller, err := clientFactory.NewRestorePointsClient().BeginCreate(ctx, "myResourceGroup", "rpcName", "rpName", armcompute.RestorePoint{ Properties: &armcompute.RestorePointProperties{ SourceRestorePoint: &armcompute.APIEntityReference{ ID: to.Ptr("/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/restorePointCollections/sourceRpcName/restorePoints/sourceRpName"), }, }, }, nil) if err != nil { log.Fatalf("failed to finish the request: %v", err) } _, err = poller.PollUntilDone(ctx, nil) if err != nil { log.Fatalf("failed to pull the result: %v", err) }
Output:
Example (CreateARestorePoint) ¶
Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/92de53a5f1e0e03c94b40475d2135d97148ed014/specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-03-01/examples/restorePointExamples/RestorePoint_Create.json
cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() clientFactory, err := armcompute.NewClientFactory("<subscription-id>", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } poller, err := clientFactory.NewRestorePointsClient().BeginCreate(ctx, "myResourceGroup", "rpcName", "rpName", armcompute.RestorePoint{ Properties: &armcompute.RestorePointProperties{ ExcludeDisks: []*armcompute.APIEntityReference{ { ID: to.Ptr("/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/disks/disk123"), }}, }, }, nil) if err != nil { log.Fatalf("failed to finish the request: %v", err) } _, err = poller.PollUntilDone(ctx, nil) if err != nil { log.Fatalf("failed to pull the result: %v", err) }
Output:
func (*RestorePointsClient) BeginDelete ¶
func (client *RestorePointsClient) BeginDelete(ctx context.Context, resourceGroupName string, restorePointCollectionName string, restorePointName string, options *RestorePointsClientBeginDeleteOptions) (*runtime.Poller[RestorePointsClientDeleteResponse], error)
BeginDelete - The operation to delete the restore point. If the operation fails it returns an *azcore.ResponseError type.
Generated from API version 2024-03-01
- resourceGroupName - The name of the resource group.
- restorePointCollectionName - The name of the Restore Point Collection.
- restorePointName - The name of the restore point.
- options - RestorePointsClientBeginDeleteOptions contains the optional parameters for the RestorePointsClient.BeginDelete method.
Example (RestorePointDeleteMaximumSetGen) ¶
Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/92de53a5f1e0e03c94b40475d2135d97148ed014/specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-03-01/examples/restorePointExamples/RestorePoint_Delete_MaximumSet_Gen.json
cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() clientFactory, err := armcompute.NewClientFactory("<subscription-id>", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } poller, err := clientFactory.NewRestorePointsClient().BeginDelete(ctx, "rgcompute", "aaaaaaaaaaaaaaaaaaaaaa", "a", nil) if err != nil { log.Fatalf("failed to finish the request: %v", err) } _, err = poller.PollUntilDone(ctx, nil) if err != nil { log.Fatalf("failed to pull the result: %v", err) }
Output:
Example (RestorePointDeleteMinimumSetGen) ¶
Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/92de53a5f1e0e03c94b40475d2135d97148ed014/specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-03-01/examples/restorePointExamples/RestorePoint_Delete_MinimumSet_Gen.json
cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() clientFactory, err := armcompute.NewClientFactory("<subscription-id>", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } poller, err := clientFactory.NewRestorePointsClient().BeginDelete(ctx, "rgcompute", "aaaaaaaaaaaaaaaaa", "aaaaaaaaaaaaaaaaaaaaaaaa", nil) if err != nil { log.Fatalf("failed to finish the request: %v", err) } _, err = poller.PollUntilDone(ctx, nil) if err != nil { log.Fatalf("failed to pull the result: %v", err) }
Output:
func (*RestorePointsClient) Get ¶
func (client *RestorePointsClient) Get(ctx context.Context, resourceGroupName string, restorePointCollectionName string, restorePointName string, options *RestorePointsClientGetOptions) (RestorePointsClientGetResponse, error)
Get - The operation to get the restore point. If the operation fails it returns an *azcore.ResponseError type.
Generated from API version 2024-03-01
- resourceGroupName - The name of the resource group.
- restorePointCollectionName - The name of the restore point collection.
- restorePointName - The name of the restore point.
- options - RestorePointsClientGetOptions contains the optional parameters for the RestorePointsClient.Get method.
Example (GetARestorePoint) ¶
Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/92de53a5f1e0e03c94b40475d2135d97148ed014/specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-03-01/examples/restorePointExamples/RestorePoint_Get.json
cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() clientFactory, err := armcompute.NewClientFactory("<subscription-id>", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } res, err := clientFactory.NewRestorePointsClient().Get(ctx, "myResourceGroup", "rpcName", "rpName", &armcompute.RestorePointsClientGetOptions{Expand: nil}) if err != nil { log.Fatalf("failed to finish the request: %v", err) } // You could use response here. We use blank identifier for just demo purposes. _ = res // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. // res.RestorePoint = armcompute.RestorePoint{ // Name: to.Ptr("rpName"), // ID: to.Ptr("/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/restorePointCollections/rpcName/restorePoints/rpName"), // Properties: &armcompute.RestorePointProperties{ // ConsistencyMode: to.Ptr(armcompute.ConsistencyModeTypesApplicationConsistent), // ExcludeDisks: []*armcompute.APIEntityReference{ // { // ID: to.Ptr("/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/disks/vm8768_disk2_fe6ffde4f69b491ca33fb984d5bcd89f"), // }}, // ProvisioningState: to.Ptr("Succeeded"), // SourceMetadata: &armcompute.RestorePointSourceMetadata{ // DiagnosticsProfile: &armcompute.DiagnosticsProfile{ // BootDiagnostics: &armcompute.BootDiagnostics{ // Enabled: to.Ptr(true), // }, // }, // HardwareProfile: &armcompute.HardwareProfile{ // VMSize: to.Ptr(armcompute.VirtualMachineSizeTypesStandardB1S), // }, // Location: to.Ptr("westus"), // OSProfile: &armcompute.OSProfile{ // AdminUsername: to.Ptr("admin"), // AllowExtensionOperations: to.Ptr(true), // ComputerName: to.Ptr("computerName"), // RequireGuestProvisionSignal: to.Ptr(true), // Secrets: []*armcompute.VaultSecretGroup{ // }, // WindowsConfiguration: &armcompute.WindowsConfiguration{ // EnableAutomaticUpdates: to.Ptr(true), // ProvisionVMAgent: to.Ptr(true), // }, // }, // StorageProfile: &armcompute.RestorePointSourceVMStorageProfile{ // DataDisks: []*armcompute.RestorePointSourceVMDataDisk{ // { // Name: to.Ptr("testingexcludedisk_DataDisk_1"), // Caching: to.Ptr(armcompute.CachingTypesNone), // DiskRestorePoint: &armcompute.DiskRestorePointAttributes{ // ID: to.Ptr("/subscriptions/{subscription-id}/resourceGroups/userdata/providers/Microsoft.Compute/restorePointCollections/mynewrpc/restorePoints/restorepointtwo/diskRestorePoints/testingexcludedisk_DataDisk_1_68785190-1acb-4d5e-a8ae-705b45f3dca5"), // }, // Lun: to.Ptr[int32](1), // ManagedDisk: &armcompute.ManagedDiskParameters{ // ID: to.Ptr("/subscriptions/{subscription-id}/resourceGroups/userdata/providers/Microsoft.Compute/disks/testingexcludedisk_DataDisk_1"), // StorageAccountType: to.Ptr(armcompute.StorageAccountTypesStandardLRS), // }, // }}, // DiskControllerType: to.Ptr(armcompute.DiskControllerTypesNVMe), // OSDisk: &armcompute.RestorePointSourceVMOSDisk{ // Name: to.Ptr("testingexcludedisk_OsDisk_1_74cdaedcea50483d9833c96adefa100f"), // Caching: to.Ptr(armcompute.CachingTypesReadWrite), // DiskRestorePoint: &armcompute.DiskRestorePointAttributes{ // ID: to.Ptr("/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/restorePointCollections/rpcName/restorePoints/rpName/diskRestorePoints/testingexcludedisk_OsDisk_1_74cdaedcea50483d9833c96adefa100f_22b4bdfe-6c54-4f72-84d8-85d8860f0c57"), // }, // ManagedDisk: &armcompute.ManagedDiskParameters{ // ID: to.Ptr("/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/disks/testingexcludedisk_OsDisk_1_74cdaedcea50483d9833c96adefa100f"), // StorageAccountType: to.Ptr(armcompute.StorageAccountTypesStandardLRS), // }, // OSType: to.Ptr(armcompute.OperatingSystemTypeWindows), // }, // }, // VMID: to.Ptr("76d6541e-80bd-4dc1-932b-3cae4cfb80e7"), // }, // TimeCreated: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-01-27T20:35:05.840Z"); return t}()), // }, // }
Output:
Example (GetRestorePointWithInstanceView) ¶
Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/92de53a5f1e0e03c94b40475d2135d97148ed014/specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-03-01/examples/restorePointExamples/RestorePoint_Get_WithInstanceView.json
cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() clientFactory, err := armcompute.NewClientFactory("<subscription-id>", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } res, err := clientFactory.NewRestorePointsClient().Get(ctx, "myResourceGroup", "rpcName", "rpName", &armcompute.RestorePointsClientGetOptions{Expand: nil}) if err != nil { log.Fatalf("failed to finish the request: %v", err) } // You could use response here. We use blank identifier for just demo purposes. _ = res // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. // res.RestorePoint = armcompute.RestorePoint{ // Name: to.Ptr("rpName"), // ID: to.Ptr("/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/restorePointCollections/rpcName/restorePoints/rpName"), // Properties: &armcompute.RestorePointProperties{ // ConsistencyMode: to.Ptr(armcompute.ConsistencyModeTypesApplicationConsistent), // ExcludeDisks: []*armcompute.APIEntityReference{ // { // ID: to.Ptr("/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/disks/vm8768_disk2_fe6ffde4f69b491ca33fb984d5bcd89f"), // }}, // InstanceView: &armcompute.RestorePointInstanceView{ // DiskRestorePoints: []*armcompute.DiskRestorePointInstanceView{ // { // ID: to.Ptr("/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/restorePointCollections/rpcName/restorePoints/rpName/diskRestorePoints/testingexcludedisk_OsDisk_1_74cdaedcea50483d9833c96adefa100f_22b4bdfe-6c54-4f72-84d8-85d8860f0c57"), // ReplicationStatus: &armcompute.DiskRestorePointReplicationStatus{ // CompletionPercent: to.Ptr[int32](100), // Status: &armcompute.InstanceViewStatus{ // Code: to.Ptr("ReplicationState/succeeded"), // DisplayStatus: to.Ptr("Succeeded"), // Level: to.Ptr(armcompute.StatusLevelTypesInfo), // }, // }, // }, // { // ID: to.Ptr("/subscriptions/{subscription-id}/resourceGroups/userdata/providers/Microsoft.Compute/restorePointCollections/mynewrpc/restorePoints/restorepointtwo/diskRestorePoints/testingexcludedisk_DataDisk_1_68785190-1acb-4d5e-a8ae-705b45f3dca5"), // ReplicationStatus: &armcompute.DiskRestorePointReplicationStatus{ // CompletionPercent: to.Ptr[int32](100), // Status: &armcompute.InstanceViewStatus{ // Code: to.Ptr("ReplicationState/succeeded"), // DisplayStatus: to.Ptr("Succeeded"), // Level: to.Ptr(armcompute.StatusLevelTypesInfo), // }, // }, // }}, // Statuses: []*armcompute.InstanceViewStatus{ // { // Code: to.Ptr("ReplicationState/succeeded"), // DisplayStatus: to.Ptr("Succeeded"), // Level: to.Ptr(armcompute.StatusLevelTypesInfo), // }}, // }, // ProvisioningState: to.Ptr("Succeeded"), // SourceMetadata: &armcompute.RestorePointSourceMetadata{ // DiagnosticsProfile: &armcompute.DiagnosticsProfile{ // BootDiagnostics: &armcompute.BootDiagnostics{ // Enabled: to.Ptr(true), // }, // }, // HardwareProfile: &armcompute.HardwareProfile{ // VMSize: to.Ptr(armcompute.VirtualMachineSizeTypesStandardB1S), // }, // Location: to.Ptr("westus"), // OSProfile: &armcompute.OSProfile{ // AdminUsername: to.Ptr("admin"), // AllowExtensionOperations: to.Ptr(true), // ComputerName: to.Ptr("computerName"), // RequireGuestProvisionSignal: to.Ptr(true), // Secrets: []*armcompute.VaultSecretGroup{ // }, // WindowsConfiguration: &armcompute.WindowsConfiguration{ // EnableAutomaticUpdates: to.Ptr(true), // ProvisionVMAgent: to.Ptr(true), // }, // }, // StorageProfile: &armcompute.RestorePointSourceVMStorageProfile{ // DataDisks: []*armcompute.RestorePointSourceVMDataDisk{ // { // Name: to.Ptr("testingexcludedisk_DataDisk_1"), // Caching: to.Ptr(armcompute.CachingTypesNone), // DiskRestorePoint: &armcompute.DiskRestorePointAttributes{ // ID: to.Ptr("/subscriptions/{subscription-id}/resourceGroups/userdata/providers/Microsoft.Compute/restorePointCollections/mynewrpc/restorePoints/restorepointtwo/diskRestorePoints/testingexcludedisk_DataDisk_1_68785190-1acb-4d5e-a8ae-705b45f3dca5"), // }, // Lun: to.Ptr[int32](1), // ManagedDisk: &armcompute.ManagedDiskParameters{ // ID: to.Ptr("/subscriptions/{subscription-id}/resourceGroups/userdata/providers/Microsoft.Compute/disks/testingexcludedisk_DataDisk_1"), // StorageAccountType: to.Ptr(armcompute.StorageAccountTypesStandardLRS), // }, // }}, // DiskControllerType: to.Ptr(armcompute.DiskControllerTypesNVMe), // OSDisk: &armcompute.RestorePointSourceVMOSDisk{ // Name: to.Ptr("testingexcludedisk_OsDisk_1_74cdaedcea50483d9833c96adefa100f"), // Caching: to.Ptr(armcompute.CachingTypesReadWrite), // DiskRestorePoint: &armcompute.DiskRestorePointAttributes{ // ID: to.Ptr("/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/restorePointCollections/rpcName/restorePoints/rpName/diskRestorePoints/testingexcludedisk_OsDisk_1_74cdaedcea50483d9833c96adefa100f_22b4bdfe-6c54-4f72-84d8-85d8860f0c57"), // }, // ManagedDisk: &armcompute.ManagedDiskParameters{ // ID: to.Ptr("/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/disks/testingexcludedisk_OsDisk_1_74cdaedcea50483d9833c96adefa100f"), // StorageAccountType: to.Ptr(armcompute.StorageAccountTypesStandardLRS), // }, // OSType: to.Ptr(armcompute.OperatingSystemTypeWindows), // }, // }, // VMID: to.Ptr("76d6541e-80bd-4dc1-932b-3cae4cfb80e7"), // }, // TimeCreated: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-01-27T20:35:05.840Z"); return t}()), // }, // }
Output:
type RestorePointsClientBeginCreateOptions ¶
type RestorePointsClientBeginCreateOptions struct { // Resumes the LRO from the provided token. ResumeToken string }
RestorePointsClientBeginCreateOptions contains the optional parameters for the RestorePointsClient.BeginCreate method.
type RestorePointsClientBeginDeleteOptions ¶
type RestorePointsClientBeginDeleteOptions struct { // Resumes the LRO from the provided token. ResumeToken string }
RestorePointsClientBeginDeleteOptions contains the optional parameters for the RestorePointsClient.BeginDelete method.
type RestorePointsClientCreateResponse ¶
type RestorePointsClientCreateResponse struct { // Restore Point details. RestorePoint }
RestorePointsClientCreateResponse contains the response from method RestorePointsClient.BeginCreate.
type RestorePointsClientDeleteResponse ¶
type RestorePointsClientDeleteResponse struct { }
RestorePointsClientDeleteResponse contains the response from method RestorePointsClient.BeginDelete.
type RestorePointsClientGetOptions ¶
type RestorePointsClientGetOptions struct { // The expand expression to apply on the operation. 'InstanceView' retrieves information about the run-time state of a restore // point. Expand *RestorePointExpandOptions }
RestorePointsClientGetOptions contains the optional parameters for the RestorePointsClient.Get method.
type RestorePointsClientGetResponse ¶
type RestorePointsClientGetResponse struct { // Restore Point details. RestorePoint }
RestorePointsClientGetResponse contains the response from method RestorePointsClient.Get.
type RetrieveBootDiagnosticsDataResult ¶
type RetrieveBootDiagnosticsDataResult struct { // READ-ONLY; The console screenshot blob URI ConsoleScreenshotBlobURI *string // READ-ONLY; The serial console log blob URI. SerialConsoleLogBlobURI *string }
RetrieveBootDiagnosticsDataResult - The SAS URIs of the console screenshot and serial log blobs.
func (RetrieveBootDiagnosticsDataResult) MarshalJSON ¶
func (r RetrieveBootDiagnosticsDataResult) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type RetrieveBootDiagnosticsDataResult.
func (*RetrieveBootDiagnosticsDataResult) UnmarshalJSON ¶
func (r *RetrieveBootDiagnosticsDataResult) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type RetrieveBootDiagnosticsDataResult.
type RoleInstance ¶
type RoleInstance struct { // Role instance properties. Properties *RoleInstanceProperties // The role instance SKU. SKU *InstanceSKU // READ-ONLY; Resource Id ID *string // READ-ONLY; Resource Location. Location *string // READ-ONLY; Resource Name. Name *string // READ-ONLY; Resource tags. Tags map[string]*string // READ-ONLY; Resource Type. Type *string }
RoleInstance - Describes the cloud service role instance.
func (RoleInstance) MarshalJSON ¶
func (r RoleInstance) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type RoleInstance.
func (*RoleInstance) UnmarshalJSON ¶
func (r *RoleInstance) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type RoleInstance.
type RoleInstanceListResult ¶
type RoleInstanceListResult struct { // REQUIRED; The list of resources. Value []*RoleInstance // The URI to fetch the next page of resources. Use this to get the next page of resources. Do this till nextLink is null // to fetch all the resources. NextLink *string }
RoleInstanceListResult - The list operation result.
func (RoleInstanceListResult) MarshalJSON ¶
func (r RoleInstanceListResult) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type RoleInstanceListResult.
func (*RoleInstanceListResult) UnmarshalJSON ¶
func (r *RoleInstanceListResult) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type RoleInstanceListResult.
type RoleInstanceNetworkProfile ¶
type RoleInstanceNetworkProfile struct { // READ-ONLY; Specifies the list of resource Ids for the network interfaces associated with the role instance. NetworkInterfaces []*SubResource }
RoleInstanceNetworkProfile - Describes the network profile for the role instance.
func (RoleInstanceNetworkProfile) MarshalJSON ¶
func (r RoleInstanceNetworkProfile) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type RoleInstanceNetworkProfile.
func (*RoleInstanceNetworkProfile) UnmarshalJSON ¶
func (r *RoleInstanceNetworkProfile) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type RoleInstanceNetworkProfile.
type RoleInstanceProperties ¶
type RoleInstanceProperties struct { // The instance view of the role instance. InstanceView *RoleInstanceView // Describes the network profile for the role instance. NetworkProfile *RoleInstanceNetworkProfile }
RoleInstanceProperties - Role instance properties.
func (RoleInstanceProperties) MarshalJSON ¶
func (r RoleInstanceProperties) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type RoleInstanceProperties.
func (*RoleInstanceProperties) UnmarshalJSON ¶
func (r *RoleInstanceProperties) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type RoleInstanceProperties.
type RoleInstanceView ¶
type RoleInstanceView struct { // READ-ONLY; The Fault Domain. PlatformFaultDomain *int32 // READ-ONLY; The Update Domain. PlatformUpdateDomain *int32 // READ-ONLY; Specifies a unique identifier generated internally for the cloud service associated with this role instance. // NOTE: If you are using Azure Diagnostics extension, this property can be used as 'DeploymentId' for querying details. PrivateID *string // READ-ONLY Statuses []*ResourceInstanceViewStatus }
RoleInstanceView - The instance view of the role instance.
func (RoleInstanceView) MarshalJSON ¶
func (r RoleInstanceView) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type RoleInstanceView.
func (*RoleInstanceView) UnmarshalJSON ¶
func (r *RoleInstanceView) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type RoleInstanceView.
type RoleInstances ¶
type RoleInstances struct { // REQUIRED; List of cloud service role instance names. Value of '*' will signify all role instances of the cloud service. RoleInstances []*string }
RoleInstances - Specifies a list of role instances from the cloud service.
func (RoleInstances) MarshalJSON ¶
func (r RoleInstances) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type RoleInstances.
func (*RoleInstances) UnmarshalJSON ¶
func (r *RoleInstances) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type RoleInstances.
type RollbackStatusInfo ¶
type RollbackStatusInfo struct { // READ-ONLY; The number of instances which failed to rollback. FailedRolledbackInstanceCount *int32 // READ-ONLY; Error details if OS rollback failed. RollbackError *APIError // READ-ONLY; The number of instances which have been successfully rolled back. SuccessfullyRolledbackInstanceCount *int32 }
RollbackStatusInfo - Information about rollback on failed VM instances after a OS Upgrade operation.
func (RollbackStatusInfo) MarshalJSON ¶
func (r RollbackStatusInfo) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type RollbackStatusInfo.
func (*RollbackStatusInfo) UnmarshalJSON ¶
func (r *RollbackStatusInfo) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type RollbackStatusInfo.
type RollingUpgradeActionType ¶
type RollingUpgradeActionType string
RollingUpgradeActionType - The last action performed on the rolling upgrade.
const ( RollingUpgradeActionTypeCancel RollingUpgradeActionType = "Cancel" RollingUpgradeActionTypeStart RollingUpgradeActionType = "Start" )
func PossibleRollingUpgradeActionTypeValues ¶
func PossibleRollingUpgradeActionTypeValues() []RollingUpgradeActionType
PossibleRollingUpgradeActionTypeValues returns the possible values for the RollingUpgradeActionType const type.
type RollingUpgradePolicy ¶
type RollingUpgradePolicy struct { // Allow VMSS to ignore AZ boundaries when constructing upgrade batches. Take into consideration the Update Domain and maxBatchInstancePercent // to determine the batch size. EnableCrossZoneUpgrade *bool // The maximum percent of total virtual machine instances that will be upgraded simultaneously by the rolling upgrade in one // batch. As this is a maximum, unhealthy instances in previous or future batches // can cause the percentage of instances in a batch to decrease to ensure higher reliability. The default value for this parameter // is 20%. MaxBatchInstancePercent *int32 // Create new virtual machines to upgrade the scale set, rather than updating the existing virtual machines. Existing virtual // machines will be deleted once the new virtual machines are created for each // batch. MaxSurge *bool // The maximum percentage of the total virtual machine instances in the scale set that can be simultaneously unhealthy, either // as a result of being upgraded, or by being found in an unhealthy state by // the virtual machine health checks before the rolling upgrade aborts. This constraint will be checked prior to starting // any batch. The default value for this parameter is 20%. MaxUnhealthyInstancePercent *int32 // The maximum percentage of upgraded virtual machine instances that can be found to be in an unhealthy state. This check // will happen after each batch is upgraded. If this percentage is ever exceeded, // the rolling update aborts. The default value for this parameter is 20%. MaxUnhealthyUpgradedInstancePercent *int32 // The wait time between completing the update for all virtual machines in one batch and starting the next batch. The time // duration should be specified in ISO 8601 format. The default value is 0 seconds // (PT0S). PauseTimeBetweenBatches *string // Upgrade all unhealthy instances in a scale set before any healthy instances. PrioritizeUnhealthyInstances *bool // Rollback failed instances to previous model if the Rolling Upgrade policy is violated. RollbackFailedInstancesOnPolicyBreach *bool }
RollingUpgradePolicy - The configuration parameters used while performing a rolling upgrade.
func (RollingUpgradePolicy) MarshalJSON ¶
func (r RollingUpgradePolicy) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type RollingUpgradePolicy.
func (*RollingUpgradePolicy) UnmarshalJSON ¶
func (r *RollingUpgradePolicy) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type RollingUpgradePolicy.
type RollingUpgradeProgressInfo ¶
type RollingUpgradeProgressInfo struct { // READ-ONLY; The number of instances that have failed to be upgraded successfully. FailedInstanceCount *int32 // READ-ONLY; The number of instances that are currently being upgraded. InProgressInstanceCount *int32 // READ-ONLY; The number of instances that have not yet begun to be upgraded. PendingInstanceCount *int32 // READ-ONLY; The number of instances that have been successfully upgraded. SuccessfulInstanceCount *int32 }
RollingUpgradeProgressInfo - Information about the number of virtual machine instances in each upgrade state.
func (RollingUpgradeProgressInfo) MarshalJSON ¶
func (r RollingUpgradeProgressInfo) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type RollingUpgradeProgressInfo.
func (*RollingUpgradeProgressInfo) UnmarshalJSON ¶
func (r *RollingUpgradeProgressInfo) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type RollingUpgradeProgressInfo.
type RollingUpgradeRunningStatus ¶
type RollingUpgradeRunningStatus struct { // READ-ONLY; Code indicating the current status of the upgrade. Code *RollingUpgradeStatusCode // READ-ONLY; The last action performed on the rolling upgrade. LastAction *RollingUpgradeActionType // READ-ONLY; Last action time of the upgrade. LastActionTime *time.Time // READ-ONLY; Start time of the upgrade. StartTime *time.Time }
RollingUpgradeRunningStatus - Information about the current running state of the overall upgrade.
func (RollingUpgradeRunningStatus) MarshalJSON ¶
func (r RollingUpgradeRunningStatus) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type RollingUpgradeRunningStatus.
func (*RollingUpgradeRunningStatus) UnmarshalJSON ¶
func (r *RollingUpgradeRunningStatus) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type RollingUpgradeRunningStatus.
type RollingUpgradeStatusCode ¶
type RollingUpgradeStatusCode string
RollingUpgradeStatusCode - Code indicating the current status of the upgrade.
const ( RollingUpgradeStatusCodeCancelled RollingUpgradeStatusCode = "Cancelled" RollingUpgradeStatusCodeCompleted RollingUpgradeStatusCode = "Completed" RollingUpgradeStatusCodeFaulted RollingUpgradeStatusCode = "Faulted" RollingUpgradeStatusCodeRollingForward RollingUpgradeStatusCode = "RollingForward" )
func PossibleRollingUpgradeStatusCodeValues ¶
func PossibleRollingUpgradeStatusCodeValues() []RollingUpgradeStatusCode
PossibleRollingUpgradeStatusCodeValues returns the possible values for the RollingUpgradeStatusCode const type.
type RollingUpgradeStatusInfo ¶
type RollingUpgradeStatusInfo struct { // REQUIRED; Resource location Location *string // The status of the latest virtual machine scale set rolling upgrade. Properties *RollingUpgradeStatusInfoProperties // Resource tags Tags map[string]*string // READ-ONLY; Resource Id ID *string // READ-ONLY; Resource name Name *string // READ-ONLY; Resource type Type *string }
RollingUpgradeStatusInfo - The status of the latest virtual machine scale set rolling upgrade.
func (RollingUpgradeStatusInfo) MarshalJSON ¶
func (r RollingUpgradeStatusInfo) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type RollingUpgradeStatusInfo.
func (*RollingUpgradeStatusInfo) UnmarshalJSON ¶
func (r *RollingUpgradeStatusInfo) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type RollingUpgradeStatusInfo.
type RollingUpgradeStatusInfoProperties ¶
type RollingUpgradeStatusInfoProperties struct { // READ-ONLY; Error details for this upgrade, if there are any. Error *APIError // READ-ONLY; The rolling upgrade policies applied for this upgrade. Policy *RollingUpgradePolicy // READ-ONLY; Information about the number of virtual machine instances in each upgrade state. Progress *RollingUpgradeProgressInfo // READ-ONLY; Information about the current running state of the overall upgrade. RunningStatus *RollingUpgradeRunningStatus }
RollingUpgradeStatusInfoProperties - The status of the latest virtual machine scale set rolling upgrade.
func (RollingUpgradeStatusInfoProperties) MarshalJSON ¶
func (r RollingUpgradeStatusInfoProperties) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type RollingUpgradeStatusInfoProperties.
func (*RollingUpgradeStatusInfoProperties) UnmarshalJSON ¶
func (r *RollingUpgradeStatusInfoProperties) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type RollingUpgradeStatusInfoProperties.
type RunCommandDocument ¶
type RunCommandDocument struct { // REQUIRED; The VM run command description. Description *string // REQUIRED; The VM run command id. ID *string // REQUIRED; The VM run command label. Label *string // REQUIRED; The Operating System type. OSType *OperatingSystemTypes // REQUIRED; The VM run command schema. Schema *string // REQUIRED; The script to be executed. Script []*string // The parameters used by the script. Parameters []*RunCommandParameterDefinition }
RunCommandDocument - Describes the properties of a Run Command.
func (RunCommandDocument) MarshalJSON ¶
func (r RunCommandDocument) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type RunCommandDocument.
func (*RunCommandDocument) UnmarshalJSON ¶
func (r *RunCommandDocument) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type RunCommandDocument.
type RunCommandDocumentBase ¶
type RunCommandDocumentBase struct { // REQUIRED; The VM run command description. Description *string // REQUIRED; The VM run command id. ID *string // REQUIRED; The VM run command label. Label *string // REQUIRED; The Operating System type. OSType *OperatingSystemTypes // REQUIRED; The VM run command schema. Schema *string }
RunCommandDocumentBase - Describes the properties of a Run Command metadata.
func (RunCommandDocumentBase) MarshalJSON ¶
func (r RunCommandDocumentBase) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type RunCommandDocumentBase.
func (*RunCommandDocumentBase) UnmarshalJSON ¶
func (r *RunCommandDocumentBase) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type RunCommandDocumentBase.
type RunCommandInput ¶
type RunCommandInput struct { // REQUIRED; The run command id. CommandID *string // The run command parameters. Parameters []*RunCommandInputParameter // Optional. The script to be executed. When this value is given, the given script will override the default script of the // command. Script []*string }
RunCommandInput - Capture Virtual Machine parameters.
func (RunCommandInput) MarshalJSON ¶
func (r RunCommandInput) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type RunCommandInput.
func (*RunCommandInput) UnmarshalJSON ¶
func (r *RunCommandInput) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type RunCommandInput.
type RunCommandInputParameter ¶
type RunCommandInputParameter struct { // REQUIRED; The run command parameter name. Name *string // REQUIRED; The run command parameter value. Value *string }
RunCommandInputParameter - Describes the properties of a run command parameter.
func (RunCommandInputParameter) MarshalJSON ¶
func (r RunCommandInputParameter) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type RunCommandInputParameter.
func (*RunCommandInputParameter) UnmarshalJSON ¶
func (r *RunCommandInputParameter) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type RunCommandInputParameter.
type RunCommandListResult ¶
type RunCommandListResult struct { // REQUIRED; The list of virtual machine run commands. Value []*RunCommandDocumentBase // The uri to fetch the next page of run commands. Call ListNext() with this to fetch the next page of run commands. NextLink *string }
RunCommandListResult - The List Virtual Machine operation response.
func (RunCommandListResult) MarshalJSON ¶
func (r RunCommandListResult) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type RunCommandListResult.
func (*RunCommandListResult) UnmarshalJSON ¶
func (r *RunCommandListResult) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type RunCommandListResult.
type RunCommandManagedIdentity ¶
type RunCommandManagedIdentity struct { // Client Id (GUID value) of the user-assigned managed identity. ObjectId should not be used if this is provided. ClientID *string // Object Id (GUID value) of the user-assigned managed identity. ClientId should not be used if this is provided. ObjectID *string }
RunCommandManagedIdentity - Contains clientId or objectId (use only one, not both) of a user-assigned managed identity that has access to storage blob used in Run Command. Use an empty RunCommandManagedIdentity object in case of system-assigned identity. Make sure the Azure storage blob exists in case of scriptUri, and managed identity has been given access to blob's container with 'Storage Blob Data Reader' role assignment with scriptUri blob and 'Storage Blob Data Contributor' for Append blobs(outputBlobUri, errorBlobUri). In case of user assigned identity, make sure you add it under VM's identity. For more info on managed identity and Run Command, refer https://aka.ms/ManagedIdentity and https://aka.ms/RunCommandManaged.
func (RunCommandManagedIdentity) MarshalJSON ¶
func (r RunCommandManagedIdentity) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type RunCommandManagedIdentity.
func (*RunCommandManagedIdentity) UnmarshalJSON ¶
func (r *RunCommandManagedIdentity) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type RunCommandManagedIdentity.
type RunCommandParameterDefinition ¶
type RunCommandParameterDefinition struct { // REQUIRED; The run command parameter name. Name *string // REQUIRED; The run command parameter type. Type *string // The run command parameter default value. DefaultValue *string // The run command parameter required. Required *bool }
RunCommandParameterDefinition - Describes the properties of a run command parameter.
func (RunCommandParameterDefinition) MarshalJSON ¶
func (r RunCommandParameterDefinition) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type RunCommandParameterDefinition.
func (*RunCommandParameterDefinition) UnmarshalJSON ¶
func (r *RunCommandParameterDefinition) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type RunCommandParameterDefinition.
type RunCommandResult ¶
type RunCommandResult struct { // Run command operation response. Value []*InstanceViewStatus }
func (RunCommandResult) MarshalJSON ¶
func (r RunCommandResult) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type RunCommandResult.
func (*RunCommandResult) UnmarshalJSON ¶
func (r *RunCommandResult) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type RunCommandResult.
type SKU ¶
type SKU struct { // Specifies the number of virtual machines in the scale set. Capacity *int64 // The sku name. Name *string // Specifies the tier of virtual machines in a scale set. // Possible Values: // Standard // Basic Tier *string }
SKU - Describes a virtual machine scale set sku. NOTE: If the new VM SKU is not supported on the hardware the scale set is currently on, you need to deallocate the VMs in the scale set before you modify the SKU name.
func (SKU) MarshalJSON ¶
MarshalJSON implements the json.Marshaller interface for type SKU.
func (*SKU) UnmarshalJSON ¶
UnmarshalJSON implements the json.Unmarshaller interface for type SKU.
type SSHConfiguration ¶
type SSHConfiguration struct { // The list of SSH public keys used to authenticate with linux based VMs. PublicKeys []*SSHPublicKey }
SSHConfiguration - SSH configuration for Linux based VMs running on Azure
func (SSHConfiguration) MarshalJSON ¶
func (s SSHConfiguration) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type SSHConfiguration.
func (*SSHConfiguration) UnmarshalJSON ¶
func (s *SSHConfiguration) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type SSHConfiguration.
type SSHEncryptionTypes ¶ added in v5.4.0
type SSHEncryptionTypes string
SSHEncryptionTypes - The encryption type of the SSH keys to be generated. See SshEncryptionTypes for possible set of values. If not provided, will default to RSA
const ( SSHEncryptionTypesEd25519 SSHEncryptionTypes = "Ed25519" SSHEncryptionTypesRSA SSHEncryptionTypes = "RSA" )
func PossibleSSHEncryptionTypesValues ¶ added in v5.4.0
func PossibleSSHEncryptionTypesValues() []SSHEncryptionTypes
PossibleSSHEncryptionTypesValues returns the possible values for the SSHEncryptionTypes const type.
type SSHGenerateKeyPairInputParameters ¶ added in v5.4.0
type SSHGenerateKeyPairInputParameters struct { // The encryption type of the SSH keys to be generated. See SshEncryptionTypes for possible set of values. If not provided, // will default to RSA EncryptionType *SSHEncryptionTypes }
SSHGenerateKeyPairInputParameters - Parameters for GenerateSshKeyPair.
func (SSHGenerateKeyPairInputParameters) MarshalJSON ¶ added in v5.4.0
func (s SSHGenerateKeyPairInputParameters) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type SSHGenerateKeyPairInputParameters.
func (*SSHGenerateKeyPairInputParameters) UnmarshalJSON ¶ added in v5.4.0
func (s *SSHGenerateKeyPairInputParameters) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type SSHGenerateKeyPairInputParameters.
type SSHPublicKey ¶
type SSHPublicKey struct { // SSH public key certificate used to authenticate with the VM through ssh. The key needs to be at least 2048-bit and in ssh-rsa // format. For creating ssh keys, see [Create SSH keys on Linux and Mac for // Linux VMs in Azure]https://docs.microsoft.com/azure/virtual-machines/linux/create-ssh-keys-detailed). KeyData *string // Specifies the full path on the created VM where ssh public key is stored. If the file already exists, the specified key // is appended to the file. Example: /home/user/.ssh/authorized_keys Path *string }
SSHPublicKey - Contains information about SSH certificate public key and the path on the Linux VM where the public key is placed.
func (SSHPublicKey) MarshalJSON ¶
func (s SSHPublicKey) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type SSHPublicKey.
func (*SSHPublicKey) UnmarshalJSON ¶
func (s *SSHPublicKey) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type SSHPublicKey.
type SSHPublicKeyGenerateKeyPairResult ¶
type SSHPublicKeyGenerateKeyPairResult struct { // REQUIRED; The ARM resource id in the form of /subscriptions/{SubscriptionId}/resourceGroups/{ResourceGroupName}/providers/Microsoft.Compute/sshPublicKeys/{SshPublicKeyName} ID *string // REQUIRED; Private key portion of the key pair used to authenticate to a virtual machine through ssh. The private key is // returned in RFC3447 format and should be treated as a secret. PrivateKey *string // REQUIRED; Public key portion of the key pair used to authenticate to a virtual machine through ssh. The public key is in // ssh-rsa format. PublicKey *string }
SSHPublicKeyGenerateKeyPairResult - Response from generation of an SSH key pair.
func (SSHPublicKeyGenerateKeyPairResult) MarshalJSON ¶
func (s SSHPublicKeyGenerateKeyPairResult) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type SSHPublicKeyGenerateKeyPairResult.
func (*SSHPublicKeyGenerateKeyPairResult) UnmarshalJSON ¶
func (s *SSHPublicKeyGenerateKeyPairResult) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type SSHPublicKeyGenerateKeyPairResult.
type SSHPublicKeyResource ¶
type SSHPublicKeyResource struct { // REQUIRED; Resource location Location *string // Properties of the SSH public key. Properties *SSHPublicKeyResourceProperties // Resource tags Tags map[string]*string // READ-ONLY; Resource Id ID *string // READ-ONLY; Resource name Name *string // READ-ONLY; Resource type Type *string }
SSHPublicKeyResource - Specifies information about the SSH public key.
func (SSHPublicKeyResource) MarshalJSON ¶
func (s SSHPublicKeyResource) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type SSHPublicKeyResource.
func (*SSHPublicKeyResource) UnmarshalJSON ¶
func (s *SSHPublicKeyResource) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type SSHPublicKeyResource.
type SSHPublicKeyResourceProperties ¶
type SSHPublicKeyResourceProperties struct { // SSH public key used to authenticate to a virtual machine through ssh. If this property is not initially provided when the // resource is created, the publicKey property will be populated when // generateKeyPair is called. If the public key is provided upon resource creation, the provided public key needs to be at // least 2048-bit and in ssh-rsa format. PublicKey *string }
SSHPublicKeyResourceProperties - Properties of the SSH public key.
func (SSHPublicKeyResourceProperties) MarshalJSON ¶
func (s SSHPublicKeyResourceProperties) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type SSHPublicKeyResourceProperties.
func (*SSHPublicKeyResourceProperties) UnmarshalJSON ¶
func (s *SSHPublicKeyResourceProperties) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type SSHPublicKeyResourceProperties.
type SSHPublicKeyUpdateResource ¶
type SSHPublicKeyUpdateResource struct { // Properties of the SSH public key. Properties *SSHPublicKeyResourceProperties // Resource tags Tags map[string]*string }
SSHPublicKeyUpdateResource - Specifies information about the SSH public key.
func (SSHPublicKeyUpdateResource) MarshalJSON ¶
func (s SSHPublicKeyUpdateResource) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type SSHPublicKeyUpdateResource.
func (*SSHPublicKeyUpdateResource) UnmarshalJSON ¶
func (s *SSHPublicKeyUpdateResource) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type SSHPublicKeyUpdateResource.
type SSHPublicKeysClient ¶
type SSHPublicKeysClient struct {
// contains filtered or unexported fields
}
SSHPublicKeysClient contains the methods for the SSHPublicKeys group. Don't use this type directly, use NewSSHPublicKeysClient() instead.
func NewSSHPublicKeysClient ¶
func NewSSHPublicKeysClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*SSHPublicKeysClient, error)
NewSSHPublicKeysClient creates a new instance of SSHPublicKeysClient 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 (*SSHPublicKeysClient) Create ¶
func (client *SSHPublicKeysClient) Create(ctx context.Context, resourceGroupName string, sshPublicKeyName string, parameters SSHPublicKeyResource, options *SSHPublicKeysClientCreateOptions) (SSHPublicKeysClientCreateResponse, error)
Create - Creates a new SSH public key resource. If the operation fails it returns an *azcore.ResponseError type.
Generated from API version 2024-03-01
- resourceGroupName - The name of the resource group.
- sshPublicKeyName - The name of the SSH public key.
- parameters - Parameters supplied to create the SSH public key.
- options - SSHPublicKeysClientCreateOptions contains the optional parameters for the SSHPublicKeysClient.Create method.
Example ¶
Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/92de53a5f1e0e03c94b40475d2135d97148ed014/specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-03-01/examples/sshPublicKeyExamples/SshPublicKey_Create.json
cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() clientFactory, err := armcompute.NewClientFactory("<subscription-id>", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } res, err := clientFactory.NewSSHPublicKeysClient().Create(ctx, "myResourceGroup", "mySshPublicKeyName", armcompute.SSHPublicKeyResource{ Location: to.Ptr("westus"), Properties: &armcompute.SSHPublicKeyResourceProperties{ PublicKey: to.Ptr("{ssh-rsa public key}"), }, }, nil) if err != nil { log.Fatalf("failed to finish the request: %v", err) } // You could use response here. We use blank identifier for just demo purposes. _ = res // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. // res.SSHPublicKeyResource = armcompute.SSHPublicKeyResource{ // Name: to.Ptr("mySshPublicKeyName"), // ID: to.Ptr("/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/sshPublicKeys/mySshPublicKeyName"), // Location: to.Ptr("westus"), // Properties: &armcompute.SSHPublicKeyResourceProperties{ // PublicKey: to.Ptr("{ssh-rsa public key}"), // }, // }
Output:
func (*SSHPublicKeysClient) Delete ¶
func (client *SSHPublicKeysClient) Delete(ctx context.Context, resourceGroupName string, sshPublicKeyName string, options *SSHPublicKeysClientDeleteOptions) (SSHPublicKeysClientDeleteResponse, error)
Delete - Delete an SSH public key. If the operation fails it returns an *azcore.ResponseError type.
Generated from API version 2024-03-01
- resourceGroupName - The name of the resource group.
- sshPublicKeyName - The name of the SSH public key.
- options - SSHPublicKeysClientDeleteOptions contains the optional parameters for the SSHPublicKeysClient.Delete method.
Example (SshPublicKeyDeleteMaximumSetGen) ¶
Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/92de53a5f1e0e03c94b40475d2135d97148ed014/specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-03-01/examples/sshPublicKeyExamples/SshPublicKey_Delete_MaximumSet_Gen.json
cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() clientFactory, err := armcompute.NewClientFactory("<subscription-id>", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } _, err = clientFactory.NewSSHPublicKeysClient().Delete(ctx, "rgcompute", "aaaaaaaaaa", nil) if err != nil { log.Fatalf("failed to finish the request: %v", err) }
Output:
Example (SshPublicKeyDeleteMinimumSetGen) ¶
Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/92de53a5f1e0e03c94b40475d2135d97148ed014/specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-03-01/examples/sshPublicKeyExamples/SshPublicKey_Delete_MinimumSet_Gen.json
cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() clientFactory, err := armcompute.NewClientFactory("<subscription-id>", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } _, err = clientFactory.NewSSHPublicKeysClient().Delete(ctx, "rgcompute", "aaaaaaaaaaaaaaaaaaa", nil) if err != nil { log.Fatalf("failed to finish the request: %v", err) }
Output:
func (*SSHPublicKeysClient) GenerateKeyPair ¶
func (client *SSHPublicKeysClient) GenerateKeyPair(ctx context.Context, resourceGroupName string, sshPublicKeyName string, options *SSHPublicKeysClientGenerateKeyPairOptions) (SSHPublicKeysClientGenerateKeyPairResponse, error)
GenerateKeyPair - Generates and returns a public/private key pair and populates the SSH public key resource with the public key. The length of the key will be 3072 bits. This operation can only be performed once per SSH public key resource. If the operation fails it returns an *azcore.ResponseError type.
Generated from API version 2024-03-01
- resourceGroupName - The name of the resource group.
- sshPublicKeyName - The name of the SSH public key.
- options - SSHPublicKeysClientGenerateKeyPairOptions contains the optional parameters for the SSHPublicKeysClient.GenerateKeyPair method.
Example (GenerateAnSshKeyPair) ¶
Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/92de53a5f1e0e03c94b40475d2135d97148ed014/specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-03-01/examples/sshPublicKeyExamples/SshPublicKey_GenerateKeyPair.json
cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() clientFactory, err := armcompute.NewClientFactory("<subscription-id>", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } res, err := clientFactory.NewSSHPublicKeysClient().GenerateKeyPair(ctx, "myResourceGroup", "mySshPublicKeyName", &armcompute.SSHPublicKeysClientGenerateKeyPairOptions{Parameters: nil}) if err != nil { log.Fatalf("failed to finish the request: %v", err) } // You could use response here. We use blank identifier for just demo purposes. _ = res // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. // res.SSHPublicKeyGenerateKeyPairResult = armcompute.SSHPublicKeyGenerateKeyPairResult{ // ID: to.Ptr("/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/SshPublicKeys/mySshPublicKeyName"), // PrivateKey: to.Ptr("{ssh private key}"), // PublicKey: to.Ptr("{ssh-rsa public key}"), // }
Output:
Example (GenerateAnSshKeyPairWithEd25519Encryption) ¶
Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/92de53a5f1e0e03c94b40475d2135d97148ed014/specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-03-01/examples/sshPublicKeyExamples/SshPublicKey_GenerateKeyPair_EncryptionWithEd25519.json
cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() clientFactory, err := armcompute.NewClientFactory("<subscription-id>", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } res, err := clientFactory.NewSSHPublicKeysClient().GenerateKeyPair(ctx, "myResourceGroup", "mySshPublicKeyName", &armcompute.SSHPublicKeysClientGenerateKeyPairOptions{Parameters: &armcompute.SSHGenerateKeyPairInputParameters{ EncryptionType: to.Ptr(armcompute.SSHEncryptionTypesRSA), }, }) if err != nil { log.Fatalf("failed to finish the request: %v", err) } // You could use response here. We use blank identifier for just demo purposes. _ = res // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. // res.SSHPublicKeyGenerateKeyPairResult = armcompute.SSHPublicKeyGenerateKeyPairResult{ // ID: to.Ptr("/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/SshPublicKeys/mySshPublicKeyName"), // PrivateKey: to.Ptr("{ssh private key}"), // PublicKey: to.Ptr("{ssh-rsa public key}"), // }
Output:
Example (GenerateAnSshKeyPairWithRsaEncryption) ¶
Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/92de53a5f1e0e03c94b40475d2135d97148ed014/specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-03-01/examples/sshPublicKeyExamples/SshPublicKey_GenerateKeyPair_EncryptionWithRSA.json
cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() clientFactory, err := armcompute.NewClientFactory("<subscription-id>", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } res, err := clientFactory.NewSSHPublicKeysClient().GenerateKeyPair(ctx, "myResourceGroup", "mySshPublicKeyName", &armcompute.SSHPublicKeysClientGenerateKeyPairOptions{Parameters: &armcompute.SSHGenerateKeyPairInputParameters{ EncryptionType: to.Ptr(armcompute.SSHEncryptionTypesRSA), }, }) if err != nil { log.Fatalf("failed to finish the request: %v", err) } // You could use response here. We use blank identifier for just demo purposes. _ = res // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. // res.SSHPublicKeyGenerateKeyPairResult = armcompute.SSHPublicKeyGenerateKeyPairResult{ // ID: to.Ptr("/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/SshPublicKeys/mySshPublicKeyName"), // PrivateKey: to.Ptr("{ed25519 private key}"), // PublicKey: to.Ptr("{ed25519 public key}"), // }
Output:
func (*SSHPublicKeysClient) Get ¶
func (client *SSHPublicKeysClient) Get(ctx context.Context, resourceGroupName string, sshPublicKeyName string, options *SSHPublicKeysClientGetOptions) (SSHPublicKeysClientGetResponse, error)
Get - Retrieves information about an SSH public key. If the operation fails it returns an *azcore.ResponseError type.
Generated from API version 2024-03-01
- resourceGroupName - The name of the resource group.
- sshPublicKeyName - The name of the SSH public key.
- options - SSHPublicKeysClientGetOptions contains the optional parameters for the SSHPublicKeysClient.Get method.
Example ¶
Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/92de53a5f1e0e03c94b40475d2135d97148ed014/specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-03-01/examples/sshPublicKeyExamples/SshPublicKey_Get.json
cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() clientFactory, err := armcompute.NewClientFactory("<subscription-id>", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } res, err := clientFactory.NewSSHPublicKeysClient().Get(ctx, "myResourceGroup", "mySshPublicKeyName", nil) if err != nil { log.Fatalf("failed to finish the request: %v", err) } // You could use response here. We use blank identifier for just demo purposes. _ = res // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. // res.SSHPublicKeyResource = armcompute.SSHPublicKeyResource{ // Name: to.Ptr("mySshPublicKeyName"), // ID: to.Ptr("/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/SshPublicKeys/mySshPublicKeyName"), // Location: to.Ptr("westus"), // Tags: map[string]*string{ // "{tagName}": to.Ptr("{tagValue}"), // }, // Properties: &armcompute.SSHPublicKeyResourceProperties{ // PublicKey: to.Ptr("{ssh-rsa public key}"), // }, // }
Output:
func (*SSHPublicKeysClient) NewListByResourceGroupPager ¶
func (client *SSHPublicKeysClient) NewListByResourceGroupPager(resourceGroupName string, options *SSHPublicKeysClientListByResourceGroupOptions) *runtime.Pager[SSHPublicKeysClientListByResourceGroupResponse]
NewListByResourceGroupPager - Lists all of the SSH public keys in the specified resource group. Use the nextLink property in the response to get the next page of SSH public keys.
Generated from API version 2024-03-01
- resourceGroupName - The name of the resource group.
- options - SSHPublicKeysClientListByResourceGroupOptions contains the optional parameters for the SSHPublicKeysClient.NewListByResourceGroupPager method.
Example (SshPublicKeyListByResourceGroupMaximumSetGen) ¶
Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/92de53a5f1e0e03c94b40475d2135d97148ed014/specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-03-01/examples/sshPublicKeyExamples/SshPublicKey_ListByResourceGroup_MaximumSet_Gen.json
cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() clientFactory, err := armcompute.NewClientFactory("<subscription-id>", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } pager := clientFactory.NewSSHPublicKeysClient().NewListByResourceGroupPager("rgcompute", nil) for pager.More() { page, err := pager.NextPage(ctx) if err != nil { log.Fatalf("failed to advance page: %v", err) } for _, v := range page.Value { // You could use page here. We use blank identifier for just demo purposes. _ = v } // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. // page.SSHPublicKeysGroupListResult = armcompute.SSHPublicKeysGroupListResult{ // Value: []*armcompute.SSHPublicKeyResource{ // { // Name: to.Ptr("mySshPublicKeyName"), // Type: to.Ptr("aaaa"), // ID: to.Ptr("/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/sshPublicKeys/mySshPublicKeyName"), // Location: to.Ptr("westus"), // Tags: map[string]*string{ // "key6396": to.Ptr("aaaaaaaaaaaaa"), // "key8839": to.Ptr("aaa"), // }, // Properties: &armcompute.SSHPublicKeyResourceProperties{ // PublicKey: to.Ptr("{ssh-rsa public key}"), // }, // }}, // } }
Output:
Example (SshPublicKeyListByResourceGroupMinimumSetGen) ¶
Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/92de53a5f1e0e03c94b40475d2135d97148ed014/specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-03-01/examples/sshPublicKeyExamples/SshPublicKey_ListByResourceGroup_MinimumSet_Gen.json
cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() clientFactory, err := armcompute.NewClientFactory("<subscription-id>", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } pager := clientFactory.NewSSHPublicKeysClient().NewListByResourceGroupPager("rgcompute", nil) for pager.More() { page, err := pager.NextPage(ctx) if err != nil { log.Fatalf("failed to advance page: %v", err) } for _, v := range page.Value { // You could use page here. We use blank identifier for just demo purposes. _ = v } // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. // page.SSHPublicKeysGroupListResult = armcompute.SSHPublicKeysGroupListResult{ // Value: []*armcompute.SSHPublicKeyResource{ // { // ID: to.Ptr("/subscriptions/{subscription-id}/resourceGroups/rgcompute/providers/Microsoft.Compute/sshPublicKeys/mySshPublicKeyName"), // Location: to.Ptr("westus"), // }}, // } }
Output:
func (*SSHPublicKeysClient) NewListBySubscriptionPager ¶
func (client *SSHPublicKeysClient) NewListBySubscriptionPager(options *SSHPublicKeysClientListBySubscriptionOptions) *runtime.Pager[SSHPublicKeysClientListBySubscriptionResponse]
NewListBySubscriptionPager - Lists all of the SSH public keys in the subscription. Use the nextLink property in the response to get the next page of SSH public keys.
Generated from API version 2024-03-01
- options - SSHPublicKeysClientListBySubscriptionOptions contains the optional parameters for the SSHPublicKeysClient.NewListBySubscriptionPager method.
Example (SshPublicKeyListBySubscriptionMaximumSetGen) ¶
Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/92de53a5f1e0e03c94b40475d2135d97148ed014/specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-03-01/examples/sshPublicKeyExamples/SshPublicKey_ListBySubscription_MaximumSet_Gen.json
cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() clientFactory, err := armcompute.NewClientFactory("<subscription-id>", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } pager := clientFactory.NewSSHPublicKeysClient().NewListBySubscriptionPager(nil) for pager.More() { page, err := pager.NextPage(ctx) if err != nil { log.Fatalf("failed to advance page: %v", err) } for _, v := range page.Value { // You could use page here. We use blank identifier for just demo purposes. _ = v } // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. // page.SSHPublicKeysGroupListResult = armcompute.SSHPublicKeysGroupListResult{ // Value: []*armcompute.SSHPublicKeyResource{ // { // Name: to.Ptr("mySshPublicKeyName"), // Type: to.Ptr("aaaa"), // ID: to.Ptr("/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/sshPublicKeys/mySshPublicKeyName"), // Location: to.Ptr("westus"), // Tags: map[string]*string{ // "key6396": to.Ptr("aaaaaaaaaaaaa"), // "key8839": to.Ptr("aaa"), // }, // Properties: &armcompute.SSHPublicKeyResourceProperties{ // PublicKey: to.Ptr("{ssh-rsa public key}"), // }, // }}, // } }
Output:
Example (SshPublicKeyListBySubscriptionMinimumSetGen) ¶
Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/92de53a5f1e0e03c94b40475d2135d97148ed014/specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-03-01/examples/sshPublicKeyExamples/SshPublicKey_ListBySubscription_MinimumSet_Gen.json
cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() clientFactory, err := armcompute.NewClientFactory("<subscription-id>", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } pager := clientFactory.NewSSHPublicKeysClient().NewListBySubscriptionPager(nil) for pager.More() { page, err := pager.NextPage(ctx) if err != nil { log.Fatalf("failed to advance page: %v", err) } for _, v := range page.Value { // You could use page here. We use blank identifier for just demo purposes. _ = v } // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. // page.SSHPublicKeysGroupListResult = armcompute.SSHPublicKeysGroupListResult{ // Value: []*armcompute.SSHPublicKeyResource{ // { // ID: to.Ptr("/subscriptions/{subscription-id}/resourceGroups/rgcompute/providers/Microsoft.Compute/sshPublicKeys/mySshPublicKeyName"), // Location: to.Ptr("westus"), // }}, // } }
Output:
func (*SSHPublicKeysClient) Update ¶
func (client *SSHPublicKeysClient) Update(ctx context.Context, resourceGroupName string, sshPublicKeyName string, parameters SSHPublicKeyUpdateResource, options *SSHPublicKeysClientUpdateOptions) (SSHPublicKeysClientUpdateResponse, error)
Update - Updates a new SSH public key resource. If the operation fails it returns an *azcore.ResponseError type.
Generated from API version 2024-03-01
- resourceGroupName - The name of the resource group.
- sshPublicKeyName - The name of the SSH public key.
- parameters - Parameters supplied to update the SSH public key.
- options - SSHPublicKeysClientUpdateOptions contains the optional parameters for the SSHPublicKeysClient.Update method.
Example (SshPublicKeyUpdateMaximumSetGen) ¶
Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/92de53a5f1e0e03c94b40475d2135d97148ed014/specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-03-01/examples/sshPublicKeyExamples/SshPublicKey_Update_MaximumSet_Gen.json
cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() clientFactory, err := armcompute.NewClientFactory("<subscription-id>", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } res, err := clientFactory.NewSSHPublicKeysClient().Update(ctx, "rgcompute", "aaaaaaaaaaaa", armcompute.SSHPublicKeyUpdateResource{ Tags: map[string]*string{ "key2854": to.Ptr("a"), }, Properties: &armcompute.SSHPublicKeyResourceProperties{ PublicKey: to.Ptr("{ssh-rsa public key}"), }, }, nil) if err != nil { log.Fatalf("failed to finish the request: %v", err) } // You could use response here. We use blank identifier for just demo purposes. _ = res // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. // res.SSHPublicKeyResource = armcompute.SSHPublicKeyResource{ // Name: to.Ptr("mySshPublicKeyName"), // Type: to.Ptr("aaaa"), // ID: to.Ptr("/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/sshPublicKeys/mySshPublicKeyName"), // Location: to.Ptr("westus"), // Tags: map[string]*string{ // "key6396": to.Ptr("aaaaaaaaaaaaa"), // "key8839": to.Ptr("aaa"), // }, // Properties: &armcompute.SSHPublicKeyResourceProperties{ // PublicKey: to.Ptr("{ssh-rsa public key}"), // }, // }
Output:
Example (SshPublicKeyUpdateMinimumSetGen) ¶
Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/92de53a5f1e0e03c94b40475d2135d97148ed014/specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-03-01/examples/sshPublicKeyExamples/SshPublicKey_Update_MinimumSet_Gen.json
cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() clientFactory, err := armcompute.NewClientFactory("<subscription-id>", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } res, err := clientFactory.NewSSHPublicKeysClient().Update(ctx, "rgcompute", "aaaaaaaaaaa", armcompute.SSHPublicKeyUpdateResource{}, nil) if err != nil { log.Fatalf("failed to finish the request: %v", err) } // You could use response here. We use blank identifier for just demo purposes. _ = res // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. // res.SSHPublicKeyResource = armcompute.SSHPublicKeyResource{ // Location: to.Ptr("westus"), // }
Output:
type SSHPublicKeysClientCreateOptions ¶
type SSHPublicKeysClientCreateOptions struct { }
SSHPublicKeysClientCreateOptions contains the optional parameters for the SSHPublicKeysClient.Create method.
type SSHPublicKeysClientCreateResponse ¶
type SSHPublicKeysClientCreateResponse struct { // Specifies information about the SSH public key. SSHPublicKeyResource }
SSHPublicKeysClientCreateResponse contains the response from method SSHPublicKeysClient.Create.
type SSHPublicKeysClientDeleteOptions ¶
type SSHPublicKeysClientDeleteOptions struct { }
SSHPublicKeysClientDeleteOptions contains the optional parameters for the SSHPublicKeysClient.Delete method.
type SSHPublicKeysClientDeleteResponse ¶
type SSHPublicKeysClientDeleteResponse struct { }
SSHPublicKeysClientDeleteResponse contains the response from method SSHPublicKeysClient.Delete.
type SSHPublicKeysClientGenerateKeyPairOptions ¶
type SSHPublicKeysClientGenerateKeyPairOptions struct { // Parameters supplied to generate the SSH public key. Parameters *SSHGenerateKeyPairInputParameters }
SSHPublicKeysClientGenerateKeyPairOptions contains the optional parameters for the SSHPublicKeysClient.GenerateKeyPair method.
type SSHPublicKeysClientGenerateKeyPairResponse ¶
type SSHPublicKeysClientGenerateKeyPairResponse struct { // Response from generation of an SSH key pair. SSHPublicKeyGenerateKeyPairResult }
SSHPublicKeysClientGenerateKeyPairResponse contains the response from method SSHPublicKeysClient.GenerateKeyPair.
type SSHPublicKeysClientGetOptions ¶
type SSHPublicKeysClientGetOptions struct { }
SSHPublicKeysClientGetOptions contains the optional parameters for the SSHPublicKeysClient.Get method.
type SSHPublicKeysClientGetResponse ¶
type SSHPublicKeysClientGetResponse struct { // Specifies information about the SSH public key. SSHPublicKeyResource }
SSHPublicKeysClientGetResponse contains the response from method SSHPublicKeysClient.Get.
type SSHPublicKeysClientListByResourceGroupOptions ¶
type SSHPublicKeysClientListByResourceGroupOptions struct { }
SSHPublicKeysClientListByResourceGroupOptions contains the optional parameters for the SSHPublicKeysClient.NewListByResourceGroupPager method.
type SSHPublicKeysClientListByResourceGroupResponse ¶
type SSHPublicKeysClientListByResourceGroupResponse struct { // The list SSH public keys operation response. SSHPublicKeysGroupListResult }
SSHPublicKeysClientListByResourceGroupResponse contains the response from method SSHPublicKeysClient.NewListByResourceGroupPager.
type SSHPublicKeysClientListBySubscriptionOptions ¶
type SSHPublicKeysClientListBySubscriptionOptions struct { }
SSHPublicKeysClientListBySubscriptionOptions contains the optional parameters for the SSHPublicKeysClient.NewListBySubscriptionPager method.
type SSHPublicKeysClientListBySubscriptionResponse ¶
type SSHPublicKeysClientListBySubscriptionResponse struct { // The list SSH public keys operation response. SSHPublicKeysGroupListResult }
SSHPublicKeysClientListBySubscriptionResponse contains the response from method SSHPublicKeysClient.NewListBySubscriptionPager.
type SSHPublicKeysClientUpdateOptions ¶
type SSHPublicKeysClientUpdateOptions struct { }
SSHPublicKeysClientUpdateOptions contains the optional parameters for the SSHPublicKeysClient.Update method.
type SSHPublicKeysClientUpdateResponse ¶
type SSHPublicKeysClientUpdateResponse struct { // Specifies information about the SSH public key. SSHPublicKeyResource }
SSHPublicKeysClientUpdateResponse contains the response from method SSHPublicKeysClient.Update.
type SSHPublicKeysGroupListResult ¶
type SSHPublicKeysGroupListResult struct { // REQUIRED; The list of SSH public keys Value []*SSHPublicKeyResource // The URI to fetch the next page of SSH public keys. Call ListNext() with this URI to fetch the next page of SSH public keys. NextLink *string }
SSHPublicKeysGroupListResult - The list SSH public keys operation response.
func (SSHPublicKeysGroupListResult) MarshalJSON ¶
func (s SSHPublicKeysGroupListResult) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type SSHPublicKeysGroupListResult.
func (*SSHPublicKeysGroupListResult) UnmarshalJSON ¶
func (s *SSHPublicKeysGroupListResult) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type SSHPublicKeysGroupListResult.
type ScaleInPolicy ¶
type ScaleInPolicy struct { // This property allows you to specify if virtual machines chosen for removal have to be force deleted when a virtual machine // scale set is being scaled-in.(Feature in Preview) ForceDeletion *bool // The rules to be followed when scaling-in a virtual machine scale set. // Possible values are: // Default When a virtual machine scale set is scaled in, the scale set will first be balanced across zones if it is a zonal // scale set. Then, it will be balanced across Fault Domains as far as possible. // Within each Fault Domain, the virtual machines chosen for removal will be the newest ones that are not protected from scale-in. // OldestVM When a virtual machine scale set is being scaled-in, the oldest virtual machines that are not protected from scale-in // will be chosen for removal. For zonal virtual machine scale sets, the // scale set will first be balanced across zones. Within each zone, the oldest virtual machines that are not protected will // be chosen for removal. // NewestVM When a virtual machine scale set is being scaled-in, the newest virtual machines that are not protected from scale-in // will be chosen for removal. For zonal virtual machine scale sets, the // scale set will first be balanced across zones. Within each zone, the newest virtual machines that are not protected will // be chosen for removal. Rules []*VirtualMachineScaleSetScaleInRules }
ScaleInPolicy - Describes a scale-in policy for a virtual machine scale set.
func (ScaleInPolicy) MarshalJSON ¶
func (s ScaleInPolicy) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type ScaleInPolicy.
func (*ScaleInPolicy) UnmarshalJSON ¶
func (s *ScaleInPolicy) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type ScaleInPolicy.
type ScheduledEventsAdditionalPublishingTargets ¶ added in v5.7.0
type ScheduledEventsAdditionalPublishingTargets struct { // The configuration parameters used while creating eventGridAndResourceGraph Scheduled Event setting. EventGridAndResourceGraph *EventGridAndResourceGraph }
func (ScheduledEventsAdditionalPublishingTargets) MarshalJSON ¶ added in v5.7.0
func (s ScheduledEventsAdditionalPublishingTargets) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type ScheduledEventsAdditionalPublishingTargets.
func (*ScheduledEventsAdditionalPublishingTargets) UnmarshalJSON ¶ added in v5.7.0
func (s *ScheduledEventsAdditionalPublishingTargets) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type ScheduledEventsAdditionalPublishingTargets.
type ScheduledEventsPolicy ¶ added in v5.7.0
type ScheduledEventsPolicy struct { // The configuration parameters used while publishing scheduledEventsAdditionalPublishingTargets. ScheduledEventsAdditionalPublishingTargets *ScheduledEventsAdditionalPublishingTargets // The configuration parameters used while creating userInitiatedReboot scheduled event setting creation. UserInitiatedReboot *UserInitiatedReboot // The configuration parameters used while creating userInitiatedRedeploy scheduled event setting creation. UserInitiatedRedeploy *UserInitiatedRedeploy }
ScheduledEventsPolicy - Specifies Redeploy, Reboot and ScheduledEventsAdditionalPublishingTargets Scheduled Event related configurations.
func (ScheduledEventsPolicy) MarshalJSON ¶ added in v5.7.0
func (s ScheduledEventsPolicy) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type ScheduledEventsPolicy.
func (*ScheduledEventsPolicy) UnmarshalJSON ¶ added in v5.7.0
func (s *ScheduledEventsPolicy) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type ScheduledEventsPolicy.
type ScheduledEventsProfile ¶
type ScheduledEventsProfile struct { // Specifies OS Image Scheduled Event related configurations. OSImageNotificationProfile *OSImageNotificationProfile // Specifies Terminate Scheduled Event related configurations. TerminateNotificationProfile *TerminateNotificationProfile }
func (ScheduledEventsProfile) MarshalJSON ¶
func (s ScheduledEventsProfile) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type ScheduledEventsProfile.
func (*ScheduledEventsProfile) UnmarshalJSON ¶
func (s *ScheduledEventsProfile) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type ScheduledEventsProfile.
type SecurityEncryptionTypes ¶
type SecurityEncryptionTypes string
SecurityEncryptionTypes - Specifies the EncryptionType of the managed disk. It is set to DiskWithVMGuestState for encryption of the managed disk along with VMGuestState blob, VMGuestStateOnly for encryption of just the VMGuestState blob, and NonPersistedTPM for not persisting firmware state in the VMGuestState blob.. Note: It can be set for only Confidential VMs.
const ( SecurityEncryptionTypesDiskWithVMGuestState SecurityEncryptionTypes = "DiskWithVMGuestState" SecurityEncryptionTypesNonPersistedTPM SecurityEncryptionTypes = "NonPersistedTPM" SecurityEncryptionTypesVMGuestStateOnly SecurityEncryptionTypes = "VMGuestStateOnly" )
func PossibleSecurityEncryptionTypesValues ¶
func PossibleSecurityEncryptionTypesValues() []SecurityEncryptionTypes
PossibleSecurityEncryptionTypesValues returns the possible values for the SecurityEncryptionTypes const type.
type SecurityPostureReference ¶
type SecurityPostureReference struct { // List of virtual machine extensions to exclude when applying the Security Posture. ExcludeExtensions []*VirtualMachineExtension // The security posture reference id in the form of /CommunityGalleries/{communityGalleryName}/securityPostures/{securityPostureName}/versions/{major.minor.patch}|{major.*}|latest ID *string }
SecurityPostureReference - Specifies the security posture to be used for all virtual machines in the scale set. Minimum api-version: 2023-03-01
func (SecurityPostureReference) MarshalJSON ¶
func (s SecurityPostureReference) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type SecurityPostureReference.
func (*SecurityPostureReference) UnmarshalJSON ¶
func (s *SecurityPostureReference) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type SecurityPostureReference.
type SecurityProfile ¶
type SecurityProfile struct { // This property can be used by user in the request to enable or disable the Host Encryption for the virtual machine or virtual // machine scale set. This will enable the encryption for all the disks // including Resource/Temp disk at host itself. The default behavior is: The Encryption at host will be disabled unless this // property is set to true for the resource. EncryptionAtHost *bool // Specifies the Managed Identity used by ADE to get access token for keyvault operations. EncryptionIdentity *EncryptionIdentity // Specifies ProxyAgent settings while creating the virtual machine. Minimum api-version: 2024-03-01. ProxyAgentSettings *ProxyAgentSettings // Specifies the SecurityType of the virtual machine. It has to be set to any specified value to enable UefiSettings. The // default behavior is: UefiSettings will not be enabled unless this property is // set. SecurityType *SecurityTypes // Specifies the security settings like secure boot and vTPM used while creating the virtual machine. Minimum api-version: // 2020-12-01. UefiSettings *UefiSettings }
SecurityProfile - Specifies the Security profile settings for the virtual machine or virtual machine scale set.
func (SecurityProfile) MarshalJSON ¶
func (s SecurityProfile) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type SecurityProfile.
func (*SecurityProfile) UnmarshalJSON ¶
func (s *SecurityProfile) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type SecurityProfile.
type SecurityTypes ¶
type SecurityTypes string
SecurityTypes - Specifies the SecurityType of the virtual machine. It has to be set to any specified value to enable UefiSettings. The default behavior is: UefiSettings will not be enabled unless this property is set.
const ( SecurityTypesConfidentialVM SecurityTypes = "ConfidentialVM" SecurityTypesTrustedLaunch SecurityTypes = "TrustedLaunch" )
func PossibleSecurityTypesValues ¶
func PossibleSecurityTypesValues() []SecurityTypes
PossibleSecurityTypesValues returns the possible values for the SecurityTypes const type.
type SelectPermissions ¶
type SelectPermissions string
const (
SelectPermissionsPermissions SelectPermissions = "Permissions"
)
func PossibleSelectPermissionsValues ¶
func PossibleSelectPermissionsValues() []SelectPermissions
PossibleSelectPermissionsValues returns the possible values for the SelectPermissions const type.
type ServiceArtifactReference ¶
type ServiceArtifactReference struct { // The service artifact reference id in the form of // /subscriptions/{subscriptionId}/resourceGroups/{resourceGroup}/providers/Microsoft.Compute/galleries/{galleryName}/serviceArtifacts/{serviceArtifactName}/vmArtifactsProfiles/{vmArtifactsProfilesName} ID *string }
ServiceArtifactReference - Specifies the service artifact reference id used to set same image version for all virtual machines in the scale set when using 'latest' image version. Minimum api-version: 2022-11-01
func (ServiceArtifactReference) MarshalJSON ¶
func (s ServiceArtifactReference) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type ServiceArtifactReference.
func (*ServiceArtifactReference) UnmarshalJSON ¶
func (s *ServiceArtifactReference) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type ServiceArtifactReference.
type SettingNames ¶
type SettingNames string
SettingNames - Specifies the name of the setting to which the content applies. Possible values are: FirstLogonCommands and AutoLogon.
const ( SettingNamesAutoLogon SettingNames = "AutoLogon" SettingNamesFirstLogonCommands SettingNames = "FirstLogonCommands" )
func PossibleSettingNamesValues ¶
func PossibleSettingNamesValues() []SettingNames
PossibleSettingNamesValues returns the possible values for the SettingNames const type.
type ShareInfoElement ¶
type ShareInfoElement struct { string }VMURI *
func (ShareInfoElement) MarshalJSON ¶
func (s ShareInfoElement) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type ShareInfoElement.
func (*ShareInfoElement) UnmarshalJSON ¶
func (s *ShareInfoElement) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type ShareInfoElement.
type SharedGalleriesClient ¶
type SharedGalleriesClient struct {
// contains filtered or unexported fields
}
SharedGalleriesClient contains the methods for the SharedGalleries group. Don't use this type directly, use NewSharedGalleriesClient() instead.
func NewSharedGalleriesClient ¶
func NewSharedGalleriesClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*SharedGalleriesClient, error)
NewSharedGalleriesClient creates a new instance of SharedGalleriesClient 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 (*SharedGalleriesClient) Get ¶
func (client *SharedGalleriesClient) Get(ctx context.Context, location string, galleryUniqueName string, options *SharedGalleriesClientGetOptions) (SharedGalleriesClientGetResponse, error)
Get - Get a shared gallery by subscription id or tenant id. If the operation fails it returns an *azcore.ResponseError type.
Generated from API version 2023-07-03
- location - Resource location.
- galleryUniqueName - The unique name of the Shared Gallery.
- options - SharedGalleriesClientGetOptions contains the optional parameters for the SharedGalleriesClient.Get method.
func (*SharedGalleriesClient) NewListPager ¶
func (client *SharedGalleriesClient) NewListPager(location string, options *SharedGalleriesClientListOptions) *runtime.Pager[SharedGalleriesClientListResponse]
NewListPager - List shared galleries by subscription id or tenant id.
Generated from API version 2023-07-03
- location - Resource location.
- options - SharedGalleriesClientListOptions contains the optional parameters for the SharedGalleriesClient.NewListPager method.
type SharedGalleriesClientGetOptions ¶
type SharedGalleriesClientGetOptions struct { }
SharedGalleriesClientGetOptions contains the optional parameters for the SharedGalleriesClient.Get method.
type SharedGalleriesClientGetResponse ¶
type SharedGalleriesClientGetResponse struct { SharedGallery }
SharedGalleriesClientGetResponse contains the response from method SharedGalleriesClient.Get.
type SharedGalleriesClientListOptions ¶
type SharedGalleriesClientListOptions struct { SharedToValues }SharedTo *
SharedGalleriesClientListOptions contains the optional parameters for the SharedGalleriesClient.NewListPager method.
type SharedGalleriesClientListResponse ¶
type SharedGalleriesClientListResponse struct { SharedGalleryList }
SharedGalleriesClientListResponse contains the response from method SharedGalleriesClient.NewListPager.
type SharedGallery ¶
type SharedGallery struct { SharedGalleryIdentifier Properties *SharedGalleryProperties Location *string Name *string }Identifier *
SharedGallery - Specifies information about the Shared Gallery that you want to create or update.
func (SharedGallery) MarshalJSON ¶
func (s SharedGallery) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type SharedGallery.
func (*SharedGallery) UnmarshalJSON ¶
func (s *SharedGallery) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type SharedGallery.
type SharedGalleryDataDiskImage ¶
type SharedGalleryDataDiskImage struct { // the Virtual Machine and therefore must be unique for each data disk attached to the // Virtual Machine. Lun *int32 HostCaching *SharedGalleryHostCaching DiskSizeGB *int32 }
SharedGalleryDataDiskImage - This is the data disk image.
func (SharedGalleryDataDiskImage) MarshalJSON ¶
func (s SharedGalleryDataDiskImage) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type SharedGalleryDataDiskImage.
func (*SharedGalleryDataDiskImage) UnmarshalJSON ¶
func (s *SharedGalleryDataDiskImage) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type SharedGalleryDataDiskImage.
type SharedGalleryDiskImage ¶
type SharedGalleryDiskImage struct { SharedGalleryHostCaching DiskSizeGB *int32 }HostCaching *
SharedGalleryDiskImage - This is the disk image base class.
func (SharedGalleryDiskImage) MarshalJSON ¶
func (s SharedGalleryDiskImage) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type SharedGalleryDiskImage.
func (*SharedGalleryDiskImage) UnmarshalJSON ¶
func (s *SharedGalleryDiskImage) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type SharedGalleryDiskImage.
type SharedGalleryHostCaching ¶
type SharedGalleryHostCaching string
SharedGalleryHostCaching - The host caching of the disk. Valid values are 'None', 'ReadOnly', and 'ReadWrite'
const ()
func PossibleSharedGalleryHostCachingValues ¶
func PossibleSharedGalleryHostCachingValues() []SharedGalleryHostCaching
PossibleSharedGalleryHostCachingValues returns the possible values for the SharedGalleryHostCaching const type.
type SharedGalleryIdentifier ¶
type SharedGalleryIdentifier struct { string }UniqueID *
SharedGalleryIdentifier - The identifier information of shared gallery.
func (SharedGalleryIdentifier) MarshalJSON ¶
func (s SharedGalleryIdentifier) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type SharedGalleryIdentifier.
func (*SharedGalleryIdentifier) UnmarshalJSON ¶
func (s *SharedGalleryIdentifier) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type SharedGalleryIdentifier.
type SharedGalleryImage ¶
type SharedGalleryImage struct { SharedGalleryIdentifier Properties *SharedGalleryImageProperties Location *string Name *string }Identifier *
SharedGalleryImage - Specifies information about the gallery image definition that you want to create or update.
func (SharedGalleryImage) MarshalJSON ¶
func (s SharedGalleryImage) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type SharedGalleryImage.
func (*SharedGalleryImage) UnmarshalJSON ¶
func (s *SharedGalleryImage) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type SharedGalleryImage.
type SharedGalleryImageList ¶
type SharedGalleryImageList struct { SharedGalleryImage // images. NextLink *string }Value []*
SharedGalleryImageList - The List Shared Gallery Images operation response.
func (SharedGalleryImageList) MarshalJSON ¶
func (s SharedGalleryImageList) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type SharedGalleryImageList.
func (*SharedGalleryImageList) UnmarshalJSON ¶
func (s *SharedGalleryImageList) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type SharedGalleryImageList.
type SharedGalleryImageProperties ¶
type SharedGalleryImageProperties struct { GalleryImageIdentifier // or 'Specialized'. OSState *OperatingSystemStateTypes // managed image. Possible values are: Windows, Linux. OSType *OperatingSystemTypes Architecture *Architecture ArtifactTags map[string]*string Disallowed *Disallowed // is updatable. EndOfLifeDate *time.Time Eula *string Features []*GalleryImageFeature HyperVGeneration *HyperVGeneration PrivacyStatementURI *string PurchasePlan *ImagePurchasePlan Recommended *RecommendedMachineConfiguration }Identifier *
SharedGalleryImageProperties - Describes the properties of a gallery image definition.
func (SharedGalleryImageProperties) MarshalJSON ¶
func (s SharedGalleryImageProperties) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type SharedGalleryImageProperties.
func (*SharedGalleryImageProperties) UnmarshalJSON ¶
func (s *SharedGalleryImageProperties) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type SharedGalleryImageProperties.
type SharedGalleryImageVersion ¶
type SharedGalleryImageVersion struct { SharedGalleryIdentifier Properties *SharedGalleryImageVersionProperties Location *string Name *string }Identifier *
SharedGalleryImageVersion - Specifies information about the gallery image version that you want to create or update.
func (SharedGalleryImageVersion) MarshalJSON ¶
func (s SharedGalleryImageVersion) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type SharedGalleryImageVersion.
func (*SharedGalleryImageVersion) UnmarshalJSON ¶
func (s *SharedGalleryImageVersion) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type SharedGalleryImageVersion.
type SharedGalleryImageVersionList ¶
type SharedGalleryImageVersionList struct { SharedGalleryImageVersion // gallery image versions. NextLink *string }Value []*
SharedGalleryImageVersionList - The List Shared Gallery Image versions operation response.
func (SharedGalleryImageVersionList) MarshalJSON ¶
func (s SharedGalleryImageVersionList) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type SharedGalleryImageVersionList.
func (*SharedGalleryImageVersionList) UnmarshalJSON ¶
func (s *SharedGalleryImageVersionList) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type SharedGalleryImageVersionList.
type SharedGalleryImageVersionProperties ¶
type SharedGalleryImageVersionProperties struct { string]*string // property is updatable. EndOfLifeDate *time.Time ExcludeFromLatest *bool // property is updatable. PublishedDate *time.Time StorageProfile *SharedGalleryImageVersionStorageProfile }ArtifactTags map[
SharedGalleryImageVersionProperties - Describes the properties of a gallery image version.
func (SharedGalleryImageVersionProperties) MarshalJSON ¶
func (s SharedGalleryImageVersionProperties) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type SharedGalleryImageVersionProperties.
func (*SharedGalleryImageVersionProperties) UnmarshalJSON ¶
func (s *SharedGalleryImageVersionProperties) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type SharedGalleryImageVersionProperties.
type SharedGalleryImageVersionStorageProfile ¶
type SharedGalleryImageVersionStorageProfile struct { SharedGalleryDataDiskImage OSDiskImage *SharedGalleryOSDiskImage }DataDiskImages []*
SharedGalleryImageVersionStorageProfile - This is the storage profile of a Gallery Image Version.
func (SharedGalleryImageVersionStorageProfile) MarshalJSON ¶
func (s SharedGalleryImageVersionStorageProfile) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type SharedGalleryImageVersionStorageProfile.
func (*SharedGalleryImageVersionStorageProfile) UnmarshalJSON ¶
func (s *SharedGalleryImageVersionStorageProfile) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type SharedGalleryImageVersionStorageProfile.
type SharedGalleryImageVersionsClient ¶
type SharedGalleryImageVersionsClient struct {
// contains filtered or unexported fields
}
SharedGalleryImageVersionsClient contains the methods for the SharedGalleryImageVersions group. Don't use this type directly, use NewSharedGalleryImageVersionsClient() instead.
func NewSharedGalleryImageVersionsClient ¶
func NewSharedGalleryImageVersionsClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*SharedGalleryImageVersionsClient, error)
NewSharedGalleryImageVersionsClient creates a new instance of SharedGalleryImageVersionsClient 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 (*SharedGalleryImageVersionsClient) Get ¶
func (client *SharedGalleryImageVersionsClient) Get(ctx context.Context, location string, galleryUniqueName string, galleryImageName string, galleryImageVersionName string, options *SharedGalleryImageVersionsClientGetOptions) (SharedGalleryImageVersionsClientGetResponse, error)
Get - Get a shared gallery image version by subscription id or tenant id. If the operation fails it returns an *azcore.ResponseError type.
Generated from API version 2023-07-03
- location - Resource location.
- galleryUniqueName - The unique name of the Shared Gallery.
- galleryImageName - The name of the Shared Gallery Image Definition from which the Image Versions are to be listed.
- galleryImageVersionName - The name of the gallery image version to be created. Needs to follow semantic version name pattern: The allowed characters are digit and period. Digits must be within the range of a 32-bit integer. Format: ..
- options - SharedGalleryImageVersionsClientGetOptions contains the optional parameters for the SharedGalleryImageVersionsClient.Get method.
func (*SharedGalleryImageVersionsClient) NewListPager ¶
func (client *SharedGalleryImageVersionsClient) NewListPager(location string, galleryUniqueName string, galleryImageName string, options *SharedGalleryImageVersionsClientListOptions) *runtime.Pager[SharedGalleryImageVersionsClientListResponse]
NewListPager - List shared gallery image versions by subscription id or tenant id.
Generated from API version 2023-07-03
- location - Resource location.
- galleryUniqueName - The unique name of the Shared Gallery.
- galleryImageName - The name of the Shared Gallery Image Definition from which the Image Versions are to be listed.
- options - SharedGalleryImageVersionsClientListOptions contains the optional parameters for the SharedGalleryImageVersionsClient.NewListPager method.
type SharedGalleryImageVersionsClientGetOptions ¶
type SharedGalleryImageVersionsClientGetOptions struct { }
SharedGalleryImageVersionsClientGetOptions contains the optional parameters for the SharedGalleryImageVersionsClient.Get method.
type SharedGalleryImageVersionsClientGetResponse ¶
type SharedGalleryImageVersionsClientGetResponse struct { SharedGalleryImageVersion }
SharedGalleryImageVersionsClientGetResponse contains the response from method SharedGalleryImageVersionsClient.Get.
type SharedGalleryImageVersionsClientListOptions ¶
type SharedGalleryImageVersionsClientListOptions struct { SharedToValues }SharedTo *
SharedGalleryImageVersionsClientListOptions contains the optional parameters for the SharedGalleryImageVersionsClient.NewListPager method.
type SharedGalleryImageVersionsClientListResponse ¶
type SharedGalleryImageVersionsClientListResponse struct { SharedGalleryImageVersionList }
SharedGalleryImageVersionsClientListResponse contains the response from method SharedGalleryImageVersionsClient.NewListPager.
type SharedGalleryImagesClient ¶
type SharedGalleryImagesClient struct {
// contains filtered or unexported fields
}
SharedGalleryImagesClient contains the methods for the SharedGalleryImages group. Don't use this type directly, use NewSharedGalleryImagesClient() instead.
func NewSharedGalleryImagesClient ¶
func NewSharedGalleryImagesClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*SharedGalleryImagesClient, error)
NewSharedGalleryImagesClient creates a new instance of SharedGalleryImagesClient 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 (*SharedGalleryImagesClient) Get ¶
func (client *SharedGalleryImagesClient) Get(ctx context.Context, location string, galleryUniqueName string, galleryImageName string, options *SharedGalleryImagesClientGetOptions) (SharedGalleryImagesClientGetResponse, error)
Get - Get a shared gallery image by subscription id or tenant id. If the operation fails it returns an *azcore.ResponseError type.
Generated from API version 2023-07-03
- location - Resource location.
- galleryUniqueName - The unique name of the Shared Gallery.
- galleryImageName - The name of the Shared Gallery Image Definition from which the Image Versions are to be listed.
- options - SharedGalleryImagesClientGetOptions contains the optional parameters for the SharedGalleryImagesClient.Get method.
func (*SharedGalleryImagesClient) NewListPager ¶
func (client *SharedGalleryImagesClient) NewListPager(location string, galleryUniqueName string, options *SharedGalleryImagesClientListOptions) *runtime.Pager[SharedGalleryImagesClientListResponse]
NewListPager - List shared gallery images by subscription id or tenant id.
Generated from API version 2023-07-03
- location - Resource location.
- galleryUniqueName - The unique name of the Shared Gallery.
- options - SharedGalleryImagesClientListOptions contains the optional parameters for the SharedGalleryImagesClient.NewListPager method.
type SharedGalleryImagesClientGetOptions ¶
type SharedGalleryImagesClientGetOptions struct { }
SharedGalleryImagesClientGetOptions contains the optional parameters for the SharedGalleryImagesClient.Get method.
type SharedGalleryImagesClientGetResponse ¶
type SharedGalleryImagesClientGetResponse struct { SharedGalleryImage }
SharedGalleryImagesClientGetResponse contains the response from method SharedGalleryImagesClient.Get.
type SharedGalleryImagesClientListOptions ¶
type SharedGalleryImagesClientListOptions struct { SharedToValues }SharedTo *
SharedGalleryImagesClientListOptions contains the optional parameters for the SharedGalleryImagesClient.NewListPager method.
type SharedGalleryImagesClientListResponse ¶
type SharedGalleryImagesClientListResponse struct { SharedGalleryImageList }
SharedGalleryImagesClientListResponse contains the response from method SharedGalleryImagesClient.NewListPager.
type SharedGalleryList ¶
type SharedGalleryList struct { SharedGallery NextLink *string }Value []*
SharedGalleryList - The List Shared Galleries operation response.
func (SharedGalleryList) MarshalJSON ¶
func (s SharedGalleryList) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type SharedGalleryList.
func (*SharedGalleryList) UnmarshalJSON ¶
func (s *SharedGalleryList) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type SharedGalleryList.
type SharedGalleryOSDiskImage ¶
type SharedGalleryOSDiskImage struct { SharedGalleryHostCaching DiskSizeGB *int32 }HostCaching *
SharedGalleryOSDiskImage - This is the OS disk image.
func (SharedGalleryOSDiskImage) MarshalJSON ¶
func (s SharedGalleryOSDiskImage) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type SharedGalleryOSDiskImage.
func (*SharedGalleryOSDiskImage) UnmarshalJSON ¶
func (s *SharedGalleryOSDiskImage) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type SharedGalleryOSDiskImage.
type SharedGalleryProperties ¶ added in v5.4.0
SharedGalleryProperties - Specifies the properties of a shared gallery
func (SharedGalleryProperties) MarshalJSON ¶ added in v5.4.0
func (s SharedGalleryProperties) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type SharedGalleryProperties.
func (*SharedGalleryProperties) UnmarshalJSON ¶ added in v5.4.0
func (s *SharedGalleryProperties) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type SharedGalleryProperties.
type SharedToValues ¶
type SharedToValues string
const (
)func PossibleSharedToValuesValues ¶
func PossibleSharedToValuesValues() []SharedToValues
PossibleSharedToValuesValues returns the possible values for the SharedToValues const type.
type SharingProfile ¶
type SharingProfile struct { // Information of community gallery if current gallery is shared to community. CommunityGalleryInfo *CommunityGalleryInfo // This property allows you to specify the permission of sharing gallery. Possible values are: Private, Groups, Community. Permissions *GallerySharingPermissionTypes // READ-ONLY; A list of sharing profile groups. Groups []*SharingProfileGroup }
SharingProfile - Profile for gallery sharing to subscription or tenant
func (SharingProfile) MarshalJSON ¶
func (s SharingProfile) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type SharingProfile.
func (*SharingProfile) UnmarshalJSON ¶
func (s *SharingProfile) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type SharingProfile.
type SharingProfileGroup ¶
type SharingProfileGroup struct { // A list of subscription/tenant ids the gallery is aimed to be shared to. IDs []*string // This property allows you to specify the type of sharing group. Possible values are: Subscriptions, AADTenants. Type *SharingProfileGroupTypes }
SharingProfileGroup - Group of the gallery sharing profile
func (SharingProfileGroup) MarshalJSON ¶
func (s SharingProfileGroup) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type SharingProfileGroup.
func (*SharingProfileGroup) UnmarshalJSON ¶
func (s *SharingProfileGroup) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type SharingProfileGroup.
type SharingProfileGroupTypes ¶
type SharingProfileGroupTypes string
SharingProfileGroupTypes - This property allows you to specify the type of sharing group. Possible values are: Subscriptions, AADTenants.
const ( SharingProfileGroupTypesAADTenants SharingProfileGroupTypes = "AADTenants" SharingProfileGroupTypesSubscriptions SharingProfileGroupTypes = "Subscriptions" )
func PossibleSharingProfileGroupTypesValues ¶
func PossibleSharingProfileGroupTypesValues() []SharingProfileGroupTypes
PossibleSharingProfileGroupTypesValues returns the possible values for the SharingProfileGroupTypes const type.
type SharingState ¶
type SharingState string
SharingState - The sharing state of the gallery, which only appears in the response.
const ( SharingStateFailed SharingState = "Failed" SharingStateInProgress SharingState = "InProgress" SharingStateSucceeded SharingState = "Succeeded" SharingStateUnknown SharingState = "Unknown" )
func PossibleSharingStateValues ¶
func PossibleSharingStateValues() []SharingState
PossibleSharingStateValues returns the possible values for the SharingState const type.
type SharingStatus ¶
type SharingStatus struct { // Summary of all regional sharing status. Summary []*RegionalSharingStatus // READ-ONLY; Aggregated sharing state of current gallery. AggregatedState *SharingState }
SharingStatus - Sharing status of current gallery.
func (SharingStatus) MarshalJSON ¶
func (s SharingStatus) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type SharingStatus.
func (*SharingStatus) UnmarshalJSON ¶
func (s *SharingStatus) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type SharingStatus.
type SharingUpdate ¶
type SharingUpdate struct { // REQUIRED; This property allows you to specify the operation type of gallery sharing update. Possible values are: Add, Remove, // Reset. OperationType *SharingUpdateOperationTypes // A list of sharing profile groups. Groups []*SharingProfileGroup }
SharingUpdate - Specifies information about the gallery sharing profile update.
func (SharingUpdate) MarshalJSON ¶
func (s SharingUpdate) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type SharingUpdate.
func (*SharingUpdate) UnmarshalJSON ¶
func (s *SharingUpdate) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type SharingUpdate.
type SharingUpdateOperationTypes ¶
type SharingUpdateOperationTypes string
SharingUpdateOperationTypes - This property allows you to specify the operation type of gallery sharing update. Possible values are: Add, Remove, Reset.
const ( SharingUpdateOperationTypesAdd SharingUpdateOperationTypes = "Add" SharingUpdateOperationTypesEnableCommunity SharingUpdateOperationTypes = "EnableCommunity" SharingUpdateOperationTypesRemove SharingUpdateOperationTypes = "Remove" SharingUpdateOperationTypesReset SharingUpdateOperationTypes = "Reset" )
func PossibleSharingUpdateOperationTypesValues ¶
func PossibleSharingUpdateOperationTypesValues() []SharingUpdateOperationTypes
PossibleSharingUpdateOperationTypesValues returns the possible values for the SharingUpdateOperationTypes const type.
type Snapshot ¶
type Snapshot struct { // REQUIRED; Resource location Location *string // The extended location where the snapshot will be created. Extended location cannot be changed. ExtendedLocation *ExtendedLocation // Snapshot resource properties. Properties *SnapshotProperties // The snapshots sku name. Can be StandardLRS, PremiumLRS, or Standard_ZRS. This is an optional parameter for incremental // snapshot and the default behavior is the SKU will be set to the same sku as the // previous snapshot SKU *SnapshotSKU // Resource tags Tags map[string]*string // READ-ONLY; Resource Id ID *string // READ-ONLY; Unused. Always Null. ManagedBy *string // READ-ONLY; Resource name Name *string // READ-ONLY; Resource type Type *string }
Snapshot resource.
func (Snapshot) MarshalJSON ¶
MarshalJSON implements the json.Marshaller interface for type Snapshot.
func (*Snapshot) UnmarshalJSON ¶
UnmarshalJSON implements the json.Unmarshaller interface for type Snapshot.
type SnapshotList ¶
type SnapshotList struct { // REQUIRED; A list of snapshots. Value []*Snapshot // The uri to fetch the next page of snapshots. Call ListNext() with this to fetch the next page of snapshots. NextLink *string }
SnapshotList - The List Snapshots operation response.
func (SnapshotList) MarshalJSON ¶
func (s SnapshotList) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type SnapshotList.
func (*SnapshotList) UnmarshalJSON ¶
func (s *SnapshotList) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type SnapshotList.
type SnapshotProperties ¶
type SnapshotProperties struct { // REQUIRED; Disk source information. CreationData information cannot be changed after the disk has been created. CreationData *CreationData // Percentage complete for the background copy when a resource is created via the CopyStart operation. CompletionPercent *float32 // Indicates the error details if the background copy of a resource created via the CopyStart operation fails. CopyCompletionError *CopyCompletionError // Additional authentication requirements when exporting or uploading to a disk or snapshot. DataAccessAuthMode *DataAccessAuthMode // ARM id of the DiskAccess resource for using private endpoints on disks. DiskAccessID *string // If creationData.createOption is Empty, this field is mandatory and it indicates the size of the disk to create. If this // field is present for updates or creation with other options, it indicates a // resize. Resizes are only allowed if the disk is not attached to a running VM, and can only increase the disk's size. DiskSizeGB *int32 // Encryption property can be used to encrypt data at rest with customer managed keys or platform managed keys. Encryption *Encryption // Encryption settings collection used be Azure Disk Encryption, can contain multiple encryption settings per disk or snapshot. EncryptionSettingsCollection *EncryptionSettingsCollection // The hypervisor generation of the Virtual Machine. Applicable to OS disks only. HyperVGeneration *HyperVGeneration // Whether a snapshot is incremental. Incremental snapshots on the same disk occupy less space than full snapshots and can // be diffed. Incremental *bool // Policy for accessing the disk via network. NetworkAccessPolicy *NetworkAccessPolicy // The Operating System type. OSType *OperatingSystemTypes // Policy for controlling export on the disk. PublicNetworkAccess *PublicNetworkAccess // Purchase plan information for the image from which the source disk for the snapshot was originally created. PurchasePlan *DiskPurchasePlan // Contains the security related information for the resource. SecurityProfile *DiskSecurityProfile // List of supported capabilities for the image from which the source disk from the snapshot was originally created. SupportedCapabilities *SupportedCapabilities // Indicates the OS on a snapshot supports hibernation. SupportsHibernation *bool // READ-ONLY; The size of the disk in bytes. This field is read only. DiskSizeBytes *int64 // READ-ONLY; The state of the snapshot. DiskState *DiskState // READ-ONLY; Incremental snapshots for a disk share an incremental snapshot family id. The Get Page Range Diff API can only // be called on incremental snapshots with the same family id. IncrementalSnapshotFamilyID *string // READ-ONLY; The disk provisioning state. ProvisioningState *string // READ-ONLY; The time when the snapshot was created. TimeCreated *time.Time // READ-ONLY; Unique Guid identifying the resource. UniqueID *string }
SnapshotProperties - Snapshot resource properties.
func (SnapshotProperties) MarshalJSON ¶
func (s SnapshotProperties) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type SnapshotProperties.
func (*SnapshotProperties) UnmarshalJSON ¶
func (s *SnapshotProperties) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type SnapshotProperties.
type SnapshotSKU ¶
type SnapshotSKU struct { // The sku name. Name *SnapshotStorageAccountTypes // READ-ONLY; The sku tier. Tier *string }
SnapshotSKU - The snapshots sku name. Can be StandardLRS, PremiumLRS, or Standard_ZRS. This is an optional parameter for incremental snapshot and the default behavior is the SKU will be set to the same sku as the previous snapshot
func (SnapshotSKU) MarshalJSON ¶
func (s SnapshotSKU) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type SnapshotSKU.
func (*SnapshotSKU) UnmarshalJSON ¶
func (s *SnapshotSKU) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type SnapshotSKU.
type SnapshotStorageAccountTypes ¶
type SnapshotStorageAccountTypes string
SnapshotStorageAccountTypes - The sku name.
const ( // SnapshotStorageAccountTypesPremiumLRS - Premium SSD locally redundant storage SnapshotStorageAccountTypesPremiumLRS SnapshotStorageAccountTypes = "Premium_LRS" // SnapshotStorageAccountTypesStandardLRS - Standard HDD locally redundant storage SnapshotStorageAccountTypesStandardLRS SnapshotStorageAccountTypes = "Standard_LRS" // SnapshotStorageAccountTypesStandardZRS - Standard zone redundant storage SnapshotStorageAccountTypesStandardZRS SnapshotStorageAccountTypes = "Standard_ZRS" )
func PossibleSnapshotStorageAccountTypesValues ¶
func PossibleSnapshotStorageAccountTypesValues() []SnapshotStorageAccountTypes
PossibleSnapshotStorageAccountTypesValues returns the possible values for the SnapshotStorageAccountTypes const type.
type SnapshotUpdate ¶
type SnapshotUpdate struct { // Snapshot resource update properties. Properties *SnapshotUpdateProperties // The snapshots sku name. Can be StandardLRS, PremiumLRS, or Standard_ZRS. This is an optional parameter for incremental // snapshot and the default behavior is the SKU will be set to the same sku as the // previous snapshot SKU *SnapshotSKU // Resource tags Tags map[string]*string }
SnapshotUpdate - Snapshot update resource.
func (SnapshotUpdate) MarshalJSON ¶
func (s SnapshotUpdate) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type SnapshotUpdate.
func (*SnapshotUpdate) UnmarshalJSON ¶
func (s *SnapshotUpdate) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type SnapshotUpdate.
type SnapshotUpdateProperties ¶
type SnapshotUpdateProperties struct { // Additional authentication requirements when exporting or uploading to a disk or snapshot. DataAccessAuthMode *DataAccessAuthMode // ARM id of the DiskAccess resource for using private endpoints on disks. DiskAccessID *string // If creationData.createOption is Empty, this field is mandatory and it indicates the size of the disk to create. If this // field is present for updates or creation with other options, it indicates a // resize. Resizes are only allowed if the disk is not attached to a running VM, and can only increase the disk's size. DiskSizeGB *int32 // Encryption property can be used to encrypt data at rest with customer managed keys or platform managed keys. Encryption *Encryption // Encryption settings collection used be Azure Disk Encryption, can contain multiple encryption settings per disk or snapshot. EncryptionSettingsCollection *EncryptionSettingsCollection // Policy for accessing the disk via network. NetworkAccessPolicy *NetworkAccessPolicy // the Operating System type. OSType *OperatingSystemTypes // Policy for controlling export on the disk. PublicNetworkAccess *PublicNetworkAccess // List of supported capabilities for the image from which the OS disk was created. SupportedCapabilities *SupportedCapabilities // Indicates the OS on a snapshot supports hibernation. SupportsHibernation *bool }
SnapshotUpdateProperties - Snapshot resource update properties.
func (SnapshotUpdateProperties) MarshalJSON ¶
func (s SnapshotUpdateProperties) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type SnapshotUpdateProperties.
func (*SnapshotUpdateProperties) UnmarshalJSON ¶
func (s *SnapshotUpdateProperties) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type SnapshotUpdateProperties.
type SnapshotsClient ¶
type SnapshotsClient struct {
// contains filtered or unexported fields
}
SnapshotsClient contains the methods for the Snapshots group. Don't use this type directly, use NewSnapshotsClient() instead.
func NewSnapshotsClient ¶
func NewSnapshotsClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*SnapshotsClient, error)
NewSnapshotsClient creates a new instance of SnapshotsClient 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 (*SnapshotsClient) BeginCreateOrUpdate ¶
func (client *SnapshotsClient) BeginCreateOrUpdate(ctx context.Context, resourceGroupName string, snapshotName string, snapshot Snapshot, options *SnapshotsClientBeginCreateOrUpdateOptions) (*runtime.Poller[SnapshotsClientCreateOrUpdateResponse], error)
BeginCreateOrUpdate - Creates or updates a snapshot. If the operation fails it returns an *azcore.ResponseError type.
Generated from API version 2023-10-02
- resourceGroupName - The name of the resource group.
- snapshotName - The name of the snapshot that is being created. The name can't be changed after the snapshot is created. Supported characters for the name are a-z, A-Z, 0-9, _ and -. The max name length is 80 characters.
- snapshot - Snapshot object supplied in the body of the Put disk operation.
- options - SnapshotsClientBeginCreateOrUpdateOptions contains the optional parameters for the SnapshotsClient.BeginCreateOrUpdate method.
Example (CreateASnapshotByImportingAnUnmanagedBlobFromADifferentSubscription) ¶
Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/92de53a5f1e0e03c94b40475d2135d97148ed014/specification/compute/resource-manager/Microsoft.Compute/DiskRP/stable/2023-10-02/examples/snapshotExamples/Snapshot_Create_ByImportingAnUnmanagedBlobFromADifferentSubscription.json
cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() clientFactory, err := armcompute.NewClientFactory("<subscription-id>", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } poller, err := clientFactory.NewSnapshotsClient().BeginCreateOrUpdate(ctx, "myResourceGroup", "mySnapshot1", armcompute.Snapshot{ Location: to.Ptr("West US"), Properties: &armcompute.SnapshotProperties{ CreationData: &armcompute.CreationData{ CreateOption: to.Ptr(armcompute.DiskCreateOptionImport), SourceURI: to.Ptr("https://mystorageaccount.blob.core.windows.net/osimages/osimage.vhd"), StorageAccountID: to.Ptr("subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Storage/storageAccounts/myStorageAccount"), }, }, }, nil) if err != nil { log.Fatalf("failed to finish the request: %v", err) } res, err := poller.PollUntilDone(ctx, nil) if err != nil { log.Fatalf("failed to pull the result: %v", err) } // You could use response here. We use blank identifier for just demo purposes. _ = res // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. // res.Snapshot = armcompute.Snapshot{ // Name: to.Ptr("mySnapshot1"), // ID: to.Ptr("/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/snapshots/mySnapshot"), // Location: to.Ptr("West US"), // Properties: &armcompute.SnapshotProperties{ // CreationData: &armcompute.CreationData{ // CreateOption: to.Ptr(armcompute.DiskCreateOptionImport), // SourceURI: to.Ptr("https://mystorageaccount.blob.core.windows.net/osimages/osimage.vhd"), // StorageAccountID: to.Ptr("subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Storage/storageAccounts/myStorageAccount"), // }, // ProvisioningState: to.Ptr("Succeeded"), // }, // }
Output:
Example (CreateASnapshotByImportingAnUnmanagedBlobFromTheSameSubscription) ¶
Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/92de53a5f1e0e03c94b40475d2135d97148ed014/specification/compute/resource-manager/Microsoft.Compute/DiskRP/stable/2023-10-02/examples/snapshotExamples/Snapshot_Create_ByImportingAnUnmanagedBlobFromTheSameSubscription.json
cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() clientFactory, err := armcompute.NewClientFactory("<subscription-id>", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } poller, err := clientFactory.NewSnapshotsClient().BeginCreateOrUpdate(ctx, "myResourceGroup", "mySnapshot1", armcompute.Snapshot{ Location: to.Ptr("West US"), Properties: &armcompute.SnapshotProperties{ CreationData: &armcompute.CreationData{ CreateOption: to.Ptr(armcompute.DiskCreateOptionImport), SourceURI: to.Ptr("https://mystorageaccount.blob.core.windows.net/osimages/osimage.vhd"), }, }, }, nil) if err != nil { log.Fatalf("failed to finish the request: %v", err) } res, err := poller.PollUntilDone(ctx, nil) if err != nil { log.Fatalf("failed to pull the result: %v", err) } // You could use response here. We use blank identifier for just demo purposes. _ = res // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. // res.Snapshot = armcompute.Snapshot{ // Name: to.Ptr("mySnapshot1"), // ID: to.Ptr("/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/snapshots/mySnapshot"), // Location: to.Ptr("West US"), // Properties: &armcompute.SnapshotProperties{ // CreationData: &armcompute.CreationData{ // CreateOption: to.Ptr(armcompute.DiskCreateOptionImport), // SourceURI: to.Ptr("https://mystorageaccount.blob.core.windows.net/osimages/osimage.vhd"), // }, // ProvisioningState: to.Ptr("Succeeded"), // }, // }
Output:
Example (CreateASnapshotFromAnElasticSanVolumeSnapshot) ¶
Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/92de53a5f1e0e03c94b40475d2135d97148ed014/specification/compute/resource-manager/Microsoft.Compute/DiskRP/stable/2023-10-02/examples/snapshotExamples/Snapshot_Create_FromAnElasticSanVolumeSnapshot.json
cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() clientFactory, err := armcompute.NewClientFactory("<subscription-id>", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } poller, err := clientFactory.NewSnapshotsClient().BeginCreateOrUpdate(ctx, "myResourceGroup", "mySnapshot", armcompute.Snapshot{ Location: to.Ptr("West US"), Properties: &armcompute.SnapshotProperties{ CreationData: &armcompute.CreationData{ CreateOption: to.Ptr(armcompute.DiskCreateOptionCopyFromSanSnapshot), ElasticSanResourceID: to.Ptr("subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.ElasticSan/elasticSans/myElasticSan/volumegroups/myElasticSanVolumeGroup/snapshots/myElasticSanVolumeSnapshot"), }, }, }, nil) if err != nil { log.Fatalf("failed to finish the request: %v", err) } res, err := poller.PollUntilDone(ctx, nil) if err != nil { log.Fatalf("failed to pull the result: %v", err) } // You could use response here. We use blank identifier for just demo purposes. _ = res // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. // res.Snapshot = armcompute.Snapshot{ // Name: to.Ptr("mySnapshot"), // ID: to.Ptr("/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/snapshots/mySnapshot"), // Location: to.Ptr("West US"), // Properties: &armcompute.SnapshotProperties{ // CreationData: &armcompute.CreationData{ // CreateOption: to.Ptr(armcompute.DiskCreateOptionCopyFromSanSnapshot), // ElasticSanResourceID: to.Ptr("subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.ElasticSan/elasticSans/myElasticSan/volumegroups/myElasticSanVolumeGroup/snapshots/myElasticSanVolumeSnapshot"), // }, // ProvisioningState: to.Ptr("Succeeded"), // }, // }
Output:
Example (CreateASnapshotFromAnExistingSnapshotInTheSameOrADifferentSubscription) ¶
Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/92de53a5f1e0e03c94b40475d2135d97148ed014/specification/compute/resource-manager/Microsoft.Compute/DiskRP/stable/2023-10-02/examples/snapshotExamples/Snapshot_Create_FromAnExistingSnapshot.json
cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() clientFactory, err := armcompute.NewClientFactory("<subscription-id>", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } poller, err := clientFactory.NewSnapshotsClient().BeginCreateOrUpdate(ctx, "myResourceGroup", "mySnapshot2", armcompute.Snapshot{ Location: to.Ptr("West US"), Properties: &armcompute.SnapshotProperties{ CreationData: &armcompute.CreationData{ CreateOption: to.Ptr(armcompute.DiskCreateOptionCopy), SourceResourceID: to.Ptr("subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/snapshots/mySnapshot1"), }, }, }, nil) if err != nil { log.Fatalf("failed to finish the request: %v", err) } res, err := poller.PollUntilDone(ctx, nil) if err != nil { log.Fatalf("failed to pull the result: %v", err) } // You could use response here. We use blank identifier for just demo purposes. _ = res // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. // res.Snapshot = armcompute.Snapshot{ // Name: to.Ptr("mySnapshot2"), // ID: to.Ptr("/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/snapshots/mySnapshot2"), // Location: to.Ptr("West US"), // Properties: &armcompute.SnapshotProperties{ // CreationData: &armcompute.CreationData{ // CreateOption: to.Ptr(armcompute.DiskCreateOptionCopy), // SourceResourceID: to.Ptr("subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/snapshots/mySnapshot1"), // }, // ProvisioningState: to.Ptr("Succeeded"), // }, // }
Output:
Example (CreateASnapshotFromAnExistingSnapshotInTheSameOrADifferentSubscriptionInADifferentRegion) ¶
Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/92de53a5f1e0e03c94b40475d2135d97148ed014/specification/compute/resource-manager/Microsoft.Compute/DiskRP/stable/2023-10-02/examples/snapshotExamples/Snapshot_Create_FromAnExistingSnapshotInDifferentRegion.json
cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() clientFactory, err := armcompute.NewClientFactory("<subscription-id>", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } poller, err := clientFactory.NewSnapshotsClient().BeginCreateOrUpdate(ctx, "myResourceGroup", "mySnapshot2", armcompute.Snapshot{ Location: to.Ptr("West US"), Properties: &armcompute.SnapshotProperties{ CreationData: &armcompute.CreationData{ CreateOption: to.Ptr(armcompute.DiskCreateOptionCopyStart), SourceResourceID: to.Ptr("subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/snapshots/mySnapshot1"), }, }, }, nil) if err != nil { log.Fatalf("failed to finish the request: %v", err) } res, err := poller.PollUntilDone(ctx, nil) if err != nil { log.Fatalf("failed to pull the result: %v", err) } // You could use response here. We use blank identifier for just demo purposes. _ = res // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. // res.Snapshot = armcompute.Snapshot{ // Name: to.Ptr("mySnapshot2"), // ID: to.Ptr("/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/snapshots/mySnapshot2"), // Location: to.Ptr("West US"), // Properties: &armcompute.SnapshotProperties{ // CreationData: &armcompute.CreationData{ // CreateOption: to.Ptr(armcompute.DiskCreateOptionCopyStart), // SourceResourceID: to.Ptr("subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/snapshots/mySnapshot1"), // }, // ProvisioningState: to.Ptr("Succeeded"), // }, // }
Output:
Example (CreateASnapshotFromAnExistingSnapshotInTheSameOrADifferentSubscriptionInADifferentRegionWithQuickerCopySpeed) ¶
Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/92de53a5f1e0e03c94b40475d2135d97148ed014/specification/compute/resource-manager/Microsoft.Compute/DiskRP/stable/2023-10-02/examples/snapshotExamples/Snapshot_Create_EnhancedProvisionedBandwidthCopySpeed.json
cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() clientFactory, err := armcompute.NewClientFactory("<subscription-id>", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } poller, err := clientFactory.NewSnapshotsClient().BeginCreateOrUpdate(ctx, "myResourceGroup", "mySnapshot2", armcompute.Snapshot{ Location: to.Ptr("West US"), Properties: &armcompute.SnapshotProperties{ CreationData: &armcompute.CreationData{ CreateOption: to.Ptr(armcompute.DiskCreateOptionCopyStart), ProvisionedBandwidthCopySpeed: to.Ptr(armcompute.ProvisionedBandwidthCopyOptionEnhanced), SourceResourceID: to.Ptr("subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/snapshots/mySnapshot1"), }, }, }, nil) if err != nil { log.Fatalf("failed to finish the request: %v", err) } res, err := poller.PollUntilDone(ctx, nil) if err != nil { log.Fatalf("failed to pull the result: %v", err) } // You could use response here. We use blank identifier for just demo purposes. _ = res // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. // res.Snapshot = armcompute.Snapshot{ // Name: to.Ptr("mySnapshot2"), // ID: to.Ptr("/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/snapshots/mySnapshot2"), // Location: to.Ptr("West US"), // Properties: &armcompute.SnapshotProperties{ // CreationData: &armcompute.CreationData{ // CreateOption: to.Ptr(armcompute.DiskCreateOptionCopyStart), // ProvisionedBandwidthCopySpeed: to.Ptr(armcompute.ProvisionedBandwidthCopyOptionEnhanced), // SourceResourceID: to.Ptr("subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/snapshots/mySnapshot1"), // }, // ProvisioningState: to.Ptr("Succeeded"), // }, // }
Output:
func (*SnapshotsClient) BeginDelete ¶
func (client *SnapshotsClient) BeginDelete(ctx context.Context, resourceGroupName string, snapshotName string, options *SnapshotsClientBeginDeleteOptions) (*runtime.Poller[SnapshotsClientDeleteResponse], error)
BeginDelete - Deletes a snapshot. If the operation fails it returns an *azcore.ResponseError type.
Generated from API version 2023-10-02
- resourceGroupName - The name of the resource group.
- snapshotName - The name of the snapshot that is being created. The name can't be changed after the snapshot is created. Supported characters for the name are a-z, A-Z, 0-9, _ and -. The max name length is 80 characters.
- options - SnapshotsClientBeginDeleteOptions contains the optional parameters for the SnapshotsClient.BeginDelete method.
Example ¶
Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/92de53a5f1e0e03c94b40475d2135d97148ed014/specification/compute/resource-manager/Microsoft.Compute/DiskRP/stable/2023-10-02/examples/snapshotExamples/Snapshot_Delete.json
cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() clientFactory, err := armcompute.NewClientFactory("<subscription-id>", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } poller, err := clientFactory.NewSnapshotsClient().BeginDelete(ctx, "myResourceGroup", "mySnapshot", nil) if err != nil { log.Fatalf("failed to finish the request: %v", err) } _, err = poller.PollUntilDone(ctx, nil) if err != nil { log.Fatalf("failed to pull the result: %v", err) }
Output:
func (*SnapshotsClient) BeginGrantAccess ¶
func (client *SnapshotsClient) BeginGrantAccess(ctx context.Context, resourceGroupName string, snapshotName string, grantAccessData GrantAccessData, options *SnapshotsClientBeginGrantAccessOptions) (*runtime.Poller[SnapshotsClientGrantAccessResponse], error)
BeginGrantAccess - Grants access to a snapshot. If the operation fails it returns an *azcore.ResponseError type.
Generated from API version 2023-10-02
- resourceGroupName - The name of the resource group.
- snapshotName - The name of the snapshot that is being created. The name can't be changed after the snapshot is created. Supported characters for the name are a-z, A-Z, 0-9, _ and -. The max name length is 80 characters.
- grantAccessData - Access data object supplied in the body of the get snapshot access operation.
- options - SnapshotsClientBeginGrantAccessOptions contains the optional parameters for the SnapshotsClient.BeginGrantAccess method.
Example ¶
Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/92de53a5f1e0e03c94b40475d2135d97148ed014/specification/compute/resource-manager/Microsoft.Compute/DiskRP/stable/2023-10-02/examples/snapshotExamples/Snapshot_BeginGetAccess.json
cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() clientFactory, err := armcompute.NewClientFactory("<subscription-id>", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } poller, err := clientFactory.NewSnapshotsClient().BeginGrantAccess(ctx, "myResourceGroup", "mySnapshot", armcompute.GrantAccessData{ Access: to.Ptr(armcompute.AccessLevelRead), DurationInSeconds: to.Ptr[int32](300), FileFormat: to.Ptr(armcompute.FileFormatVHDX), }, nil) if err != nil { log.Fatalf("failed to finish the request: %v", err) } res, err := poller.PollUntilDone(ctx, nil) if err != nil { log.Fatalf("failed to pull the result: %v", err) } // You could use response here. We use blank identifier for just demo purposes. _ = res // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. // res.AccessURI = armcompute.AccessURI{ // AccessSAS: to.Ptr("https://md-gpvmcxzlzxgd.partition.blob.storage.azure.net/xx3cqcx53f0v/abcd?sv=2014-02-14&sr=b&sk=key1&sig=XXX&st=2021-05-24T18:02:34Z&se=2021-05-24T18:19:14Z&sp=r"), // }
Output:
func (*SnapshotsClient) BeginRevokeAccess ¶
func (client *SnapshotsClient) BeginRevokeAccess(ctx context.Context, resourceGroupName string, snapshotName string, options *SnapshotsClientBeginRevokeAccessOptions) (*runtime.Poller[SnapshotsClientRevokeAccessResponse], error)
BeginRevokeAccess - Revokes access to a snapshot. If the operation fails it returns an *azcore.ResponseError type.
Generated from API version 2023-10-02
- resourceGroupName - The name of the resource group.
- snapshotName - The name of the snapshot that is being created. The name can't be changed after the snapshot is created. Supported characters for the name are a-z, A-Z, 0-9, _ and -. The max name length is 80 characters.
- options - SnapshotsClientBeginRevokeAccessOptions contains the optional parameters for the SnapshotsClient.BeginRevokeAccess method.
Example ¶
Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/92de53a5f1e0e03c94b40475d2135d97148ed014/specification/compute/resource-manager/Microsoft.Compute/DiskRP/stable/2023-10-02/examples/snapshotExamples/Snapshot_EndGetAccess.json
cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() clientFactory, err := armcompute.NewClientFactory("<subscription-id>", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } poller, err := clientFactory.NewSnapshotsClient().BeginRevokeAccess(ctx, "myResourceGroup", "mySnapshot", nil) if err != nil { log.Fatalf("failed to finish the request: %v", err) } _, err = poller.PollUntilDone(ctx, nil) if err != nil { log.Fatalf("failed to pull the result: %v", err) }
Output:
func (*SnapshotsClient) BeginUpdate ¶
func (client *SnapshotsClient) BeginUpdate(ctx context.Context, resourceGroupName string, snapshotName string, snapshot SnapshotUpdate, options *SnapshotsClientBeginUpdateOptions) (*runtime.Poller[SnapshotsClientUpdateResponse], error)
BeginUpdate - Updates (patches) a snapshot. If the operation fails it returns an *azcore.ResponseError type.
Generated from API version 2023-10-02
- resourceGroupName - The name of the resource group.
- snapshotName - The name of the snapshot that is being created. The name can't be changed after the snapshot is created. Supported characters for the name are a-z, A-Z, 0-9, _ and -. The max name length is 80 characters.
- snapshot - Snapshot object supplied in the body of the Patch snapshot operation.
- options - SnapshotsClientBeginUpdateOptions contains the optional parameters for the SnapshotsClient.BeginUpdate method.
Example (UpdateASnapshot) ¶
Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/92de53a5f1e0e03c94b40475d2135d97148ed014/specification/compute/resource-manager/Microsoft.Compute/DiskRP/stable/2023-10-02/examples/snapshotExamples/Snapshot_Update.json
cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() clientFactory, err := armcompute.NewClientFactory("<subscription-id>", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } poller, err := clientFactory.NewSnapshotsClient().BeginUpdate(ctx, "myResourceGroup", "mySnapshot", armcompute.SnapshotUpdate{ Properties: &armcompute.SnapshotUpdateProperties{ DiskSizeGB: to.Ptr[int32](20), }, Tags: map[string]*string{ "department": to.Ptr("Development"), "project": to.Ptr("UpdateSnapshots"), }, }, nil) if err != nil { log.Fatalf("failed to finish the request: %v", err) } res, err := poller.PollUntilDone(ctx, nil) if err != nil { log.Fatalf("failed to pull the result: %v", err) } // You could use response here. We use blank identifier for just demo purposes. _ = res // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. // res.Snapshot = armcompute.Snapshot{ // Name: to.Ptr("mySnapshot"), // Location: to.Ptr("West US"), // Tags: map[string]*string{ // "department": to.Ptr("Development"), // "project": to.Ptr("UpdateSnapshots"), // }, // Properties: &armcompute.SnapshotProperties{ // CreationData: &armcompute.CreationData{ // CreateOption: to.Ptr(armcompute.DiskCreateOptionCopy), // SourceResourceID: to.Ptr("subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/snapshots/mySnapshot1"), // }, // DiskSizeGB: to.Ptr[int32](20), // ProvisioningState: to.Ptr("Succeeded"), // }, // }
Output:
Example (UpdateASnapshotWithAcceleratedNetworking) ¶
Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/92de53a5f1e0e03c94b40475d2135d97148ed014/specification/compute/resource-manager/Microsoft.Compute/DiskRP/stable/2023-10-02/examples/snapshotExamples/Snapshot_Update_WithAcceleratedNetwork.json
cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() clientFactory, err := armcompute.NewClientFactory("<subscription-id>", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } poller, err := clientFactory.NewSnapshotsClient().BeginUpdate(ctx, "myResourceGroup", "mySnapshot", armcompute.SnapshotUpdate{ Properties: &armcompute.SnapshotUpdateProperties{ DiskSizeGB: to.Ptr[int32](20), SupportedCapabilities: &armcompute.SupportedCapabilities{ AcceleratedNetwork: to.Ptr(false), }, }, Tags: map[string]*string{ "department": to.Ptr("Development"), "project": to.Ptr("UpdateSnapshots"), }, }, nil) if err != nil { log.Fatalf("failed to finish the request: %v", err) } res, err := poller.PollUntilDone(ctx, nil) if err != nil { log.Fatalf("failed to pull the result: %v", err) } // You could use response here. We use blank identifier for just demo purposes. _ = res // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. // res.Snapshot = armcompute.Snapshot{ // Name: to.Ptr("mySnapshot"), // Location: to.Ptr("West US"), // Tags: map[string]*string{ // "department": to.Ptr("Development"), // "project": to.Ptr("UpdateSnapshots"), // }, // Properties: &armcompute.SnapshotProperties{ // CreationData: &armcompute.CreationData{ // CreateOption: to.Ptr(armcompute.DiskCreateOptionCopy), // SourceResourceID: to.Ptr("subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/snapshots/mySnapshot1"), // }, // DiskSizeGB: to.Ptr[int32](20), // ProvisioningState: to.Ptr("Succeeded"), // SupportedCapabilities: &armcompute.SupportedCapabilities{ // AcceleratedNetwork: to.Ptr(false), // }, // }, // }
Output:
func (*SnapshotsClient) Get ¶
func (client *SnapshotsClient) Get(ctx context.Context, resourceGroupName string, snapshotName string, options *SnapshotsClientGetOptions) (SnapshotsClientGetResponse, error)
Get - Gets information about a snapshot. If the operation fails it returns an *azcore.ResponseError type.
Generated from API version 2023-10-02
- resourceGroupName - The name of the resource group.
- snapshotName - The name of the snapshot that is being created. The name can't be changed after the snapshot is created. Supported characters for the name are a-z, A-Z, 0-9, _ and -. The max name length is 80 characters.
- options - SnapshotsClientGetOptions contains the optional parameters for the SnapshotsClient.Get method.
Example (GetInformationAboutASnapshot) ¶
Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/92de53a5f1e0e03c94b40475d2135d97148ed014/specification/compute/resource-manager/Microsoft.Compute/DiskRP/stable/2023-10-02/examples/snapshotExamples/Snapshot_Get.json
cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() clientFactory, err := armcompute.NewClientFactory("<subscription-id>", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } res, err := clientFactory.NewSnapshotsClient().Get(ctx, "myResourceGroup", "mySnapshot", nil) if err != nil { log.Fatalf("failed to finish the request: %v", err) } // You could use response here. We use blank identifier for just demo purposes. _ = res // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. // res.Snapshot = armcompute.Snapshot{ // Name: to.Ptr("mySnapshot"), // Type: to.Ptr("Microsoft.Compute/snapshots"), // ID: to.Ptr("/subscriptions/{subscriptionId}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/snapshots/mySnapshot"), // Location: to.Ptr("westus"), // Tags: map[string]*string{ // "department": to.Ptr("Development"), // "project": to.Ptr("Snapshots"), // }, // Properties: &armcompute.SnapshotProperties{ // CreationData: &armcompute.CreationData{ // CreateOption: to.Ptr(armcompute.DiskCreateOptionCopy), // SourceResourceID: to.Ptr("/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/disks/myDisk"), // SourceUniqueID: to.Ptr("d633885d-d102-4481-901e-5b2413d1a7be"), // }, // DiskSizeGB: to.Ptr[int32](100), // Encryption: &armcompute.Encryption{ // Type: to.Ptr(armcompute.EncryptionTypeEncryptionAtRestWithPlatformKey), // }, // EncryptionSettingsCollection: &armcompute.EncryptionSettingsCollection{ // Enabled: to.Ptr(true), // EncryptionSettings: []*armcompute.EncryptionSettingsElement{ // { // DiskEncryptionKey: &armcompute.KeyVaultAndSecretReference{ // SecretURL: to.Ptr("https://myvmvault.vault-int.azure-int.net/secrets/{secret}"), // SourceVault: &armcompute.SourceVault{ // ID: to.Ptr("/subscriptions/{subscriptionId}/resourceGroups/myResourceGroup/providers/Microsoft.KeyVault/vaults/myVMVault"), // }, // }, // KeyEncryptionKey: &armcompute.KeyVaultAndKeyReference{ // KeyURL: to.Ptr("https://myvmvault.vault-int.azure-int.net/keys/{key}"), // SourceVault: &armcompute.SourceVault{ // ID: to.Ptr("/subscriptions/{subscriptionId}/resourceGroups/myResourceGroup/providers/Microsoft.KeyVault/vaults/myVMVault"), // }, // }, // }}, // }, // HyperVGeneration: to.Ptr(armcompute.HyperVGenerationV1), // OSType: to.Ptr(armcompute.OperatingSystemTypesWindows), // ProvisioningState: to.Ptr("Succeeded"), // PurchasePlan: &armcompute.DiskPurchasePlan{ // Name: to.Ptr("test_sku"), // Product: to.Ptr("marketplace_vm_test"), // Publisher: to.Ptr("test_test_pmc2pc1"), // }, // SupportedCapabilities: &armcompute.SupportedCapabilities{ // AcceleratedNetwork: to.Ptr(true), // }, // SupportsHibernation: to.Ptr(true), // TimeCreated: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2016-12-28T04:41:35.079Z"); return t}()), // }, // }
Output:
Example (GetInformationAboutAnIncrementalSnapshot) ¶
Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/92de53a5f1e0e03c94b40475d2135d97148ed014/specification/compute/resource-manager/Microsoft.Compute/DiskRP/stable/2023-10-02/examples/snapshotExamples/Snapshot_GetIncrementalSnapshot.json
cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() clientFactory, err := armcompute.NewClientFactory("<subscription-id>", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } res, err := clientFactory.NewSnapshotsClient().Get(ctx, "myResourceGroup", "myIncrementalSnapshot", nil) if err != nil { log.Fatalf("failed to finish the request: %v", err) } // You could use response here. We use blank identifier for just demo purposes. _ = res // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. // res.Snapshot = armcompute.Snapshot{ // Name: to.Ptr("myIncrementalSnapshot"), // Type: to.Ptr("Microsoft.Compute/snapshots"), // ID: to.Ptr("/subscriptions/{subscriptionId}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/snapshots/myIncrementalSnapshot"), // Location: to.Ptr("westus"), // Tags: map[string]*string{ // "department": to.Ptr("Development"), // "project": to.Ptr("Snapshots"), // }, // Properties: &armcompute.SnapshotProperties{ // CreationData: &armcompute.CreationData{ // CreateOption: to.Ptr(armcompute.DiskCreateOptionCopy), // SourceResourceID: to.Ptr("/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/disks/myDisk"), // SourceUniqueID: to.Ptr("d633885d-d102-4481-901e-5b2413d1a7be"), // }, // DiskSizeBytes: to.Ptr[int64](10737418240), // DiskSizeGB: to.Ptr[int32](100), // DiskState: to.Ptr(armcompute.DiskState("0")), // Encryption: &armcompute.Encryption{ // Type: to.Ptr(armcompute.EncryptionTypeEncryptionAtRestWithPlatformKey), // }, // EncryptionSettingsCollection: &armcompute.EncryptionSettingsCollection{ // Enabled: to.Ptr(true), // EncryptionSettings: []*armcompute.EncryptionSettingsElement{ // { // DiskEncryptionKey: &armcompute.KeyVaultAndSecretReference{ // SecretURL: to.Ptr("https://myvmvault.vault-int.azure-int.net/secrets/{secret}"), // SourceVault: &armcompute.SourceVault{ // ID: to.Ptr("/subscriptions/{subscriptionId}/resourceGroups/myResourceGroup/providers/Microsoft.KeyVault/vaults/myVMVault"), // }, // }, // KeyEncryptionKey: &armcompute.KeyVaultAndKeyReference{ // KeyURL: to.Ptr("https://myvmvault.vault-int.azure-int.net/keys/{key}"), // SourceVault: &armcompute.SourceVault{ // ID: to.Ptr("/subscriptions/{subscriptionId}/resourceGroups/myResourceGroup/providers/Microsoft.KeyVault/vaults/myVMVault"), // }, // }, // }}, // }, // HyperVGeneration: to.Ptr(armcompute.HyperVGenerationV1), // Incremental: to.Ptr(true), // IncrementalSnapshotFamilyID: to.Ptr("d1a341d5-1ea7-4a85-b304-944ad8021639"), // NetworkAccessPolicy: to.Ptr(armcompute.NetworkAccessPolicy("0")), // OSType: to.Ptr(armcompute.OperatingSystemTypesWindows), // ProvisioningState: to.Ptr("Succeeded"), // PurchasePlan: &armcompute.DiskPurchasePlan{ // Name: to.Ptr("test_sku"), // Product: to.Ptr("marketplace_vm_test"), // Publisher: to.Ptr("test_test_pmc2pc1"), // }, // SupportedCapabilities: &armcompute.SupportedCapabilities{ // AcceleratedNetwork: to.Ptr(true), // }, // SupportsHibernation: to.Ptr(true), // TimeCreated: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2016-12-28T04:41:35.079Z"); return t}()), // UniqueID: to.Ptr("a395e9c1-fb9e-446e-a9ba-7b2fa0bcd305"), // }, // }
Output:
func (*SnapshotsClient) NewListByResourceGroupPager ¶
func (client *SnapshotsClient) NewListByResourceGroupPager(resourceGroupName string, options *SnapshotsClientListByResourceGroupOptions) *runtime.Pager[SnapshotsClientListByResourceGroupResponse]
NewListByResourceGroupPager - Lists snapshots under a resource group.
Generated from API version 2023-10-02
- resourceGroupName - The name of the resource group.
- options - SnapshotsClientListByResourceGroupOptions contains the optional parameters for the SnapshotsClient.NewListByResourceGroupPager method.
Example ¶
Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/92de53a5f1e0e03c94b40475d2135d97148ed014/specification/compute/resource-manager/Microsoft.Compute/DiskRP/stable/2023-10-02/examples/snapshotExamples/Snapshot_ListByResourceGroup.json
cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() clientFactory, err := armcompute.NewClientFactory("<subscription-id>", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } pager := clientFactory.NewSnapshotsClient().NewListByResourceGroupPager("myResourceGroup", nil) for pager.More() { page, err := pager.NextPage(ctx) if err != nil { log.Fatalf("failed to advance page: %v", err) } for _, v := range page.Value { // You could use page here. We use blank identifier for just demo purposes. _ = v } // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. // page.SnapshotList = armcompute.SnapshotList{ // Value: []*armcompute.Snapshot{ // { // Name: to.Ptr("mySnapshot"), // Type: to.Ptr("Microsoft.Compute/snapshots"), // ID: to.Ptr("/subscriptions/{subscriptionId}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/snapshots/mySnapshot"), // Location: to.Ptr("westus"), // Tags: map[string]*string{ // "department": to.Ptr("Development"), // "project": to.Ptr("Snapshots"), // }, // Properties: &armcompute.SnapshotProperties{ // CreationData: &armcompute.CreationData{ // CreateOption: to.Ptr(armcompute.DiskCreateOptionCopy), // SourceResourceID: to.Ptr("subscriptions/{subscriptionId}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/snapshots/mySnapshot"), // }, // DiskSizeGB: to.Ptr[int32](200), // Encryption: &armcompute.Encryption{ // Type: to.Ptr(armcompute.EncryptionTypeEncryptionAtRestWithPlatformKey), // }, // EncryptionSettingsCollection: &armcompute.EncryptionSettingsCollection{ // Enabled: to.Ptr(true), // EncryptionSettings: []*armcompute.EncryptionSettingsElement{ // { // DiskEncryptionKey: &armcompute.KeyVaultAndSecretReference{ // SecretURL: to.Ptr("https://myvmvault.vault-int.azure-int.net/secrets/{secret}"), // SourceVault: &armcompute.SourceVault{ // ID: to.Ptr("/subscriptions/{subscriptionId}/resourceGroups/myResourceGroup/providers/Microsoft.KeyVault/vaults/myVMVault"), // }, // }, // KeyEncryptionKey: &armcompute.KeyVaultAndKeyReference{ // KeyURL: to.Ptr("https://myvmvault.vault-int.azure-int.net/keys/{key}"), // SourceVault: &armcompute.SourceVault{ // ID: to.Ptr("/subscriptions/{subscriptionId}/resourceGroups/myResourceGroup/providers/Microsoft.KeyVault/vaults/myVMVault"), // }, // }, // }}, // }, // OSType: to.Ptr(armcompute.OperatingSystemTypesWindows), // ProvisioningState: to.Ptr("Succeeded"), // TimeCreated: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2016-12-28T04:41:35.927Z"); return t}()), // }, // }}, // } }
Output:
func (*SnapshotsClient) NewListPager ¶
func (client *SnapshotsClient) NewListPager(options *SnapshotsClientListOptions) *runtime.Pager[SnapshotsClientListResponse]
NewListPager - Lists snapshots under a subscription.
Generated from API version 2023-10-02
- options - SnapshotsClientListOptions contains the optional parameters for the SnapshotsClient.NewListPager method.
Example ¶
Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/92de53a5f1e0e03c94b40475d2135d97148ed014/specification/compute/resource-manager/Microsoft.Compute/DiskRP/stable/2023-10-02/examples/snapshotExamples/Snapshot_ListBySubscription.json
cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() clientFactory, err := armcompute.NewClientFactory("<subscription-id>", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } pager := clientFactory.NewSnapshotsClient().NewListPager(nil) for pager.More() { page, err := pager.NextPage(ctx) if err != nil { log.Fatalf("failed to advance page: %v", err) } for _, v := range page.Value { // You could use page here. We use blank identifier for just demo purposes. _ = v } // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. // page.SnapshotList = armcompute.SnapshotList{ // Value: []*armcompute.Snapshot{ // { // Name: to.Ptr("mySnapshot1"), // Type: to.Ptr("Microsoft.Compute/snapshots"), // ID: to.Ptr("/subscriptions/{subscriptionId}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/snapshots/mySnapshot1"), // Location: to.Ptr("westus"), // Tags: map[string]*string{ // "department": to.Ptr("Development"), // "project": to.Ptr("Snapshots"), // }, // Properties: &armcompute.SnapshotProperties{ // CreationData: &armcompute.CreationData{ // CreateOption: to.Ptr(armcompute.DiskCreateOptionCopy), // SourceResourceID: to.Ptr("subscriptions/{subscriptionId}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/snapshots/mySnapshot"), // }, // DiskSizeGB: to.Ptr[int32](200), // Encryption: &armcompute.Encryption{ // Type: to.Ptr(armcompute.EncryptionTypeEncryptionAtRestWithPlatformKey), // }, // EncryptionSettingsCollection: &armcompute.EncryptionSettingsCollection{ // Enabled: to.Ptr(true), // EncryptionSettings: []*armcompute.EncryptionSettingsElement{ // { // DiskEncryptionKey: &armcompute.KeyVaultAndSecretReference{ // SecretURL: to.Ptr("https://myvmvault.vault-int.azure-int.net/secrets/{secret}"), // SourceVault: &armcompute.SourceVault{ // ID: to.Ptr("/subscriptions/{subscriptionId}/resourceGroups/myResourceGroup/providers/Microsoft.KeyVault/vaults/myVMVault"), // }, // }, // KeyEncryptionKey: &armcompute.KeyVaultAndKeyReference{ // KeyURL: to.Ptr("https://myvmvault.vault-int.azure-int.net/keys/{key}"), // SourceVault: &armcompute.SourceVault{ // ID: to.Ptr("/subscriptions/{subscriptionId}/resourceGroups/myResourceGroup/providers/Microsoft.KeyVault/vaults/myVMVault"), // }, // }, // }}, // }, // OSType: to.Ptr(armcompute.OperatingSystemTypesWindows), // ProvisioningState: to.Ptr("Succeeded"), // TimeCreated: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2016-12-28T04:47:30.663Z"); return t}()), // }, // }, // { // Name: to.Ptr("mySnapshot2"), // Type: to.Ptr("Microsoft.Compute/snapshots"), // ID: to.Ptr("/subscriptions/{subscriptionId}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/snapshots/mySnapshot2"), // Location: to.Ptr("westus"), // Tags: map[string]*string{ // "department": to.Ptr("Development"), // "project": to.Ptr("Snapshots"), // }, // Properties: &armcompute.SnapshotProperties{ // CreationData: &armcompute.CreationData{ // CreateOption: to.Ptr(armcompute.DiskCreateOptionImport), // SourceURI: to.Ptr("https://mystorageaccount.blob.core.windows.net/osimages/osimage.vhd"), // StorageAccountID: to.Ptr("subscriptions/{subscriptionId}/resourceGroups/myResourceGroup/providers/Microsoft.Storage/storageAccounts/myStorageAccount"), // }, // DiskSizeGB: to.Ptr[int32](200), // Encryption: &armcompute.Encryption{ // Type: to.Ptr(armcompute.EncryptionTypeEncryptionAtRestWithPlatformKey), // }, // EncryptionSettingsCollection: &armcompute.EncryptionSettingsCollection{ // Enabled: to.Ptr(true), // EncryptionSettings: []*armcompute.EncryptionSettingsElement{ // { // DiskEncryptionKey: &armcompute.KeyVaultAndSecretReference{ // SecretURL: to.Ptr("https://myvmvault.vault-int.azure-int.net/secrets/{secret}"), // SourceVault: &armcompute.SourceVault{ // ID: to.Ptr("/subscriptions/{subscriptionId}/resourceGroups/myResourceGroup/providers/Microsoft.KeyVault/vaults/myVMVault"), // }, // }, // KeyEncryptionKey: &armcompute.KeyVaultAndKeyReference{ // KeyURL: to.Ptr("https://myvmvault.vault-int.azure-int.net/keys/{key}"), // SourceVault: &armcompute.SourceVault{ // ID: to.Ptr("/subscriptions/{subscriptionId}/resourceGroups/myResourceGroup/providers/Microsoft.KeyVault/vaults/myVMVault"), // }, // }, // }}, // }, // OSType: to.Ptr(armcompute.OperatingSystemTypesWindows), // ProvisioningState: to.Ptr("Succeeded"), // TimeCreated: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2016-12-28T04:47:30.324Z"); return t}()), // }, // }}, // } }
Output:
type SnapshotsClientBeginCreateOrUpdateOptions ¶
type SnapshotsClientBeginCreateOrUpdateOptions struct { // Resumes the LRO from the provided token. ResumeToken string }
SnapshotsClientBeginCreateOrUpdateOptions contains the optional parameters for the SnapshotsClient.BeginCreateOrUpdate method.
type SnapshotsClientBeginDeleteOptions ¶
type SnapshotsClientBeginDeleteOptions struct { // Resumes the LRO from the provided token. ResumeToken string }
SnapshotsClientBeginDeleteOptions contains the optional parameters for the SnapshotsClient.BeginDelete method.
type SnapshotsClientBeginGrantAccessOptions ¶
type SnapshotsClientBeginGrantAccessOptions struct { // Resumes the LRO from the provided token. ResumeToken string }
SnapshotsClientBeginGrantAccessOptions contains the optional parameters for the SnapshotsClient.BeginGrantAccess method.
type SnapshotsClientBeginRevokeAccessOptions ¶
type SnapshotsClientBeginRevokeAccessOptions struct { // Resumes the LRO from the provided token. ResumeToken string }
SnapshotsClientBeginRevokeAccessOptions contains the optional parameters for the SnapshotsClient.BeginRevokeAccess method.
type SnapshotsClientBeginUpdateOptions ¶
type SnapshotsClientBeginUpdateOptions struct { // Resumes the LRO from the provided token. ResumeToken string }
SnapshotsClientBeginUpdateOptions contains the optional parameters for the SnapshotsClient.BeginUpdate method.
type SnapshotsClientCreateOrUpdateResponse ¶
type SnapshotsClientCreateOrUpdateResponse struct { // Snapshot resource. Snapshot }
SnapshotsClientCreateOrUpdateResponse contains the response from method SnapshotsClient.BeginCreateOrUpdate.
type SnapshotsClientDeleteResponse ¶
type SnapshotsClientDeleteResponse struct { }
SnapshotsClientDeleteResponse contains the response from method SnapshotsClient.BeginDelete.
type SnapshotsClientGetOptions ¶
type SnapshotsClientGetOptions struct { }
SnapshotsClientGetOptions contains the optional parameters for the SnapshotsClient.Get method.
type SnapshotsClientGetResponse ¶
type SnapshotsClientGetResponse struct { // Snapshot resource. Snapshot }
SnapshotsClientGetResponse contains the response from method SnapshotsClient.Get.
type SnapshotsClientGrantAccessResponse ¶
type SnapshotsClientGrantAccessResponse struct { // A disk access SAS uri. AccessURI }
SnapshotsClientGrantAccessResponse contains the response from method SnapshotsClient.BeginGrantAccess.
type SnapshotsClientListByResourceGroupOptions ¶
type SnapshotsClientListByResourceGroupOptions struct { }
SnapshotsClientListByResourceGroupOptions contains the optional parameters for the SnapshotsClient.NewListByResourceGroupPager method.
type SnapshotsClientListByResourceGroupResponse ¶
type SnapshotsClientListByResourceGroupResponse struct { // The List Snapshots operation response. SnapshotList }
SnapshotsClientListByResourceGroupResponse contains the response from method SnapshotsClient.NewListByResourceGroupPager.
type SnapshotsClientListOptions ¶
type SnapshotsClientListOptions struct { }
SnapshotsClientListOptions contains the optional parameters for the SnapshotsClient.NewListPager method.
type SnapshotsClientListResponse ¶
type SnapshotsClientListResponse struct { // The List Snapshots operation response. SnapshotList }
SnapshotsClientListResponse contains the response from method SnapshotsClient.NewListPager.
type SnapshotsClientRevokeAccessResponse ¶
type SnapshotsClientRevokeAccessResponse struct { }
SnapshotsClientRevokeAccessResponse contains the response from method SnapshotsClient.BeginRevokeAccess.
type SnapshotsClientUpdateResponse ¶
type SnapshotsClientUpdateResponse struct { // Snapshot resource. Snapshot }
SnapshotsClientUpdateResponse contains the response from method SnapshotsClient.BeginUpdate.
type SoftDeletePolicy ¶
type SoftDeletePolicy struct { // Enables soft-deletion for resources in this gallery, allowing them to be recovered within retention time. IsSoftDeleteEnabled *bool }
SoftDeletePolicy - Contains information about the soft deletion policy of the gallery.
func (SoftDeletePolicy) MarshalJSON ¶
func (s SoftDeletePolicy) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type SoftDeletePolicy.
func (*SoftDeletePolicy) UnmarshalJSON ¶
func (s *SoftDeletePolicy) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type SoftDeletePolicy.
type SourceVault ¶
type SourceVault struct { // Resource Id ID *string }
SourceVault - The vault id is an Azure Resource Manager Resource id in the form /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.KeyVault/vaults/{vaultName}
func (SourceVault) MarshalJSON ¶
func (s SourceVault) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type SourceVault.
func (*SourceVault) UnmarshalJSON ¶
func (s *SourceVault) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type SourceVault.
type SpotRestorePolicy ¶
type SpotRestorePolicy struct { // Enables the Spot-Try-Restore feature where evicted VMSS SPOT instances will be tried to be restored opportunistically based // on capacity availability and pricing constraints Enabled *bool // Timeout value expressed as an ISO 8601 time duration after which the platform will not try to restore the VMSS SPOT instances RestoreTimeout *string }
SpotRestorePolicy - Specifies the Spot-Try-Restore properties for the virtual machine scale set. With this property customer can enable or disable automatic restore of the evicted Spot VMSS VM instances opportunistically based on capacity availability and pricing constraint.
func (SpotRestorePolicy) MarshalJSON ¶
func (s SpotRestorePolicy) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type SpotRestorePolicy.
func (*SpotRestorePolicy) UnmarshalJSON ¶
func (s *SpotRestorePolicy) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type SpotRestorePolicy.
type StatusCodeCount ¶
type StatusCodeCount struct { // READ-ONLY; The instance view status code Code *string // READ-ONLY; Number of instances having this status code Count *int32 }
StatusCodeCount - The status code and count of the cloud service instance view statuses
func (StatusCodeCount) MarshalJSON ¶
func (s StatusCodeCount) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type StatusCodeCount.
func (*StatusCodeCount) UnmarshalJSON ¶
func (s *StatusCodeCount) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type StatusCodeCount.
type StatusLevelTypes ¶
type StatusLevelTypes string
StatusLevelTypes - The level code.
const ( StatusLevelTypesError StatusLevelTypes = "Error" StatusLevelTypesInfo StatusLevelTypes = "Info" StatusLevelTypesWarning StatusLevelTypes = "Warning" )
func PossibleStatusLevelTypesValues ¶
func PossibleStatusLevelTypesValues() []StatusLevelTypes
PossibleStatusLevelTypesValues returns the possible values for the StatusLevelTypes const type.
type StorageAccountType ¶
type StorageAccountType string
StorageAccountType - Specifies the storage account type to be used to store the image. This property is not updatable.
const ( StorageAccountTypePremiumLRS StorageAccountType = "Premium_LRS" StorageAccountTypeStandardLRS StorageAccountType = "Standard_LRS" StorageAccountTypeStandardZRS StorageAccountType = "Standard_ZRS" )
func PossibleStorageAccountTypeValues ¶
func PossibleStorageAccountTypeValues() []StorageAccountType
PossibleStorageAccountTypeValues returns the possible values for the StorageAccountType const type.
type StorageAccountTypes ¶
type StorageAccountTypes string
StorageAccountTypes - Specifies the storage account type for the managed disk. Managed OS disk storage account type can only be set when you create the scale set. NOTE: UltraSSDLRS can only be used with data disks. It cannot be used with OS Disk. StandardLRS uses Standard HDD. StandardSSDLRS uses Standard SSD. PremiumLRS uses Premium SSD. UltraSSDLRS uses Ultra disk. PremiumZRS uses Premium SSD zone redundant storage. StandardSSD_ZRS uses Standard SSD zone redundant storage. For more information regarding disks supported for Windows Virtual Machines, refer to https://docs.microsoft.com/azure/virtual-machines/windows/disks-types and, for Linux Virtual Machines, refer to https://docs.microsoft.com/azure/virtual-machines/linux/disks-types
const ( StorageAccountTypesPremiumLRS StorageAccountTypes = "Premium_LRS" StorageAccountTypesPremiumV2LRS StorageAccountTypes = "PremiumV2_LRS" StorageAccountTypesPremiumZRS StorageAccountTypes = "Premium_ZRS" StorageAccountTypesStandardLRS StorageAccountTypes = "Standard_LRS" StorageAccountTypesStandardSSDLRS StorageAccountTypes = "StandardSSD_LRS" StorageAccountTypesStandardSSDZRS StorageAccountTypes = "StandardSSD_ZRS" StorageAccountTypesUltraSSDLRS StorageAccountTypes = "UltraSSD_LRS" )
func PossibleStorageAccountTypesValues ¶
func PossibleStorageAccountTypesValues() []StorageAccountTypes
PossibleStorageAccountTypesValues returns the possible values for the StorageAccountTypes const type.
type StorageProfile ¶
type StorageProfile struct { // Specifies the parameters that are used to add a data disk to a virtual machine. For more information about disks, see About // disks and VHDs for Azure virtual machines // [https://docs.microsoft.com/azure/virtual-machines/managed-disks-overview]. DataDisks []*DataDisk // Specifies the disk controller type configured for the VM. Note: This property will be set to the default disk controller // type if not specified provided virtual machine is being created with // 'hyperVGeneration' set to V2 based on the capabilities of the operating system disk and VM size from the the specified // minimum api version. You need to deallocate the VM before updating its disk // controller type unless you are updating the VM size in the VM configuration which implicitly deallocates and reallocates // the VM. Minimum api-version: 2022-08-01. DiskControllerType *DiskControllerTypes // Specifies information about the image to use. You can specify information about platform images, marketplace images, or // virtual machine images. This element is required when you want to use a platform // image, marketplace image, or virtual machine image, but is not used in other creation operations. ImageReference *ImageReference // Specifies information about the operating system disk used by the virtual machine. For more information about disks, see // About disks and VHDs for Azure virtual machines // [https://docs.microsoft.com/azure/virtual-machines/managed-disks-overview]. OSDisk *OSDisk }
StorageProfile - Specifies the storage settings for the virtual machine disks.
func (StorageProfile) MarshalJSON ¶
func (s StorageProfile) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type StorageProfile.
func (*StorageProfile) UnmarshalJSON ¶
func (s *StorageProfile) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type StorageProfile.
type SubResource ¶
type SubResource struct { // Resource Id ID *string }
func (SubResource) MarshalJSON ¶
func (s SubResource) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type SubResource.
func (*SubResource) UnmarshalJSON ¶
func (s *SubResource) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type SubResource.
type SubResourceReadOnly ¶
type SubResourceReadOnly struct { // READ-ONLY; Resource Id ID *string }
func (SubResourceReadOnly) MarshalJSON ¶
func (s SubResourceReadOnly) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type SubResourceReadOnly.
func (*SubResourceReadOnly) UnmarshalJSON ¶
func (s *SubResourceReadOnly) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type SubResourceReadOnly.
type SubResourceWithColocationStatus ¶
type SubResourceWithColocationStatus struct { // Describes colocation status of a resource in the Proximity Placement Group. ColocationStatus *InstanceViewStatus // Resource Id ID *string }
func (SubResourceWithColocationStatus) MarshalJSON ¶
func (s SubResourceWithColocationStatus) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type SubResourceWithColocationStatus.
func (*SubResourceWithColocationStatus) UnmarshalJSON ¶
func (s *SubResourceWithColocationStatus) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type SubResourceWithColocationStatus.
type SupportedCapabilities ¶
type SupportedCapabilities struct { // True if the image from which the OS disk is created supports accelerated networking. AcceleratedNetwork *bool // CPU architecture supported by an OS disk. Architecture *Architecture // The disk controllers that an OS disk supports. If set it can be SCSI or SCSI, NVME or NVME, SCSI. DiskControllerTypes *string }
SupportedCapabilities - List of supported capabilities persisted on the disk resource for VM use.
func (SupportedCapabilities) MarshalJSON ¶
func (s SupportedCapabilities) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type SupportedCapabilities.
func (*SupportedCapabilities) UnmarshalJSON ¶
func (s *SupportedCapabilities) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type SupportedCapabilities.
type SystemData ¶
type SystemData struct { // READ-ONLY; Specifies the time in UTC at which the Cloud Service (extended support) resource was created. // Minimum api-version: 2022-04-04. CreatedAt *time.Time // READ-ONLY; Specifies the time in UTC at which the Cloud Service (extended support) resource was last modified. // Minimum api-version: 2022-04-04. LastModifiedAt *time.Time }
SystemData - The system meta data relating to this resource.
func (SystemData) MarshalJSON ¶
func (s SystemData) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type SystemData.
func (*SystemData) UnmarshalJSON ¶
func (s *SystemData) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type SystemData.
type TargetRegion ¶
type TargetRegion struct { // REQUIRED; The name of the region. Name *string // Optional. Allows users to provide customer managed keys for encrypting the OS and data disks in the gallery artifact. Encryption *EncryptionImages // Contains the flag setting to hide an image when users specify version='latest' ExcludeFromLatest *bool // The number of replicas of the Image Version to be created per region. This property is updatable. RegionalReplicaCount *int32 // Specifies the storage account type to be used to store the image. This property is not updatable. StorageAccountType *StorageAccountType }
TargetRegion - Describes the target region information.
func (TargetRegion) MarshalJSON ¶
func (t TargetRegion) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type TargetRegion.
func (*TargetRegion) UnmarshalJSON ¶
func (t *TargetRegion) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type TargetRegion.
type TerminateNotificationProfile ¶
type TerminateNotificationProfile struct { // Specifies whether the Terminate Scheduled event is enabled or disabled. Enable *bool // Configurable length of time a Virtual Machine being deleted will have to potentially approve the Terminate Scheduled Event // before the event is auto approved (timed out). The configuration must be // specified in ISO 8601 format, the default value is 5 minutes (PT5M) NotBeforeTimeout *string }
func (TerminateNotificationProfile) MarshalJSON ¶
func (t TerminateNotificationProfile) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type TerminateNotificationProfile.
func (*TerminateNotificationProfile) UnmarshalJSON ¶
func (t *TerminateNotificationProfile) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type TerminateNotificationProfile.
type ThrottledRequestsInput ¶
type ThrottledRequestsInput struct { // REQUIRED; SAS Uri of the logging blob container to which LogAnalytics Api writes output logs to. BlobContainerSasURI *string // REQUIRED; From time of the query FromTime *time.Time // REQUIRED; To time of the query ToTime *time.Time // Group query result by Client Application ID. GroupByClientApplicationID *bool // Group query result by Operation Name. GroupByOperationName *bool // Group query result by Resource Name. GroupByResourceName *bool // Group query result by Throttle Policy applied. GroupByThrottlePolicy *bool // Group query result by User Agent. GroupByUserAgent *bool }
ThrottledRequestsInput - Api request input for LogAnalytics getThrottledRequests Api.
func (ThrottledRequestsInput) MarshalJSON ¶
func (t ThrottledRequestsInput) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type ThrottledRequestsInput.
func (*ThrottledRequestsInput) UnmarshalJSON ¶
func (t *ThrottledRequestsInput) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type ThrottledRequestsInput.
type UefiKey ¶ added in v5.4.0
type UefiKey struct { // The type of key signature. Type *UefiKeyType // The value of the key signature. Value []*string }
UefiKey - A UEFI key signature.
func (UefiKey) MarshalJSON ¶ added in v5.4.0
MarshalJSON implements the json.Marshaller interface for type UefiKey.
func (*UefiKey) UnmarshalJSON ¶ added in v5.4.0
UnmarshalJSON implements the json.Unmarshaller interface for type UefiKey.
type UefiKeySignatures ¶ added in v5.4.0
type UefiKeySignatures struct { // The database of UEFI keys for this image version. Db []*UefiKey // The database of revoked UEFI keys for this image version. Dbx []*UefiKey // The Key Encryption Keys of this image version. Kek []*UefiKey // The Platform Key of this image version. Pk *UefiKey }
UefiKeySignatures - Additional UEFI key signatures that will be added to the image in addition to the signature templates
func (UefiKeySignatures) MarshalJSON ¶ added in v5.4.0
func (u UefiKeySignatures) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type UefiKeySignatures.
func (*UefiKeySignatures) UnmarshalJSON ¶ added in v5.4.0
func (u *UefiKeySignatures) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type UefiKeySignatures.
type UefiKeyType ¶ added in v5.4.0
type UefiKeyType string
UefiKeyType - The type of key signature.
const ( UefiKeyTypeSHA256 UefiKeyType = "sha256" UefiKeyTypeX509 UefiKeyType = "x509" )
func PossibleUefiKeyTypeValues ¶ added in v5.4.0
func PossibleUefiKeyTypeValues() []UefiKeyType
PossibleUefiKeyTypeValues returns the possible values for the UefiKeyType const type.
type UefiSettings ¶
type UefiSettings struct { // Specifies whether secure boot should be enabled on the virtual machine. Minimum api-version: 2020-12-01. SecureBootEnabled *bool // Specifies whether vTPM should be enabled on the virtual machine. Minimum api-version: 2020-12-01. VTpmEnabled *bool }
UefiSettings - Specifies the security settings like secure boot and vTPM used while creating the virtual machine. Minimum api-version: 2020-12-01.
func (UefiSettings) MarshalJSON ¶
func (u UefiSettings) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type UefiSettings.
func (*UefiSettings) UnmarshalJSON ¶
func (u *UefiSettings) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type UefiSettings.
type UefiSignatureTemplateName ¶ added in v5.4.0
type UefiSignatureTemplateName string
UefiSignatureTemplateName - The name of the signature template that contains default UEFI keys.
const ( UefiSignatureTemplateNameMicrosoftUefiCertificateAuthorityTemplate UefiSignatureTemplateName = "MicrosoftUefiCertificateAuthorityTemplate" UefiSignatureTemplateNameMicrosoftWindowsTemplate UefiSignatureTemplateName = "MicrosoftWindowsTemplate" UefiSignatureTemplateNameNoSignatureTemplate UefiSignatureTemplateName = "NoSignatureTemplate" )
func PossibleUefiSignatureTemplateNameValues ¶ added in v5.4.0
func PossibleUefiSignatureTemplateNameValues() []UefiSignatureTemplateName
PossibleUefiSignatureTemplateNameValues returns the possible values for the UefiSignatureTemplateName const type.
type UpdateDomain ¶
type UpdateDomain struct { // READ-ONLY; Resource Id ID *string // READ-ONLY; Resource Name Name *string }
UpdateDomain - Defines an update domain for the cloud service.
func (UpdateDomain) MarshalJSON ¶
func (u UpdateDomain) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type UpdateDomain.
func (*UpdateDomain) UnmarshalJSON ¶
func (u *UpdateDomain) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type UpdateDomain.
type UpdateDomainListResult ¶
type UpdateDomainListResult struct { // REQUIRED; The list of resources. Value []*UpdateDomain // The URI to fetch the next page of resources. Use this to get the next page of resources. Do this till nextLink is null // to fetch all the resources. NextLink *string }
UpdateDomainListResult - The list operation result.
func (UpdateDomainListResult) MarshalJSON ¶
func (u UpdateDomainListResult) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type UpdateDomainListResult.
func (*UpdateDomainListResult) UnmarshalJSON ¶
func (u *UpdateDomainListResult) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type UpdateDomainListResult.
type UpdateResource ¶
UpdateResource - The Update Resource model definition.
func (UpdateResource) MarshalJSON ¶
func (u UpdateResource) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type UpdateResource.
func (*UpdateResource) UnmarshalJSON ¶
func (u *UpdateResource) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type UpdateResource.
type UpdateResourceDefinition ¶
type UpdateResourceDefinition struct { // Resource tags Tags map[string]*string // READ-ONLY; Resource Id ID *string // READ-ONLY; Resource name Name *string // READ-ONLY; Resource type Type *string }
UpdateResourceDefinition - The Update Resource model definition.
func (UpdateResourceDefinition) MarshalJSON ¶
func (u UpdateResourceDefinition) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type UpdateResourceDefinition.
func (*UpdateResourceDefinition) UnmarshalJSON ¶
func (u *UpdateResourceDefinition) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type UpdateResourceDefinition.
type UpgradeMode ¶
type UpgradeMode string
UpgradeMode - Specifies the mode of an upgrade to virtual machines in the scale set. Possible values are: Manual - You control the application of updates to virtual machines in the scale set. You do this by using the manualUpgrade action. Automatic - All virtual machines in the scale set are automatically updated at the same time.
const ( UpgradeModeAutomatic UpgradeMode = "Automatic" UpgradeModeManual UpgradeMode = "Manual" UpgradeModeRolling UpgradeMode = "Rolling" )
func PossibleUpgradeModeValues ¶
func PossibleUpgradeModeValues() []UpgradeMode
PossibleUpgradeModeValues returns the possible values for the UpgradeMode const type.
type UpgradeOperationHistoricalStatusInfo ¶
type UpgradeOperationHistoricalStatusInfo struct { // READ-ONLY; Resource location Location *string // READ-ONLY; Information about the properties of the upgrade operation. Properties *UpgradeOperationHistoricalStatusInfoProperties // READ-ONLY; Resource type Type *string }
UpgradeOperationHistoricalStatusInfo - Virtual Machine Scale Set OS Upgrade History operation response.
func (UpgradeOperationHistoricalStatusInfo) MarshalJSON ¶
func (u UpgradeOperationHistoricalStatusInfo) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type UpgradeOperationHistoricalStatusInfo.
func (*UpgradeOperationHistoricalStatusInfo) UnmarshalJSON ¶
func (u *UpgradeOperationHistoricalStatusInfo) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type UpgradeOperationHistoricalStatusInfo.
type UpgradeOperationHistoricalStatusInfoProperties ¶
type UpgradeOperationHistoricalStatusInfoProperties struct { // READ-ONLY; Error Details for this upgrade if there are any. Error *APIError // READ-ONLY; Counts of the VMs in each state. Progress *RollingUpgradeProgressInfo // READ-ONLY; Information about OS rollback if performed RollbackInfo *RollbackStatusInfo // READ-ONLY; Information about the overall status of the upgrade operation. RunningStatus *UpgradeOperationHistoryStatus // READ-ONLY; Invoker of the Upgrade Operation StartedBy *UpgradeOperationInvoker // READ-ONLY; Image Reference details TargetImageReference *ImageReference }
UpgradeOperationHistoricalStatusInfoProperties - Describes each OS upgrade on the Virtual Machine Scale Set.
func (UpgradeOperationHistoricalStatusInfoProperties) MarshalJSON ¶
func (u UpgradeOperationHistoricalStatusInfoProperties) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type UpgradeOperationHistoricalStatusInfoProperties.
func (*UpgradeOperationHistoricalStatusInfoProperties) UnmarshalJSON ¶
func (u *UpgradeOperationHistoricalStatusInfoProperties) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type UpgradeOperationHistoricalStatusInfoProperties.
type UpgradeOperationHistoryStatus ¶
type UpgradeOperationHistoryStatus struct { // READ-ONLY; Code indicating the current status of the upgrade. Code *UpgradeState // READ-ONLY; End time of the upgrade. EndTime *time.Time // READ-ONLY; Start time of the upgrade. StartTime *time.Time }
UpgradeOperationHistoryStatus - Information about the current running state of the overall upgrade.
func (UpgradeOperationHistoryStatus) MarshalJSON ¶
func (u UpgradeOperationHistoryStatus) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type UpgradeOperationHistoryStatus.
func (*UpgradeOperationHistoryStatus) UnmarshalJSON ¶
func (u *UpgradeOperationHistoryStatus) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type UpgradeOperationHistoryStatus.
type UpgradeOperationInvoker ¶
type UpgradeOperationInvoker string
UpgradeOperationInvoker - Invoker of the Upgrade Operation
const ( UpgradeOperationInvokerPlatform UpgradeOperationInvoker = "Platform" UpgradeOperationInvokerUnknown UpgradeOperationInvoker = "Unknown" UpgradeOperationInvokerUser UpgradeOperationInvoker = "User" )
func PossibleUpgradeOperationInvokerValues ¶
func PossibleUpgradeOperationInvokerValues() []UpgradeOperationInvoker
PossibleUpgradeOperationInvokerValues returns the possible values for the UpgradeOperationInvoker const type.
type UpgradePolicy ¶
type UpgradePolicy struct { // Configuration parameters used for performing automatic OS Upgrade. AutomaticOSUpgradePolicy *AutomaticOSUpgradePolicy // Specifies the mode of an upgrade to virtual machines in the scale set. // Possible values are: // Manual - You control the application of updates to virtual machines in the scale set. You do this by using the manualUpgrade // action. // Automatic - All virtual machines in the scale set are automatically updated at the same time. Mode *UpgradeMode // The configuration parameters used while performing a rolling upgrade. RollingUpgradePolicy *RollingUpgradePolicy }
UpgradePolicy - Describes an upgrade policy - automatic, manual, or rolling.
func (UpgradePolicy) MarshalJSON ¶
func (u UpgradePolicy) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type UpgradePolicy.
func (*UpgradePolicy) UnmarshalJSON ¶
func (u *UpgradePolicy) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type UpgradePolicy.
type UpgradeState ¶
type UpgradeState string
UpgradeState - Code indicating the current status of the upgrade.
const ( UpgradeStateCancelled UpgradeState = "Cancelled" UpgradeStateCompleted UpgradeState = "Completed" UpgradeStateFaulted UpgradeState = "Faulted" UpgradeStateRollingForward UpgradeState = "RollingForward" )
func PossibleUpgradeStateValues ¶
func PossibleUpgradeStateValues() []UpgradeState
PossibleUpgradeStateValues returns the possible values for the UpgradeState const type.
type Usage ¶
type Usage struct { // REQUIRED; The current usage of the resource. CurrentValue *int32 // REQUIRED; The maximum permitted usage of the resource. Limit *int64 // REQUIRED; The name of the type of usage. Name *UsageName // REQUIRED; An enum describing the unit of usage measurement. Unit *string }
Usage - Describes Compute Resource Usage.
func (Usage) MarshalJSON ¶
MarshalJSON implements the json.Marshaller interface for type Usage.
func (*Usage) UnmarshalJSON ¶
UnmarshalJSON implements the json.Unmarshaller interface for type Usage.
type UsageClient ¶
type UsageClient struct {
// contains filtered or unexported fields
}
UsageClient contains the methods for the Usage group. Don't use this type directly, use NewUsageClient() instead.
func NewUsageClient ¶
func NewUsageClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*UsageClient, error)
NewUsageClient creates a new instance of UsageClient 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 (*UsageClient) NewListPager ¶
func (client *UsageClient) NewListPager(location string, options *UsageClientListOptions) *runtime.Pager[UsageClientListResponse]
NewListPager - Gets, for the specified location, the current compute resource usage information as well as the limits for compute resources under the subscription.
Generated from API version 2024-03-01
- location - The location for which resource usage is queried.
- options - UsageClientListOptions contains the optional parameters for the UsageClient.NewListPager method.
Example (UsageListMaximumSetGen) ¶
Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/92de53a5f1e0e03c94b40475d2135d97148ed014/specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-03-01/examples/computeRPCommonExamples/Usage_List_MaximumSet_Gen.json
cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() clientFactory, err := armcompute.NewClientFactory("<subscription-id>", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } pager := clientFactory.NewUsageClient().NewListPager("4_.", nil) for pager.More() { page, err := pager.NextPage(ctx) if err != nil { log.Fatalf("failed to advance page: %v", err) } for _, v := range page.Value { // You could use page here. We use blank identifier for just demo purposes. _ = v } // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. // page.ListUsagesResult = armcompute.ListUsagesResult{ // Value: []*armcompute.Usage{ // { // Name: &armcompute.UsageName{ // LocalizedValue: to.Ptr("aaaaaaaaaaaaaa"), // Value: to.Ptr("aaaaaaaaaaaaaaaaaa"), // }, // CurrentValue: to.Ptr[int32](17), // Limit: to.Ptr[int64](19), // Unit: to.Ptr("Count"), // }}, // } }
Output:
Example (UsageListMinimumSetGen) ¶
Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/92de53a5f1e0e03c94b40475d2135d97148ed014/specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-03-01/examples/computeRPCommonExamples/Usage_List_MinimumSet_Gen.json
cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() clientFactory, err := armcompute.NewClientFactory("<subscription-id>", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } pager := clientFactory.NewUsageClient().NewListPager("_--", nil) for pager.More() { page, err := pager.NextPage(ctx) if err != nil { log.Fatalf("failed to advance page: %v", err) } for _, v := range page.Value { // You could use page here. We use blank identifier for just demo purposes. _ = v } // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. // page.ListUsagesResult = armcompute.ListUsagesResult{ // Value: []*armcompute.Usage{ // { // Name: &armcompute.UsageName{ // }, // CurrentValue: to.Ptr[int32](17), // Limit: to.Ptr[int64](19), // Unit: to.Ptr("Count"), // }}, // } }
Output:
type UsageClientListOptions ¶
type UsageClientListOptions struct { }
UsageClientListOptions contains the optional parameters for the UsageClient.NewListPager method.
type UsageClientListResponse ¶
type UsageClientListResponse struct { // The List Usages operation response. ListUsagesResult }
UsageClientListResponse contains the response from method UsageClient.NewListPager.
type UsageName ¶
type UsageName struct { // The localized name of the resource. LocalizedValue *string // The name of the resource. Value *string }
UsageName - The Usage Names.
func (UsageName) MarshalJSON ¶
MarshalJSON implements the json.Marshaller interface for type UsageName.
func (*UsageName) UnmarshalJSON ¶
UnmarshalJSON implements the json.Unmarshaller interface for type UsageName.
type UserArtifactManage ¶
type UserArtifactManage struct { // REQUIRED; Required. The path and arguments to install the gallery application. This is limited to 4096 characters. Install *string // REQUIRED; Required. The path and arguments to remove the gallery application. This is limited to 4096 characters. Remove *string // Optional. The path and arguments to update the gallery application. If not present, then update operation will invoke remove // command on the previous version and install command on the current version // of the gallery application. This is limited to 4096 characters. Update *string }
func (UserArtifactManage) MarshalJSON ¶
func (u UserArtifactManage) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type UserArtifactManage.
func (*UserArtifactManage) UnmarshalJSON ¶
func (u *UserArtifactManage) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type UserArtifactManage.
type UserArtifactSettings ¶
type UserArtifactSettings struct { // Optional. The name to assign the downloaded config file on the VM. This is limited to 4096 characters. If not specified, // the config file will be named the Gallery Application name appended with // "_config". ConfigFileName *string // Optional. The name to assign the downloaded package file on the VM. This is limited to 4096 characters. If not specified, // the package file will be named the same as the Gallery Application name. PackageFileName *string }
UserArtifactSettings - Additional settings for the VM app that contains the target package and config file name when it is deployed to target VM or VM scale set.
func (UserArtifactSettings) MarshalJSON ¶
func (u UserArtifactSettings) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type UserArtifactSettings.
func (*UserArtifactSettings) UnmarshalJSON ¶
func (u *UserArtifactSettings) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type UserArtifactSettings.
type UserArtifactSource ¶
type UserArtifactSource struct { // REQUIRED; Required. The mediaLink of the artifact, must be a readable storage page blob. MediaLink *string // Optional. The defaultConfigurationLink of the artifact, must be a readable storage page blob. DefaultConfigurationLink *string }
UserArtifactSource - The source image from which the Image Version is going to be created.
func (UserArtifactSource) MarshalJSON ¶
func (u UserArtifactSource) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type UserArtifactSource.
func (*UserArtifactSource) UnmarshalJSON ¶
func (u *UserArtifactSource) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type UserArtifactSource.
type UserAssignedIdentitiesValue ¶
type UserAssignedIdentitiesValue struct { // READ-ONLY; The client id of user assigned identity. ClientID *string // READ-ONLY; The principal id of user assigned identity. PrincipalID *string }
func (UserAssignedIdentitiesValue) MarshalJSON ¶
func (u UserAssignedIdentitiesValue) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type UserAssignedIdentitiesValue.
func (*UserAssignedIdentitiesValue) UnmarshalJSON ¶
func (u *UserAssignedIdentitiesValue) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type UserAssignedIdentitiesValue.
type UserInitiatedReboot ¶ added in v5.7.0
type UserInitiatedReboot struct { // Specifies Reboot Scheduled Event related configurations. AutomaticallyApprove *bool }
UserInitiatedReboot - Specifies Reboot related Scheduled Event related configurations.
func (UserInitiatedReboot) MarshalJSON ¶ added in v5.7.0
func (u UserInitiatedReboot) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type UserInitiatedReboot.
func (*UserInitiatedReboot) UnmarshalJSON ¶ added in v5.7.0
func (u *UserInitiatedReboot) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type UserInitiatedReboot.
type UserInitiatedRedeploy ¶ added in v5.7.0
type UserInitiatedRedeploy struct { // Specifies Redeploy Scheduled Event related configurations. AutomaticallyApprove *bool }
UserInitiatedRedeploy - Specifies Redeploy related Scheduled Event related configurations.
func (UserInitiatedRedeploy) MarshalJSON ¶ added in v5.7.0
func (u UserInitiatedRedeploy) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type UserInitiatedRedeploy.
func (*UserInitiatedRedeploy) UnmarshalJSON ¶ added in v5.7.0
func (u *UserInitiatedRedeploy) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type UserInitiatedRedeploy.
type VMDiskSecurityProfile ¶
type VMDiskSecurityProfile struct { // Specifies the customer managed disk encryption set resource id for the managed disk that is used for Customer Managed Key // encrypted ConfidentialVM OS Disk and VMGuest blob. DiskEncryptionSet *DiskEncryptionSetParameters // Specifies the EncryptionType of the managed disk. It is set to DiskWithVMGuestState for encryption of the managed disk // along with VMGuestState blob, VMGuestStateOnly for encryption of just the // VMGuestState blob, and NonPersistedTPM for not persisting firmware state in the VMGuestState blob.. Note: It can be set // for only Confidential VMs. SecurityEncryptionType *SecurityEncryptionTypes }
VMDiskSecurityProfile - Specifies the security profile settings for the managed disk. Note: It can only be set for Confidential VMs.
func (VMDiskSecurityProfile) MarshalJSON ¶
func (v VMDiskSecurityProfile) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type VMDiskSecurityProfile.
func (*VMDiskSecurityProfile) UnmarshalJSON ¶
func (v *VMDiskSecurityProfile) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type VMDiskSecurityProfile.
type VMDiskTypes ¶
type VMDiskTypes string
VMDiskTypes - VM disk types which are disallowed.
const ( VMDiskTypesNone VMDiskTypes = "None" VMDiskTypesUnmanaged VMDiskTypes = "Unmanaged" )
func PossibleVMDiskTypesValues ¶
func PossibleVMDiskTypesValues() []VMDiskTypes
PossibleVMDiskTypesValues returns the possible values for the VMDiskTypes const type.
type VMGalleryApplication ¶
type VMGalleryApplication struct { // REQUIRED; Specifies the GalleryApplicationVersion resource id on the form of // /subscriptions/{SubscriptionId}/resourceGroups/{ResourceGroupName}/providers/Microsoft.Compute/galleries/{galleryName}/applications/{application}/versions/{version} PackageReferenceID *string // Optional, Specifies the uri to an azure blob that will replace the default configuration for the package if provided ConfigurationReference *string // If set to true, when a new Gallery Application version is available in PIR/SIG, it will be automatically updated for the // VM/VMSS EnableAutomaticUpgrade *bool // Optional, Specifies the order in which the packages have to be installed Order *int32 // Optional, Specifies a passthrough value for more generic context. Tags *string // Optional, If true, any failure for any operation in the VmApplication will fail the deployment TreatFailureAsDeploymentFailure *bool }
VMGalleryApplication - Specifies the required information to reference a compute gallery application version
func (VMGalleryApplication) MarshalJSON ¶
func (v VMGalleryApplication) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type VMGalleryApplication.
func (*VMGalleryApplication) UnmarshalJSON ¶
func (v *VMGalleryApplication) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type VMGalleryApplication.
type VMGuestPatchClassificationLinux ¶
type VMGuestPatchClassificationLinux string
const ( VMGuestPatchClassificationLinuxCritical VMGuestPatchClassificationLinux = "Critical" VMGuestPatchClassificationLinuxOther VMGuestPatchClassificationLinux = "Other" VMGuestPatchClassificationLinuxSecurity VMGuestPatchClassificationLinux = "Security" )
func PossibleVMGuestPatchClassificationLinuxValues ¶
func PossibleVMGuestPatchClassificationLinuxValues() []VMGuestPatchClassificationLinux
PossibleVMGuestPatchClassificationLinuxValues returns the possible values for the VMGuestPatchClassificationLinux const type.
type VMGuestPatchClassificationWindows ¶
type VMGuestPatchClassificationWindows string
const ( VMGuestPatchClassificationWindowsCritical VMGuestPatchClassificationWindows = "Critical" VMGuestPatchClassificationWindowsDefinition VMGuestPatchClassificationWindows = "Definition" VMGuestPatchClassificationWindowsFeaturePack VMGuestPatchClassificationWindows = "FeaturePack" VMGuestPatchClassificationWindowsSecurity VMGuestPatchClassificationWindows = "Security" VMGuestPatchClassificationWindowsServicePack VMGuestPatchClassificationWindows = "ServicePack" VMGuestPatchClassificationWindowsTools VMGuestPatchClassificationWindows = "Tools" VMGuestPatchClassificationWindowsUpdateRollUp VMGuestPatchClassificationWindows = "UpdateRollUp" VMGuestPatchClassificationWindowsUpdates VMGuestPatchClassificationWindows = "Updates" )
func PossibleVMGuestPatchClassificationWindowsValues ¶
func PossibleVMGuestPatchClassificationWindowsValues() []VMGuestPatchClassificationWindows
PossibleVMGuestPatchClassificationWindowsValues returns the possible values for the VMGuestPatchClassificationWindows const type.
type VMGuestPatchRebootBehavior ¶
type VMGuestPatchRebootBehavior string
VMGuestPatchRebootBehavior - Describes the reboot requirements of the patch.
const ( VMGuestPatchRebootBehaviorAlwaysRequiresReboot VMGuestPatchRebootBehavior = "AlwaysRequiresReboot" VMGuestPatchRebootBehaviorCanRequestReboot VMGuestPatchRebootBehavior = "CanRequestReboot" VMGuestPatchRebootBehaviorNeverReboots VMGuestPatchRebootBehavior = "NeverReboots" VMGuestPatchRebootBehaviorUnknown VMGuestPatchRebootBehavior = "Unknown" )
func PossibleVMGuestPatchRebootBehaviorValues ¶
func PossibleVMGuestPatchRebootBehaviorValues() []VMGuestPatchRebootBehavior
PossibleVMGuestPatchRebootBehaviorValues returns the possible values for the VMGuestPatchRebootBehavior const type.
type VMGuestPatchRebootSetting ¶
type VMGuestPatchRebootSetting string
VMGuestPatchRebootSetting - Defines when it is acceptable to reboot a VM during a software update operation.
const ( VMGuestPatchRebootSettingAlways VMGuestPatchRebootSetting = "Always" VMGuestPatchRebootSettingIfRequired VMGuestPatchRebootSetting = "IfRequired" VMGuestPatchRebootSettingNever VMGuestPatchRebootSetting = "Never" )
func PossibleVMGuestPatchRebootSettingValues ¶
func PossibleVMGuestPatchRebootSettingValues() []VMGuestPatchRebootSetting
PossibleVMGuestPatchRebootSettingValues returns the possible values for the VMGuestPatchRebootSetting const type.
type VMGuestPatchRebootStatus ¶
type VMGuestPatchRebootStatus string
VMGuestPatchRebootStatus - The reboot state of the VM following completion of the operation.
const ( VMGuestPatchRebootStatusCompleted VMGuestPatchRebootStatus = "Completed" VMGuestPatchRebootStatusFailed VMGuestPatchRebootStatus = "Failed" VMGuestPatchRebootStatusNotNeeded VMGuestPatchRebootStatus = "NotNeeded" VMGuestPatchRebootStatusRequired VMGuestPatchRebootStatus = "Required" VMGuestPatchRebootStatusStarted VMGuestPatchRebootStatus = "Started" VMGuestPatchRebootStatusUnknown VMGuestPatchRebootStatus = "Unknown" )
func PossibleVMGuestPatchRebootStatusValues ¶
func PossibleVMGuestPatchRebootStatusValues() []VMGuestPatchRebootStatus
PossibleVMGuestPatchRebootStatusValues returns the possible values for the VMGuestPatchRebootStatus const type.
type VMImagesInEdgeZoneListResult ¶
type VMImagesInEdgeZoneListResult struct { // The URI to fetch the next page of VMImages in EdgeZone. Call ListNext() with this URI to fetch the next page of VmImages. NextLink *string // The list of VMImages in EdgeZone Value []*VirtualMachineImageResource }
VMImagesInEdgeZoneListResult - The List VmImages in EdgeZone operation response.
func (VMImagesInEdgeZoneListResult) MarshalJSON ¶
func (v VMImagesInEdgeZoneListResult) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type VMImagesInEdgeZoneListResult.
func (*VMImagesInEdgeZoneListResult) UnmarshalJSON ¶
func (v *VMImagesInEdgeZoneListResult) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type VMImagesInEdgeZoneListResult.
type VMScaleSetConvertToSinglePlacementGroupInput ¶
type VMScaleSetConvertToSinglePlacementGroupInput struct { // Id of the placement group in which you want future virtual machine instances to be placed. To query placement group Id, // please use Virtual Machine Scale Set VMs - Get API. If not provided, the // platform will choose one with maximum number of virtual machine instances. ActivePlacementGroupID *string }
func (VMScaleSetConvertToSinglePlacementGroupInput) MarshalJSON ¶
func (v VMScaleSetConvertToSinglePlacementGroupInput) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type VMScaleSetConvertToSinglePlacementGroupInput.
func (*VMScaleSetConvertToSinglePlacementGroupInput) UnmarshalJSON ¶
func (v *VMScaleSetConvertToSinglePlacementGroupInput) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type VMScaleSetConvertToSinglePlacementGroupInput.
type VMSizeProperties ¶
type VMSizeProperties struct { // Specifies the number of vCPUs available for the VM. When this property is not specified in the request body the default // behavior is to set it to the value of vCPUs available for that VM size exposed // in api response of List all available virtual machine sizes in a region [https://docs.microsoft.com/en-us/rest/api/compute/resource-skus/list]. VCPUsAvailable *int32 // Specifies the vCPU to physical core ratio. When this property is not specified in the request body the default behavior // is set to the value of vCPUsPerCore for the VM Size exposed in api response of // List all available virtual machine sizes in a region [https://docs.microsoft.com/en-us/rest/api/compute/resource-skus/list]. // Setting this property to 1 also means that hyper-threading is disabled. VCPUsPerCore *int32 }
VMSizeProperties - Specifies VM Size Property settings on the virtual machine.
func (VMSizeProperties) MarshalJSON ¶
func (v VMSizeProperties) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type VMSizeProperties.
func (*VMSizeProperties) UnmarshalJSON ¶
func (v *VMSizeProperties) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type VMSizeProperties.
type VaultCertificate ¶
type VaultCertificate struct { // For Windows VMs, specifies the certificate store on the Virtual Machine to which the certificate should be added. The specified // certificate store is implicitly in the LocalMachine account. For Linux // VMs, the certificate file is placed under the /var/lib/waagent directory, with the file name <UppercaseThumbprint>.crt // for the X509 certificate file and <UppercaseThumbprint>.prv for private key. Both // of these files are .pem formatted. CertificateStore *string // This is the URL of a certificate that has been uploaded to Key Vault as a secret. For adding a secret to the Key Vault, // see Add a key or secret to the key vault // [https://docs.microsoft.com/azure/key-vault/key-vault-get-started/#add]. In this case, your certificate needs to be It // is the Base64 encoding of the following JSON Object which is encoded in UTF-8: // { // "data":"", // "dataType":"pfx", // "password":"" // } // To install certificates on a virtual machine it is recommended to use the Azure Key Vault virtual machine extension for // Linux // [https://docs.microsoft.com/azure/virtual-machines/extensions/key-vault-linux] or the Azure Key Vault virtual machine extension // for Windows // [https://docs.microsoft.com/azure/virtual-machines/extensions/key-vault-windows]. CertificateURL *string }
VaultCertificate - Describes a single certificate reference in a Key Vault, and where the certificate should reside on the VM.
func (VaultCertificate) MarshalJSON ¶
func (v VaultCertificate) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type VaultCertificate.
func (*VaultCertificate) UnmarshalJSON ¶
func (v *VaultCertificate) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type VaultCertificate.
type VaultSecretGroup ¶
type VaultSecretGroup struct { // The relative URL of the Key Vault containing all of the certificates in VaultCertificates. SourceVault *SubResource // The list of key vault references in SourceVault which contain certificates. VaultCertificates []*VaultCertificate }
VaultSecretGroup - Describes a set of certificates which are all in the same Key Vault.
func (VaultSecretGroup) MarshalJSON ¶
func (v VaultSecretGroup) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type VaultSecretGroup.
func (*VaultSecretGroup) UnmarshalJSON ¶
func (v *VaultSecretGroup) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type VaultSecretGroup.
type VirtualHardDisk ¶
type VirtualHardDisk struct { // Specifies the virtual hard disk's uri. URI *string }
VirtualHardDisk - Describes the uri of a disk.
func (VirtualHardDisk) MarshalJSON ¶
func (v VirtualHardDisk) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type VirtualHardDisk.
func (*VirtualHardDisk) UnmarshalJSON ¶
func (v *VirtualHardDisk) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type VirtualHardDisk.
type VirtualMachine ¶
type VirtualMachine struct { // REQUIRED; Resource location Location *string // The extended location of the Virtual Machine. ExtendedLocation *ExtendedLocation // The identity of the virtual machine, if configured. Identity *VirtualMachineIdentity // Specifies information about the marketplace image used to create the virtual machine. This element is only used for marketplace // images. Before you can use a marketplace image from an API, you must // enable the image for programmatic use. In the Azure portal, find the marketplace image that you want to use and then click // Want to deploy programmatically, Get Started ->. Enter any required // information and then click Save. Plan *Plan // Describes the properties of a Virtual Machine. Properties *VirtualMachineProperties // Resource tags Tags map[string]*string // The virtual machine zones. Zones []*string // READ-ONLY; Etag is property returned in Create/Update/Get response of the VM, so that customer can supply it in the header // to ensure optimistic updates. Etag *string // READ-ONLY; Resource Id ID *string // READ-ONLY; ManagedBy is set to Virtual Machine Scale Set(VMSS) flex ARM resourceID, if the VM is part of the VMSS. This // property is used by platform for internal resource group delete optimization. ManagedBy *string // READ-ONLY; Resource name Name *string // READ-ONLY; The virtual machine child extension resources. Resources []*VirtualMachineExtension // READ-ONLY; Resource type Type *string }
VirtualMachine - Describes a Virtual Machine.
func (VirtualMachine) MarshalJSON ¶
func (v VirtualMachine) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type VirtualMachine.
func (*VirtualMachine) UnmarshalJSON ¶
func (v *VirtualMachine) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type VirtualMachine.
type VirtualMachineAgentInstanceView ¶
type VirtualMachineAgentInstanceView struct { // The virtual machine extension handler instance view. ExtensionHandlers []*VirtualMachineExtensionHandlerInstanceView // The resource status information. Statuses []*InstanceViewStatus // The VM Agent full version. VMAgentVersion *string }
VirtualMachineAgentInstanceView - The instance view of the VM Agent running on the virtual machine.
func (VirtualMachineAgentInstanceView) MarshalJSON ¶
func (v VirtualMachineAgentInstanceView) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type VirtualMachineAgentInstanceView.
func (*VirtualMachineAgentInstanceView) UnmarshalJSON ¶
func (v *VirtualMachineAgentInstanceView) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type VirtualMachineAgentInstanceView.
type VirtualMachineAssessPatchesResult ¶
type VirtualMachineAssessPatchesResult 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 // READ-ONLY; The list of patches that have been detected as available for installation. AvailablePatches []*VirtualMachineSoftwarePatchProperties // READ-ONLY; The number of critical or security patches that have been detected as available and not yet installed. CriticalAndSecurityPatchCount *int32 // READ-ONLY; The errors that were encountered during execution of the operation. The details array contains the list of them. Error *APIError // READ-ONLY; The number of all available patches excluding critical and security. OtherPatchCount *int32 // 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 // READ-ONLY; The UTC timestamp when the operation began. StartDateTime *time.Time // READ-ONLY; The overall success or failure status of the operation. It remains "InProgress" until the operation completes. // At that point it will become "Unknown", "Failed", "Succeeded", or // "CompletedWithWarnings." Status *PatchOperationStatus }
VirtualMachineAssessPatchesResult - Describes the properties of an AssessPatches result.
func (VirtualMachineAssessPatchesResult) MarshalJSON ¶
func (v VirtualMachineAssessPatchesResult) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type VirtualMachineAssessPatchesResult.
func (*VirtualMachineAssessPatchesResult) UnmarshalJSON ¶
func (v *VirtualMachineAssessPatchesResult) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type VirtualMachineAssessPatchesResult.
type VirtualMachineCaptureParameters ¶
type VirtualMachineCaptureParameters struct { // REQUIRED; The destination container name. DestinationContainerName *string // REQUIRED; Specifies whether to overwrite the destination virtual hard disk, in case of conflict. OverwriteVhds *bool // REQUIRED; The captured virtual hard disk's name prefix. VhdPrefix *string }
VirtualMachineCaptureParameters - Capture Virtual Machine parameters.
func (VirtualMachineCaptureParameters) MarshalJSON ¶
func (v VirtualMachineCaptureParameters) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type VirtualMachineCaptureParameters.
func (*VirtualMachineCaptureParameters) UnmarshalJSON ¶
func (v *VirtualMachineCaptureParameters) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type VirtualMachineCaptureParameters.
type VirtualMachineCaptureResult ¶
type VirtualMachineCaptureResult struct { // Resource Id ID *string // READ-ONLY; the version of the content ContentVersion *string // READ-ONLY; parameters of the captured virtual machine Parameters any // READ-ONLY; a list of resource items of the captured virtual machine Resources []any // READ-ONLY; the schema of the captured virtual machine Schema *string }
VirtualMachineCaptureResult - Output of virtual machine capture operation.
func (VirtualMachineCaptureResult) MarshalJSON ¶
func (v VirtualMachineCaptureResult) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type VirtualMachineCaptureResult.
func (*VirtualMachineCaptureResult) UnmarshalJSON ¶
func (v *VirtualMachineCaptureResult) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type VirtualMachineCaptureResult.
type VirtualMachineEvictionPolicyTypes ¶
type VirtualMachineEvictionPolicyTypes string
VirtualMachineEvictionPolicyTypes - Specifies the eviction policy for the Azure Spot VM/VMSS
const ( VirtualMachineEvictionPolicyTypesDeallocate VirtualMachineEvictionPolicyTypes = "Deallocate" VirtualMachineEvictionPolicyTypesDelete VirtualMachineEvictionPolicyTypes = "Delete" )
func PossibleVirtualMachineEvictionPolicyTypesValues ¶
func PossibleVirtualMachineEvictionPolicyTypesValues() []VirtualMachineEvictionPolicyTypes
PossibleVirtualMachineEvictionPolicyTypesValues returns the possible values for the VirtualMachineEvictionPolicyTypes const type.
type VirtualMachineExtension ¶
type VirtualMachineExtension struct { // Resource location Location *string // Describes the properties of a Virtual Machine Extension. Properties *VirtualMachineExtensionProperties // Resource tags Tags map[string]*string // READ-ONLY; Resource Id ID *string // READ-ONLY; Resource name Name *string // READ-ONLY; Resource type Type *string }
VirtualMachineExtension - Describes a Virtual Machine Extension.
func (VirtualMachineExtension) MarshalJSON ¶
func (v VirtualMachineExtension) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type VirtualMachineExtension.
func (*VirtualMachineExtension) UnmarshalJSON ¶
func (v *VirtualMachineExtension) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type VirtualMachineExtension.
type VirtualMachineExtensionHandlerInstanceView ¶
type VirtualMachineExtensionHandlerInstanceView struct { // The extension handler status. Status *InstanceViewStatus // Specifies the type of the extension; an example is "CustomScriptExtension". Type *string // Specifies the version of the script handler. TypeHandlerVersion *string }
VirtualMachineExtensionHandlerInstanceView - The instance view of a virtual machine extension handler.
func (VirtualMachineExtensionHandlerInstanceView) MarshalJSON ¶
func (v VirtualMachineExtensionHandlerInstanceView) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type VirtualMachineExtensionHandlerInstanceView.
func (*VirtualMachineExtensionHandlerInstanceView) UnmarshalJSON ¶
func (v *VirtualMachineExtensionHandlerInstanceView) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type VirtualMachineExtensionHandlerInstanceView.
type VirtualMachineExtensionImage ¶
type VirtualMachineExtensionImage struct { // REQUIRED; Resource location Location *string // Describes the properties of a Virtual Machine Extension Image. Properties *VirtualMachineExtensionImageProperties // Resource tags Tags map[string]*string // READ-ONLY; Resource Id ID *string // READ-ONLY; Resource name Name *string // READ-ONLY; Resource type Type *string }
VirtualMachineExtensionImage - Describes a Virtual Machine Extension Image.
func (VirtualMachineExtensionImage) MarshalJSON ¶
func (v VirtualMachineExtensionImage) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type VirtualMachineExtensionImage.
func (*VirtualMachineExtensionImage) UnmarshalJSON ¶
func (v *VirtualMachineExtensionImage) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type VirtualMachineExtensionImage.
type VirtualMachineExtensionImageProperties ¶
type VirtualMachineExtensionImageProperties struct { // REQUIRED; The type of role (IaaS or PaaS) this extension supports. ComputeRole *string // REQUIRED; The schema defined by publisher, where extension consumers should provide settings in a matching schema. HandlerSchema *string // REQUIRED; The operating system this extension supports. OperatingSystem *string // Whether the handler can support multiple extensions. SupportsMultipleExtensions *bool // Whether the extension can be used on xRP VMScaleSets. By default existing extensions are usable on scalesets, but there // might be cases where a publisher wants to explicitly indicate the extension is // only enabled for CRP VMs but not VMSS. VMScaleSetEnabled *bool }
VirtualMachineExtensionImageProperties - Describes the properties of a Virtual Machine Extension Image.
func (VirtualMachineExtensionImageProperties) MarshalJSON ¶
func (v VirtualMachineExtensionImageProperties) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type VirtualMachineExtensionImageProperties.
func (*VirtualMachineExtensionImageProperties) UnmarshalJSON ¶
func (v *VirtualMachineExtensionImageProperties) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type VirtualMachineExtensionImageProperties.
type VirtualMachineExtensionImagesClient ¶
type VirtualMachineExtensionImagesClient struct {
// contains filtered or unexported fields
}
VirtualMachineExtensionImagesClient contains the methods for the VirtualMachineExtensionImages group. Don't use this type directly, use NewVirtualMachineExtensionImagesClient() instead.
func NewVirtualMachineExtensionImagesClient ¶
func NewVirtualMachineExtensionImagesClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*VirtualMachineExtensionImagesClient, error)
NewVirtualMachineExtensionImagesClient creates a new instance of VirtualMachineExtensionImagesClient 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 (*VirtualMachineExtensionImagesClient) Get ¶
func (client *VirtualMachineExtensionImagesClient) Get(ctx context.Context, location string, publisherName string, typeParam string, version string, options *VirtualMachineExtensionImagesClientGetOptions) (VirtualMachineExtensionImagesClientGetResponse, error)
Get - Gets a virtual machine extension image. If the operation fails it returns an *azcore.ResponseError type.
Generated from API version 2024-03-01
- location - The name of a supported Azure region.
- options - VirtualMachineExtensionImagesClientGetOptions contains the optional parameters for the VirtualMachineExtensionImagesClient.Get method.
Example (VirtualMachineExtensionImageGetMaximumSetGen) ¶
Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/92de53a5f1e0e03c94b40475d2135d97148ed014/specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-03-01/examples/virtualMachineExtensionImageExamples/VirtualMachineExtensionImage_Get_MaximumSet_Gen.json
cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() clientFactory, err := armcompute.NewClientFactory("<subscription-id>", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } res, err := clientFactory.NewVirtualMachineExtensionImagesClient().Get(ctx, "aaaaaaaaaaaaa", "aaaaaaaaaaaaaaaaaaaa", "aaaaaaaaaaaaaaaaaa", "aaaaaaaaaaaaaa", nil) if err != nil { log.Fatalf("failed to finish the request: %v", err) } // You could use response here. We use blank identifier for just demo purposes. _ = res // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. // res.VirtualMachineExtensionImage = armcompute.VirtualMachineExtensionImage{ // Name: to.Ptr("aaaaaaaaaaaaaaa"), // Type: to.Ptr("aaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"), // ID: to.Ptr("aaaaaaaaaaaaaaaaa"), // Location: to.Ptr("aaaaaaaaaaaaa"), // Tags: map[string]*string{ // "key9885": to.Ptr("aaaaaaaaa"), // }, // Properties: &armcompute.VirtualMachineExtensionImageProperties{ // ComputeRole: to.Ptr("aaaaaaaaaaaaaaaaa"), // HandlerSchema: to.Ptr("aaaaaaaaaaaaaaaaaaaaaaaaaaaaa"), // OperatingSystem: to.Ptr("aaaaaaaaaaaaaaaaaa"), // SupportsMultipleExtensions: to.Ptr(true), // VMScaleSetEnabled: to.Ptr(true), // }, // }
Output:
Example (VirtualMachineExtensionImageGetMinimumSetGen) ¶
Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/92de53a5f1e0e03c94b40475d2135d97148ed014/specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-03-01/examples/virtualMachineExtensionImageExamples/VirtualMachineExtensionImage_Get_MinimumSet_Gen.json
cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() clientFactory, err := armcompute.NewClientFactory("<subscription-id>", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } res, err := clientFactory.NewVirtualMachineExtensionImagesClient().Get(ctx, "aaaaaaaaaaaaaa", "aaaaaaaaaaaaaaaaaaaaaaaaaa", "aa", "aaa", nil) if err != nil { log.Fatalf("failed to finish the request: %v", err) } // You could use response here. We use blank identifier for just demo purposes. _ = res // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. // res.VirtualMachineExtensionImage = armcompute.VirtualMachineExtensionImage{ // Name: to.Ptr("aaaaaaaaaaaaaaa"), // ID: to.Ptr("aaaaaaaaaaaaaaaaa"), // Location: to.Ptr("aaaaaaaaaaaaa"), // }
Output:
func (*VirtualMachineExtensionImagesClient) ListTypes ¶
func (client *VirtualMachineExtensionImagesClient) ListTypes(ctx context.Context, location string, publisherName string, options *VirtualMachineExtensionImagesClientListTypesOptions) (VirtualMachineExtensionImagesClientListTypesResponse, error)
ListTypes - Gets a list of virtual machine extension image types. If the operation fails it returns an *azcore.ResponseError type.
Generated from API version 2024-03-01
- location - The name of a supported Azure region.
- options - VirtualMachineExtensionImagesClientListTypesOptions contains the optional parameters for the VirtualMachineExtensionImagesClient.ListTypes method.
Example (VirtualMachineExtensionImageListTypesMaximumSetGen) ¶
Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/92de53a5f1e0e03c94b40475d2135d97148ed014/specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-03-01/examples/virtualMachineExtensionImageExamples/VirtualMachineExtensionImage_ListTypes_MaximumSet_Gen.json
cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() clientFactory, err := armcompute.NewClientFactory("<subscription-id>", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } res, err := clientFactory.NewVirtualMachineExtensionImagesClient().ListTypes(ctx, "aaaaaaaaaaaaaaaaaaaaaaaaaa", "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", nil) if err != nil { log.Fatalf("failed to finish the request: %v", err) } // You could use response here. We use blank identifier for just demo purposes. _ = res // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. // res.VirtualMachineExtensionImageArray = []*armcompute.VirtualMachineExtensionImage{ // { // Name: to.Ptr("aaaaaaaaaaaaaaa"), // Type: to.Ptr("aaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"), // ID: to.Ptr("aaaaaaaaaaaaaaaaa"), // Location: to.Ptr("aaaaaaaaaaaaa"), // Tags: map[string]*string{ // "key9885": to.Ptr("aaaaaaaaa"), // }, // Properties: &armcompute.VirtualMachineExtensionImageProperties{ // ComputeRole: to.Ptr("aaaaaaaaaaaaaaaaa"), // HandlerSchema: to.Ptr("aaaaaaaaaaaaaaaaaaaaaaaaaaaaa"), // OperatingSystem: to.Ptr("aaaaaaaaaaaaaaaaaa"), // SupportsMultipleExtensions: to.Ptr(true), // VMScaleSetEnabled: to.Ptr(true), // }, // }}
Output:
Example (VirtualMachineExtensionImageListTypesMinimumSetGen) ¶
Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/92de53a5f1e0e03c94b40475d2135d97148ed014/specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-03-01/examples/virtualMachineExtensionImageExamples/VirtualMachineExtensionImage_ListTypes_MinimumSet_Gen.json
cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() clientFactory, err := armcompute.NewClientFactory("<subscription-id>", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } res, err := clientFactory.NewVirtualMachineExtensionImagesClient().ListTypes(ctx, "aaaa", "aa", nil) if err != nil { log.Fatalf("failed to finish the request: %v", err) } // You could use response here. We use blank identifier for just demo purposes. _ = res // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. // res.VirtualMachineExtensionImageArray = []*armcompute.VirtualMachineExtensionImage{ // { // Name: to.Ptr("aaaaaaaaaaaaaaa"), // ID: to.Ptr("aaaaaaaaaaaaaaaaa"), // Location: to.Ptr("aaaaaaaaaaaaa"), // }}
Output:
func (*VirtualMachineExtensionImagesClient) ListVersions ¶
func (client *VirtualMachineExtensionImagesClient) ListVersions(ctx context.Context, location string, publisherName string, typeParam string, options *VirtualMachineExtensionImagesClientListVersionsOptions) (VirtualMachineExtensionImagesClientListVersionsResponse, error)
ListVersions - Gets a list of virtual machine extension image versions. If the operation fails it returns an *azcore.ResponseError type.
Generated from API version 2024-03-01
- location - The name of a supported Azure region.
- options - VirtualMachineExtensionImagesClientListVersionsOptions contains the optional parameters for the VirtualMachineExtensionImagesClient.ListVersions method.
Example (VirtualMachineExtensionImageListVersionsMaximumSetGen) ¶
Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/92de53a5f1e0e03c94b40475d2135d97148ed014/specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-03-01/examples/virtualMachineExtensionImageExamples/VirtualMachineExtensionImage_ListVersions_MaximumSet_Gen.json
cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() clientFactory, err := armcompute.NewClientFactory("<subscription-id>", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } res, err := clientFactory.NewVirtualMachineExtensionImagesClient().ListVersions(ctx, "aaaaaaaaaaaaaaaaaaaaaaaaaa", "aaaaaaaaaaaaaaaaaaaa", "aaaaaaaaaaaaaaaaaa", &armcompute.VirtualMachineExtensionImagesClientListVersionsOptions{Filter: to.Ptr("aaaaaaaaaaaaaaaaaaaaaaaaa"), Top: to.Ptr[int32](22), Orderby: to.Ptr("a"), }) if err != nil { log.Fatalf("failed to finish the request: %v", err) } // You could use response here. We use blank identifier for just demo purposes. _ = res // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. // res.VirtualMachineExtensionImageArray = []*armcompute.VirtualMachineExtensionImage{ // { // Name: to.Ptr("aaaaaaaaaaaaaaa"), // Type: to.Ptr("aaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"), // ID: to.Ptr("aaaaaaaaaaaaaaaaa"), // Location: to.Ptr("aaaaaaaaaaaaa"), // Tags: map[string]*string{ // "key9885": to.Ptr("aaaaaaaaa"), // }, // Properties: &armcompute.VirtualMachineExtensionImageProperties{ // ComputeRole: to.Ptr("aaaaaaaaaaaaaaaaa"), // HandlerSchema: to.Ptr("aaaaaaaaaaaaaaaaaaaaaaaaaaaaa"), // OperatingSystem: to.Ptr("aaaaaaaaaaaaaaaaaa"), // SupportsMultipleExtensions: to.Ptr(true), // VMScaleSetEnabled: to.Ptr(true), // }, // }}
Output:
Example (VirtualMachineExtensionImageListVersionsMinimumSetGen) ¶
Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/92de53a5f1e0e03c94b40475d2135d97148ed014/specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-03-01/examples/virtualMachineExtensionImageExamples/VirtualMachineExtensionImage_ListVersions_MinimumSet_Gen.json
cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() clientFactory, err := armcompute.NewClientFactory("<subscription-id>", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } res, err := clientFactory.NewVirtualMachineExtensionImagesClient().ListVersions(ctx, "aaaaaaaaa", "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "aaaa", &armcompute.VirtualMachineExtensionImagesClientListVersionsOptions{Filter: nil, Top: nil, Orderby: nil, }) if err != nil { log.Fatalf("failed to finish the request: %v", err) } // You could use response here. We use blank identifier for just demo purposes. _ = res // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. // res.VirtualMachineExtensionImageArray = []*armcompute.VirtualMachineExtensionImage{ // { // Name: to.Ptr("aaaaaaaaaaaaaaa"), // ID: to.Ptr("aaaaaaaaaaaaaaaaa"), // Location: to.Ptr("aaaaaaaaaaaaa"), // }}
Output:
type VirtualMachineExtensionImagesClientGetOptions ¶
type VirtualMachineExtensionImagesClientGetOptions struct { }
VirtualMachineExtensionImagesClientGetOptions contains the optional parameters for the VirtualMachineExtensionImagesClient.Get method.
type VirtualMachineExtensionImagesClientGetResponse ¶
type VirtualMachineExtensionImagesClientGetResponse struct { // Describes a Virtual Machine Extension Image. VirtualMachineExtensionImage }
VirtualMachineExtensionImagesClientGetResponse contains the response from method VirtualMachineExtensionImagesClient.Get.
type VirtualMachineExtensionImagesClientListTypesOptions ¶
type VirtualMachineExtensionImagesClientListTypesOptions struct { }
VirtualMachineExtensionImagesClientListTypesOptions contains the optional parameters for the VirtualMachineExtensionImagesClient.ListTypes method.
type VirtualMachineExtensionImagesClientListTypesResponse ¶
type VirtualMachineExtensionImagesClientListTypesResponse struct { // Array of VirtualMachineExtensionImage VirtualMachineExtensionImageArray []*VirtualMachineExtensionImage }
VirtualMachineExtensionImagesClientListTypesResponse contains the response from method VirtualMachineExtensionImagesClient.ListTypes.
type VirtualMachineExtensionImagesClientListVersionsOptions ¶
type VirtualMachineExtensionImagesClientListVersionsOptions struct { // The filter to apply on the operation. Filter *string Orderby *string Top *int32 }
VirtualMachineExtensionImagesClientListVersionsOptions contains the optional parameters for the VirtualMachineExtensionImagesClient.ListVersions method.
type VirtualMachineExtensionImagesClientListVersionsResponse ¶
type VirtualMachineExtensionImagesClientListVersionsResponse struct { // Array of VirtualMachineExtensionImage VirtualMachineExtensionImageArray []*VirtualMachineExtensionImage }
VirtualMachineExtensionImagesClientListVersionsResponse contains the response from method VirtualMachineExtensionImagesClient.ListVersions.
type VirtualMachineExtensionInstanceView ¶
type VirtualMachineExtensionInstanceView struct { // The virtual machine extension name. Name *string // The resource status information. Statuses []*InstanceViewStatus // The resource status information. Substatuses []*InstanceViewStatus // Specifies the type of the extension; an example is "CustomScriptExtension". Type *string // Specifies the version of the script handler. TypeHandlerVersion *string }
VirtualMachineExtensionInstanceView - The instance view of a virtual machine extension.
func (VirtualMachineExtensionInstanceView) MarshalJSON ¶
func (v VirtualMachineExtensionInstanceView) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type VirtualMachineExtensionInstanceView.
func (*VirtualMachineExtensionInstanceView) UnmarshalJSON ¶
func (v *VirtualMachineExtensionInstanceView) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type VirtualMachineExtensionInstanceView.
type VirtualMachineExtensionProperties ¶
type VirtualMachineExtensionProperties struct { // Indicates whether the extension should use a newer minor version if one is available at deployment time. Once deployed, // however, the extension will not upgrade minor versions unless redeployed, even // with this property set to true. AutoUpgradeMinorVersion *bool // Indicates whether the extension should be automatically upgraded by the platform if there is a newer version of the extension // available. EnableAutomaticUpgrade *bool // How the extension handler should be forced to update even if the extension configuration has not changed. ForceUpdateTag *string // The virtual machine extension instance view. InstanceView *VirtualMachineExtensionInstanceView // The extension can contain either protectedSettings or protectedSettingsFromKeyVault or no protected settings at all. ProtectedSettings any // The extensions protected settings that are passed by reference, and consumed from key vault ProtectedSettingsFromKeyVault *KeyVaultSecretReference // Collection of extension names after which this extension needs to be provisioned. ProvisionAfterExtensions []*string // The name of the extension handler publisher. Publisher *string // Json formatted public settings for the extension. Settings any // Indicates whether failures stemming from the extension will be suppressed (Operational failures such as not connecting // to the VM will not be suppressed regardless of this value). The default is false. SuppressFailures *bool // Specifies the type of the extension; an example is "CustomScriptExtension". Type *string // Specifies the version of the script handler. TypeHandlerVersion *string // READ-ONLY; The provisioning state, which only appears in the response. ProvisioningState *string }
VirtualMachineExtensionProperties - Describes the properties of a Virtual Machine Extension.
func (VirtualMachineExtensionProperties) MarshalJSON ¶
func (v VirtualMachineExtensionProperties) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type VirtualMachineExtensionProperties.
func (*VirtualMachineExtensionProperties) UnmarshalJSON ¶
func (v *VirtualMachineExtensionProperties) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type VirtualMachineExtensionProperties.
type VirtualMachineExtensionUpdate ¶
type VirtualMachineExtensionUpdate struct { // Describes the properties of a Virtual Machine Extension. Properties *VirtualMachineExtensionUpdateProperties // Resource tags Tags map[string]*string }
VirtualMachineExtensionUpdate - Describes a Virtual Machine Extension.
func (VirtualMachineExtensionUpdate) MarshalJSON ¶
func (v VirtualMachineExtensionUpdate) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type VirtualMachineExtensionUpdate.
func (*VirtualMachineExtensionUpdate) UnmarshalJSON ¶
func (v *VirtualMachineExtensionUpdate) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type VirtualMachineExtensionUpdate.
type VirtualMachineExtensionUpdateProperties ¶
type VirtualMachineExtensionUpdateProperties struct { // Indicates whether the extension should use a newer minor version if one is available at deployment time. Once deployed, // however, the extension will not upgrade minor versions unless redeployed, even // with this property set to true. AutoUpgradeMinorVersion *bool // Indicates whether the extension should be automatically upgraded by the platform if there is a newer version of the extension // available. EnableAutomaticUpgrade *bool // How the extension handler should be forced to update even if the extension configuration has not changed. ForceUpdateTag *string // The extension can contain either protectedSettings or protectedSettingsFromKeyVault or no protected settings at all. ProtectedSettings any // The extensions protected settings that are passed by reference, and consumed from key vault ProtectedSettingsFromKeyVault *KeyVaultSecretReference // The name of the extension handler publisher. Publisher *string // Json formatted public settings for the extension. Settings any // Indicates whether failures stemming from the extension will be suppressed (Operational failures such as not connecting // to the VM will not be suppressed regardless of this value). The default is false. SuppressFailures *bool // Specifies the type of the extension; an example is "CustomScriptExtension". Type *string // Specifies the version of the script handler. TypeHandlerVersion *string }
VirtualMachineExtensionUpdateProperties - Describes the properties of a Virtual Machine Extension.
func (VirtualMachineExtensionUpdateProperties) MarshalJSON ¶
func (v VirtualMachineExtensionUpdateProperties) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type VirtualMachineExtensionUpdateProperties.
func (*VirtualMachineExtensionUpdateProperties) UnmarshalJSON ¶
func (v *VirtualMachineExtensionUpdateProperties) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type VirtualMachineExtensionUpdateProperties.
type VirtualMachineExtensionsClient ¶
type VirtualMachineExtensionsClient struct {
// contains filtered or unexported fields
}
VirtualMachineExtensionsClient contains the methods for the VirtualMachineExtensions group. Don't use this type directly, use NewVirtualMachineExtensionsClient() instead.
func NewVirtualMachineExtensionsClient ¶
func NewVirtualMachineExtensionsClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*VirtualMachineExtensionsClient, error)
NewVirtualMachineExtensionsClient creates a new instance of VirtualMachineExtensionsClient 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 (*VirtualMachineExtensionsClient) BeginCreateOrUpdate ¶
func (client *VirtualMachineExtensionsClient) BeginCreateOrUpdate(ctx context.Context, resourceGroupName string, vmName string, vmExtensionName string, extensionParameters VirtualMachineExtension, options *VirtualMachineExtensionsClientBeginCreateOrUpdateOptions) (*runtime.Poller[VirtualMachineExtensionsClientCreateOrUpdateResponse], error)
BeginCreateOrUpdate - The operation to create or update the extension. If the operation fails it returns an *azcore.ResponseError type.
Generated from API version 2024-03-01
- resourceGroupName - The name of the resource group.
- vmName - The name of the virtual machine where the extension should be created or updated.
- vmExtensionName - The name of the virtual machine extension.
- extensionParameters - Parameters supplied to the Create Virtual Machine Extension operation.
- options - VirtualMachineExtensionsClientBeginCreateOrUpdateOptions contains the optional parameters for the VirtualMachineExtensionsClient.BeginCreateOrUpdate method.
Example (VirtualMachineExtensionCreateOrUpdateMaximumSetGen) ¶
Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/92de53a5f1e0e03c94b40475d2135d97148ed014/specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-03-01/examples/virtualMachineExamples/VirtualMachineExtension_CreateOrUpdate_MaximumSet_Gen.json
cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() clientFactory, err := armcompute.NewClientFactory("<subscription-id>", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } poller, err := clientFactory.NewVirtualMachineExtensionsClient().BeginCreateOrUpdate(ctx, "rgcompute", "aaaaaaaaaaaaaaaaaaaaaaaa", "aaaaaaaaaaaaa", armcompute.VirtualMachineExtension{ Location: to.Ptr("westus"), Tags: map[string]*string{ "key9183": to.Ptr("aa"), }, Properties: &armcompute.VirtualMachineExtensionProperties{ Type: to.Ptr("extType"), AutoUpgradeMinorVersion: to.Ptr(true), EnableAutomaticUpgrade: to.Ptr(true), ForceUpdateTag: to.Ptr("a"), InstanceView: &armcompute.VirtualMachineExtensionInstanceView{ Name: to.Ptr("aaaaaaaaaaaaaaaaa"), Type: to.Ptr("aaaaaaaaa"), Statuses: []*armcompute.InstanceViewStatus{ { Code: to.Ptr("aaaaaaaaaaaaaaaaaaaaaaa"), DisplayStatus: to.Ptr("aaaaaa"), Level: to.Ptr(armcompute.StatusLevelTypesInfo), Message: to.Ptr("a"), Time: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-11-30T12:58:26.522Z"); return t }()), }}, Substatuses: []*armcompute.InstanceViewStatus{ { Code: to.Ptr("aaaaaaaaaaaaaaaaaaaaaaa"), DisplayStatus: to.Ptr("aaaaaa"), Level: to.Ptr(armcompute.StatusLevelTypesInfo), Message: to.Ptr("a"), Time: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-11-30T12:58:26.522Z"); return t }()), }}, TypeHandlerVersion: to.Ptr("aaaaaaaaaaaaaaaaaaaaaaaaaa"), }, ProtectedSettings: map[string]any{}, Publisher: to.Ptr("extPublisher"), Settings: map[string]any{}, SuppressFailures: to.Ptr(true), TypeHandlerVersion: to.Ptr("1.2"), }, }, nil) if err != nil { log.Fatalf("failed to finish the request: %v", err) } res, err := poller.PollUntilDone(ctx, nil) if err != nil { log.Fatalf("failed to pull the result: %v", err) } // You could use response here. We use blank identifier for just demo purposes. _ = res // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. // res.VirtualMachineExtension = armcompute.VirtualMachineExtension{ // Name: to.Ptr("myVMExtension"), // Type: to.Ptr("Microsoft.Compute/virtualMachines/extensions"), // ID: to.Ptr("/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/virtualMachines/myVM/extensions/myVMExtension"), // Location: to.Ptr("westus"), // Tags: map[string]*string{ // "key9183": to.Ptr("aa"), // }, // Properties: &armcompute.VirtualMachineExtensionProperties{ // Type: to.Ptr("extType"), // AutoUpgradeMinorVersion: to.Ptr(true), // EnableAutomaticUpgrade: to.Ptr(true), // ForceUpdateTag: to.Ptr("a"), // InstanceView: &armcompute.VirtualMachineExtensionInstanceView{ // Name: to.Ptr("aaaaaaaaaaaaaaaaa"), // Type: to.Ptr("aaaaaaaaa"), // Statuses: []*armcompute.InstanceViewStatus{ // { // Code: to.Ptr("aaaaaaaaaaaaaaaaaaaaaaa"), // DisplayStatus: to.Ptr("aaaaaa"), // Level: to.Ptr(armcompute.StatusLevelTypesInfo), // Message: to.Ptr("a"), // Time: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-11-30T12:58:26.522Z"); return t}()), // }}, // Substatuses: []*armcompute.InstanceViewStatus{ // { // Code: to.Ptr("aaaaaaaaaaaaaaaaaaaaaaa"), // DisplayStatus: to.Ptr("aaaaaa"), // Level: to.Ptr(armcompute.StatusLevelTypesInfo), // Message: to.Ptr("a"), // Time: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-11-30T12:58:26.522Z"); return t}()), // }}, // TypeHandlerVersion: to.Ptr("aaaaaaaaaaaaaaaaaaaaaaaaaa"), // }, // ProtectedSettings: map[string]any{ // }, // ProvisioningState: to.Ptr("Succeeded"), // Publisher: to.Ptr("extPublisher"), // Settings: map[string]any{ // }, // SuppressFailures: to.Ptr(true), // TypeHandlerVersion: to.Ptr("1.2"), // }, // }
Output:
Example (VirtualMachineExtensionCreateOrUpdateMinimumSetGen) ¶
Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/92de53a5f1e0e03c94b40475d2135d97148ed014/specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-03-01/examples/virtualMachineExamples/VirtualMachineExtension_CreateOrUpdate_MinimumSet_Gen.json
cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() clientFactory, err := armcompute.NewClientFactory("<subscription-id>", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } poller, err := clientFactory.NewVirtualMachineExtensionsClient().BeginCreateOrUpdate(ctx, "rgcompute", "myVM", "myVMExtension", armcompute.VirtualMachineExtension{ Location: to.Ptr("westus"), }, nil) if err != nil { log.Fatalf("failed to finish the request: %v", err) } res, err := poller.PollUntilDone(ctx, nil) if err != nil { log.Fatalf("failed to pull the result: %v", err) } // You could use response here. We use blank identifier for just demo purposes. _ = res // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. // res.VirtualMachineExtension = armcompute.VirtualMachineExtension{ // ID: to.Ptr("/subscriptions/{subscription-id}/resourceGroups/rgcompute/providers/Microsoft.Compute/virtualMachines/myVM/extensions/myVMExtension"), // Location: to.Ptr("westus"), // }
Output:
func (*VirtualMachineExtensionsClient) BeginDelete ¶
func (client *VirtualMachineExtensionsClient) BeginDelete(ctx context.Context, resourceGroupName string, vmName string, vmExtensionName string, options *VirtualMachineExtensionsClientBeginDeleteOptions) (*runtime.Poller[VirtualMachineExtensionsClientDeleteResponse], error)
BeginDelete - The operation to delete the extension. If the operation fails it returns an *azcore.ResponseError type.
Generated from API version 2024-03-01
- resourceGroupName - The name of the resource group.
- vmName - The name of the virtual machine where the extension should be deleted.
- vmExtensionName - The name of the virtual machine extension.
- options - VirtualMachineExtensionsClientBeginDeleteOptions contains the optional parameters for the VirtualMachineExtensionsClient.BeginDelete method.
Example (VirtualMachineExtensionDeleteMaximumSetGen) ¶
Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/92de53a5f1e0e03c94b40475d2135d97148ed014/specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-03-01/examples/virtualMachineExamples/VirtualMachineExtension_Delete_MaximumSet_Gen.json
cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() clientFactory, err := armcompute.NewClientFactory("<subscription-id>", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } poller, err := clientFactory.NewVirtualMachineExtensionsClient().BeginDelete(ctx, "rgcompute", "aaaaaaaaaaaaa", "aaaaaaaaaaaaaaaaaaaaaaaaaaaaa", nil) if err != nil { log.Fatalf("failed to finish the request: %v", err) } _, err = poller.PollUntilDone(ctx, nil) if err != nil { log.Fatalf("failed to pull the result: %v", err) }
Output:
Example (VirtualMachineExtensionDeleteMinimumSetGen) ¶
Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/92de53a5f1e0e03c94b40475d2135d97148ed014/specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-03-01/examples/virtualMachineExamples/VirtualMachineExtension_Delete_MinimumSet_Gen.json
cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() clientFactory, err := armcompute.NewClientFactory("<subscription-id>", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } poller, err := clientFactory.NewVirtualMachineExtensionsClient().BeginDelete(ctx, "rgcompute", "aaaaaaaaaaaaaaaaaaaaaaaaa", "aa", nil) if err != nil { log.Fatalf("failed to finish the request: %v", err) } _, err = poller.PollUntilDone(ctx, nil) if err != nil { log.Fatalf("failed to pull the result: %v", err) }
Output:
func (*VirtualMachineExtensionsClient) BeginUpdate ¶
func (client *VirtualMachineExtensionsClient) BeginUpdate(ctx context.Context, resourceGroupName string, vmName string, vmExtensionName string, extensionParameters VirtualMachineExtensionUpdate, options *VirtualMachineExtensionsClientBeginUpdateOptions) (*runtime.Poller[VirtualMachineExtensionsClientUpdateResponse], error)
BeginUpdate - The operation to update the extension. If the operation fails it returns an *azcore.ResponseError type.
Generated from API version 2024-03-01
- resourceGroupName - The name of the resource group.
- vmName - The name of the virtual machine where the extension should be updated.
- vmExtensionName - The name of the virtual machine extension.
- extensionParameters - Parameters supplied to the Update Virtual Machine Extension operation.
- options - VirtualMachineExtensionsClientBeginUpdateOptions contains the optional parameters for the VirtualMachineExtensionsClient.BeginUpdate method.
Example ¶
Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/92de53a5f1e0e03c94b40475d2135d97148ed014/specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-03-01/examples/virtualMachineExamples/VirtualMachineExtension_Update.json
cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() clientFactory, err := armcompute.NewClientFactory("<subscription-id>", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } poller, err := clientFactory.NewVirtualMachineExtensionsClient().BeginUpdate(ctx, "myResourceGroup", "myVM", "myVMExtension", armcompute.VirtualMachineExtensionUpdate{ Properties: &armcompute.VirtualMachineExtensionUpdateProperties{ Type: to.Ptr("extType"), AutoUpgradeMinorVersion: to.Ptr(true), ProtectedSettingsFromKeyVault: &armcompute.KeyVaultSecretReference{ SecretURL: to.Ptr("https://kvName.vault.azure.net/secrets/secretName/79b88b3a6f5440ffb2e73e44a0db712e"), SourceVault: &armcompute.SubResource{ ID: to.Ptr("/subscriptions/a53f7094-a16c-47af-abe4-b05c05d0d79a/resourceGroups/myResourceGroup/providers/Microsoft.KeyVault/vaults/kvName"), }, }, Publisher: to.Ptr("extPublisher"), Settings: map[string]any{ "UserName": "xyz@microsoft.com", }, SuppressFailures: to.Ptr(true), TypeHandlerVersion: to.Ptr("1.2"), }, }, nil) if err != nil { log.Fatalf("failed to finish the request: %v", err) } res, err := poller.PollUntilDone(ctx, nil) if err != nil { log.Fatalf("failed to pull the result: %v", err) } // You could use response here. We use blank identifier for just demo purposes. _ = res // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. // res.VirtualMachineExtension = armcompute.VirtualMachineExtension{ // Name: to.Ptr("myVMExtension"), // Type: to.Ptr("Microsoft.Compute/virtualMachines/extensions"), // ID: to.Ptr("/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/virtualMachines/myVM/extensions/myVMExtension"), // Location: to.Ptr("westus"), // Properties: &armcompute.VirtualMachineExtensionProperties{ // Type: to.Ptr("extType"), // AutoUpgradeMinorVersion: to.Ptr(true), // ProtectedSettingsFromKeyVault: &armcompute.KeyVaultSecretReference{ // SecretURL: to.Ptr("https://kvName.vault.azure.net/secrets/secretName/79b88b3a6f5440ffb2e73e44a0db712e"), // SourceVault: &armcompute.SubResource{ // ID: to.Ptr("/subscriptions/a53f7094-a16c-47af-abe4-b05c05d0d79a/resourceGroups/myResourceGroup/providers/Microsoft.KeyVault/vaults/kvName"), // }, // }, // ProvisioningState: to.Ptr("Succeeded"), // Publisher: to.Ptr("extPublisher"), // Settings: map[string]any{ // "UserName": "xyz@microsoft.com", // }, // SuppressFailures: to.Ptr(true), // TypeHandlerVersion: to.Ptr("1.2"), // }, // }
Output:
func (*VirtualMachineExtensionsClient) Get ¶
func (client *VirtualMachineExtensionsClient) Get(ctx context.Context, resourceGroupName string, vmName string, vmExtensionName string, options *VirtualMachineExtensionsClientGetOptions) (VirtualMachineExtensionsClientGetResponse, error)
Get - The operation to get the extension. If the operation fails it returns an *azcore.ResponseError type.
Generated from API version 2024-03-01
- resourceGroupName - The name of the resource group.
- vmName - The name of the virtual machine containing the extension.
- vmExtensionName - The name of the virtual machine extension.
- options - VirtualMachineExtensionsClientGetOptions contains the optional parameters for the VirtualMachineExtensionsClient.Get method.
Example (VirtualMachineExtensionGetMaximumSetGen) ¶
Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/92de53a5f1e0e03c94b40475d2135d97148ed014/specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-03-01/examples/virtualMachineExamples/VirtualMachineExtension_Get_MaximumSet_Gen.json
cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() clientFactory, err := armcompute.NewClientFactory("<subscription-id>", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } res, err := clientFactory.NewVirtualMachineExtensionsClient().Get(ctx, "rgcompute", "aaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "aaaaaaa", &armcompute.VirtualMachineExtensionsClientGetOptions{Expand: to.Ptr("aaaaaa")}) if err != nil { log.Fatalf("failed to finish the request: %v", err) } // You could use response here. We use blank identifier for just demo purposes. _ = res // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. // res.VirtualMachineExtension = armcompute.VirtualMachineExtension{ // Name: to.Ptr("myVMExtension"), // Type: to.Ptr("Microsoft.Compute/virtualMachines/extensions"), // ID: to.Ptr("/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/virtualMachines/myVM/extensions/myVMExtension"), // Location: to.Ptr("westus"), // Tags: map[string]*string{ // "key9183": to.Ptr("aa"), // }, // Properties: &armcompute.VirtualMachineExtensionProperties{ // Type: to.Ptr("extType"), // AutoUpgradeMinorVersion: to.Ptr(true), // EnableAutomaticUpgrade: to.Ptr(true), // ForceUpdateTag: to.Ptr("a"), // InstanceView: &armcompute.VirtualMachineExtensionInstanceView{ // Name: to.Ptr("aaaaaaaaaaaaaaaaa"), // Type: to.Ptr("aaaaaaaaa"), // Statuses: []*armcompute.InstanceViewStatus{ // { // Code: to.Ptr("aaaaaaaaaaaaaaaaaaaaaaa"), // DisplayStatus: to.Ptr("aaaaaa"), // Level: to.Ptr(armcompute.StatusLevelTypesInfo), // Message: to.Ptr("a"), // Time: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-11-30T12:58:26.522Z"); return t}()), // }}, // Substatuses: []*armcompute.InstanceViewStatus{ // { // Code: to.Ptr("aaaaaaaaaaaaaaaaaaaaaaa"), // DisplayStatus: to.Ptr("aaaaaa"), // Level: to.Ptr(armcompute.StatusLevelTypesInfo), // Message: to.Ptr("a"), // Time: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-11-30T12:58:26.522Z"); return t}()), // }}, // TypeHandlerVersion: to.Ptr("aaaaaaaaaaaaaaaaaaaaaaaaaa"), // }, // ProtectedSettings: map[string]any{ // }, // ProvisioningState: to.Ptr("Succeeded"), // Publisher: to.Ptr("extPublisher"), // Settings: map[string]any{ // }, // SuppressFailures: to.Ptr(true), // TypeHandlerVersion: to.Ptr("1.2"), // }, // }
Output:
Example (VirtualMachineExtensionGetMinimumSetGen) ¶
Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/92de53a5f1e0e03c94b40475d2135d97148ed014/specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-03-01/examples/virtualMachineExamples/VirtualMachineExtension_Get_MinimumSet_Gen.json
cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() clientFactory, err := armcompute.NewClientFactory("<subscription-id>", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } res, err := clientFactory.NewVirtualMachineExtensionsClient().Get(ctx, "rgcompute", "myVM", "myVMExtension", &armcompute.VirtualMachineExtensionsClientGetOptions{Expand: nil}) if err != nil { log.Fatalf("failed to finish the request: %v", err) } // You could use response here. We use blank identifier for just demo purposes. _ = res // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. // res.VirtualMachineExtension = armcompute.VirtualMachineExtension{ // ID: to.Ptr("/subscriptions/{subscription-id}/resourceGroups/rgcompute/providers/Microsoft.Compute/virtualMachines/myVM/extensions/myVMExtension"), // Location: to.Ptr("westus"), // }
Output:
func (*VirtualMachineExtensionsClient) List ¶
func (client *VirtualMachineExtensionsClient) List(ctx context.Context, resourceGroupName string, vmName string, options *VirtualMachineExtensionsClientListOptions) (VirtualMachineExtensionsClientListResponse, error)
List - The operation to get all extensions of a Virtual Machine. If the operation fails it returns an *azcore.ResponseError type.
Generated from API version 2024-03-01
- resourceGroupName - The name of the resource group.
- vmName - The name of the virtual machine containing the extension.
- options - VirtualMachineExtensionsClientListOptions contains the optional parameters for the VirtualMachineExtensionsClient.List method.
Example (VirtualMachineExtensionListMaximumSetGen) ¶
Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/92de53a5f1e0e03c94b40475d2135d97148ed014/specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-03-01/examples/virtualMachineExamples/VirtualMachineExtension_List_MaximumSet_Gen.json
cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() clientFactory, err := armcompute.NewClientFactory("<subscription-id>", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } res, err := clientFactory.NewVirtualMachineExtensionsClient().List(ctx, "rgcompute", "aaaaaaaaaaaaa", &armcompute.VirtualMachineExtensionsClientListOptions{Expand: to.Ptr("aaaaaaaaaaaaaaaaa")}) if err != nil { log.Fatalf("failed to finish the request: %v", err) } // You could use response here. We use blank identifier for just demo purposes. _ = res // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. // res.VirtualMachineExtensionsListResult = armcompute.VirtualMachineExtensionsListResult{ // Value: []*armcompute.VirtualMachineExtension{ // { // Name: to.Ptr("myVMExtension"), // Type: to.Ptr("Microsoft.Compute/virtualMachines/extensions"), // ID: to.Ptr("/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/virtualMachines/myVM/extensions/myVMExtension"), // Location: to.Ptr("westus"), // Tags: map[string]*string{ // "key9183": to.Ptr("aa"), // }, // Properties: &armcompute.VirtualMachineExtensionProperties{ // Type: to.Ptr("extType"), // AutoUpgradeMinorVersion: to.Ptr(true), // EnableAutomaticUpgrade: to.Ptr(true), // ForceUpdateTag: to.Ptr("a"), // InstanceView: &armcompute.VirtualMachineExtensionInstanceView{ // Name: to.Ptr("aaaaaaaaaaaaaaaaa"), // Type: to.Ptr("aaaaaaaaa"), // Statuses: []*armcompute.InstanceViewStatus{ // { // Code: to.Ptr("aaaaaaaaaaaaaaaaaaaaaaa"), // DisplayStatus: to.Ptr("aaaaaa"), // Level: to.Ptr(armcompute.StatusLevelTypesInfo), // Message: to.Ptr("a"), // Time: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-11-30T12:58:26.522Z"); return t}()), // }}, // Substatuses: []*armcompute.InstanceViewStatus{ // { // Code: to.Ptr("aaaaaaaaaaaaaaaaaaaaaaa"), // DisplayStatus: to.Ptr("aaaaaa"), // Level: to.Ptr(armcompute.StatusLevelTypesInfo), // Message: to.Ptr("a"), // Time: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-11-30T12:58:26.522Z"); return t}()), // }}, // TypeHandlerVersion: to.Ptr("aaaaaaaaaaaaaaaaaaaaaaaaaa"), // }, // ProtectedSettings: map[string]any{ // }, // ProvisioningState: to.Ptr("Succeeded"), // Publisher: to.Ptr("extPublisher"), // Settings: map[string]any{ // }, // SuppressFailures: to.Ptr(true), // TypeHandlerVersion: to.Ptr("1.2"), // }, // }}, // }
Output:
Example (VirtualMachineExtensionListMinimumSetGen) ¶
Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/92de53a5f1e0e03c94b40475d2135d97148ed014/specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-03-01/examples/virtualMachineExamples/VirtualMachineExtension_List_MinimumSet_Gen.json
cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() clientFactory, err := armcompute.NewClientFactory("<subscription-id>", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } res, err := clientFactory.NewVirtualMachineExtensionsClient().List(ctx, "rgcompute", "aaaaaaaaaaaaaaaaaaaaaaaaaaa", &armcompute.VirtualMachineExtensionsClientListOptions{Expand: nil}) if err != nil { log.Fatalf("failed to finish the request: %v", err) } // You could use response here. We use blank identifier for just demo purposes. _ = res // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. // res.VirtualMachineExtensionsListResult = armcompute.VirtualMachineExtensionsListResult{ // }
Output:
type VirtualMachineExtensionsClientBeginCreateOrUpdateOptions ¶
type VirtualMachineExtensionsClientBeginCreateOrUpdateOptions struct { // Resumes the LRO from the provided token. ResumeToken string }
VirtualMachineExtensionsClientBeginCreateOrUpdateOptions contains the optional parameters for the VirtualMachineExtensionsClient.BeginCreateOrUpdate method.
type VirtualMachineExtensionsClientBeginDeleteOptions ¶
type VirtualMachineExtensionsClientBeginDeleteOptions struct { // Resumes the LRO from the provided token. ResumeToken string }
VirtualMachineExtensionsClientBeginDeleteOptions contains the optional parameters for the VirtualMachineExtensionsClient.BeginDelete method.
type VirtualMachineExtensionsClientBeginUpdateOptions ¶
type VirtualMachineExtensionsClientBeginUpdateOptions struct { // Resumes the LRO from the provided token. ResumeToken string }
VirtualMachineExtensionsClientBeginUpdateOptions contains the optional parameters for the VirtualMachineExtensionsClient.BeginUpdate method.
type VirtualMachineExtensionsClientCreateOrUpdateResponse ¶
type VirtualMachineExtensionsClientCreateOrUpdateResponse struct { // Describes a Virtual Machine Extension. VirtualMachineExtension }
VirtualMachineExtensionsClientCreateOrUpdateResponse contains the response from method VirtualMachineExtensionsClient.BeginCreateOrUpdate.
type VirtualMachineExtensionsClientDeleteResponse ¶
type VirtualMachineExtensionsClientDeleteResponse struct { }
VirtualMachineExtensionsClientDeleteResponse contains the response from method VirtualMachineExtensionsClient.BeginDelete.
type VirtualMachineExtensionsClientGetOptions ¶
type VirtualMachineExtensionsClientGetOptions struct { // The expand expression to apply on the operation. Expand *string }
VirtualMachineExtensionsClientGetOptions contains the optional parameters for the VirtualMachineExtensionsClient.Get method.
type VirtualMachineExtensionsClientGetResponse ¶
type VirtualMachineExtensionsClientGetResponse struct { // Describes a Virtual Machine Extension. VirtualMachineExtension }
VirtualMachineExtensionsClientGetResponse contains the response from method VirtualMachineExtensionsClient.Get.
type VirtualMachineExtensionsClientListOptions ¶
type VirtualMachineExtensionsClientListOptions struct { // The expand expression to apply on the operation. Expand *string }
VirtualMachineExtensionsClientListOptions contains the optional parameters for the VirtualMachineExtensionsClient.List method.
type VirtualMachineExtensionsClientListResponse ¶
type VirtualMachineExtensionsClientListResponse struct { // The List Extension operation response VirtualMachineExtensionsListResult }
VirtualMachineExtensionsClientListResponse contains the response from method VirtualMachineExtensionsClient.List.
type VirtualMachineExtensionsClientUpdateResponse ¶
type VirtualMachineExtensionsClientUpdateResponse struct { // Describes a Virtual Machine Extension. VirtualMachineExtension }
VirtualMachineExtensionsClientUpdateResponse contains the response from method VirtualMachineExtensionsClient.BeginUpdate.
type VirtualMachineExtensionsListResult ¶
type VirtualMachineExtensionsListResult struct { // The list of extensions Value []*VirtualMachineExtension }
VirtualMachineExtensionsListResult - The List Extension operation response
func (VirtualMachineExtensionsListResult) MarshalJSON ¶
func (v VirtualMachineExtensionsListResult) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type VirtualMachineExtensionsListResult.
func (*VirtualMachineExtensionsListResult) UnmarshalJSON ¶
func (v *VirtualMachineExtensionsListResult) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type VirtualMachineExtensionsListResult.
type VirtualMachineHealthStatus ¶
type VirtualMachineHealthStatus struct { // READ-ONLY; The health status information for the VM. Status *InstanceViewStatus }
VirtualMachineHealthStatus - The health status of the VM.
func (VirtualMachineHealthStatus) MarshalJSON ¶
func (v VirtualMachineHealthStatus) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type VirtualMachineHealthStatus.
func (*VirtualMachineHealthStatus) UnmarshalJSON ¶
func (v *VirtualMachineHealthStatus) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type VirtualMachineHealthStatus.
type VirtualMachineIPTag ¶
type VirtualMachineIPTag struct { // IP tag type. Example: FirstPartyUsage. IPTagType *string // IP tag associated with the public IP. Example: SQL, Storage etc. Tag *string }
VirtualMachineIPTag - Contains the IP tag associated with the public IP address.
func (VirtualMachineIPTag) MarshalJSON ¶
func (v VirtualMachineIPTag) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type VirtualMachineIPTag.
func (*VirtualMachineIPTag) UnmarshalJSON ¶
func (v *VirtualMachineIPTag) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type VirtualMachineIPTag.
type VirtualMachineIdentity ¶
type VirtualMachineIdentity struct { // The type of identity used for the virtual machine. The type 'SystemAssigned, UserAssigned' includes both an implicitly // created identity and a set of user assigned identities. The type 'None' will // remove any identities from the virtual machine. Type *ResourceIdentityType // The list of user identities associated with the Virtual Machine. The user identity dictionary key references will be ARM // resource ids in the form: // '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{identityName}'. UserAssignedIdentities map[string]*UserAssignedIdentitiesValue // READ-ONLY; The principal id of virtual machine identity. This property will only be provided for a system assigned identity. PrincipalID *string // READ-ONLY; The tenant id associated with the virtual machine. This property will only be provided for a system assigned // identity. TenantID *string }
VirtualMachineIdentity - Identity for the virtual machine.
func (VirtualMachineIdentity) MarshalJSON ¶
func (v VirtualMachineIdentity) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type VirtualMachineIdentity.
func (*VirtualMachineIdentity) UnmarshalJSON ¶
func (v *VirtualMachineIdentity) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type VirtualMachineIdentity.
type VirtualMachineImage ¶
type VirtualMachineImage struct { // REQUIRED; The supported Azure location of the resource. Location *string // REQUIRED; The name of the resource. Name *string // The extended location of the Virtual Machine. ExtendedLocation *ExtendedLocation // Resource Id ID *string // Describes the properties of a Virtual Machine Image. Properties *VirtualMachineImageProperties // Specifies the tags that are assigned to the virtual machine. For more information about using tags, see Using tags to organize // your Azure resources // [https://docs.microsoft.com/azure/azure-resource-manager/resource-group-using-tags.md]. Tags map[string]*string }
VirtualMachineImage - Describes a Virtual Machine Image.
func (VirtualMachineImage) MarshalJSON ¶
func (v VirtualMachineImage) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type VirtualMachineImage.
func (*VirtualMachineImage) UnmarshalJSON ¶
func (v *VirtualMachineImage) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type VirtualMachineImage.
type VirtualMachineImageFeature ¶
type VirtualMachineImageFeature struct { // The name of the feature. Name *string // The corresponding value for the feature. Value *string }
VirtualMachineImageFeature - Specifies additional capabilities supported by the image
func (VirtualMachineImageFeature) MarshalJSON ¶
func (v VirtualMachineImageFeature) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type VirtualMachineImageFeature.
func (*VirtualMachineImageFeature) UnmarshalJSON ¶
func (v *VirtualMachineImageFeature) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type VirtualMachineImageFeature.
type VirtualMachineImageProperties ¶
type VirtualMachineImageProperties struct { // Specifies the Architecture Type Architecture *ArchitectureTypes // Describes automatic OS upgrade properties on the image. AutomaticOSUpgradeProperties *AutomaticOSUpgradeProperties DataDiskImages []*DataDiskImage // Specifies disallowed configuration for the VirtualMachine created from the image Disallowed *DisallowedConfiguration Features []*VirtualMachineImageFeature // Specifies the HyperVGeneration Type HyperVGeneration *HyperVGenerationTypes // Describes image deprecation status properties on the image. ImageDeprecationStatus *ImageDeprecationStatus // Contains the os disk image information. OSDiskImage *OSDiskImage // Used for establishing the purchase context of any 3rd Party artifact through MarketPlace. Plan *PurchasePlan }
VirtualMachineImageProperties - Describes the properties of a Virtual Machine Image.
func (VirtualMachineImageProperties) MarshalJSON ¶
func (v VirtualMachineImageProperties) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type VirtualMachineImageProperties.
func (*VirtualMachineImageProperties) UnmarshalJSON ¶
func (v *VirtualMachineImageProperties) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type VirtualMachineImageProperties.
type VirtualMachineImageResource ¶
type VirtualMachineImageResource struct { // REQUIRED; The supported Azure location of the resource. Location *string // REQUIRED; The name of the resource. Name *string // The extended location of the Virtual Machine. ExtendedLocation *ExtendedLocation // Resource Id ID *string // Specifies the tags that are assigned to the virtual machine. For more information about using tags, see Using tags to organize // your Azure resources // [https://docs.microsoft.com/azure/azure-resource-manager/resource-group-using-tags.md]. Tags map[string]*string }
VirtualMachineImageResource - Virtual machine image resource information.
func (VirtualMachineImageResource) MarshalJSON ¶
func (v VirtualMachineImageResource) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type VirtualMachineImageResource.
func (*VirtualMachineImageResource) UnmarshalJSON ¶
func (v *VirtualMachineImageResource) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type VirtualMachineImageResource.
type VirtualMachineImagesClient ¶
type VirtualMachineImagesClient struct {
// contains filtered or unexported fields
}
VirtualMachineImagesClient contains the methods for the VirtualMachineImages group. Don't use this type directly, use NewVirtualMachineImagesClient() instead.
func NewVirtualMachineImagesClient ¶
func NewVirtualMachineImagesClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*VirtualMachineImagesClient, error)
NewVirtualMachineImagesClient creates a new instance of VirtualMachineImagesClient 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 (*VirtualMachineImagesClient) Get ¶
func (client *VirtualMachineImagesClient) Get(ctx context.Context, location string, publisherName string, offer string, skus string, version string, options *VirtualMachineImagesClientGetOptions) (VirtualMachineImagesClientGetResponse, error)
Get - Gets a virtual machine image. If the operation fails it returns an *azcore.ResponseError type.
Generated from API version 2024-03-01
- location - The name of a supported Azure region.
- publisherName - A valid image publisher.
- offer - A valid image publisher offer.
- skus - A valid image SKU.
- version - A valid image SKU version.
- options - VirtualMachineImagesClientGetOptions contains the optional parameters for the VirtualMachineImagesClient.Get method.
Example (VirtualMachineImageGetMaximumSetGen) ¶
Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/92de53a5f1e0e03c94b40475d2135d97148ed014/specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-03-01/examples/virtualMachineImageExamples/VirtualMachineImage_Get_MaximumSet_Gen.json
cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() clientFactory, err := armcompute.NewClientFactory("<subscription-id>", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } res, err := clientFactory.NewVirtualMachineImagesClient().Get(ctx, "aaaaaa", "aaa", "aaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "aaaaaaaaaaaaaaaaaaaaaaaaaaa", "aaaaaaaaaaaaaaaaaaa", nil) if err != nil { log.Fatalf("failed to finish the request: %v", err) } // You could use response here. We use blank identifier for just demo purposes. _ = res // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. // res.VirtualMachineImage = armcompute.VirtualMachineImage{ // ID: to.Ptr("aaaaaaaaaaa"), // Name: to.Ptr("aaaaaaaaa"), // ExtendedLocation: &armcompute.ExtendedLocation{ // Name: to.Ptr("aaaaaaaaaaaaaaaaaaaaa"), // Type: to.Ptr(armcompute.ExtendedLocationTypesEdgeZone), // }, // Location: to.Ptr("aaaaa"), // Tags: map[string]*string{ // "key6817": to.Ptr("aaaaaaaaaaaaaaaaaaaaaaaaaaaaa"), // }, // Properties: &armcompute.VirtualMachineImageProperties{ // AutomaticOSUpgradeProperties: &armcompute.AutomaticOSUpgradeProperties{ // AutomaticOSUpgradeSupported: to.Ptr(true), // }, // DataDiskImages: []*armcompute.DataDiskImage{ // { // Lun: to.Ptr[int32](17), // }}, // Disallowed: &armcompute.DisallowedConfiguration{ // VMDiskType: to.Ptr(armcompute.VMDiskTypesNone), // }, // Features: []*armcompute.VirtualMachineImageFeature{ // { // Name: to.Ptr("aaaaaaaaaaaaaaaaaaaaa"), // Value: to.Ptr("aaaaaaaaaaaaaaaaaaaa"), // }}, // HyperVGeneration: to.Ptr(armcompute.HyperVGenerationTypesV1), // ImageDeprecationStatus: &armcompute.ImageDeprecationStatus{ // AlternativeOption: &armcompute.AlternativeOption{ // Type: to.Ptr(armcompute.AlternativeTypeOffer), // Value: to.Ptr("aaaaaaa"), // }, // ImageState: to.Ptr(armcompute.ImageStateScheduledForDeprecation), // ScheduledDeprecationTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-01-13T00:00:00.000Z"); return t}()), // }, // OSDiskImage: &armcompute.OSDiskImage{ // OperatingSystem: to.Ptr(armcompute.OperatingSystemTypesWindows), // }, // Plan: &armcompute.PurchasePlan{ // Name: to.Ptr("aaaaaaaaa"), // Product: to.Ptr("aaaaaaaaaaaaaa"), // Publisher: to.Ptr("aaaaaaaaaaaaaaaaaaa"), // }, // }, // }
Output:
Example (VirtualMachineImageGetMinimumSetGen) ¶
Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/92de53a5f1e0e03c94b40475d2135d97148ed014/specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-03-01/examples/virtualMachineImageExamples/VirtualMachineImage_Get_MinimumSet_Gen.json
cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() clientFactory, err := armcompute.NewClientFactory("<subscription-id>", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } res, err := clientFactory.NewVirtualMachineImagesClient().Get(ctx, "aaaaaaaaaaaa", "aaaaaaaaaaa", "aa", "aaaaaaaaa", "aaaaaaaaaaaaaaaaaaaaaaaaaaaaa", nil) if err != nil { log.Fatalf("failed to finish the request: %v", err) } // You could use response here. We use blank identifier for just demo purposes. _ = res // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. // res.VirtualMachineImage = armcompute.VirtualMachineImage{ // ID: to.Ptr("aaaaaaaaaaa"), // Name: to.Ptr("aaaaaaaaa"), // Location: to.Ptr("aaaaa"), // }
Output:
func (*VirtualMachineImagesClient) List ¶
func (client *VirtualMachineImagesClient) List(ctx context.Context, location string, publisherName string, offer string, skus string, options *VirtualMachineImagesClientListOptions) (VirtualMachineImagesClientListResponse, error)
List - Gets a list of all virtual machine image versions for the specified location, publisher, offer, and SKU. If the operation fails it returns an *azcore.ResponseError type.
Generated from API version 2024-03-01
- location - The name of a supported Azure region.
- publisherName - A valid image publisher.
- offer - A valid image publisher offer.
- skus - A valid image SKU.
- options - VirtualMachineImagesClientListOptions contains the optional parameters for the VirtualMachineImagesClient.List method.
Example (VirtualMachineImageListMaximumSetGen) ¶
Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/92de53a5f1e0e03c94b40475d2135d97148ed014/specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-03-01/examples/virtualMachineImageExamples/VirtualMachineImage_List_MaximumSet_Gen.json
cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() clientFactory, err := armcompute.NewClientFactory("<subscription-id>", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } res, err := clientFactory.NewVirtualMachineImagesClient().List(ctx, "aaaaaaaaaaaaaaa", "aaaaaa", "aaaaaaaaaaaaaaaa", "aaaaaaaaaaaaaaaaaaaaaaa", &armcompute.VirtualMachineImagesClientListOptions{Expand: to.Ptr("aaaaaaaaaaaaaaaaaaaaaaaa"), Top: to.Ptr[int32](18), Orderby: to.Ptr("aa"), }) if err != nil { log.Fatalf("failed to finish the request: %v", err) } // You could use response here. We use blank identifier for just demo purposes. _ = res // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. // res.VirtualMachineImageResourceArray = []*armcompute.VirtualMachineImageResource{ // { // ID: to.Ptr("aaaaaaaaaaa"), // Name: to.Ptr("aaaaaaaa"), // ExtendedLocation: &armcompute.ExtendedLocation{ // Name: to.Ptr("aaaaaaaaaaaaaaaaaaaaa"), // Type: to.Ptr(armcompute.ExtendedLocationTypesEdgeZone), // }, // Location: to.Ptr("aaaaaaaaaaaaaaaaaa"), // Tags: map[string]*string{ // "key7868": to.Ptr("aaaaa"), // }, // }}
Output:
Example (VirtualMachineImageListMinimumSetGen) ¶
Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/92de53a5f1e0e03c94b40475d2135d97148ed014/specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-03-01/examples/virtualMachineImageExamples/VirtualMachineImage_List_MinimumSet_Gen.json
cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() clientFactory, err := armcompute.NewClientFactory("<subscription-id>", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } res, err := clientFactory.NewVirtualMachineImagesClient().List(ctx, "aaaaaaa", "aaaaaaaaaaa", "aaaaaaaaaa", "aaaaaa", &armcompute.VirtualMachineImagesClientListOptions{Expand: nil, Top: nil, Orderby: nil, }) if err != nil { log.Fatalf("failed to finish the request: %v", err) } // You could use response here. We use blank identifier for just demo purposes. _ = res // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. // res.VirtualMachineImageResourceArray = []*armcompute.VirtualMachineImageResource{ // { // ID: to.Ptr("aaaaaaaaaaa"), // Name: to.Ptr("aaaaaaaa"), // Location: to.Ptr("aaaaaaaaaaaaaaaaaa"), // }}
Output:
func (*VirtualMachineImagesClient) ListByEdgeZone ¶
func (client *VirtualMachineImagesClient) ListByEdgeZone(ctx context.Context, location string, edgeZone string, options *VirtualMachineImagesClientListByEdgeZoneOptions) (VirtualMachineImagesClientListByEdgeZoneResponse, error)
ListByEdgeZone - Gets a list of all virtual machine image versions for the specified edge zone If the operation fails it returns an *azcore.ResponseError type.
Generated from API version 2024-03-01
- location - The name of a supported Azure region.
- edgeZone - The name of the edge zone.
- options - VirtualMachineImagesClientListByEdgeZoneOptions contains the optional parameters for the VirtualMachineImagesClient.ListByEdgeZone method.
Example (VirtualMachineImagesEdgeZoneListByEdgeZoneMaximumSetGen) ¶
Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/92de53a5f1e0e03c94b40475d2135d97148ed014/specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-03-01/examples/virtualMachineImageExamples/VirtualMachineImagesEdgeZone_ListByEdgeZone_MaximumSet_Gen.json
cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() clientFactory, err := armcompute.NewClientFactory("<subscription-id>", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } res, err := clientFactory.NewVirtualMachineImagesClient().ListByEdgeZone(ctx, "WestUS", "microsoftlosangeles1", nil) if err != nil { log.Fatalf("failed to finish the request: %v", err) } // You could use response here. We use blank identifier for just demo purposes. _ = res // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. // res.VMImagesInEdgeZoneListResult = armcompute.VMImagesInEdgeZoneListResult{ // Value: []*armcompute.VirtualMachineImageResource{ // { // ID: to.Ptr("/Subscriptions/5ece5940-d962-4dad-a98f-ca9ac0f021a5/Providers/Microsoft.Compute/Locations/westus/Publishers/CANONICAL/ArtifactTypes/VMImage/Offers/UBUNTUSERVER/Skus/18_04-LTS-GEN2/Versions/18.04.202107200"), // Name: to.Ptr("18.04.202107200"), // ExtendedLocation: &armcompute.ExtendedLocation{ // Name: to.Ptr("microsoftlosangeles1"), // Type: to.Ptr(armcompute.ExtendedLocationTypesEdgeZone), // }, // Location: to.Ptr("WestUS"), // }}, // }
Output:
Example (VirtualMachineImagesEdgeZoneListByEdgeZoneMinimumSetGen) ¶
Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/92de53a5f1e0e03c94b40475d2135d97148ed014/specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-03-01/examples/virtualMachineImageExamples/VirtualMachineImagesEdgeZone_ListByEdgeZone_MinimumSet_Gen.json
cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() clientFactory, err := armcompute.NewClientFactory("<subscription-id>", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } res, err := clientFactory.NewVirtualMachineImagesClient().ListByEdgeZone(ctx, "WestUS", "microsoftlosangeles1", nil) if err != nil { log.Fatalf("failed to finish the request: %v", err) } // You could use response here. We use blank identifier for just demo purposes. _ = res // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. // res.VMImagesInEdgeZoneListResult = armcompute.VMImagesInEdgeZoneListResult{ // Value: []*armcompute.VirtualMachineImageResource{ // }, // }
Output:
func (*VirtualMachineImagesClient) ListOffers ¶
func (client *VirtualMachineImagesClient) ListOffers(ctx context.Context, location string, publisherName string, options *VirtualMachineImagesClientListOffersOptions) (VirtualMachineImagesClientListOffersResponse, error)
ListOffers - Gets a list of virtual machine image offers for the specified location and publisher. If the operation fails it returns an *azcore.ResponseError type.
Generated from API version 2024-03-01
- location - The name of a supported Azure region.
- publisherName - A valid image publisher.
- options - VirtualMachineImagesClientListOffersOptions contains the optional parameters for the VirtualMachineImagesClient.ListOffers method.
Example (VirtualMachineImageListOffersMaximumSetGen) ¶
Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/92de53a5f1e0e03c94b40475d2135d97148ed014/specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-03-01/examples/virtualMachineImageExamples/VirtualMachineImage_ListOffers_MaximumSet_Gen.json
cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() clientFactory, err := armcompute.NewClientFactory("<subscription-id>", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } res, err := clientFactory.NewVirtualMachineImagesClient().ListOffers(ctx, "aaaaaaa", "aaaaaaaa", nil) if err != nil { log.Fatalf("failed to finish the request: %v", err) } // You could use response here. We use blank identifier for just demo purposes. _ = res // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. // res.VirtualMachineImageResourceArray = []*armcompute.VirtualMachineImageResource{ // { // ID: to.Ptr("aaaaaaaaaaa"), // Name: to.Ptr("aaaaaaaa"), // ExtendedLocation: &armcompute.ExtendedLocation{ // Name: to.Ptr("aaaaaaaaaaaaaaaaaaaaa"), // Type: to.Ptr(armcompute.ExtendedLocationTypesEdgeZone), // }, // Location: to.Ptr("aaaaaaaaaaaaaaaaaa"), // Tags: map[string]*string{ // "key7868": to.Ptr("aaaaa"), // }, // }}
Output:
Example (VirtualMachineImageListOffersMinimumSetGen) ¶
Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/92de53a5f1e0e03c94b40475d2135d97148ed014/specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-03-01/examples/virtualMachineImageExamples/VirtualMachineImage_ListOffers_MinimumSet_Gen.json
cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() clientFactory, err := armcompute.NewClientFactory("<subscription-id>", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } res, err := clientFactory.NewVirtualMachineImagesClient().ListOffers(ctx, "aaaaaaaaaaaaaaaaa", "aaaaaaaaaaaaaaaaaaaaaaaaaaaa", nil) if err != nil { log.Fatalf("failed to finish the request: %v", err) } // You could use response here. We use blank identifier for just demo purposes. _ = res // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. // res.VirtualMachineImageResourceArray = []*armcompute.VirtualMachineImageResource{ // { // ID: to.Ptr("aaaaaaaaaaa"), // Name: to.Ptr("aaaaaaaa"), // Location: to.Ptr("aaaaaaaaaaaaaaaaaa"), // }}
Output:
func (*VirtualMachineImagesClient) ListPublishers ¶
func (client *VirtualMachineImagesClient) ListPublishers(ctx context.Context, location string, options *VirtualMachineImagesClientListPublishersOptions) (VirtualMachineImagesClientListPublishersResponse, error)
ListPublishers - Gets a list of virtual machine image publishers for the specified Azure location. If the operation fails it returns an *azcore.ResponseError type.
Generated from API version 2024-03-01
- location - The name of a supported Azure region.
- options - VirtualMachineImagesClientListPublishersOptions contains the optional parameters for the VirtualMachineImagesClient.ListPublishers method.
Example (VirtualMachineImageListPublishersMaximumSetGen) ¶
Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/92de53a5f1e0e03c94b40475d2135d97148ed014/specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-03-01/examples/virtualMachineImageExamples/VirtualMachineImage_ListPublishers_MaximumSet_Gen.json
cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() clientFactory, err := armcompute.NewClientFactory("<subscription-id>", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } res, err := clientFactory.NewVirtualMachineImagesClient().ListPublishers(ctx, "aaaaa", nil) if err != nil { log.Fatalf("failed to finish the request: %v", err) } // You could use response here. We use blank identifier for just demo purposes. _ = res // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. // res.VirtualMachineImageResourceArray = []*armcompute.VirtualMachineImageResource{ // { // ID: to.Ptr("aaaaaaaaaaa"), // Name: to.Ptr("aaaaaaaa"), // ExtendedLocation: &armcompute.ExtendedLocation{ // Name: to.Ptr("aaaaaaaaaaaaaaaaaaaaa"), // Type: to.Ptr(armcompute.ExtendedLocationTypesEdgeZone), // }, // Location: to.Ptr("aaaaaaaaaaaaaaaaaa"), // Tags: map[string]*string{ // "key7868": to.Ptr("aaaaa"), // }, // }}
Output:
Example (VirtualMachineImageListPublishersMinimumSetGen) ¶
Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/92de53a5f1e0e03c94b40475d2135d97148ed014/specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-03-01/examples/virtualMachineImageExamples/VirtualMachineImage_ListPublishers_MinimumSet_Gen.json
cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() clientFactory, err := armcompute.NewClientFactory("<subscription-id>", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } res, err := clientFactory.NewVirtualMachineImagesClient().ListPublishers(ctx, "aaaaaaaaaaaaaaaaaaaaaaaaaaa", nil) if err != nil { log.Fatalf("failed to finish the request: %v", err) } // You could use response here. We use blank identifier for just demo purposes. _ = res // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. // res.VirtualMachineImageResourceArray = []*armcompute.VirtualMachineImageResource{ // { // ID: to.Ptr("aaaaaaaaaaa"), // Name: to.Ptr("aaaaaaaa"), // Location: to.Ptr("aaaaaaaaaaaaaaaaaa"), // }}
Output:
func (*VirtualMachineImagesClient) ListSKUs ¶
func (client *VirtualMachineImagesClient) ListSKUs(ctx context.Context, location string, publisherName string, offer string, options *VirtualMachineImagesClientListSKUsOptions) (VirtualMachineImagesClientListSKUsResponse, error)
ListSKUs - Gets a list of virtual machine image SKUs for the specified location, publisher, and offer. If the operation fails it returns an *azcore.ResponseError type.
Generated from API version 2024-03-01
- location - The name of a supported Azure region.
- publisherName - A valid image publisher.
- offer - A valid image publisher offer.
- options - VirtualMachineImagesClientListSKUsOptions contains the optional parameters for the VirtualMachineImagesClient.ListSKUs method.
Example (VirtualMachineImageListSkusMaximumSetGen) ¶
Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/92de53a5f1e0e03c94b40475d2135d97148ed014/specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-03-01/examples/virtualMachineImageExamples/VirtualMachineImage_ListSkus_MaximumSet_Gen.json
cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() clientFactory, err := armcompute.NewClientFactory("<subscription-id>", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } res, err := clientFactory.NewVirtualMachineImagesClient().ListSKUs(ctx, "aaaa", "aaaaaaaaaaaaaaaaaaaaaaaaaaaa", "aaaaaaa", nil) if err != nil { log.Fatalf("failed to finish the request: %v", err) } // You could use response here. We use blank identifier for just demo purposes. _ = res // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. // res.VirtualMachineImageResourceArray = []*armcompute.VirtualMachineImageResource{ // { // ID: to.Ptr("aaaaaaaaaaa"), // Name: to.Ptr("aaaaaaaa"), // ExtendedLocation: &armcompute.ExtendedLocation{ // Name: to.Ptr("aaaaaaaaaaaaaaaaaaaaa"), // Type: to.Ptr(armcompute.ExtendedLocationTypesEdgeZone), // }, // Location: to.Ptr("aaaaaaaaaaaaaaaaaa"), // Tags: map[string]*string{ // "key7868": to.Ptr("aaaaa"), // }, // }}
Output:
Example (VirtualMachineImageListSkusMinimumSetGen) ¶
Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/92de53a5f1e0e03c94b40475d2135d97148ed014/specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-03-01/examples/virtualMachineImageExamples/VirtualMachineImage_ListSkus_MinimumSet_Gen.json
cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() clientFactory, err := armcompute.NewClientFactory("<subscription-id>", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } res, err := clientFactory.NewVirtualMachineImagesClient().ListSKUs(ctx, "aaaa", "aaaaaaaaaaaaa", "aaaaaaa", nil) if err != nil { log.Fatalf("failed to finish the request: %v", err) } // You could use response here. We use blank identifier for just demo purposes. _ = res // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. // res.VirtualMachineImageResourceArray = []*armcompute.VirtualMachineImageResource{ // { // ID: to.Ptr("aaaaaaaaaaa"), // Name: to.Ptr("aaaaaaaa"), // Location: to.Ptr("aaaaaaaaaaaaaaaaaa"), // }}
Output:
type VirtualMachineImagesClientGetOptions ¶
type VirtualMachineImagesClientGetOptions struct { }
VirtualMachineImagesClientGetOptions contains the optional parameters for the VirtualMachineImagesClient.Get method.
type VirtualMachineImagesClientGetResponse ¶
type VirtualMachineImagesClientGetResponse struct { // Describes a Virtual Machine Image. VirtualMachineImage }
VirtualMachineImagesClientGetResponse contains the response from method VirtualMachineImagesClient.Get.
type VirtualMachineImagesClientListByEdgeZoneOptions ¶
type VirtualMachineImagesClientListByEdgeZoneOptions struct { }
VirtualMachineImagesClientListByEdgeZoneOptions contains the optional parameters for the VirtualMachineImagesClient.ListByEdgeZone method.
type VirtualMachineImagesClientListByEdgeZoneResponse ¶
type VirtualMachineImagesClientListByEdgeZoneResponse struct { // The List VmImages in EdgeZone operation response. VMImagesInEdgeZoneListResult }
VirtualMachineImagesClientListByEdgeZoneResponse contains the response from method VirtualMachineImagesClient.ListByEdgeZone.
type VirtualMachineImagesClientListOffersOptions ¶
type VirtualMachineImagesClientListOffersOptions struct { }
VirtualMachineImagesClientListOffersOptions contains the optional parameters for the VirtualMachineImagesClient.ListOffers method.
type VirtualMachineImagesClientListOffersResponse ¶
type VirtualMachineImagesClientListOffersResponse struct { // Array of VirtualMachineImageResource VirtualMachineImageResourceArray []*VirtualMachineImageResource }
VirtualMachineImagesClientListOffersResponse contains the response from method VirtualMachineImagesClient.ListOffers.
type VirtualMachineImagesClientListOptions ¶
type VirtualMachineImagesClientListOptions struct { // The expand expression to apply on the operation. Expand *string Orderby *string Top *int32 }
VirtualMachineImagesClientListOptions contains the optional parameters for the VirtualMachineImagesClient.List method.
type VirtualMachineImagesClientListPublishersOptions ¶
type VirtualMachineImagesClientListPublishersOptions struct { }
VirtualMachineImagesClientListPublishersOptions contains the optional parameters for the VirtualMachineImagesClient.ListPublishers method.
type VirtualMachineImagesClientListPublishersResponse ¶
type VirtualMachineImagesClientListPublishersResponse struct { // Array of VirtualMachineImageResource VirtualMachineImageResourceArray []*VirtualMachineImageResource }
VirtualMachineImagesClientListPublishersResponse contains the response from method VirtualMachineImagesClient.ListPublishers.
type VirtualMachineImagesClientListResponse ¶
type VirtualMachineImagesClientListResponse struct { // Array of VirtualMachineImageResource VirtualMachineImageResourceArray []*VirtualMachineImageResource }
VirtualMachineImagesClientListResponse contains the response from method VirtualMachineImagesClient.List.
type VirtualMachineImagesClientListSKUsOptions ¶
type VirtualMachineImagesClientListSKUsOptions struct { }
VirtualMachineImagesClientListSKUsOptions contains the optional parameters for the VirtualMachineImagesClient.ListSKUs method.
type VirtualMachineImagesClientListSKUsResponse ¶
type VirtualMachineImagesClientListSKUsResponse struct { // Array of VirtualMachineImageResource VirtualMachineImageResourceArray []*VirtualMachineImageResource }
VirtualMachineImagesClientListSKUsResponse contains the response from method VirtualMachineImagesClient.ListSKUs.
type VirtualMachineImagesEdgeZoneClient ¶
type VirtualMachineImagesEdgeZoneClient struct {
// contains filtered or unexported fields
}
VirtualMachineImagesEdgeZoneClient contains the methods for the VirtualMachineImagesEdgeZone group. Don't use this type directly, use NewVirtualMachineImagesEdgeZoneClient() instead.
func NewVirtualMachineImagesEdgeZoneClient ¶
func NewVirtualMachineImagesEdgeZoneClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*VirtualMachineImagesEdgeZoneClient, error)
NewVirtualMachineImagesEdgeZoneClient creates a new instance of VirtualMachineImagesEdgeZoneClient 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 (*VirtualMachineImagesEdgeZoneClient) Get ¶
func (client *VirtualMachineImagesEdgeZoneClient) Get(ctx context.Context, location string, edgeZone string, publisherName string, offer string, skus string, version string, options *VirtualMachineImagesEdgeZoneClientGetOptions) (VirtualMachineImagesEdgeZoneClientGetResponse, error)
Get - Gets a virtual machine image in an edge zone. If the operation fails it returns an *azcore.ResponseError type.
Generated from API version 2024-03-01
- location - The name of a supported Azure region.
- edgeZone - The name of the edge zone.
- publisherName - A valid image publisher.
- offer - A valid image publisher offer.
- skus - A valid image SKU.
- version - A valid image SKU version.
- options - VirtualMachineImagesEdgeZoneClientGetOptions contains the optional parameters for the VirtualMachineImagesEdgeZoneClient.Get method.
Example (VirtualMachineImagesEdgeZoneGetMaximumSetGen) ¶
Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/92de53a5f1e0e03c94b40475d2135d97148ed014/specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-03-01/examples/virtualMachineImageExamples/VirtualMachineImagesEdgeZone_Get_MaximumSet_Gen.json
cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() clientFactory, err := armcompute.NewClientFactory("<subscription-id>", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } res, err := clientFactory.NewVirtualMachineImagesEdgeZoneClient().Get(ctx, "aaaaaaaaaaaaaaaaaaaaaaaa", "aaaaaaaa", "aaaaaaaaaaaaaaaaaaaaaaa", "aaaaaaaaaaaaaaaaaaaaaaaaaaa", "aaaaaaaaaa", "aaaaaaaaaaaaaaaaaaaaaaaaaaa", nil) if err != nil { log.Fatalf("failed to finish the request: %v", err) } // You could use response here. We use blank identifier for just demo purposes. _ = res // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. // res.VirtualMachineImage = armcompute.VirtualMachineImage{ // ID: to.Ptr("aaaaaaaaaaa"), // Name: to.Ptr("aaaaaaaaa"), // ExtendedLocation: &armcompute.ExtendedLocation{ // Name: to.Ptr("aaaaaaaaaaaaaaaaaaaaa"), // Type: to.Ptr(armcompute.ExtendedLocationTypesEdgeZone), // }, // Location: to.Ptr("aaaaa"), // Tags: map[string]*string{ // "key6817": to.Ptr("aaaaaaaaaaaaaaaaaaaaaaaaaaaaa"), // }, // Properties: &armcompute.VirtualMachineImageProperties{ // AutomaticOSUpgradeProperties: &armcompute.AutomaticOSUpgradeProperties{ // AutomaticOSUpgradeSupported: to.Ptr(true), // }, // DataDiskImages: []*armcompute.DataDiskImage{ // { // Lun: to.Ptr[int32](17), // }}, // Disallowed: &armcompute.DisallowedConfiguration{ // VMDiskType: to.Ptr(armcompute.VMDiskTypesNone), // }, // Features: []*armcompute.VirtualMachineImageFeature{ // { // Name: to.Ptr("aaaaaaaaaaaaaaaaaaaaa"), // Value: to.Ptr("aaaaaaaaaaaaaaaaaaaa"), // }}, // HyperVGeneration: to.Ptr(armcompute.HyperVGenerationTypesV1), // OSDiskImage: &armcompute.OSDiskImage{ // OperatingSystem: to.Ptr(armcompute.OperatingSystemTypesWindows), // }, // Plan: &armcompute.PurchasePlan{ // Name: to.Ptr("aaaaaaaaa"), // Product: to.Ptr("aaaaaaaaaaaaaa"), // Publisher: to.Ptr("aaaaaaaaaaaaaaaaaaa"), // }, // }, // }
Output:
Example (VirtualMachineImagesEdgeZoneGetMinimumSetGen) ¶
Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/92de53a5f1e0e03c94b40475d2135d97148ed014/specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-03-01/examples/virtualMachineImageExamples/VirtualMachineImagesEdgeZone_Get_MinimumSet_Gen.json
cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() clientFactory, err := armcompute.NewClientFactory("<subscription-id>", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } res, err := clientFactory.NewVirtualMachineImagesEdgeZoneClient().Get(ctx, "aaaaaaaaaaaaaaaaaaaaaaa", "aaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "aaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "aaaaaaaaaaa", "aaaaaaaaaaaaaaaaaa", "aa", nil) if err != nil { log.Fatalf("failed to finish the request: %v", err) } // You could use response here. We use blank identifier for just demo purposes. _ = res // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. // res.VirtualMachineImage = armcompute.VirtualMachineImage{ // ID: to.Ptr("aaaaaaaaaaa"), // Name: to.Ptr("aaaaaaaaa"), // Location: to.Ptr("aaaaa"), // }
Output:
func (*VirtualMachineImagesEdgeZoneClient) List ¶
func (client *VirtualMachineImagesEdgeZoneClient) List(ctx context.Context, location string, edgeZone string, publisherName string, offer string, skus string, options *VirtualMachineImagesEdgeZoneClientListOptions) (VirtualMachineImagesEdgeZoneClientListResponse, error)
List - Gets a list of all virtual machine image versions for the specified location, edge zone, publisher, offer, and SKU. If the operation fails it returns an *azcore.ResponseError type.
Generated from API version 2024-03-01
- location - The name of a supported Azure region.
- edgeZone - The name of the edge zone.
- publisherName - A valid image publisher.
- offer - A valid image publisher offer.
- skus - A valid image SKU.
- options - VirtualMachineImagesEdgeZoneClientListOptions contains the optional parameters for the VirtualMachineImagesEdgeZoneClient.List method.
Example (VirtualMachineImagesEdgeZoneListMaximumSetGen) ¶
Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/92de53a5f1e0e03c94b40475d2135d97148ed014/specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-03-01/examples/virtualMachineImageExamples/VirtualMachineImagesEdgeZone_List_MaximumSet_Gen.json
cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() clientFactory, err := armcompute.NewClientFactory("<subscription-id>", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } res, err := clientFactory.NewVirtualMachineImagesEdgeZoneClient().List(ctx, "aaaaaaaaaaaaaaa", "aaaaaaaaaaaaaaaaaaaaaaaaa", "aaaa", "aaaaaaaaaaaaaaaaaaaaaaaaaa", "aaaaaaaaaaaaaaaaaaaaaaa", &armcompute.VirtualMachineImagesEdgeZoneClientListOptions{Expand: to.Ptr("aaaaaaaaaaaaaaaaaaaaaaaa"), Top: to.Ptr[int32](12), Orderby: to.Ptr("aaaaaaaaaaaaaaaaaaaaaaaaaaaa"), }) if err != nil { log.Fatalf("failed to finish the request: %v", err) } // You could use response here. We use blank identifier for just demo purposes. _ = res // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. // res.VirtualMachineImageResourceArray = []*armcompute.VirtualMachineImageResource{ // { // ID: to.Ptr("aaaaaaaaaaa"), // Name: to.Ptr("aaaaaaaa"), // ExtendedLocation: &armcompute.ExtendedLocation{ // Name: to.Ptr("aaaaaaaaaaaaaaaaaaaaa"), // Type: to.Ptr(armcompute.ExtendedLocationTypesEdgeZone), // }, // Location: to.Ptr("aaaaaaaaaaaaaaaaaa"), // Tags: map[string]*string{ // "key7868": to.Ptr("aaaaa"), // }, // }}
Output:
Example (VirtualMachineImagesEdgeZoneListMinimumSetGen) ¶
Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/92de53a5f1e0e03c94b40475d2135d97148ed014/specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-03-01/examples/virtualMachineImageExamples/VirtualMachineImagesEdgeZone_List_MinimumSet_Gen.json
cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() clientFactory, err := armcompute.NewClientFactory("<subscription-id>", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } res, err := clientFactory.NewVirtualMachineImagesEdgeZoneClient().List(ctx, "aaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "aaaaa", "aaaaaaaaaaaaaaaaaaa", "aaaaaaaaaaaaaaaaaaaaaaaaaaa", "aaaaaaaaaaaaaaaaaaaaaaaaaaaaa", &armcompute.VirtualMachineImagesEdgeZoneClientListOptions{Expand: nil, Top: nil, Orderby: nil, }) if err != nil { log.Fatalf("failed to finish the request: %v", err) } // You could use response here. We use blank identifier for just demo purposes. _ = res // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. // res.VirtualMachineImageResourceArray = []*armcompute.VirtualMachineImageResource{ // { // ID: to.Ptr("aaaaaaaaaaa"), // Name: to.Ptr("aaaaaaaa"), // Location: to.Ptr("aaaaaaaaaaaaaaaaaa"), // }}
Output:
func (*VirtualMachineImagesEdgeZoneClient) ListOffers ¶
func (client *VirtualMachineImagesEdgeZoneClient) ListOffers(ctx context.Context, location string, edgeZone string, publisherName string, options *VirtualMachineImagesEdgeZoneClientListOffersOptions) (VirtualMachineImagesEdgeZoneClientListOffersResponse, error)
ListOffers - Gets a list of virtual machine image offers for the specified location, edge zone and publisher. If the operation fails it returns an *azcore.ResponseError type.
Generated from API version 2024-03-01
- location - The name of a supported Azure region.
- edgeZone - The name of the edge zone.
- publisherName - A valid image publisher.
- options - VirtualMachineImagesEdgeZoneClientListOffersOptions contains the optional parameters for the VirtualMachineImagesEdgeZoneClient.ListOffers method.
Example (VirtualMachineImagesEdgeZoneListOffersMaximumSetGen) ¶
Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/92de53a5f1e0e03c94b40475d2135d97148ed014/specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-03-01/examples/virtualMachineImageExamples/VirtualMachineImagesEdgeZone_ListOffers_MaximumSet_Gen.json
cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() clientFactory, err := armcompute.NewClientFactory("<subscription-id>", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } res, err := clientFactory.NewVirtualMachineImagesEdgeZoneClient().ListOffers(ctx, "aaaaaaaaaaaaaaaaaa", "aaaaaaaaaaaaaaaaaaa", "aaaaaaaaaaaaa", nil) if err != nil { log.Fatalf("failed to finish the request: %v", err) } // You could use response here. We use blank identifier for just demo purposes. _ = res // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. // res.VirtualMachineImageResourceArray = []*armcompute.VirtualMachineImageResource{ // { // ID: to.Ptr("aaaaaaaaaaa"), // Name: to.Ptr("aaaaaaaa"), // ExtendedLocation: &armcompute.ExtendedLocation{ // Name: to.Ptr("aaaaaaaaaaaaaaaaaaaaa"), // Type: to.Ptr(armcompute.ExtendedLocationTypesEdgeZone), // }, // Location: to.Ptr("aaaaaaaaaaaaaaaaaa"), // Tags: map[string]*string{ // "key7868": to.Ptr("aaaaa"), // }, // }}
Output:
Example (VirtualMachineImagesEdgeZoneListOffersMinimumSetGen) ¶
Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/92de53a5f1e0e03c94b40475d2135d97148ed014/specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-03-01/examples/virtualMachineImageExamples/VirtualMachineImagesEdgeZone_ListOffers_MinimumSet_Gen.json
cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() clientFactory, err := armcompute.NewClientFactory("<subscription-id>", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } res, err := clientFactory.NewVirtualMachineImagesEdgeZoneClient().ListOffers(ctx, "aaaaaaaaaaaaaa", "aaaaaaaaaaaaaaaaaaaaa", "aaaaaaaaaaaaaaaaaaaaaaaaaaa", nil) if err != nil { log.Fatalf("failed to finish the request: %v", err) } // You could use response here. We use blank identifier for just demo purposes. _ = res // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. // res.VirtualMachineImageResourceArray = []*armcompute.VirtualMachineImageResource{ // { // ID: to.Ptr("aaaaaaaaaaa"), // Name: to.Ptr("aaaaaaaa"), // Location: to.Ptr("aaaaaaaaaaaaaaaaaa"), // }}
Output:
func (*VirtualMachineImagesEdgeZoneClient) ListPublishers ¶
func (client *VirtualMachineImagesEdgeZoneClient) ListPublishers(ctx context.Context, location string, edgeZone string, options *VirtualMachineImagesEdgeZoneClientListPublishersOptions) (VirtualMachineImagesEdgeZoneClientListPublishersResponse, error)
ListPublishers - Gets a list of virtual machine image publishers for the specified Azure location and edge zone. If the operation fails it returns an *azcore.ResponseError type.
Generated from API version 2024-03-01
- location - The name of a supported Azure region.
- edgeZone - The name of the edge zone.
- options - VirtualMachineImagesEdgeZoneClientListPublishersOptions contains the optional parameters for the VirtualMachineImagesEdgeZoneClient.ListPublishers method.
Example (VirtualMachineImagesEdgeZoneListPublishersMaximumSetGen) ¶
Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/92de53a5f1e0e03c94b40475d2135d97148ed014/specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-03-01/examples/virtualMachineImageExamples/VirtualMachineImagesEdgeZone_ListPublishers_MaximumSet_Gen.json
cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() clientFactory, err := armcompute.NewClientFactory("<subscription-id>", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } res, err := clientFactory.NewVirtualMachineImagesEdgeZoneClient().ListPublishers(ctx, "aaaaaa", "aaaaaaaaaaaaaaaaaaaaaaaaaaa", nil) if err != nil { log.Fatalf("failed to finish the request: %v", err) } // You could use response here. We use blank identifier for just demo purposes. _ = res // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. // res.VirtualMachineImageResourceArray = []*armcompute.VirtualMachineImageResource{ // { // ID: to.Ptr("aaaaaaaaaaa"), // Name: to.Ptr("aaaaaaaa"), // ExtendedLocation: &armcompute.ExtendedLocation{ // Name: to.Ptr("aaaaaaaaaaaaaaaaaaaaa"), // Type: to.Ptr(armcompute.ExtendedLocationTypesEdgeZone), // }, // Location: to.Ptr("aaaaaaaaaaaaaaaaaa"), // Tags: map[string]*string{ // "key7868": to.Ptr("aaaaa"), // }, // }}
Output:
Example (VirtualMachineImagesEdgeZoneListPublishersMinimumSetGen) ¶
Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/92de53a5f1e0e03c94b40475d2135d97148ed014/specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-03-01/examples/virtualMachineImageExamples/VirtualMachineImagesEdgeZone_ListPublishers_MinimumSet_Gen.json
cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() clientFactory, err := armcompute.NewClientFactory("<subscription-id>", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } res, err := clientFactory.NewVirtualMachineImagesEdgeZoneClient().ListPublishers(ctx, "aaaa", "aaaaaaaaaaaaaaaaaaaaaaa", nil) if err != nil { log.Fatalf("failed to finish the request: %v", err) } // You could use response here. We use blank identifier for just demo purposes. _ = res // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. // res.VirtualMachineImageResourceArray = []*armcompute.VirtualMachineImageResource{ // { // ID: to.Ptr("aaaaaaaaaaa"), // Name: to.Ptr("aaaaaaaa"), // Location: to.Ptr("aaaaaaaaaaaaaaaaaa"), // }}
Output:
func (*VirtualMachineImagesEdgeZoneClient) ListSKUs ¶
func (client *VirtualMachineImagesEdgeZoneClient) ListSKUs(ctx context.Context, location string, edgeZone string, publisherName string, offer string, options *VirtualMachineImagesEdgeZoneClientListSKUsOptions) (VirtualMachineImagesEdgeZoneClientListSKUsResponse, error)
ListSKUs - Gets a list of virtual machine image SKUs for the specified location, edge zone, publisher, and offer. If the operation fails it returns an *azcore.ResponseError type.
Generated from API version 2024-03-01
- location - The name of a supported Azure region.
- edgeZone - The name of the edge zone.
- publisherName - A valid image publisher.
- offer - A valid image publisher offer.
- options - VirtualMachineImagesEdgeZoneClientListSKUsOptions contains the optional parameters for the VirtualMachineImagesEdgeZoneClient.ListSKUs method.
Example (VirtualMachineImagesEdgeZoneListSkusMaximumSetGen) ¶
Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/92de53a5f1e0e03c94b40475d2135d97148ed014/specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-03-01/examples/virtualMachineImageExamples/VirtualMachineImagesEdgeZone_ListSkus_MaximumSet_Gen.json
cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() clientFactory, err := armcompute.NewClientFactory("<subscription-id>", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } res, err := clientFactory.NewVirtualMachineImagesEdgeZoneClient().ListSKUs(ctx, "aaaaaaaaaaaa", "aaaaa", "aaaaaaaaaaaa", "aaaaaaaaaaaa", nil) if err != nil { log.Fatalf("failed to finish the request: %v", err) } // You could use response here. We use blank identifier for just demo purposes. _ = res // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. // res.VirtualMachineImageResourceArray = []*armcompute.VirtualMachineImageResource{ // { // ID: to.Ptr("aaaaaaaaaaa"), // Name: to.Ptr("aaaaaaaa"), // ExtendedLocation: &armcompute.ExtendedLocation{ // Name: to.Ptr("aaaaaaaaaaaaaaaaaaaaa"), // Type: to.Ptr(armcompute.ExtendedLocationTypesEdgeZone), // }, // Location: to.Ptr("aaaaaaaaaaaaaaaaaa"), // Tags: map[string]*string{ // "key7868": to.Ptr("aaaaa"), // }, // }}
Output:
Example (VirtualMachineImagesEdgeZoneListSkusMinimumSetGen) ¶
Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/92de53a5f1e0e03c94b40475d2135d97148ed014/specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-03-01/examples/virtualMachineImageExamples/VirtualMachineImagesEdgeZone_ListSkus_MinimumSet_Gen.json
cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() clientFactory, err := armcompute.NewClientFactory("<subscription-id>", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } res, err := clientFactory.NewVirtualMachineImagesEdgeZoneClient().ListSKUs(ctx, "aaaaaaaaaaaaaaaaaaaa", "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "aaaaaaaaa", "aaaaaaaaaaaa", nil) if err != nil { log.Fatalf("failed to finish the request: %v", err) } // You could use response here. We use blank identifier for just demo purposes. _ = res // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. // res.VirtualMachineImageResourceArray = []*armcompute.VirtualMachineImageResource{ // { // ID: to.Ptr("aaaaaaaaaaa"), // Name: to.Ptr("aaaaaaaa"), // Location: to.Ptr("aaaaaaaaaaaaaaaaaa"), // }}
Output:
type VirtualMachineImagesEdgeZoneClientGetOptions ¶
type VirtualMachineImagesEdgeZoneClientGetOptions struct { }
VirtualMachineImagesEdgeZoneClientGetOptions contains the optional parameters for the VirtualMachineImagesEdgeZoneClient.Get method.
type VirtualMachineImagesEdgeZoneClientGetResponse ¶
type VirtualMachineImagesEdgeZoneClientGetResponse struct { // Describes a Virtual Machine Image. VirtualMachineImage }
VirtualMachineImagesEdgeZoneClientGetResponse contains the response from method VirtualMachineImagesEdgeZoneClient.Get.
type VirtualMachineImagesEdgeZoneClientListOffersOptions ¶
type VirtualMachineImagesEdgeZoneClientListOffersOptions struct { }
VirtualMachineImagesEdgeZoneClientListOffersOptions contains the optional parameters for the VirtualMachineImagesEdgeZoneClient.ListOffers method.
type VirtualMachineImagesEdgeZoneClientListOffersResponse ¶
type VirtualMachineImagesEdgeZoneClientListOffersResponse struct { // Array of VirtualMachineImageResource VirtualMachineImageResourceArray []*VirtualMachineImageResource }
VirtualMachineImagesEdgeZoneClientListOffersResponse contains the response from method VirtualMachineImagesEdgeZoneClient.ListOffers.
type VirtualMachineImagesEdgeZoneClientListOptions ¶
type VirtualMachineImagesEdgeZoneClientListOptions struct { // The expand expression to apply on the operation. Expand *string // Specifies the order of the results returned. Formatted as an OData query. Orderby *string // An integer value specifying the number of images to return that matches supplied values. Top *int32 }
VirtualMachineImagesEdgeZoneClientListOptions contains the optional parameters for the VirtualMachineImagesEdgeZoneClient.List method.
type VirtualMachineImagesEdgeZoneClientListPublishersOptions ¶
type VirtualMachineImagesEdgeZoneClientListPublishersOptions struct { }
VirtualMachineImagesEdgeZoneClientListPublishersOptions contains the optional parameters for the VirtualMachineImagesEdgeZoneClient.ListPublishers method.
type VirtualMachineImagesEdgeZoneClientListPublishersResponse ¶
type VirtualMachineImagesEdgeZoneClientListPublishersResponse struct { // Array of VirtualMachineImageResource VirtualMachineImageResourceArray []*VirtualMachineImageResource }
VirtualMachineImagesEdgeZoneClientListPublishersResponse contains the response from method VirtualMachineImagesEdgeZoneClient.ListPublishers.
type VirtualMachineImagesEdgeZoneClientListResponse ¶
type VirtualMachineImagesEdgeZoneClientListResponse struct { // Array of VirtualMachineImageResource VirtualMachineImageResourceArray []*VirtualMachineImageResource }
VirtualMachineImagesEdgeZoneClientListResponse contains the response from method VirtualMachineImagesEdgeZoneClient.List.
type VirtualMachineImagesEdgeZoneClientListSKUsOptions ¶
type VirtualMachineImagesEdgeZoneClientListSKUsOptions struct { }
VirtualMachineImagesEdgeZoneClientListSKUsOptions contains the optional parameters for the VirtualMachineImagesEdgeZoneClient.ListSKUs method.
type VirtualMachineImagesEdgeZoneClientListSKUsResponse ¶
type VirtualMachineImagesEdgeZoneClientListSKUsResponse struct { // Array of VirtualMachineImageResource VirtualMachineImageResourceArray []*VirtualMachineImageResource }
VirtualMachineImagesEdgeZoneClientListSKUsResponse contains the response from method VirtualMachineImagesEdgeZoneClient.ListSKUs.
type VirtualMachineInstallPatchesParameters ¶
type VirtualMachineInstallPatchesParameters struct { // REQUIRED; Defines when it is acceptable to reboot a VM during a software update operation. RebootSetting *VMGuestPatchRebootSetting // Input for InstallPatches on a Linux VM, as directly received by the API LinuxParameters *LinuxParameters // Specifies the maximum amount of time that the operation will run. It must be an ISO 8601-compliant duration string such // as PT4H (4 hours) MaximumDuration *string // Input for InstallPatches on a Windows VM, as directly received by the API WindowsParameters *WindowsParameters }
VirtualMachineInstallPatchesParameters - Input for InstallPatches as directly received by the API
func (VirtualMachineInstallPatchesParameters) MarshalJSON ¶
func (v VirtualMachineInstallPatchesParameters) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type VirtualMachineInstallPatchesParameters.
func (*VirtualMachineInstallPatchesParameters) UnmarshalJSON ¶
func (v *VirtualMachineInstallPatchesParameters) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type VirtualMachineInstallPatchesParameters.
type VirtualMachineInstallPatchesResult ¶
type VirtualMachineInstallPatchesResult struct { // READ-ONLY; The errors that were encountered during execution of the operation. The details array contains the list of them. Error *APIError // READ-ONLY; The number of patches that were not installed due to the user blocking their installation. ExcludedPatchCount *int32 // READ-ONLY; The number of patches that could not be installed due to some issue. See errors for details. FailedPatchCount *int32 // READ-ONLY; The activity ID of the operation that produced this result. It is used to correlate across CRP and extension // logs. InstallationActivityID *string // READ-ONLY; The number of patches successfully installed. InstalledPatchCount *int32 // READ-ONLY; Whether the operation ran out of time before it completed all its intended actions. MaintenanceWindowExceeded *bool // READ-ONLY; The number of patches that were detected as available for install, but did not meet the operation's criteria. NotSelectedPatchCount *int32 // READ-ONLY; The patches that were installed during the operation. Patches []*PatchInstallationDetail // READ-ONLY; The number of patches that were identified as meeting the installation criteria, but were not able to be installed. // Typically this happens when maintenanceWindowExceeded == true. PendingPatchCount *int32 // READ-ONLY; The reboot state of the VM following completion of the operation. RebootStatus *VMGuestPatchRebootStatus // READ-ONLY; The UTC timestamp when the operation began. StartDateTime *time.Time // READ-ONLY; The overall success or failure status of the operation. It remains "InProgress" until the operation completes. // At that point it will become "Failed", "Succeeded", "Unknown" or "CompletedWithWarnings." Status *PatchOperationStatus }
VirtualMachineInstallPatchesResult - The result summary of an installation operation.
func (VirtualMachineInstallPatchesResult) MarshalJSON ¶
func (v VirtualMachineInstallPatchesResult) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type VirtualMachineInstallPatchesResult.
func (*VirtualMachineInstallPatchesResult) UnmarshalJSON ¶
func (v *VirtualMachineInstallPatchesResult) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type VirtualMachineInstallPatchesResult.
type VirtualMachineInstanceView ¶
type VirtualMachineInstanceView struct { // Boot Diagnostics is a debugging feature which allows you to view Console Output and Screenshot to diagnose VM status. You // can easily view the output of your console log. Azure also enables you to see // a screenshot of the VM from the hypervisor. BootDiagnostics *BootDiagnosticsInstanceView // The computer name assigned to the virtual machine. ComputerName *string // The virtual machine disk information. Disks []*DiskInstanceView // The extensions information. Extensions []*VirtualMachineExtensionInstanceView // Specifies the HyperVGeneration Type associated with a resource HyperVGeneration *HyperVGenerationType // The Maintenance Operation status on the virtual machine. MaintenanceRedeployStatus *MaintenanceRedeployStatus // The Operating System running on the virtual machine. OSName *string // The version of Operating System running on the virtual machine. OSVersion *string // [Preview Feature] The status of virtual machine patch operations. PatchStatus *VirtualMachinePatchStatus // Specifies the fault domain of the virtual machine. PlatformFaultDomain *int32 // Specifies the update domain of the virtual machine. PlatformUpdateDomain *int32 // The Remote desktop certificate thumbprint. RdpThumbPrint *string // The resource status information. Statuses []*InstanceViewStatus // The VM Agent running on the virtual machine. VMAgent *VirtualMachineAgentInstanceView // READ-ONLY; Resource id of the dedicated host, on which the virtual machine is allocated through automatic placement, when // the virtual machine is associated with a dedicated host group that has automatic // placement enabled. Minimum api-version: 2020-06-01. AssignedHost *string // READ-ONLY; [Preview Feature] Specifies whether the VM is currently in or out of the Standby Pool. IsVMInStandbyPool *bool // READ-ONLY; The health status for the VM. VMHealth *VirtualMachineHealthStatus }
VirtualMachineInstanceView - The instance view of a virtual machine.
func (VirtualMachineInstanceView) MarshalJSON ¶
func (v VirtualMachineInstanceView) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type VirtualMachineInstanceView.
func (*VirtualMachineInstanceView) UnmarshalJSON ¶
func (v *VirtualMachineInstanceView) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type VirtualMachineInstanceView.
type VirtualMachineListResult ¶
type VirtualMachineListResult struct { // REQUIRED; The list of virtual machines. Value []*VirtualMachine // The URI to fetch the next page of VMs. Call ListNext() with this URI to fetch the next page of Virtual Machines. NextLink *string }
VirtualMachineListResult - The List Virtual Machine operation response.
func (VirtualMachineListResult) MarshalJSON ¶
func (v VirtualMachineListResult) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type VirtualMachineListResult.
func (*VirtualMachineListResult) UnmarshalJSON ¶
func (v *VirtualMachineListResult) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type VirtualMachineListResult.
type VirtualMachineNetworkInterfaceConfiguration ¶
type VirtualMachineNetworkInterfaceConfiguration struct { // REQUIRED; The network interface configuration name. Name *string // Describes a virtual machine network profile's IP configuration. Properties *VirtualMachineNetworkInterfaceConfigurationProperties }
VirtualMachineNetworkInterfaceConfiguration - Describes a virtual machine network interface configurations.
func (VirtualMachineNetworkInterfaceConfiguration) MarshalJSON ¶
func (v VirtualMachineNetworkInterfaceConfiguration) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type VirtualMachineNetworkInterfaceConfiguration.
func (*VirtualMachineNetworkInterfaceConfiguration) UnmarshalJSON ¶
func (v *VirtualMachineNetworkInterfaceConfiguration) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type VirtualMachineNetworkInterfaceConfiguration.
type VirtualMachineNetworkInterfaceConfigurationProperties ¶
type VirtualMachineNetworkInterfaceConfigurationProperties struct { // REQUIRED; Specifies the IP configurations of the network interface. IPConfigurations []*VirtualMachineNetworkInterfaceIPConfiguration // Specifies whether the Auxiliary mode is enabled for the Network Interface resource. AuxiliaryMode *NetworkInterfaceAuxiliaryMode // Specifies whether the Auxiliary sku is enabled for the Network Interface resource. AuxiliarySKU *NetworkInterfaceAuxiliarySKU // The dns settings to be applied on the network interfaces. DNSSettings *VirtualMachineNetworkInterfaceDNSSettingsConfiguration // Specify what happens to the network interface when the VM is deleted DeleteOption *DeleteOptions // Specifies whether the network interface is disabled for tcp state tracking. DisableTCPStateTracking *bool DscpConfiguration *SubResource // Specifies whether the network interface is accelerated networking-enabled. EnableAcceleratedNetworking *bool // Specifies whether the network interface is FPGA networking-enabled. EnableFpga *bool // Whether IP forwarding enabled on this NIC. EnableIPForwarding *bool // The network security group. NetworkSecurityGroup *SubResource // Specifies the primary network interface in case the virtual machine has more than 1 network interface. Primary *bool }
VirtualMachineNetworkInterfaceConfigurationProperties - Describes a virtual machine network profile's IP configuration.
func (VirtualMachineNetworkInterfaceConfigurationProperties) MarshalJSON ¶
func (v VirtualMachineNetworkInterfaceConfigurationProperties) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type VirtualMachineNetworkInterfaceConfigurationProperties.
func (*VirtualMachineNetworkInterfaceConfigurationProperties) UnmarshalJSON ¶
func (v *VirtualMachineNetworkInterfaceConfigurationProperties) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type VirtualMachineNetworkInterfaceConfigurationProperties.
type VirtualMachineNetworkInterfaceDNSSettingsConfiguration ¶
type VirtualMachineNetworkInterfaceDNSSettingsConfiguration struct { // List of DNS servers IP addresses DNSServers []*string }
VirtualMachineNetworkInterfaceDNSSettingsConfiguration - Describes a virtual machines network configuration's DNS settings.
func (VirtualMachineNetworkInterfaceDNSSettingsConfiguration) MarshalJSON ¶
func (v VirtualMachineNetworkInterfaceDNSSettingsConfiguration) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type VirtualMachineNetworkInterfaceDNSSettingsConfiguration.
func (*VirtualMachineNetworkInterfaceDNSSettingsConfiguration) UnmarshalJSON ¶
func (v *VirtualMachineNetworkInterfaceDNSSettingsConfiguration) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type VirtualMachineNetworkInterfaceDNSSettingsConfiguration.
type VirtualMachineNetworkInterfaceIPConfiguration ¶
type VirtualMachineNetworkInterfaceIPConfiguration struct { // REQUIRED; The IP configuration name. Name *string // Describes a virtual machine network interface IP configuration properties. Properties *VirtualMachineNetworkInterfaceIPConfigurationProperties }
VirtualMachineNetworkInterfaceIPConfiguration - Describes a virtual machine network profile's IP configuration.
func (VirtualMachineNetworkInterfaceIPConfiguration) MarshalJSON ¶
func (v VirtualMachineNetworkInterfaceIPConfiguration) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type VirtualMachineNetworkInterfaceIPConfiguration.
func (*VirtualMachineNetworkInterfaceIPConfiguration) UnmarshalJSON ¶
func (v *VirtualMachineNetworkInterfaceIPConfiguration) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type VirtualMachineNetworkInterfaceIPConfiguration.
type VirtualMachineNetworkInterfaceIPConfigurationProperties ¶
type VirtualMachineNetworkInterfaceIPConfigurationProperties struct { // Specifies an array of references to backend address pools of application gateways. A virtual machine can reference backend // address pools of multiple application gateways. Multiple virtual machines // cannot use the same application gateway. ApplicationGatewayBackendAddressPools []*SubResource // Specifies an array of references to application security group. ApplicationSecurityGroups []*SubResource // Specifies an array of references to backend address pools of load balancers. A virtual machine can reference backend address // pools of one public and one internal load balancer. [Multiple virtual // machines cannot use the same basic sku load balancer]. LoadBalancerBackendAddressPools []*SubResource // Specifies the primary network interface in case the virtual machine has more than 1 network interface. Primary *bool // Available from Api-Version 2017-03-30 onwards, it represents whether the specific ipconfiguration is IPv4 or IPv6. Default // is taken as IPv4. Possible values are: 'IPv4' and 'IPv6'. PrivateIPAddressVersion *IPVersions // The publicIPAddressConfiguration. PublicIPAddressConfiguration *VirtualMachinePublicIPAddressConfiguration // Specifies the identifier of the subnet. Subnet *SubResource }
VirtualMachineNetworkInterfaceIPConfigurationProperties - Describes a virtual machine network interface IP configuration properties.
func (VirtualMachineNetworkInterfaceIPConfigurationProperties) MarshalJSON ¶
func (v VirtualMachineNetworkInterfaceIPConfigurationProperties) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type VirtualMachineNetworkInterfaceIPConfigurationProperties.
func (*VirtualMachineNetworkInterfaceIPConfigurationProperties) UnmarshalJSON ¶
func (v *VirtualMachineNetworkInterfaceIPConfigurationProperties) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type VirtualMachineNetworkInterfaceIPConfigurationProperties.
type VirtualMachinePatchStatus ¶
type VirtualMachinePatchStatus struct { // The available patch summary of the latest assessment operation for the virtual machine. AvailablePatchSummary *AvailablePatchSummary // The installation summary of the latest installation operation for the virtual machine. LastPatchInstallationSummary *LastPatchInstallationSummary // READ-ONLY; The enablement status of the specified patchMode ConfigurationStatuses []*InstanceViewStatus }
VirtualMachinePatchStatus - The status of virtual machine patch operations.
func (VirtualMachinePatchStatus) MarshalJSON ¶
func (v VirtualMachinePatchStatus) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type VirtualMachinePatchStatus.
func (*VirtualMachinePatchStatus) UnmarshalJSON ¶
func (v *VirtualMachinePatchStatus) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type VirtualMachinePatchStatus.
type VirtualMachinePriorityTypes ¶
type VirtualMachinePriorityTypes string
VirtualMachinePriorityTypes - Specifies the priority for a standalone virtual machine or the virtual machines in the scale set. 'Low' enum will be deprecated in the future, please use 'Spot' as the enum to deploy Azure Spot VM/VMSS.
const ( VirtualMachinePriorityTypesLow VirtualMachinePriorityTypes = "Low" VirtualMachinePriorityTypesRegular VirtualMachinePriorityTypes = "Regular" VirtualMachinePriorityTypesSpot VirtualMachinePriorityTypes = "Spot" )
func PossibleVirtualMachinePriorityTypesValues ¶
func PossibleVirtualMachinePriorityTypesValues() []VirtualMachinePriorityTypes
PossibleVirtualMachinePriorityTypesValues returns the possible values for the VirtualMachinePriorityTypes const type.
type VirtualMachineProperties ¶
type VirtualMachineProperties struct { // Specifies additional capabilities enabled or disabled on the virtual machine. AdditionalCapabilities *AdditionalCapabilities // Specifies the gallery applications that should be made available to the VM/VMSS. ApplicationProfile *ApplicationProfile // 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. The availability set to which the VM is being added should be under the same resource // group as the availability set resource. An existing VM cannot be added to an // availability set. This property cannot exist along with a non-null properties.virtualMachineScaleSet reference. AvailabilitySet *SubResource // Specifies the billing related details of a Azure Spot virtual machine. Minimum api-version: 2019-03-01. BillingProfile *BillingProfile // Specifies information about the capacity reservation that is used to allocate virtual machine. Minimum api-version: 2021-04-01. CapacityReservation *CapacityReservationProfile // Specifies the boot diagnostic settings state. Minimum api-version: 2015-06-15. DiagnosticsProfile *DiagnosticsProfile // Specifies the eviction policy for the Azure Spot virtual machine and Azure Spot scale set. For Azure Spot virtual machines, // both 'Deallocate' and 'Delete' are supported and the minimum api-version is // 2019-03-01. For Azure Spot scale sets, both 'Deallocate' and 'Delete' are supported and the minimum api-version is 2017-10-30-preview. EvictionPolicy *VirtualMachineEvictionPolicyTypes // Specifies the time alloted for all extensions to start. The time duration should be between 15 minutes and 120 minutes // (inclusive) and should be specified in ISO 8601 format. The default value is 90 // minutes (PT1H30M). Minimum api-version: 2020-06-01. ExtensionsTimeBudget *string // Specifies the hardware settings for the virtual machine. HardwareProfile *HardwareProfile // Specifies information about the dedicated host that the virtual machine resides in. Minimum api-version: 2018-10-01. Host *SubResource // Specifies information about the dedicated host group that the virtual machine resides in. Note: User cannot specify both // host and hostGroup properties. Minimum api-version: 2020-06-01. HostGroup *SubResource // Specifies that the image or disk that is being used was licensed on-premises. // Possible values for Windows Server operating system are: // WindowsClient // WindowsServer // Possible values for Linux Server operating system are: // RHELBYOS (for RHEL) // SLESBYOS (for SUSE) // For more information, see Azure Hybrid Use Benefit for Windows Server [https://docs.microsoft.com/azure/virtual-machines/windows/hybrid-use-benefit-licensing] // Azure Hybrid Use Benefit for Linux Server [https://docs.microsoft.com/azure/virtual-machines/linux/azure-hybrid-benefit-linux] // Minimum api-version: 2015-06-15 LicenseType *string // Specifies the network interfaces of the virtual machine. NetworkProfile *NetworkProfile // Specifies the operating system settings used while creating the virtual machine. Some of the settings cannot be changed // once VM is provisioned. OSProfile *OSProfile // Specifies the scale set logical fault domain into which the Virtual Machine will be created. By default, the Virtual Machine // will by automatically assigned to a fault domain that best maintains // balance across available fault domains. This is applicable only if the 'virtualMachineScaleSet' property of this Virtual // Machine is set. The Virtual Machine Scale Set that is referenced, must have // 'platformFaultDomainCount' greater than 1. This property cannot be updated once the Virtual Machine is created. Fault domain // assignment can be viewed in the Virtual Machine Instance View. Minimum // api‐version: 2020‐12‐01. PlatformFaultDomain *int32 // Specifies the priority for the virtual machine. Minimum api-version: 2019-03-01 Priority *VirtualMachinePriorityTypes // Specifies information about the proximity placement group that the virtual machine should be assigned to. Minimum api-version: // 2018-04-01. ProximityPlacementGroup *SubResource // Specifies Redeploy, Reboot and ScheduledEventsAdditionalPublishingTargets Scheduled Event related configurations for the // virtual machine. ScheduledEventsPolicy *ScheduledEventsPolicy // Specifies Scheduled Event related configurations. ScheduledEventsProfile *ScheduledEventsProfile // Specifies the Security related profile settings for the virtual machine. SecurityProfile *SecurityProfile // Specifies the storage settings for the virtual machine disks. StorageProfile *StorageProfile // UserData for the VM, which must be base-64 encoded. Customer should not pass any secrets in here. Minimum api-version: // 2021-03-01. UserData *string // Specifies information about the virtual machine scale set that the virtual machine should be assigned to. Virtual machines // specified in the same virtual machine scale set are allocated to different // nodes to maximize availability. Currently, a VM can only be added to virtual machine scale set at creation time. An existing // VM cannot be added to a virtual machine scale set. This property cannot // exist along with a non-null properties.availabilitySet reference. Minimum api‐version: 2019‐03‐01. VirtualMachineScaleSet *SubResource // READ-ONLY; The virtual machine instance view. InstanceView *VirtualMachineInstanceView // READ-ONLY; The provisioning state, which only appears in the response. ProvisioningState *string // READ-ONLY; Specifies the time at which the Virtual Machine resource was created. Minimum api-version: 2021-11-01. TimeCreated *time.Time // READ-ONLY; Specifies the VM unique ID which is a 128-bits identifier that is encoded and stored in all Azure IaaS VMs SMBIOS // and can be read using platform BIOS commands. VMID *string }
VirtualMachineProperties - Describes the properties of a Virtual Machine.
func (VirtualMachineProperties) MarshalJSON ¶
func (v VirtualMachineProperties) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type VirtualMachineProperties.
func (*VirtualMachineProperties) UnmarshalJSON ¶
func (v *VirtualMachineProperties) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type VirtualMachineProperties.
type VirtualMachinePublicIPAddressConfiguration ¶
type VirtualMachinePublicIPAddressConfiguration struct { // REQUIRED; The publicIP address configuration name. Name *string // Describes a virtual machines IP Configuration's PublicIPAddress configuration Properties *VirtualMachinePublicIPAddressConfigurationProperties // Describes the public IP Sku. It can only be set with OrchestrationMode as Flexible. SKU *PublicIPAddressSKU }
VirtualMachinePublicIPAddressConfiguration - Describes a virtual machines IP Configuration's PublicIPAddress configuration
func (VirtualMachinePublicIPAddressConfiguration) MarshalJSON ¶
func (v VirtualMachinePublicIPAddressConfiguration) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type VirtualMachinePublicIPAddressConfiguration.
func (*VirtualMachinePublicIPAddressConfiguration) UnmarshalJSON ¶
func (v *VirtualMachinePublicIPAddressConfiguration) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type VirtualMachinePublicIPAddressConfiguration.
type VirtualMachinePublicIPAddressConfigurationProperties ¶
type VirtualMachinePublicIPAddressConfigurationProperties struct { // The dns settings to be applied on the publicIP addresses . DNSSettings *VirtualMachinePublicIPAddressDNSSettingsConfiguration // Specify what happens to the public IP address when the VM is deleted DeleteOption *DeleteOptions // The list of IP tags associated with the public IP address. IPTags []*VirtualMachineIPTag // The idle timeout of the public IP address. IdleTimeoutInMinutes *int32 // Available from Api-Version 2019-07-01 onwards, it represents whether the specific ipconfiguration is IPv4 or IPv6. Default // is taken as IPv4. Possible values are: 'IPv4' and 'IPv6'. PublicIPAddressVersion *IPVersions // Specify the public IP allocation type PublicIPAllocationMethod *PublicIPAllocationMethod // The PublicIPPrefix from which to allocate publicIP addresses. PublicIPPrefix *SubResource }
VirtualMachinePublicIPAddressConfigurationProperties - Describes a virtual machines IP Configuration's PublicIPAddress configuration
func (VirtualMachinePublicIPAddressConfigurationProperties) MarshalJSON ¶
func (v VirtualMachinePublicIPAddressConfigurationProperties) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type VirtualMachinePublicIPAddressConfigurationProperties.
func (*VirtualMachinePublicIPAddressConfigurationProperties) UnmarshalJSON ¶
func (v *VirtualMachinePublicIPAddressConfigurationProperties) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type VirtualMachinePublicIPAddressConfigurationProperties.
type VirtualMachinePublicIPAddressDNSSettingsConfiguration ¶
type VirtualMachinePublicIPAddressDNSSettingsConfiguration struct { // REQUIRED; The Domain name label prefix of the PublicIPAddress resources that will be created. The generated name label // is the concatenation of the domain name label and vm network profile unique ID. DomainNameLabel *string // The Domain name label scope of the PublicIPAddress resources that will be created. The generated name label is the concatenation // of the hashed domain name label with policy according to the domain // name label scope and vm network profile unique ID. DomainNameLabelScope *DomainNameLabelScopeTypes }
VirtualMachinePublicIPAddressDNSSettingsConfiguration - Describes a virtual machines network configuration's DNS settings.
func (VirtualMachinePublicIPAddressDNSSettingsConfiguration) MarshalJSON ¶
func (v VirtualMachinePublicIPAddressDNSSettingsConfiguration) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type VirtualMachinePublicIPAddressDNSSettingsConfiguration.
func (*VirtualMachinePublicIPAddressDNSSettingsConfiguration) UnmarshalJSON ¶
func (v *VirtualMachinePublicIPAddressDNSSettingsConfiguration) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type VirtualMachinePublicIPAddressDNSSettingsConfiguration.
type VirtualMachineReimageParameters ¶
type VirtualMachineReimageParameters struct { // Specifies in decimal number, the version the OS disk should be reimaged to. If exact version is not provided, the OS disk // is reimaged to the existing version of OS Disk. ExactVersion *string // Specifies information required for reimaging the non-ephemeral OS disk. OSProfile *OSProfileProvisioningData // Specifies whether to reimage temp disk. Default value: false. Note: This temp disk reimage parameter is only supported // for VM/VMSS with Ephemeral OS disk. TempDisk *bool }
VirtualMachineReimageParameters - Parameters for Reimaging Virtual Machine. NOTE: Virtual Machine OS disk will always be reimaged
func (VirtualMachineReimageParameters) MarshalJSON ¶
func (v VirtualMachineReimageParameters) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type VirtualMachineReimageParameters.
func (*VirtualMachineReimageParameters) UnmarshalJSON ¶
func (v *VirtualMachineReimageParameters) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type VirtualMachineReimageParameters.
type VirtualMachineRunCommand ¶
type VirtualMachineRunCommand struct { // REQUIRED; Resource location Location *string // Describes the properties of a Virtual Machine run command. Properties *VirtualMachineRunCommandProperties // Resource tags Tags map[string]*string // READ-ONLY; Resource Id ID *string // READ-ONLY; Resource name Name *string // READ-ONLY; Resource type Type *string }
VirtualMachineRunCommand - Describes a Virtual Machine run command.
func (VirtualMachineRunCommand) MarshalJSON ¶
func (v VirtualMachineRunCommand) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type VirtualMachineRunCommand.
func (*VirtualMachineRunCommand) UnmarshalJSON ¶
func (v *VirtualMachineRunCommand) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type VirtualMachineRunCommand.
type VirtualMachineRunCommandInstanceView ¶
type VirtualMachineRunCommandInstanceView struct { // Script end time. EndTime *time.Time // Script error stream. Error *string // Communicate script configuration errors or execution messages. ExecutionMessage *string // Script execution status. ExecutionState *ExecutionState // Exit code returned from script execution. ExitCode *int32 // Script output stream. Output *string // Script start time. StartTime *time.Time // The resource status information. Statuses []*InstanceViewStatus }
VirtualMachineRunCommandInstanceView - The instance view of a virtual machine run command.
func (VirtualMachineRunCommandInstanceView) MarshalJSON ¶
func (v VirtualMachineRunCommandInstanceView) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type VirtualMachineRunCommandInstanceView.
func (*VirtualMachineRunCommandInstanceView) UnmarshalJSON ¶
func (v *VirtualMachineRunCommandInstanceView) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type VirtualMachineRunCommandInstanceView.
type VirtualMachineRunCommandProperties ¶
type VirtualMachineRunCommandProperties struct { // Optional. If set to true, provisioning will complete as soon as the script starts and will not wait for script to complete. AsyncExecution *bool // User-assigned managed identity that has access to errorBlobUri storage blob. Use an empty object in case of system-assigned // identity. Make sure managed identity has been given access to blob's // container with 'Storage Blob Data Contributor' role assignment. In case of user-assigned identity, make sure you add it // under VM's identity. For more info on managed identity and Run Command, refer // https://aka.ms/ManagedIdentity and https://aka.ms/RunCommandManaged ErrorBlobManagedIdentity *RunCommandManagedIdentity // Specifies the Azure storage blob where script error stream will be uploaded. Use a SAS URI with read, append, create, write // access OR use managed identity to provide the VM access to the blob. Refer // errorBlobManagedIdentity parameter. ErrorBlobURI *string // User-assigned managed identity that has access to outputBlobUri storage blob. Use an empty object in case of system-assigned // identity. Make sure managed identity has been given access to blob's // container with 'Storage Blob Data Contributor' role assignment. In case of user-assigned identity, make sure you add it // under VM's identity. For more info on managed identity and Run Command, refer // https://aka.ms/ManagedIdentity and https://aka.ms/RunCommandManaged OutputBlobManagedIdentity *RunCommandManagedIdentity // Specifies the Azure storage blob where script output stream will be uploaded. Use a SAS URI with read, append, create, // write access OR use managed identity to provide the VM access to the blob. Refer // outputBlobManagedIdentity parameter. OutputBlobURI *string // The parameters used by the script. Parameters []*RunCommandInputParameter // The parameters used by the script. ProtectedParameters []*RunCommandInputParameter // Specifies the user account password on the VM when executing the run command. RunAsPassword *string // Specifies the user account on the VM when executing the run command. RunAsUser *string // The source of the run command script. Source *VirtualMachineRunCommandScriptSource // The timeout in seconds to execute the run command. TimeoutInSeconds *int32 // Optional. If set to true, any failure in the script will fail the deployment and ProvisioningState will be marked as Failed. // If set to false, ProvisioningState would only reflect whether the run // command was run or not by the extensions platform, it would not indicate whether script failed in case of script failures. // See instance view of run command in case of script failures to see // executionMessage, output, error: https://aka.ms/runcommandmanaged#get-execution-status-and-results TreatFailureAsDeploymentFailure *bool // READ-ONLY; The virtual machine run command instance view. InstanceView *VirtualMachineRunCommandInstanceView // READ-ONLY; The provisioning state, which only appears in the response. If treatFailureAsDeploymentFailure set to true, // any failure in the script will fail the deployment and ProvisioningState will be marked as // Failed. If treatFailureAsDeploymentFailure set to false, ProvisioningState would only reflect whether the run command was // run or not by the extensions platform, it would not indicate whether script // failed in case of script failures. See instance view of run command in case of script failures to see executionMessage, // output, error: https://aka.ms/runcommandmanaged#get-execution-status-and-results ProvisioningState *string }
VirtualMachineRunCommandProperties - Describes the properties of a Virtual Machine run command.
func (VirtualMachineRunCommandProperties) MarshalJSON ¶
func (v VirtualMachineRunCommandProperties) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type VirtualMachineRunCommandProperties.
func (*VirtualMachineRunCommandProperties) UnmarshalJSON ¶
func (v *VirtualMachineRunCommandProperties) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type VirtualMachineRunCommandProperties.
type VirtualMachineRunCommandScriptSource ¶
type VirtualMachineRunCommandScriptSource struct { // Specifies a commandId of predefined built-in script. CommandID *string // Specifies the script content to be executed on the VM. Script *string // Specifies the script download location. It can be either SAS URI of an Azure storage blob with read access or public URI. ScriptURI *string // User-assigned managed identity that has access to scriptUri in case of Azure storage blob. Use an empty object in case // of system-assigned identity. Make sure the Azure storage blob exists, and managed // identity has been given access to blob's container with 'Storage Blob Data Reader' role assignment. In case of user-assigned // identity, make sure you add it under VM's identity. For more info on // managed identity and Run Command, refer https://aka.ms/ManagedIdentity and https://aka.ms/RunCommandManaged. ScriptURIManagedIdentity *RunCommandManagedIdentity }
VirtualMachineRunCommandScriptSource - Describes the script sources for run command. Use only one of script, scriptUri, commandId.
func (VirtualMachineRunCommandScriptSource) MarshalJSON ¶
func (v VirtualMachineRunCommandScriptSource) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type VirtualMachineRunCommandScriptSource.
func (*VirtualMachineRunCommandScriptSource) UnmarshalJSON ¶
func (v *VirtualMachineRunCommandScriptSource) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type VirtualMachineRunCommandScriptSource.
type VirtualMachineRunCommandUpdate ¶
type VirtualMachineRunCommandUpdate struct { // Describes the properties of a Virtual Machine run command. Properties *VirtualMachineRunCommandProperties // Resource tags Tags map[string]*string }
VirtualMachineRunCommandUpdate - Describes a Virtual Machine run command.
func (VirtualMachineRunCommandUpdate) MarshalJSON ¶
func (v VirtualMachineRunCommandUpdate) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type VirtualMachineRunCommandUpdate.
func (*VirtualMachineRunCommandUpdate) UnmarshalJSON ¶
func (v *VirtualMachineRunCommandUpdate) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type VirtualMachineRunCommandUpdate.
type VirtualMachineRunCommandsClient ¶
type VirtualMachineRunCommandsClient struct {
// contains filtered or unexported fields
}
VirtualMachineRunCommandsClient contains the methods for the VirtualMachineRunCommands group. Don't use this type directly, use NewVirtualMachineRunCommandsClient() instead.
func NewVirtualMachineRunCommandsClient ¶
func NewVirtualMachineRunCommandsClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*VirtualMachineRunCommandsClient, error)
NewVirtualMachineRunCommandsClient creates a new instance of VirtualMachineRunCommandsClient 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 (*VirtualMachineRunCommandsClient) BeginCreateOrUpdate ¶
func (client *VirtualMachineRunCommandsClient) BeginCreateOrUpdate(ctx context.Context, resourceGroupName string, vmName string, runCommandName string, runCommand VirtualMachineRunCommand, options *VirtualMachineRunCommandsClientBeginCreateOrUpdateOptions) (*runtime.Poller[VirtualMachineRunCommandsClientCreateOrUpdateResponse], error)
BeginCreateOrUpdate - The operation to create or update the run command. If the operation fails it returns an *azcore.ResponseError type.
Generated from API version 2024-03-01
- resourceGroupName - The name of the resource group.
- vmName - The name of the virtual machine where the run command should be created or updated.
- runCommandName - The name of the virtual machine run command.
- runCommand - Parameters supplied to the Create Virtual Machine RunCommand operation.
- options - VirtualMachineRunCommandsClientBeginCreateOrUpdateOptions contains the optional parameters for the VirtualMachineRunCommandsClient.BeginCreateOrUpdate method.
Example ¶
Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/92de53a5f1e0e03c94b40475d2135d97148ed014/specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-03-01/examples/runCommandExamples/VirtualMachineRunCommand_CreateOrUpdate.json
cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() clientFactory, err := armcompute.NewClientFactory("<subscription-id>", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } poller, err := clientFactory.NewVirtualMachineRunCommandsClient().BeginCreateOrUpdate(ctx, "myResourceGroup", "myVM", "myRunCommand", armcompute.VirtualMachineRunCommand{ Location: to.Ptr("West US"), Properties: &armcompute.VirtualMachineRunCommandProperties{ AsyncExecution: to.Ptr(false), ErrorBlobURI: to.Ptr("https://mystorageaccount.blob.core.windows.net/scriptcontainer/scriptURI"), OutputBlobManagedIdentity: &armcompute.RunCommandManagedIdentity{ ClientID: to.Ptr("22d35efb-0c99-4041-8c5b-6d24db33a69a"), }, OutputBlobURI: to.Ptr("https://mystorageaccount.blob.core.windows.net/myscriptoutputcontainer/MyScriptoutput.txt"), Parameters: []*armcompute.RunCommandInputParameter{ { Name: to.Ptr("param1"), Value: to.Ptr("value1"), }, { Name: to.Ptr("param2"), Value: to.Ptr("value2"), }}, RunAsPassword: to.Ptr("<runAsPassword>"), RunAsUser: to.Ptr("user1"), Source: &armcompute.VirtualMachineRunCommandScriptSource{ ScriptURI: to.Ptr("https://mystorageaccount.blob.core.windows.net/scriptcontainer/scriptURI"), }, TimeoutInSeconds: to.Ptr[int32](3600), TreatFailureAsDeploymentFailure: to.Ptr(false), }, }, nil) if err != nil { log.Fatalf("failed to finish the request: %v", err) } res, err := poller.PollUntilDone(ctx, nil) if err != nil { log.Fatalf("failed to pull the result: %v", err) } // You could use response here. We use blank identifier for just demo purposes. _ = res // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. // res.VirtualMachineRunCommand = armcompute.VirtualMachineRunCommand{ // Name: to.Ptr("myRunCommand"), // Type: to.Ptr("Microsoft.Compute/virtualMachines/runCommands"), // ID: to.Ptr("/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/virtualMachines/myVM/runCommands/myRunCommand"), // Location: to.Ptr("westus"), // Tags: map[string]*string{ // "tag1": to.Ptr("value1"), // "tag2": to.Ptr("value2"), // }, // Properties: &armcompute.VirtualMachineRunCommandProperties{ // AsyncExecution: to.Ptr(false), // ErrorBlobURI: to.Ptr("https://mystorageaccount.blob.core.windows.net/mycontainer/MyScriptError.txt"), // OutputBlobURI: to.Ptr("https://mystorageaccount.blob.core.windows.net/myscriptoutputcontainer/MyScriptoutput.txt"), // Parameters: []*armcompute.RunCommandInputParameter{ // { // Name: to.Ptr("param1"), // Value: to.Ptr("value1"), // }, // { // Name: to.Ptr("param2"), // Value: to.Ptr("value2"), // }}, // ProvisioningState: to.Ptr("Succeeded"), // RunAsUser: to.Ptr("user1"), // Source: &armcompute.VirtualMachineRunCommandScriptSource{ // ScriptURI: to.Ptr("https://mystorageaccount.blob.core.windows.net/scriptcontainer/MyScript.ps1"), // }, // TimeoutInSeconds: to.Ptr[int32](3600), // TreatFailureAsDeploymentFailure: to.Ptr(false), // }, // }
Output:
func (*VirtualMachineRunCommandsClient) BeginDelete ¶
func (client *VirtualMachineRunCommandsClient) BeginDelete(ctx context.Context, resourceGroupName string, vmName string, runCommandName string, options *VirtualMachineRunCommandsClientBeginDeleteOptions) (*runtime.Poller[VirtualMachineRunCommandsClientDeleteResponse], error)
BeginDelete - The operation to delete the run command. If the operation fails it returns an *azcore.ResponseError type.
Generated from API version 2024-03-01
- resourceGroupName - The name of the resource group.
- vmName - The name of the virtual machine where the run command should be deleted.
- runCommandName - The name of the virtual machine run command.
- options - VirtualMachineRunCommandsClientBeginDeleteOptions contains the optional parameters for the VirtualMachineRunCommandsClient.BeginDelete method.
Example ¶
Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/92de53a5f1e0e03c94b40475d2135d97148ed014/specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-03-01/examples/runCommandExamples/VirtualMachineRunCommand_Delete.json
cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() clientFactory, err := armcompute.NewClientFactory("<subscription-id>", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } poller, err := clientFactory.NewVirtualMachineRunCommandsClient().BeginDelete(ctx, "myResourceGroup", "myVM", "myRunCommand", nil) if err != nil { log.Fatalf("failed to finish the request: %v", err) } _, err = poller.PollUntilDone(ctx, nil) if err != nil { log.Fatalf("failed to pull the result: %v", err) }
Output:
func (*VirtualMachineRunCommandsClient) BeginUpdate ¶
func (client *VirtualMachineRunCommandsClient) BeginUpdate(ctx context.Context, resourceGroupName string, vmName string, runCommandName string, runCommand VirtualMachineRunCommandUpdate, options *VirtualMachineRunCommandsClientBeginUpdateOptions) (*runtime.Poller[VirtualMachineRunCommandsClientUpdateResponse], error)
BeginUpdate - The operation to update the run command. If the operation fails it returns an *azcore.ResponseError type.
Generated from API version 2024-03-01
- resourceGroupName - The name of the resource group.
- vmName - The name of the virtual machine where the run command should be updated.
- runCommandName - The name of the virtual machine run command.
- runCommand - Parameters supplied to the Update Virtual Machine RunCommand operation.
- options - VirtualMachineRunCommandsClientBeginUpdateOptions contains the optional parameters for the VirtualMachineRunCommandsClient.BeginUpdate method.
Example ¶
Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/92de53a5f1e0e03c94b40475d2135d97148ed014/specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-03-01/examples/runCommandExamples/VirtualMachineRunCommand_Update.json
cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() clientFactory, err := armcompute.NewClientFactory("<subscription-id>", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } poller, err := clientFactory.NewVirtualMachineRunCommandsClient().BeginUpdate(ctx, "myResourceGroup", "myVM", "myRunCommand", armcompute.VirtualMachineRunCommandUpdate{ Properties: &armcompute.VirtualMachineRunCommandProperties{ AsyncExecution: to.Ptr(false), ErrorBlobManagedIdentity: &armcompute.RunCommandManagedIdentity{ ObjectID: to.Ptr("4231e4d2-33e4-4e23-96b2-17888afa6072"), }, ErrorBlobURI: to.Ptr("https://mystorageaccount.blob.core.windows.net/mycontainer/MyScriptError.txt"), OutputBlobURI: to.Ptr("https://mystorageaccount.blob.core.windows.net/myscriptoutputcontainer/outputUri"), Parameters: []*armcompute.RunCommandInputParameter{ { Name: to.Ptr("param1"), Value: to.Ptr("value1"), }, { Name: to.Ptr("param2"), Value: to.Ptr("value2"), }}, RunAsPassword: to.Ptr("<runAsPassword>"), RunAsUser: to.Ptr("user1"), Source: &armcompute.VirtualMachineRunCommandScriptSource{ Script: to.Ptr("Write-Host Hello World! ; Remove-Item C: est estFile.txt"), }, TimeoutInSeconds: to.Ptr[int32](3600), }, }, nil) if err != nil { log.Fatalf("failed to finish the request: %v", err) } res, err := poller.PollUntilDone(ctx, nil) if err != nil { log.Fatalf("failed to pull the result: %v", err) } // You could use response here. We use blank identifier for just demo purposes. _ = res // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. // res.VirtualMachineRunCommand = armcompute.VirtualMachineRunCommand{ // Name: to.Ptr("myRunCommand"), // Type: to.Ptr("Microsoft.Compute/virtualMachines/runCommands"), // ID: to.Ptr("/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/virtualMachines/myVM/runCommands/myRunCommand"), // Location: to.Ptr("westus"), // Tags: map[string]*string{ // "tag1": to.Ptr("value1"), // "tag2": to.Ptr("value2"), // }, // Properties: &armcompute.VirtualMachineRunCommandProperties{ // AsyncExecution: to.Ptr(false), // ErrorBlobURI: to.Ptr("https://mystorageaccount.blob.core.windows.net/mycontainer/MyScriptError.txt"), // OutputBlobURI: to.Ptr("https://mystorageaccount.blob.core.windows.net/myscriptoutputcontainer/MyScriptoutput.txt"), // Parameters: []*armcompute.RunCommandInputParameter{ // { // Name: to.Ptr("param1"), // Value: to.Ptr("value1"), // }, // { // Name: to.Ptr("param2"), // Value: to.Ptr("value2"), // }}, // ProvisioningState: to.Ptr("Succeeded"), // RunAsUser: to.Ptr("user1"), // Source: &armcompute.VirtualMachineRunCommandScriptSource{ // Script: to.Ptr("Write-Host Hello World! ; Remove-Item C: est estFile.txt"), // }, // TimeoutInSeconds: to.Ptr[int32](3600), // TreatFailureAsDeploymentFailure: to.Ptr(false), // }, // }
Output:
func (*VirtualMachineRunCommandsClient) Get ¶
func (client *VirtualMachineRunCommandsClient) Get(ctx context.Context, location string, commandID string, options *VirtualMachineRunCommandsClientGetOptions) (VirtualMachineRunCommandsClientGetResponse, error)
Get - Gets specific run command for a subscription in a location. If the operation fails it returns an *azcore.ResponseError type.
Generated from API version 2024-03-01
- location - The location upon which run commands is queried.
- commandID - The command id.
- options - VirtualMachineRunCommandsClientGetOptions contains the optional parameters for the VirtualMachineRunCommandsClient.Get method.
Example ¶
Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/92de53a5f1e0e03c94b40475d2135d97148ed014/specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-03-01/examples/runCommandExamples/RunCommand_Get.json
cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() clientFactory, err := armcompute.NewClientFactory("<subscription-id>", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } res, err := clientFactory.NewVirtualMachineRunCommandsClient().Get(ctx, "SoutheastAsia", "RunPowerShellScript", nil) if err != nil { log.Fatalf("failed to finish the request: %v", err) } // You could use response here. We use blank identifier for just demo purposes. _ = res // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. // res.RunCommandDocument = armcompute.RunCommandDocument{ // Description: to.Ptr("Custom multiline PowerShell script should be defined in script property. Optional parameters can be set in parameters property."), // Schema: to.Ptr("http://schema.management.azure.com/schemas/2016-11-17/runcommands.json"), // ID: to.Ptr("RunPowerShellScript"), // Label: to.Ptr("Executes a PowerShell script"), // OSType: to.Ptr(armcompute.OperatingSystemTypesWindows), // Parameters: []*armcompute.RunCommandParameterDefinition{ // { // Name: to.Ptr("arg1"), // Type: to.Ptr("string"), // DefaultValue: to.Ptr("value1"), // }, // { // Name: to.Ptr("arg2"), // Type: to.Ptr("string"), // DefaultValue: to.Ptr("value2"), // }}, // Script: []*string{ // to.Ptr("param("), // to.Ptr(" [string]$arg1,"), // to.Ptr(" [string]$arg2"), // to.Ptr(")"), // to.Ptr("Write-Host This is a sample script with parameters $arg1 $arg2")}, // }
Output:
func (*VirtualMachineRunCommandsClient) GetByVirtualMachine ¶
func (client *VirtualMachineRunCommandsClient) GetByVirtualMachine(ctx context.Context, resourceGroupName string, vmName string, runCommandName string, options *VirtualMachineRunCommandsClientGetByVirtualMachineOptions) (VirtualMachineRunCommandsClientGetByVirtualMachineResponse, error)
GetByVirtualMachine - The operation to get the run command. If the operation fails it returns an *azcore.ResponseError type.
Generated from API version 2024-03-01
- resourceGroupName - The name of the resource group.
- vmName - The name of the virtual machine containing the run command.
- runCommandName - The name of the virtual machine run command.
- options - VirtualMachineRunCommandsClientGetByVirtualMachineOptions contains the optional parameters for the VirtualMachineRunCommandsClient.GetByVirtualMachine method.
Example ¶
Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/92de53a5f1e0e03c94b40475d2135d97148ed014/specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-03-01/examples/runCommandExamples/VirtualMachineRunCommand_Get.json
cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() clientFactory, err := armcompute.NewClientFactory("<subscription-id>", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } res, err := clientFactory.NewVirtualMachineRunCommandsClient().GetByVirtualMachine(ctx, "myResourceGroup", "myVM", "myRunCommand", &armcompute.VirtualMachineRunCommandsClientGetByVirtualMachineOptions{Expand: nil}) if err != nil { log.Fatalf("failed to finish the request: %v", err) } // You could use response here. We use blank identifier for just demo purposes. _ = res // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. // res.VirtualMachineRunCommand = armcompute.VirtualMachineRunCommand{ // Name: to.Ptr("myRunCommand"), // Type: to.Ptr("Microsoft.Compute/virtualMachines/runCommands"), // ID: to.Ptr("/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/virtualMachines/myVM/runCommands/myRunCommand"), // Location: to.Ptr("westus"), // Tags: map[string]*string{ // "tag1": to.Ptr("value1"), // "tag2": to.Ptr("value2"), // }, // Properties: &armcompute.VirtualMachineRunCommandProperties{ // AsyncExecution: to.Ptr(false), // ErrorBlobURI: to.Ptr("https://mystorageaccount.blob.core.windows.net/mycontainer/MyScriptError.txt"), // OutputBlobURI: to.Ptr("https://mystorageaccount.blob.core.windows.net/myscriptoutputcontainer/MyScriptoutput.txt"), // Parameters: []*armcompute.RunCommandInputParameter{ // { // Name: to.Ptr("param1"), // Value: to.Ptr("value1"), // }, // { // Name: to.Ptr("param2"), // Value: to.Ptr("value2"), // }}, // ProvisioningState: to.Ptr("Succeeded"), // RunAsUser: to.Ptr("user1"), // Source: &armcompute.VirtualMachineRunCommandScriptSource{ // Script: to.Ptr("Write-Host Hello World! ; Remove-Item C: est estFile.txt"), // }, // TimeoutInSeconds: to.Ptr[int32](3600), // TreatFailureAsDeploymentFailure: to.Ptr(false), // }, // }
Output:
func (*VirtualMachineRunCommandsClient) NewListByVirtualMachinePager ¶
func (client *VirtualMachineRunCommandsClient) NewListByVirtualMachinePager(resourceGroupName string, vmName string, options *VirtualMachineRunCommandsClientListByVirtualMachineOptions) *runtime.Pager[VirtualMachineRunCommandsClientListByVirtualMachineResponse]
NewListByVirtualMachinePager - The operation to get all run commands of a Virtual Machine.
Generated from API version 2024-03-01
- resourceGroupName - The name of the resource group.
- vmName - The name of the virtual machine containing the run command.
- options - VirtualMachineRunCommandsClientListByVirtualMachineOptions contains the optional parameters for the VirtualMachineRunCommandsClient.NewListByVirtualMachinePager method.
Example ¶
Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/92de53a5f1e0e03c94b40475d2135d97148ed014/specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-03-01/examples/runCommandExamples/VirtualMachineRunCommand_List.json
cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() clientFactory, err := armcompute.NewClientFactory("<subscription-id>", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } pager := clientFactory.NewVirtualMachineRunCommandsClient().NewListByVirtualMachinePager("myResourceGroup", "myVM", &armcompute.VirtualMachineRunCommandsClientListByVirtualMachineOptions{Expand: nil}) for pager.More() { page, err := pager.NextPage(ctx) if err != nil { log.Fatalf("failed to advance page: %v", err) } for _, v := range page.Value { // You could use page here. We use blank identifier for just demo purposes. _ = v } // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. // page.VirtualMachineRunCommandsListResult = armcompute.VirtualMachineRunCommandsListResult{ // Value: []*armcompute.VirtualMachineRunCommand{ // { // Name: to.Ptr("myRunCommand"), // Type: to.Ptr("Microsoft.Compute/virtualMachines/runCommands"), // ID: to.Ptr("/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/virtualMachines/myVM/runCommands/myRunCommand"), // Location: to.Ptr("westus"), // Tags: map[string]*string{ // "tag1": to.Ptr("value1"), // "tag2": to.Ptr("value2"), // }, // Properties: &armcompute.VirtualMachineRunCommandProperties{ // AsyncExecution: to.Ptr(false), // ErrorBlobURI: to.Ptr("https://mystorageaccount.blob.core.windows.net/mycontainer/MyScriptError.txt"), // OutputBlobURI: to.Ptr("https://mystorageaccount.blob.core.windows.net/myscriptoutputcontainer/MyScriptoutput.txt"), // Parameters: []*armcompute.RunCommandInputParameter{ // { // Name: to.Ptr("param1"), // Value: to.Ptr("value1"), // }, // { // Name: to.Ptr("param2"), // Value: to.Ptr("value2"), // }}, // ProvisioningState: to.Ptr("Succeeded"), // RunAsUser: to.Ptr("user1"), // Source: &armcompute.VirtualMachineRunCommandScriptSource{ // Script: to.Ptr("Write-Host Hello World!"), // }, // TimeoutInSeconds: to.Ptr[int32](0), // TreatFailureAsDeploymentFailure: to.Ptr(false), // }, // }}, // } }
Output:
func (*VirtualMachineRunCommandsClient) NewListPager ¶
func (client *VirtualMachineRunCommandsClient) NewListPager(location string, options *VirtualMachineRunCommandsClientListOptions) *runtime.Pager[VirtualMachineRunCommandsClientListResponse]
NewListPager - Lists all available run commands for a subscription in a location.
Generated from API version 2024-03-01
- location - The location upon which run commands is queried.
- options - VirtualMachineRunCommandsClientListOptions contains the optional parameters for the VirtualMachineRunCommandsClient.NewListPager method.
Example ¶
Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/92de53a5f1e0e03c94b40475d2135d97148ed014/specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-03-01/examples/runCommandExamples/RunCommand_List.json
cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() clientFactory, err := armcompute.NewClientFactory("<subscription-id>", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } pager := clientFactory.NewVirtualMachineRunCommandsClient().NewListPager("SoutheastAsia", nil) for pager.More() { page, err := pager.NextPage(ctx) if err != nil { log.Fatalf("failed to advance page: %v", err) } for _, v := range page.Value { // You could use page here. We use blank identifier for just demo purposes. _ = v } // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. // page.RunCommandListResult = armcompute.RunCommandListResult{ // Value: []*armcompute.RunCommandDocumentBase{ // { // Description: to.Ptr("Configure the machine to enable remote PowerShell."), // Schema: to.Ptr("http://schema.management.azure.com/schemas/2016-11-17/runcommands.json"), // ID: to.Ptr("EnableRemotePS"), // Label: to.Ptr("Enable remote PowerShell"), // OSType: to.Ptr(armcompute.OperatingSystemTypesWindows), // }, // { // Description: to.Ptr("Shows detailed information for the IP address, subnet mask and default gateway for each adapter bound to TCP/IP."), // Schema: to.Ptr("http://schema.management.azure.com/schemas/2016-11-17/runcommands.json"), // ID: to.Ptr("IPConfig"), // Label: to.Ptr("List IP configuration"), // OSType: to.Ptr(armcompute.OperatingSystemTypesWindows), // }, // { // Description: to.Ptr("Custom multiline PowerShell script should be defined in script property. Optional parameters can be set in parameters property."), // Schema: to.Ptr("http://schema.management.azure.com/schemas/2016-11-17/runcommands.json"), // ID: to.Ptr("RunPowerShellScript"), // Label: to.Ptr("Executes a PowerShell script"), // OSType: to.Ptr(armcompute.OperatingSystemTypesWindows), // }, // { // Description: to.Ptr("Custom multiline shell script should be defined in script property. Optional parameters can be set in parameters property."), // Schema: to.Ptr("http://schema.management.azure.com/schemas/2016-11-17/runcommands.json"), // ID: to.Ptr("RunShellScript"), // Label: to.Ptr("Executes a Linux shell script"), // OSType: to.Ptr(armcompute.OperatingSystemTypesLinux), // }, // { // Description: to.Ptr("Get the configuration of all network interfaces."), // Schema: to.Ptr("http://schema.management.azure.com/schemas/2016-11-17/runcommands.json"), // ID: to.Ptr("ifconfig"), // Label: to.Ptr("List network configuration"), // OSType: to.Ptr(armcompute.OperatingSystemTypesLinux), // }, // { // Description: to.Ptr("Checks if the local Administrator account is disabled, and if so enables it."), // Schema: to.Ptr("http://schema.management.azure.com/schemas/2016-11-17/runcommands.json"), // ID: to.Ptr("EnableAdminAccount"), // Label: to.Ptr("Enable administrator account"), // OSType: to.Ptr(armcompute.OperatingSystemTypesWindows), // }, // { // Description: to.Ptr("Reset built-in Administrator account password."), // Schema: to.Ptr("http://schema.management.azure.com/schemas/2016-11-17/runcommands.json"), // ID: to.Ptr("ResetAccountPassword"), // Label: to.Ptr("Reset built-in Administrator account password"), // OSType: to.Ptr(armcompute.OperatingSystemTypesWindows), // }, // { // Description: to.Ptr("Checks registry settings and domain policy settings. Suggests policy actions if machine is part of a domain or modifies the settings to default values."), // Schema: to.Ptr("http://schema.management.azure.com/schemas/2016-11-17/runcommands.json"), // ID: to.Ptr("RDPSettings"), // Label: to.Ptr("Verify RDP Listener Settings"), // OSType: to.Ptr(armcompute.OperatingSystemTypesWindows), // }, // { // Description: to.Ptr("Sets the default or user specified port number for Remote Desktop connections. Enables firewall rule for inbound access to the port."), // Schema: to.Ptr("http://schema.management.azure.com/schemas/2016-11-17/runcommands.json"), // ID: to.Ptr("SetRDPPort"), // Label: to.Ptr("Set Remote Desktop port"), // OSType: to.Ptr(armcompute.OperatingSystemTypesWindows), // }, // { // Description: to.Ptr("Removes the SSL certificate tied to the RDP listener and restores the RDP listerner security to default. Use this script if you see any issues with the certificate."), // Schema: to.Ptr("http://schema.management.azure.com/schemas/2016-11-17/runcommands.json"), // ID: to.Ptr("ResetRDPCert"), // Label: to.Ptr("Restore RDP Authentication mode to defaults"), // OSType: to.Ptr(armcompute.OperatingSystemTypesWindows), // }}, // } }
Output:
type VirtualMachineRunCommandsClientBeginCreateOrUpdateOptions ¶
type VirtualMachineRunCommandsClientBeginCreateOrUpdateOptions struct { // Resumes the LRO from the provided token. ResumeToken string }
VirtualMachineRunCommandsClientBeginCreateOrUpdateOptions contains the optional parameters for the VirtualMachineRunCommandsClient.BeginCreateOrUpdate method.
type VirtualMachineRunCommandsClientBeginDeleteOptions ¶
type VirtualMachineRunCommandsClientBeginDeleteOptions struct { // Resumes the LRO from the provided token. ResumeToken string }
VirtualMachineRunCommandsClientBeginDeleteOptions contains the optional parameters for the VirtualMachineRunCommandsClient.BeginDelete method.
type VirtualMachineRunCommandsClientBeginUpdateOptions ¶
type VirtualMachineRunCommandsClientBeginUpdateOptions struct { // Resumes the LRO from the provided token. ResumeToken string }
VirtualMachineRunCommandsClientBeginUpdateOptions contains the optional parameters for the VirtualMachineRunCommandsClient.BeginUpdate method.
type VirtualMachineRunCommandsClientCreateOrUpdateResponse ¶
type VirtualMachineRunCommandsClientCreateOrUpdateResponse struct { // Describes a Virtual Machine run command. VirtualMachineRunCommand }
VirtualMachineRunCommandsClientCreateOrUpdateResponse contains the response from method VirtualMachineRunCommandsClient.BeginCreateOrUpdate.
type VirtualMachineRunCommandsClientDeleteResponse ¶
type VirtualMachineRunCommandsClientDeleteResponse struct { }
VirtualMachineRunCommandsClientDeleteResponse contains the response from method VirtualMachineRunCommandsClient.BeginDelete.
type VirtualMachineRunCommandsClientGetByVirtualMachineOptions ¶
type VirtualMachineRunCommandsClientGetByVirtualMachineOptions struct { // The expand expression to apply on the operation. Expand *string }
VirtualMachineRunCommandsClientGetByVirtualMachineOptions contains the optional parameters for the VirtualMachineRunCommandsClient.GetByVirtualMachine method.
type VirtualMachineRunCommandsClientGetByVirtualMachineResponse ¶
type VirtualMachineRunCommandsClientGetByVirtualMachineResponse struct { // Describes a Virtual Machine run command. VirtualMachineRunCommand }
VirtualMachineRunCommandsClientGetByVirtualMachineResponse contains the response from method VirtualMachineRunCommandsClient.GetByVirtualMachine.
type VirtualMachineRunCommandsClientGetOptions ¶
type VirtualMachineRunCommandsClientGetOptions struct { }
VirtualMachineRunCommandsClientGetOptions contains the optional parameters for the VirtualMachineRunCommandsClient.Get method.
type VirtualMachineRunCommandsClientGetResponse ¶
type VirtualMachineRunCommandsClientGetResponse struct { // Describes the properties of a Run Command. RunCommandDocument }
VirtualMachineRunCommandsClientGetResponse contains the response from method VirtualMachineRunCommandsClient.Get.
type VirtualMachineRunCommandsClientListByVirtualMachineOptions ¶
type VirtualMachineRunCommandsClientListByVirtualMachineOptions struct { // The expand expression to apply on the operation. Expand *string }
VirtualMachineRunCommandsClientListByVirtualMachineOptions contains the optional parameters for the VirtualMachineRunCommandsClient.NewListByVirtualMachinePager method.
type VirtualMachineRunCommandsClientListByVirtualMachineResponse ¶
type VirtualMachineRunCommandsClientListByVirtualMachineResponse struct { // The List run command operation response VirtualMachineRunCommandsListResult }
VirtualMachineRunCommandsClientListByVirtualMachineResponse contains the response from method VirtualMachineRunCommandsClient.NewListByVirtualMachinePager.
type VirtualMachineRunCommandsClientListOptions ¶
type VirtualMachineRunCommandsClientListOptions struct { }
VirtualMachineRunCommandsClientListOptions contains the optional parameters for the VirtualMachineRunCommandsClient.NewListPager method.
type VirtualMachineRunCommandsClientListResponse ¶
type VirtualMachineRunCommandsClientListResponse struct { // The List Virtual Machine operation response. RunCommandListResult }
VirtualMachineRunCommandsClientListResponse contains the response from method VirtualMachineRunCommandsClient.NewListPager.
type VirtualMachineRunCommandsClientUpdateResponse ¶
type VirtualMachineRunCommandsClientUpdateResponse struct { // Describes a Virtual Machine run command. VirtualMachineRunCommand }
VirtualMachineRunCommandsClientUpdateResponse contains the response from method VirtualMachineRunCommandsClient.BeginUpdate.
type VirtualMachineRunCommandsListResult ¶
type VirtualMachineRunCommandsListResult struct { // REQUIRED; The list of run commands Value []*VirtualMachineRunCommand // The uri to fetch the next page of run commands. NextLink *string }
VirtualMachineRunCommandsListResult - The List run command operation response
func (VirtualMachineRunCommandsListResult) MarshalJSON ¶
func (v VirtualMachineRunCommandsListResult) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type VirtualMachineRunCommandsListResult.
func (*VirtualMachineRunCommandsListResult) UnmarshalJSON ¶
func (v *VirtualMachineRunCommandsListResult) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type VirtualMachineRunCommandsListResult.
type VirtualMachineScaleSet ¶
type VirtualMachineScaleSet struct { // REQUIRED; Resource location Location *string // The extended location of the Virtual Machine Scale Set. ExtendedLocation *ExtendedLocation // The identity of the virtual machine scale set, if configured. Identity *VirtualMachineScaleSetIdentity // Specifies information about the marketplace image used to create the virtual machine. This element is only used for marketplace // images. Before you can use a marketplace image from an API, you must // enable the image for programmatic use. In the Azure portal, find the marketplace image that you want to use and then click // Want to deploy programmatically, Get Started ->. Enter any required // information and then click Save. Plan *Plan // Describes the properties of a Virtual Machine Scale Set. Properties *VirtualMachineScaleSetProperties // The virtual machine scale set sku. SKU *SKU // Resource tags Tags map[string]*string // The virtual machine scale set zones. NOTE: Availability zones can only be set when you create the scale set Zones []*string // READ-ONLY; Etag is property returned in Create/Update/Get response of the VMSS, so that customer can supply it in the header // to ensure optimistic updates Etag *string // READ-ONLY; Resource Id ID *string // READ-ONLY; Resource name Name *string // READ-ONLY; Resource type Type *string }
VirtualMachineScaleSet - Describes a Virtual Machine Scale Set.
func (VirtualMachineScaleSet) MarshalJSON ¶
func (v VirtualMachineScaleSet) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type VirtualMachineScaleSet.
func (*VirtualMachineScaleSet) UnmarshalJSON ¶
func (v *VirtualMachineScaleSet) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type VirtualMachineScaleSet.
type VirtualMachineScaleSetDataDisk ¶
type VirtualMachineScaleSetDataDisk struct { // REQUIRED; The create option. CreateOption *DiskCreateOptionTypes // REQUIRED; Specifies the logical unit number of the data disk. This value is used to identify data disks within the VM and // therefore must be unique for each data disk attached to a VM. Lun *int32 // Specifies the caching requirements. Possible values are: None, ReadOnly, ReadWrite. The default values are: None for Standard // storage. ReadOnly for Premium storage. Caching *CachingTypes // Specifies whether data disk should be deleted or detached upon VMSS Flex deletion (This feature is available for VMSS with // Flexible OrchestrationMode only). // Possible values: // Delete If this value is used, the data disk is deleted when the VMSS Flex VM is deleted. // Detach If this value is used, the data disk is retained after VMSS Flex VM is deleted. // The default value is set to Delete. DeleteOption *DiskDeleteOptionTypes // Specifies the Read-Write IOPS for the managed disk. Should be used only when StorageAccountType is UltraSSD_LRS. If not // specified, a default value would be assigned based on diskSizeGB. DiskIOPSReadWrite *int64 // Specifies the bandwidth in MB per second for the managed disk. Should be used only when StorageAccountType is UltraSSD_LRS. // If not specified, a default value would be assigned based on diskSizeGB. DiskMBpsReadWrite *int64 // Specifies the size of an empty data disk in gigabytes. This element can be used to overwrite the size of the disk in a // virtual machine image. The property diskSizeGB is the number of bytes x 1024^3 // for the disk and the value cannot be larger than 1023. DiskSizeGB *int32 // The managed disk parameters. ManagedDisk *VirtualMachineScaleSetManagedDiskParameters // The disk name. Name *string // Specifies whether writeAccelerator should be enabled or disabled on the disk. WriteAcceleratorEnabled *bool }
VirtualMachineScaleSetDataDisk - Describes a virtual machine scale set data disk.
func (VirtualMachineScaleSetDataDisk) MarshalJSON ¶
func (v VirtualMachineScaleSetDataDisk) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type VirtualMachineScaleSetDataDisk.
func (*VirtualMachineScaleSetDataDisk) UnmarshalJSON ¶
func (v *VirtualMachineScaleSetDataDisk) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type VirtualMachineScaleSetDataDisk.
type VirtualMachineScaleSetExtension ¶
type VirtualMachineScaleSetExtension struct { // The name of the extension. Name *string // Describes the properties of a Virtual Machine Scale Set Extension. Properties *VirtualMachineScaleSetExtensionProperties // READ-ONLY; Resource Id ID *string // READ-ONLY; Resource type Type *string }
VirtualMachineScaleSetExtension - Describes a Virtual Machine Scale Set Extension.
func (VirtualMachineScaleSetExtension) MarshalJSON ¶
func (v VirtualMachineScaleSetExtension) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type VirtualMachineScaleSetExtension.
func (*VirtualMachineScaleSetExtension) UnmarshalJSON ¶
func (v *VirtualMachineScaleSetExtension) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type VirtualMachineScaleSetExtension.
type VirtualMachineScaleSetExtensionListResult ¶
type VirtualMachineScaleSetExtensionListResult struct { // REQUIRED; The list of VM scale set extensions. Value []*VirtualMachineScaleSetExtension // The uri to fetch the next page of VM scale set extensions. Call ListNext() with this to fetch the next page of VM scale // set extensions. NextLink *string }
VirtualMachineScaleSetExtensionListResult - The List VM scale set extension operation response.
func (VirtualMachineScaleSetExtensionListResult) MarshalJSON ¶
func (v VirtualMachineScaleSetExtensionListResult) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type VirtualMachineScaleSetExtensionListResult.
func (*VirtualMachineScaleSetExtensionListResult) UnmarshalJSON ¶
func (v *VirtualMachineScaleSetExtensionListResult) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type VirtualMachineScaleSetExtensionListResult.
type VirtualMachineScaleSetExtensionProfile ¶
type VirtualMachineScaleSetExtensionProfile struct { // The virtual machine scale set child extension resources. Extensions []*VirtualMachineScaleSetExtension // Specifies the time alloted for all extensions to start. The time duration should be between 15 minutes and 120 minutes // (inclusive) and should be specified in ISO 8601 format. The default value is 90 // minutes (PT1H30M). Minimum api-version: 2020-06-01. ExtensionsTimeBudget *string }
VirtualMachineScaleSetExtensionProfile - Describes a virtual machine scale set extension profile.
func (VirtualMachineScaleSetExtensionProfile) MarshalJSON ¶
func (v VirtualMachineScaleSetExtensionProfile) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type VirtualMachineScaleSetExtensionProfile.
func (*VirtualMachineScaleSetExtensionProfile) UnmarshalJSON ¶
func (v *VirtualMachineScaleSetExtensionProfile) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type VirtualMachineScaleSetExtensionProfile.
type VirtualMachineScaleSetExtensionProperties ¶
type VirtualMachineScaleSetExtensionProperties struct { // Indicates whether the extension should use a newer minor version if one is available at deployment time. Once deployed, // however, the extension will not upgrade minor versions unless redeployed, even // with this property set to true. AutoUpgradeMinorVersion *bool // Indicates whether the extension should be automatically upgraded by the platform if there is a newer version of the extension // available. EnableAutomaticUpgrade *bool // If a value is provided and is different from the previous value, the extension handler will be forced to update even if // the extension configuration has not changed. ForceUpdateTag *string // The extension can contain either protectedSettings or protectedSettingsFromKeyVault or no protected settings at all. ProtectedSettings any // The extensions protected settings that are passed by reference, and consumed from key vault ProtectedSettingsFromKeyVault *KeyVaultSecretReference // Collection of extension names after which this extension needs to be provisioned. ProvisionAfterExtensions []*string // The name of the extension handler publisher. Publisher *string // Json formatted public settings for the extension. Settings any // Indicates whether failures stemming from the extension will be suppressed (Operational failures such as not connecting // to the VM will not be suppressed regardless of this value). The default is false. SuppressFailures *bool // Specifies the type of the extension; an example is "CustomScriptExtension". Type *string // Specifies the version of the script handler. TypeHandlerVersion *string // READ-ONLY; The provisioning state, which only appears in the response. ProvisioningState *string }
VirtualMachineScaleSetExtensionProperties - Describes the properties of a Virtual Machine Scale Set Extension.
func (VirtualMachineScaleSetExtensionProperties) MarshalJSON ¶
func (v VirtualMachineScaleSetExtensionProperties) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type VirtualMachineScaleSetExtensionProperties.
func (*VirtualMachineScaleSetExtensionProperties) UnmarshalJSON ¶
func (v *VirtualMachineScaleSetExtensionProperties) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type VirtualMachineScaleSetExtensionProperties.
type VirtualMachineScaleSetExtensionUpdate ¶
type VirtualMachineScaleSetExtensionUpdate struct { // Describes the properties of a Virtual Machine Scale Set Extension. Properties *VirtualMachineScaleSetExtensionProperties // READ-ONLY; Resource Id ID *string // READ-ONLY; The name of the extension. Name *string // READ-ONLY; Resource type Type *string }
VirtualMachineScaleSetExtensionUpdate - Describes a Virtual Machine Scale Set Extension.
func (VirtualMachineScaleSetExtensionUpdate) MarshalJSON ¶
func (v VirtualMachineScaleSetExtensionUpdate) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type VirtualMachineScaleSetExtensionUpdate.
func (*VirtualMachineScaleSetExtensionUpdate) UnmarshalJSON ¶
func (v *VirtualMachineScaleSetExtensionUpdate) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type VirtualMachineScaleSetExtensionUpdate.
type VirtualMachineScaleSetExtensionsClient ¶
type VirtualMachineScaleSetExtensionsClient struct {
// contains filtered or unexported fields
}
VirtualMachineScaleSetExtensionsClient contains the methods for the VirtualMachineScaleSetExtensions group. Don't use this type directly, use NewVirtualMachineScaleSetExtensionsClient() instead.
func NewVirtualMachineScaleSetExtensionsClient ¶
func NewVirtualMachineScaleSetExtensionsClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*VirtualMachineScaleSetExtensionsClient, error)
NewVirtualMachineScaleSetExtensionsClient creates a new instance of VirtualMachineScaleSetExtensionsClient 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 (*VirtualMachineScaleSetExtensionsClient) BeginCreateOrUpdate ¶
func (client *VirtualMachineScaleSetExtensionsClient) BeginCreateOrUpdate(ctx context.Context, resourceGroupName string, vmScaleSetName string, vmssExtensionName string, extensionParameters VirtualMachineScaleSetExtension, options *VirtualMachineScaleSetExtensionsClientBeginCreateOrUpdateOptions) (*runtime.Poller[VirtualMachineScaleSetExtensionsClientCreateOrUpdateResponse], error)
BeginCreateOrUpdate - The operation to create or update an extension. If the operation fails it returns an *azcore.ResponseError type.
Generated from API version 2024-03-01
- resourceGroupName - The name of the resource group.
- vmScaleSetName - The name of the VM scale set where the extension should be create or updated.
- vmssExtensionName - The name of the VM scale set extension.
- extensionParameters - Parameters supplied to the Create VM scale set Extension operation.
- options - VirtualMachineScaleSetExtensionsClientBeginCreateOrUpdateOptions contains the optional parameters for the VirtualMachineScaleSetExtensionsClient.BeginCreateOrUpdate method.
Example (VirtualMachineScaleSetExtensionCreateOrUpdateMaximumSetGen) ¶
Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/92de53a5f1e0e03c94b40475d2135d97148ed014/specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-03-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSetExtension_CreateOrUpdate_MaximumSet_Gen.json
cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() clientFactory, err := armcompute.NewClientFactory("<subscription-id>", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } poller, err := clientFactory.NewVirtualMachineScaleSetExtensionsClient().BeginCreateOrUpdate(ctx, "rgcompute", "aaaaaaa", "aaaaaaaaaaaaaaaaaaaaa", armcompute.VirtualMachineScaleSetExtension{ Name: to.Ptr("{extension-name}"), Properties: &armcompute.VirtualMachineScaleSetExtensionProperties{ Type: to.Ptr("{extension-Type}"), AutoUpgradeMinorVersion: to.Ptr(true), EnableAutomaticUpgrade: to.Ptr(true), ForceUpdateTag: to.Ptr("aaaaaaaaa"), ProtectedSettings: map[string]any{}, ProvisionAfterExtensions: []*string{ to.Ptr("aa")}, Publisher: to.Ptr("{extension-Publisher}"), Settings: map[string]any{}, SuppressFailures: to.Ptr(true), TypeHandlerVersion: to.Ptr("{handler-version}"), }, }, nil) if err != nil { log.Fatalf("failed to finish the request: %v", err) } res, err := poller.PollUntilDone(ctx, nil) if err != nil { log.Fatalf("failed to pull the result: %v", err) } // You could use response here. We use blank identifier for just demo purposes. _ = res // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. // res.VirtualMachineScaleSetExtension = armcompute.VirtualMachineScaleSetExtension{ // ID: to.Ptr("aaaaaaaa"), // Name: to.Ptr("{extension-name}"), // Type: to.Ptr("aaaaaaaaaaaaaaaaaaaaaaaa"), // Properties: &armcompute.VirtualMachineScaleSetExtensionProperties{ // Type: to.Ptr("{extension-Type}"), // AutoUpgradeMinorVersion: to.Ptr(true), // EnableAutomaticUpgrade: to.Ptr(true), // ForceUpdateTag: to.Ptr("aaaaaaaaa"), // ProtectedSettings: map[string]any{ // }, // ProvisionAfterExtensions: []*string{ // to.Ptr("aa")}, // ProvisioningState: to.Ptr("Succeeded"), // Publisher: to.Ptr("{extension-Publisher}"), // Settings: map[string]any{ // }, // SuppressFailures: to.Ptr(true), // TypeHandlerVersion: to.Ptr("{handler-version}"), // }, // }
Output:
Example (VirtualMachineScaleSetExtensionCreateOrUpdateMinimumSetGen) ¶
Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/92de53a5f1e0e03c94b40475d2135d97148ed014/specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-03-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSetExtension_CreateOrUpdate_MinimumSet_Gen.json
cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() clientFactory, err := armcompute.NewClientFactory("<subscription-id>", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } poller, err := clientFactory.NewVirtualMachineScaleSetExtensionsClient().BeginCreateOrUpdate(ctx, "rgcompute", "aaaaaaaaaaa", "aaaaaaaaaaa", armcompute.VirtualMachineScaleSetExtension{}, nil) if err != nil { log.Fatalf("failed to finish the request: %v", err) } res, err := poller.PollUntilDone(ctx, nil) if err != nil { log.Fatalf("failed to pull the result: %v", err) } // You could use response here. We use blank identifier for just demo purposes. _ = res // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. // res.VirtualMachineScaleSetExtension = armcompute.VirtualMachineScaleSetExtension{ // }
Output:
func (*VirtualMachineScaleSetExtensionsClient) BeginDelete ¶
func (client *VirtualMachineScaleSetExtensionsClient) BeginDelete(ctx context.Context, resourceGroupName string, vmScaleSetName string, vmssExtensionName string, options *VirtualMachineScaleSetExtensionsClientBeginDeleteOptions) (*runtime.Poller[VirtualMachineScaleSetExtensionsClientDeleteResponse], error)
BeginDelete - The operation to delete the extension. If the operation fails it returns an *azcore.ResponseError type.
Generated from API version 2024-03-01
- resourceGroupName - The name of the resource group.
- vmScaleSetName - The name of the VM scale set where the extension should be deleted.
- vmssExtensionName - The name of the VM scale set extension.
- options - VirtualMachineScaleSetExtensionsClientBeginDeleteOptions contains the optional parameters for the VirtualMachineScaleSetExtensionsClient.BeginDelete method.
Example (VirtualMachineScaleSetExtensionDeleteMaximumSetGen) ¶
Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/92de53a5f1e0e03c94b40475d2135d97148ed014/specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-03-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSetExtension_Delete_MaximumSet_Gen.json
cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() clientFactory, err := armcompute.NewClientFactory("<subscription-id>", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } poller, err := clientFactory.NewVirtualMachineScaleSetExtensionsClient().BeginDelete(ctx, "rgcompute", "aaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "aaaaaaaaaaaaaaaaaaaaaaaa", nil) if err != nil { log.Fatalf("failed to finish the request: %v", err) } _, err = poller.PollUntilDone(ctx, nil) if err != nil { log.Fatalf("failed to pull the result: %v", err) }
Output:
Example (VirtualMachineScaleSetExtensionDeleteMinimumSetGen) ¶
Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/92de53a5f1e0e03c94b40475d2135d97148ed014/specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-03-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSetExtension_Delete_MinimumSet_Gen.json
cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() clientFactory, err := armcompute.NewClientFactory("<subscription-id>", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } poller, err := clientFactory.NewVirtualMachineScaleSetExtensionsClient().BeginDelete(ctx, "rgcompute", "aaaa", "aaaaaaaaaaaaaaaaaaaaaaa", nil) if err != nil { log.Fatalf("failed to finish the request: %v", err) } _, err = poller.PollUntilDone(ctx, nil) if err != nil { log.Fatalf("failed to pull the result: %v", err) }
Output:
func (*VirtualMachineScaleSetExtensionsClient) BeginUpdate ¶
func (client *VirtualMachineScaleSetExtensionsClient) BeginUpdate(ctx context.Context, resourceGroupName string, vmScaleSetName string, vmssExtensionName string, extensionParameters VirtualMachineScaleSetExtensionUpdate, options *VirtualMachineScaleSetExtensionsClientBeginUpdateOptions) (*runtime.Poller[VirtualMachineScaleSetExtensionsClientUpdateResponse], error)
BeginUpdate - The operation to update an extension. If the operation fails it returns an *azcore.ResponseError type.
Generated from API version 2024-03-01
- resourceGroupName - The name of the resource group.
- vmScaleSetName - The name of the VM scale set where the extension should be updated.
- vmssExtensionName - The name of the VM scale set extension.
- extensionParameters - Parameters supplied to the Update VM scale set Extension operation.
- options - VirtualMachineScaleSetExtensionsClientBeginUpdateOptions contains the optional parameters for the VirtualMachineScaleSetExtensionsClient.BeginUpdate method.
Example (VirtualMachineScaleSetExtensionUpdateMaximumSetGen) ¶
Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/92de53a5f1e0e03c94b40475d2135d97148ed014/specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-03-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSetExtension_Update_MaximumSet_Gen.json
cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() clientFactory, err := armcompute.NewClientFactory("<subscription-id>", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } poller, err := clientFactory.NewVirtualMachineScaleSetExtensionsClient().BeginUpdate(ctx, "rgcompute", "aaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "aaaa", armcompute.VirtualMachineScaleSetExtensionUpdate{ Properties: &armcompute.VirtualMachineScaleSetExtensionProperties{ Type: to.Ptr("{extension-Type}"), AutoUpgradeMinorVersion: to.Ptr(true), EnableAutomaticUpgrade: to.Ptr(true), ForceUpdateTag: to.Ptr("aaaaaaaaa"), ProtectedSettings: map[string]any{}, ProvisionAfterExtensions: []*string{ to.Ptr("aa")}, Publisher: to.Ptr("{extension-Publisher}"), Settings: map[string]any{}, SuppressFailures: to.Ptr(true), TypeHandlerVersion: to.Ptr("{handler-version}"), }, }, nil) if err != nil { log.Fatalf("failed to finish the request: %v", err) } res, err := poller.PollUntilDone(ctx, nil) if err != nil { log.Fatalf("failed to pull the result: %v", err) } // You could use response here. We use blank identifier for just demo purposes. _ = res // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. // res.VirtualMachineScaleSetExtension = armcompute.VirtualMachineScaleSetExtension{ // ID: to.Ptr("aaaaaaaa"), // Name: to.Ptr("{extension-name}"), // Type: to.Ptr("aaaaaaaaaaaaaaaaaaaaaaaa"), // Properties: &armcompute.VirtualMachineScaleSetExtensionProperties{ // Type: to.Ptr("{extension-Type}"), // AutoUpgradeMinorVersion: to.Ptr(true), // EnableAutomaticUpgrade: to.Ptr(true), // ForceUpdateTag: to.Ptr("aaaaaaaaa"), // ProtectedSettings: map[string]any{ // }, // ProvisionAfterExtensions: []*string{ // to.Ptr("aa")}, // ProvisioningState: to.Ptr("Succeeded"), // Publisher: to.Ptr("{extension-Publisher}"), // Settings: map[string]any{ // }, // SuppressFailures: to.Ptr(true), // TypeHandlerVersion: to.Ptr("{handler-version}"), // }, // }
Output:
Example (VirtualMachineScaleSetExtensionUpdateMinimumSetGen) ¶
Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/92de53a5f1e0e03c94b40475d2135d97148ed014/specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-03-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSetExtension_Update_MinimumSet_Gen.json
cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() clientFactory, err := armcompute.NewClientFactory("<subscription-id>", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } poller, err := clientFactory.NewVirtualMachineScaleSetExtensionsClient().BeginUpdate(ctx, "rgcompute", "aaaaaaaaaaaaaaaaaaaaaaaaaa", "aa", armcompute.VirtualMachineScaleSetExtensionUpdate{}, nil) if err != nil { log.Fatalf("failed to finish the request: %v", err) } res, err := poller.PollUntilDone(ctx, nil) if err != nil { log.Fatalf("failed to pull the result: %v", err) } // You could use response here. We use blank identifier for just demo purposes. _ = res // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. // res.VirtualMachineScaleSetExtension = armcompute.VirtualMachineScaleSetExtension{ // }
Output:
func (*VirtualMachineScaleSetExtensionsClient) Get ¶
func (client *VirtualMachineScaleSetExtensionsClient) Get(ctx context.Context, resourceGroupName string, vmScaleSetName string, vmssExtensionName string, options *VirtualMachineScaleSetExtensionsClientGetOptions) (VirtualMachineScaleSetExtensionsClientGetResponse, error)
Get - The operation to get the extension. If the operation fails it returns an *azcore.ResponseError type.
Generated from API version 2024-03-01
- resourceGroupName - The name of the resource group.
- vmScaleSetName - The name of the VM scale set containing the extension.
- vmssExtensionName - The name of the VM scale set extension.
- options - VirtualMachineScaleSetExtensionsClientGetOptions contains the optional parameters for the VirtualMachineScaleSetExtensionsClient.Get method.
Example (VirtualMachineScaleSetExtensionGetMaximumSetGen) ¶
Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/92de53a5f1e0e03c94b40475d2135d97148ed014/specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-03-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSetExtension_Get_MaximumSet_Gen.json
cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() clientFactory, err := armcompute.NewClientFactory("<subscription-id>", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } res, err := clientFactory.NewVirtualMachineScaleSetExtensionsClient().Get(ctx, "rgcompute", "aaaaaaaaaaaaaaaaaaaaaaaa", "aaaaaaaaaaaaaaaaaaaa", &armcompute.VirtualMachineScaleSetExtensionsClientGetOptions{Expand: to.Ptr("aaaaaaa")}) if err != nil { log.Fatalf("failed to finish the request: %v", err) } // You could use response here. We use blank identifier for just demo purposes. _ = res // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. // res.VirtualMachineScaleSetExtension = armcompute.VirtualMachineScaleSetExtension{ // ID: to.Ptr("aaaaaaaa"), // Name: to.Ptr("{extension-name}"), // Type: to.Ptr("aaaaaaaaaaaaaaaaaaaaaaaa"), // Properties: &armcompute.VirtualMachineScaleSetExtensionProperties{ // Type: to.Ptr("{extension-Type}"), // AutoUpgradeMinorVersion: to.Ptr(true), // EnableAutomaticUpgrade: to.Ptr(true), // ForceUpdateTag: to.Ptr("aaaaaaaaa"), // ProtectedSettings: map[string]any{ // }, // ProvisionAfterExtensions: []*string{ // to.Ptr("aa")}, // ProvisioningState: to.Ptr("Succeeded"), // Publisher: to.Ptr("{extension-Publisher}"), // Settings: map[string]any{ // }, // SuppressFailures: to.Ptr(true), // TypeHandlerVersion: to.Ptr("{handler-version}"), // }, // }
Output:
Example (VirtualMachineScaleSetExtensionGetMinimumSetGen) ¶
Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/92de53a5f1e0e03c94b40475d2135d97148ed014/specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-03-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSetExtension_Get_MinimumSet_Gen.json
cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() clientFactory, err := armcompute.NewClientFactory("<subscription-id>", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } res, err := clientFactory.NewVirtualMachineScaleSetExtensionsClient().Get(ctx, "rgcompute", "a", "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", &armcompute.VirtualMachineScaleSetExtensionsClientGetOptions{Expand: nil}) if err != nil { log.Fatalf("failed to finish the request: %v", err) } // You could use response here. We use blank identifier for just demo purposes. _ = res // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. // res.VirtualMachineScaleSetExtension = armcompute.VirtualMachineScaleSetExtension{ // }
Output:
func (*VirtualMachineScaleSetExtensionsClient) NewListPager ¶
func (client *VirtualMachineScaleSetExtensionsClient) NewListPager(resourceGroupName string, vmScaleSetName string, options *VirtualMachineScaleSetExtensionsClientListOptions) *runtime.Pager[VirtualMachineScaleSetExtensionsClientListResponse]
NewListPager - Gets a list of all extensions in a VM scale set.
Generated from API version 2024-03-01
- resourceGroupName - The name of the resource group.
- vmScaleSetName - The name of the VM scale set containing the extension.
- options - VirtualMachineScaleSetExtensionsClientListOptions contains the optional parameters for the VirtualMachineScaleSetExtensionsClient.NewListPager method.
Example (VirtualMachineScaleSetExtensionListMaximumSetGen) ¶
Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/92de53a5f1e0e03c94b40475d2135d97148ed014/specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-03-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSetExtension_List_MaximumSet_Gen.json
cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() clientFactory, err := armcompute.NewClientFactory("<subscription-id>", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } pager := clientFactory.NewVirtualMachineScaleSetExtensionsClient().NewListPager("rgcompute", "aaaaaaaaaaaaaaaaaaaa", nil) for pager.More() { page, err := pager.NextPage(ctx) if err != nil { log.Fatalf("failed to advance page: %v", err) } for _, v := range page.Value { // You could use page here. We use blank identifier for just demo purposes. _ = v } // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. // page.VirtualMachineScaleSetExtensionListResult = armcompute.VirtualMachineScaleSetExtensionListResult{ // Value: []*armcompute.VirtualMachineScaleSetExtension{ // { // ID: to.Ptr("aaaaaaaa"), // Name: to.Ptr("{extension-name}"), // Type: to.Ptr("aaaaaaaaaaaaaaaaaaaaaaaa"), // Properties: &armcompute.VirtualMachineScaleSetExtensionProperties{ // Type: to.Ptr("{extension-Type}"), // AutoUpgradeMinorVersion: to.Ptr(true), // EnableAutomaticUpgrade: to.Ptr(true), // ForceUpdateTag: to.Ptr("aaaaaaaaa"), // ProtectedSettings: map[string]any{ // }, // ProvisionAfterExtensions: []*string{ // to.Ptr("aa")}, // ProvisioningState: to.Ptr("Succeeded"), // Publisher: to.Ptr("{extension-Publisher}"), // Settings: map[string]any{ // }, // SuppressFailures: to.Ptr(true), // TypeHandlerVersion: to.Ptr("{handler-version}"), // }, // }}, // } }
Output:
Example (VirtualMachineScaleSetExtensionListMinimumSetGen) ¶
Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/92de53a5f1e0e03c94b40475d2135d97148ed014/specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-03-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSetExtension_List_MinimumSet_Gen.json
cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() clientFactory, err := armcompute.NewClientFactory("<subscription-id>", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } pager := clientFactory.NewVirtualMachineScaleSetExtensionsClient().NewListPager("rgcompute", "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", nil) for pager.More() { page, err := pager.NextPage(ctx) if err != nil { log.Fatalf("failed to advance page: %v", err) } for _, v := range page.Value { // You could use page here. We use blank identifier for just demo purposes. _ = v } // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. // page.VirtualMachineScaleSetExtensionListResult = armcompute.VirtualMachineScaleSetExtensionListResult{ // Value: []*armcompute.VirtualMachineScaleSetExtension{ // { // }}, // } }
Output:
type VirtualMachineScaleSetExtensionsClientBeginCreateOrUpdateOptions ¶
type VirtualMachineScaleSetExtensionsClientBeginCreateOrUpdateOptions struct { // Resumes the LRO from the provided token. ResumeToken string }
VirtualMachineScaleSetExtensionsClientBeginCreateOrUpdateOptions contains the optional parameters for the VirtualMachineScaleSetExtensionsClient.BeginCreateOrUpdate method.
type VirtualMachineScaleSetExtensionsClientBeginDeleteOptions ¶
type VirtualMachineScaleSetExtensionsClientBeginDeleteOptions struct { // Resumes the LRO from the provided token. ResumeToken string }
VirtualMachineScaleSetExtensionsClientBeginDeleteOptions contains the optional parameters for the VirtualMachineScaleSetExtensionsClient.BeginDelete method.
type VirtualMachineScaleSetExtensionsClientBeginUpdateOptions ¶
type VirtualMachineScaleSetExtensionsClientBeginUpdateOptions struct { // Resumes the LRO from the provided token. ResumeToken string }
VirtualMachineScaleSetExtensionsClientBeginUpdateOptions contains the optional parameters for the VirtualMachineScaleSetExtensionsClient.BeginUpdate method.
type VirtualMachineScaleSetExtensionsClientCreateOrUpdateResponse ¶
type VirtualMachineScaleSetExtensionsClientCreateOrUpdateResponse struct { // Describes a Virtual Machine Scale Set Extension. VirtualMachineScaleSetExtension }
VirtualMachineScaleSetExtensionsClientCreateOrUpdateResponse contains the response from method VirtualMachineScaleSetExtensionsClient.BeginCreateOrUpdate.
type VirtualMachineScaleSetExtensionsClientDeleteResponse ¶
type VirtualMachineScaleSetExtensionsClientDeleteResponse struct { }
VirtualMachineScaleSetExtensionsClientDeleteResponse contains the response from method VirtualMachineScaleSetExtensionsClient.BeginDelete.
type VirtualMachineScaleSetExtensionsClientGetOptions ¶
type VirtualMachineScaleSetExtensionsClientGetOptions struct { // The expand expression to apply on the operation. Expand *string }
VirtualMachineScaleSetExtensionsClientGetOptions contains the optional parameters for the VirtualMachineScaleSetExtensionsClient.Get method.
type VirtualMachineScaleSetExtensionsClientGetResponse ¶
type VirtualMachineScaleSetExtensionsClientGetResponse struct { // Describes a Virtual Machine Scale Set Extension. VirtualMachineScaleSetExtension }
VirtualMachineScaleSetExtensionsClientGetResponse contains the response from method VirtualMachineScaleSetExtensionsClient.Get.
type VirtualMachineScaleSetExtensionsClientListOptions ¶
type VirtualMachineScaleSetExtensionsClientListOptions struct { }
VirtualMachineScaleSetExtensionsClientListOptions contains the optional parameters for the VirtualMachineScaleSetExtensionsClient.NewListPager method.
type VirtualMachineScaleSetExtensionsClientListResponse ¶
type VirtualMachineScaleSetExtensionsClientListResponse struct { // The List VM scale set extension operation response. VirtualMachineScaleSetExtensionListResult }
VirtualMachineScaleSetExtensionsClientListResponse contains the response from method VirtualMachineScaleSetExtensionsClient.NewListPager.
type VirtualMachineScaleSetExtensionsClientUpdateResponse ¶
type VirtualMachineScaleSetExtensionsClientUpdateResponse struct { // Describes a Virtual Machine Scale Set Extension. VirtualMachineScaleSetExtension }
VirtualMachineScaleSetExtensionsClientUpdateResponse contains the response from method VirtualMachineScaleSetExtensionsClient.BeginUpdate.
type VirtualMachineScaleSetHardwareProfile ¶
type VirtualMachineScaleSetHardwareProfile struct { // Specifies the properties for customizing the size of the virtual machine. Minimum api-version: 2021-11-01. Please follow // the instructions in VM Customization [https://aka.ms/vmcustomization] for more // details. VMSizeProperties *VMSizeProperties }
VirtualMachineScaleSetHardwareProfile - Specifies the hardware settings for the virtual machine scale set.
func (VirtualMachineScaleSetHardwareProfile) MarshalJSON ¶
func (v VirtualMachineScaleSetHardwareProfile) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type VirtualMachineScaleSetHardwareProfile.
func (*VirtualMachineScaleSetHardwareProfile) UnmarshalJSON ¶
func (v *VirtualMachineScaleSetHardwareProfile) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type VirtualMachineScaleSetHardwareProfile.
type VirtualMachineScaleSetIPConfiguration ¶
type VirtualMachineScaleSetIPConfiguration struct { // REQUIRED; The IP configuration name. Name *string // Describes a virtual machine scale set network profile's IP configuration properties. Properties *VirtualMachineScaleSetIPConfigurationProperties }
VirtualMachineScaleSetIPConfiguration - Describes a virtual machine scale set network profile's IP configuration.
func (VirtualMachineScaleSetIPConfiguration) MarshalJSON ¶
func (v VirtualMachineScaleSetIPConfiguration) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type VirtualMachineScaleSetIPConfiguration.
func (*VirtualMachineScaleSetIPConfiguration) UnmarshalJSON ¶
func (v *VirtualMachineScaleSetIPConfiguration) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type VirtualMachineScaleSetIPConfiguration.
type VirtualMachineScaleSetIPConfigurationProperties ¶
type VirtualMachineScaleSetIPConfigurationProperties struct { // Specifies an array of references to backend address pools of application gateways. A scale set can reference backend address // pools of multiple application gateways. Multiple scale sets cannot use the // same application gateway. ApplicationGatewayBackendAddressPools []*SubResource // Specifies an array of references to application security group. ApplicationSecurityGroups []*SubResource // Specifies an array of references to backend address pools of load balancers. A scale set can reference backend address // pools of one public and one internal load balancer. Multiple scale sets cannot // use the same basic sku load balancer. LoadBalancerBackendAddressPools []*SubResource // Specifies an array of references to inbound Nat pools of the load balancers. A scale set can reference inbound nat pools // of one public and one internal load balancer. Multiple scale sets cannot use // the same basic sku load balancer. LoadBalancerInboundNatPools []*SubResource // Specifies the primary network interface in case the virtual machine has more than 1 network interface. Primary *bool // Available from Api-Version 2017-03-30 onwards, it represents whether the specific ipconfiguration is IPv4 or IPv6. Default // is taken as IPv4. Possible values are: 'IPv4' and 'IPv6'. PrivateIPAddressVersion *IPVersion // The publicIPAddressConfiguration. PublicIPAddressConfiguration *VirtualMachineScaleSetPublicIPAddressConfiguration // Specifies the identifier of the subnet. Subnet *APIEntityReference }
VirtualMachineScaleSetIPConfigurationProperties - Describes a virtual machine scale set network profile's IP configuration properties.
func (VirtualMachineScaleSetIPConfigurationProperties) MarshalJSON ¶
func (v VirtualMachineScaleSetIPConfigurationProperties) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type VirtualMachineScaleSetIPConfigurationProperties.
func (*VirtualMachineScaleSetIPConfigurationProperties) UnmarshalJSON ¶
func (v *VirtualMachineScaleSetIPConfigurationProperties) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type VirtualMachineScaleSetIPConfigurationProperties.
type VirtualMachineScaleSetIPTag ¶
type VirtualMachineScaleSetIPTag struct { // IP tag type. Example: FirstPartyUsage. IPTagType *string // IP tag associated with the public IP. Example: SQL, Storage etc. Tag *string }
VirtualMachineScaleSetIPTag - Contains the IP tag associated with the public IP address.
func (VirtualMachineScaleSetIPTag) MarshalJSON ¶
func (v VirtualMachineScaleSetIPTag) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type VirtualMachineScaleSetIPTag.
func (*VirtualMachineScaleSetIPTag) UnmarshalJSON ¶
func (v *VirtualMachineScaleSetIPTag) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type VirtualMachineScaleSetIPTag.
type VirtualMachineScaleSetIdentity ¶
type VirtualMachineScaleSetIdentity struct { // The type of identity used for the virtual machine scale set. The type 'SystemAssigned, UserAssigned' includes both an implicitly // created identity and a set of user assigned identities. The type 'None' // will remove any identities from the virtual machine scale set. Type *ResourceIdentityType // The list of user identities associated with the virtual machine scale set. The user identity dictionary key references // will be ARM resource ids in the form: // '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{identityName}'. UserAssignedIdentities map[string]*UserAssignedIdentitiesValue // READ-ONLY; The principal id of virtual machine scale set identity. This property will only be provided for a system assigned // identity. PrincipalID *string // READ-ONLY; The tenant id associated with the virtual machine scale set. This property will only be provided for a system // assigned identity. TenantID *string }
VirtualMachineScaleSetIdentity - Identity for the virtual machine scale set.
func (VirtualMachineScaleSetIdentity) MarshalJSON ¶
func (v VirtualMachineScaleSetIdentity) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type VirtualMachineScaleSetIdentity.
func (*VirtualMachineScaleSetIdentity) UnmarshalJSON ¶
func (v *VirtualMachineScaleSetIdentity) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type VirtualMachineScaleSetIdentity.
type VirtualMachineScaleSetInstanceView ¶
type VirtualMachineScaleSetInstanceView struct { // The resource status information. Statuses []*InstanceViewStatus // READ-ONLY; The extensions information. Extensions []*VirtualMachineScaleSetVMExtensionsSummary // READ-ONLY; The orchestration services information. OrchestrationServices []*OrchestrationServiceSummary // READ-ONLY; The instance view status summary for the virtual machine scale set. VirtualMachine *VirtualMachineScaleSetInstanceViewStatusesSummary }
VirtualMachineScaleSetInstanceView - The instance view of a virtual machine scale set.
func (VirtualMachineScaleSetInstanceView) MarshalJSON ¶
func (v VirtualMachineScaleSetInstanceView) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type VirtualMachineScaleSetInstanceView.
func (*VirtualMachineScaleSetInstanceView) UnmarshalJSON ¶
func (v *VirtualMachineScaleSetInstanceView) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type VirtualMachineScaleSetInstanceView.
type VirtualMachineScaleSetInstanceViewStatusesSummary ¶
type VirtualMachineScaleSetInstanceViewStatusesSummary struct { // READ-ONLY; The extensions information. StatusesSummary []*VirtualMachineStatusCodeCount }
VirtualMachineScaleSetInstanceViewStatusesSummary - Instance view statuses summary for virtual machines of a virtual machine scale set.
func (VirtualMachineScaleSetInstanceViewStatusesSummary) MarshalJSON ¶
func (v VirtualMachineScaleSetInstanceViewStatusesSummary) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type VirtualMachineScaleSetInstanceViewStatusesSummary.
func (*VirtualMachineScaleSetInstanceViewStatusesSummary) UnmarshalJSON ¶
func (v *VirtualMachineScaleSetInstanceViewStatusesSummary) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type VirtualMachineScaleSetInstanceViewStatusesSummary.
type VirtualMachineScaleSetListOSUpgradeHistory ¶
type VirtualMachineScaleSetListOSUpgradeHistory struct { // REQUIRED; The list of OS upgrades performed on the virtual machine scale set. Value []*UpgradeOperationHistoricalStatusInfo // The uri to fetch the next page of OS Upgrade History. Call ListNext() with this to fetch the next page of history of upgrades. NextLink *string }
VirtualMachineScaleSetListOSUpgradeHistory - List of Virtual Machine Scale Set OS Upgrade History operation response.
func (VirtualMachineScaleSetListOSUpgradeHistory) MarshalJSON ¶
func (v VirtualMachineScaleSetListOSUpgradeHistory) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type VirtualMachineScaleSetListOSUpgradeHistory.
func (*VirtualMachineScaleSetListOSUpgradeHistory) UnmarshalJSON ¶
func (v *VirtualMachineScaleSetListOSUpgradeHistory) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type VirtualMachineScaleSetListOSUpgradeHistory.
type VirtualMachineScaleSetListResult ¶
type VirtualMachineScaleSetListResult struct { // REQUIRED; The list of virtual machine scale sets. Value []*VirtualMachineScaleSet // The uri to fetch the next page of Virtual Machine Scale Sets. Call ListNext() with this to fetch the next page of VMSS. NextLink *string }
VirtualMachineScaleSetListResult - The List Virtual Machine operation response.
func (VirtualMachineScaleSetListResult) MarshalJSON ¶
func (v VirtualMachineScaleSetListResult) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type VirtualMachineScaleSetListResult.
func (*VirtualMachineScaleSetListResult) UnmarshalJSON ¶
func (v *VirtualMachineScaleSetListResult) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type VirtualMachineScaleSetListResult.
type VirtualMachineScaleSetListSKUsResult ¶
type VirtualMachineScaleSetListSKUsResult struct { // REQUIRED; The list of skus available for the virtual machine scale set. Value []*VirtualMachineScaleSetSKU // The uri to fetch the next page of Virtual Machine Scale Set Skus. Call ListNext() with this to fetch the next page of VMSS // Skus. NextLink *string }
VirtualMachineScaleSetListSKUsResult - The Virtual Machine Scale Set List Skus operation response.
func (VirtualMachineScaleSetListSKUsResult) MarshalJSON ¶
func (v VirtualMachineScaleSetListSKUsResult) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type VirtualMachineScaleSetListSKUsResult.
func (*VirtualMachineScaleSetListSKUsResult) UnmarshalJSON ¶
func (v *VirtualMachineScaleSetListSKUsResult) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type VirtualMachineScaleSetListSKUsResult.
type VirtualMachineScaleSetListWithLinkResult ¶
type VirtualMachineScaleSetListWithLinkResult struct { // REQUIRED; The list of virtual machine scale sets. Value []*VirtualMachineScaleSet // The uri to fetch the next page of Virtual Machine Scale Sets. Call ListNext() with this to fetch the next page of Virtual // Machine Scale Sets. NextLink *string }
VirtualMachineScaleSetListWithLinkResult - The List Virtual Machine operation response.
func (VirtualMachineScaleSetListWithLinkResult) MarshalJSON ¶
func (v VirtualMachineScaleSetListWithLinkResult) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type VirtualMachineScaleSetListWithLinkResult.
func (*VirtualMachineScaleSetListWithLinkResult) UnmarshalJSON ¶
func (v *VirtualMachineScaleSetListWithLinkResult) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type VirtualMachineScaleSetListWithLinkResult.
type VirtualMachineScaleSetManagedDiskParameters ¶
type VirtualMachineScaleSetManagedDiskParameters struct { // Specifies the customer managed disk encryption set resource id for the managed disk. DiskEncryptionSet *DiskEncryptionSetParameters // Specifies the security profile for the managed disk. SecurityProfile *VMDiskSecurityProfile // Specifies the storage account type for the managed disk. NOTE: UltraSSD_LRS can only be used with data disks, it cannot // be used with OS Disk. StorageAccountType *StorageAccountTypes }
VirtualMachineScaleSetManagedDiskParameters - Describes the parameters of a ScaleSet managed disk.
func (VirtualMachineScaleSetManagedDiskParameters) MarshalJSON ¶
func (v VirtualMachineScaleSetManagedDiskParameters) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type VirtualMachineScaleSetManagedDiskParameters.
func (*VirtualMachineScaleSetManagedDiskParameters) UnmarshalJSON ¶
func (v *VirtualMachineScaleSetManagedDiskParameters) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type VirtualMachineScaleSetManagedDiskParameters.
type VirtualMachineScaleSetNetworkConfiguration ¶
type VirtualMachineScaleSetNetworkConfiguration struct { // REQUIRED; The network configuration name. Name *string // Describes a virtual machine scale set network profile's IP configuration. Properties *VirtualMachineScaleSetNetworkConfigurationProperties }
VirtualMachineScaleSetNetworkConfiguration - Describes a virtual machine scale set network profile's network configurations.
func (VirtualMachineScaleSetNetworkConfiguration) MarshalJSON ¶
func (v VirtualMachineScaleSetNetworkConfiguration) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type VirtualMachineScaleSetNetworkConfiguration.
func (*VirtualMachineScaleSetNetworkConfiguration) UnmarshalJSON ¶
func (v *VirtualMachineScaleSetNetworkConfiguration) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type VirtualMachineScaleSetNetworkConfiguration.
type VirtualMachineScaleSetNetworkConfigurationDNSSettings ¶
type VirtualMachineScaleSetNetworkConfigurationDNSSettings struct { // List of DNS servers IP addresses DNSServers []*string }
VirtualMachineScaleSetNetworkConfigurationDNSSettings - Describes a virtual machines scale sets network configuration's DNS settings.
func (VirtualMachineScaleSetNetworkConfigurationDNSSettings) MarshalJSON ¶
func (v VirtualMachineScaleSetNetworkConfigurationDNSSettings) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type VirtualMachineScaleSetNetworkConfigurationDNSSettings.
func (*VirtualMachineScaleSetNetworkConfigurationDNSSettings) UnmarshalJSON ¶
func (v *VirtualMachineScaleSetNetworkConfigurationDNSSettings) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type VirtualMachineScaleSetNetworkConfigurationDNSSettings.
type VirtualMachineScaleSetNetworkConfigurationProperties ¶
type VirtualMachineScaleSetNetworkConfigurationProperties struct { // REQUIRED; Specifies the IP configurations of the network interface. IPConfigurations []*VirtualMachineScaleSetIPConfiguration // Specifies whether the Auxiliary mode is enabled for the Network Interface resource. AuxiliaryMode *NetworkInterfaceAuxiliaryMode // Specifies whether the Auxiliary sku is enabled for the Network Interface resource. AuxiliarySKU *NetworkInterfaceAuxiliarySKU // The dns settings to be applied on the network interfaces. DNSSettings *VirtualMachineScaleSetNetworkConfigurationDNSSettings // Specify what happens to the network interface when the VM is deleted DeleteOption *DeleteOptions // Specifies whether the network interface is disabled for tcp state tracking. DisableTCPStateTracking *bool // Specifies whether the network interface is accelerated networking-enabled. EnableAcceleratedNetworking *bool // Specifies whether the network interface is FPGA networking-enabled. EnableFpga *bool // Whether IP forwarding enabled on this NIC. EnableIPForwarding *bool // The network security group. NetworkSecurityGroup *SubResource // Specifies the primary network interface in case the virtual machine has more than 1 network interface. Primary *bool }
VirtualMachineScaleSetNetworkConfigurationProperties - Describes a virtual machine scale set network profile's IP configuration.
func (VirtualMachineScaleSetNetworkConfigurationProperties) MarshalJSON ¶
func (v VirtualMachineScaleSetNetworkConfigurationProperties) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type VirtualMachineScaleSetNetworkConfigurationProperties.
func (*VirtualMachineScaleSetNetworkConfigurationProperties) UnmarshalJSON ¶
func (v *VirtualMachineScaleSetNetworkConfigurationProperties) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type VirtualMachineScaleSetNetworkConfigurationProperties.
type VirtualMachineScaleSetNetworkProfile ¶
type VirtualMachineScaleSetNetworkProfile struct { // A reference to a load balancer probe used to determine the health of an instance in the virtual machine scale set. The // reference will be in the form: // '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/loadBalancers/{loadBalancerName}/probes/{probeName}'. HealthProbe *APIEntityReference // specifies the Microsoft.Network API version used when creating networking resources in the Network Interface Configurations // for Virtual Machine Scale Set with orchestration mode 'Flexible' NetworkAPIVersion *NetworkAPIVersion // The list of network configurations. NetworkInterfaceConfigurations []*VirtualMachineScaleSetNetworkConfiguration }
VirtualMachineScaleSetNetworkProfile - Describes a virtual machine scale set network profile.
func (VirtualMachineScaleSetNetworkProfile) MarshalJSON ¶
func (v VirtualMachineScaleSetNetworkProfile) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type VirtualMachineScaleSetNetworkProfile.
func (*VirtualMachineScaleSetNetworkProfile) UnmarshalJSON ¶
func (v *VirtualMachineScaleSetNetworkProfile) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type VirtualMachineScaleSetNetworkProfile.
type VirtualMachineScaleSetOSDisk ¶
type VirtualMachineScaleSetOSDisk struct { // REQUIRED; Specifies how the virtual machines in the scale set should be created. The only allowed value is: FromImage. // This value is used when you are using an image to create the virtual machine. If you are // using a platform image, you also use the imageReference element described above. If you are using a marketplace image, // you also use the plan element previously described. CreateOption *DiskCreateOptionTypes // Specifies the caching requirements. Possible values are: None, ReadOnly, ReadWrite. The default values are: None for Standard // storage. ReadOnly for Premium storage. Caching *CachingTypes // Specifies whether OS Disk should be deleted or detached upon VMSS Flex deletion (This feature is available for VMSS with // Flexible OrchestrationMode only). // Possible values: // Delete If this value is used, the OS disk is deleted when VMSS Flex VM is deleted. // Detach If this value is used, the OS disk is retained after VMSS Flex VM is deleted. // The default value is set to Delete. For an Ephemeral OS Disk, the default value is set to Delete. User cannot change the // delete option for Ephemeral OS Disk. DeleteOption *DiskDeleteOptionTypes // Specifies the ephemeral disk Settings for the operating system disk used by the virtual machine scale set. DiffDiskSettings *DiffDiskSettings // Specifies the size of an empty data disk in gigabytes. This element can be used to overwrite the size of the disk in a // virtual machine image. The property 'diskSizeGB' is the number of bytes x 1024^3 // for the disk and the value cannot be larger than 1023. DiskSizeGB *int32 // Specifies information about the unmanaged user image to base the scale set on. Image *VirtualHardDisk // The managed disk parameters. ManagedDisk *VirtualMachineScaleSetManagedDiskParameters // The disk name. Name *string // This property allows you to specify the type of the OS that is included in the disk if creating a VM from user-image or // a specialized VHD. Possible values are: Windows, Linux. OSType *OperatingSystemTypes // Specifies the container urls that are used to store operating system disks for the scale set. VhdContainers []*string // Specifies whether writeAccelerator should be enabled or disabled on the disk. WriteAcceleratorEnabled *bool }
VirtualMachineScaleSetOSDisk - Describes a virtual machine scale set operating system disk.
func (VirtualMachineScaleSetOSDisk) MarshalJSON ¶
func (v VirtualMachineScaleSetOSDisk) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type VirtualMachineScaleSetOSDisk.
func (*VirtualMachineScaleSetOSDisk) UnmarshalJSON ¶
func (v *VirtualMachineScaleSetOSDisk) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type VirtualMachineScaleSetOSDisk.
type VirtualMachineScaleSetOSProfile ¶
type VirtualMachineScaleSetOSProfile struct { // Specifies the password of the administrator account. // Minimum-length (Windows): 8 characters // Minimum-length (Linux): 6 characters // Max-length (Windows): 123 characters // Max-length (Linux): 72 characters // Complexity requirements: 3 out of 4 conditions below need to be fulfilled // Has lower characters // Has upper characters // Has a digit // Has a special character (Regex match [\W_]) // Disallowed values: "abc@123", "P@$$w0rd", "P@ssw0rd", "P@ssword123", "Pa$$word", "pass@word1", "Password!", "Password1", // "Password22", "iloveyou!" // For resetting the password, see How to reset the Remote Desktop service or its login password in a Windows VM [https://docs.microsoft.com/troubleshoot/azure/virtual-machines/reset-rdp] // For resetting root password, see Manage users, SSH, and check or repair disks on Azure Linux VMs using the VMAccess Extension // [https://docs.microsoft.com/troubleshoot/azure/virtual-machines/troubleshoot-ssh-connection] AdminPassword *string // Specifies the name of the administrator account. // Windows-only restriction: Cannot end in "." // Disallowed values: "administrator", "admin", "user", "user1", "test", "user2", "test1", "user3", "admin1", "1", "123", // "a", "actuser", "adm", "admin2", "aspnet", "backup", "console", "david", "guest", // "john", "owner", "root", "server", "sql", "support", "support_388945a0", "sys", "test2", "test3", "user4", "user5". // Minimum-length (Linux): 1 character // Max-length (Linux): 64 characters // Max-length (Windows): 20 characters AdminUsername *string // Specifies whether extension operations should be allowed on the virtual machine scale set. This may only be set to False // when no extensions are present on the virtual machine scale set. AllowExtensionOperations *bool // Specifies the computer name prefix for all of the virtual machines in the scale set. Computer name prefixes must be 1 to // 15 characters long. ComputerNamePrefix *string // Specifies a base-64 encoded string of custom data. The base-64 encoded string is decoded to a binary array that is saved // as a file on the Virtual Machine. The maximum length of the binary array is // 65535 bytes. For using cloud-init for your VM, see Using cloud-init to customize a Linux VM during creation [https://docs.microsoft.com/azure/virtual-machines/linux/using-cloud-init] CustomData *string // Specifies the Linux operating system settings on the virtual machine. For a list of supported Linux distributions, see // Linux on Azure-Endorsed Distributions // [https://docs.microsoft.com/azure/virtual-machines/linux/endorsed-distros]. LinuxConfiguration *LinuxConfiguration // Optional property which must either be set to True or omitted. RequireGuestProvisionSignal *bool // Specifies set of certificates that should be installed onto the virtual machines in the scale set. To install certificates // on a virtual machine it is recommended to use the Azure Key Vault virtual // machine extension for Linux [https://docs.microsoft.com/azure/virtual-machines/extensions/key-vault-linux] or the Azure // Key Vault virtual machine extension for Windows // [https://docs.microsoft.com/azure/virtual-machines/extensions/key-vault-windows]. Secrets []*VaultSecretGroup // Specifies Windows operating system settings on the virtual machine. WindowsConfiguration *WindowsConfiguration }
VirtualMachineScaleSetOSProfile - Describes a virtual machine scale set OS profile.
func (VirtualMachineScaleSetOSProfile) MarshalJSON ¶
func (v VirtualMachineScaleSetOSProfile) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type VirtualMachineScaleSetOSProfile.
func (*VirtualMachineScaleSetOSProfile) UnmarshalJSON ¶
func (v *VirtualMachineScaleSetOSProfile) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type VirtualMachineScaleSetOSProfile.
type VirtualMachineScaleSetProperties ¶
type VirtualMachineScaleSetProperties struct { // Specifies additional capabilities enabled or disabled on the Virtual Machines in the Virtual Machine Scale Set. For instance: // whether the Virtual Machines have the capability to support attaching // managed data disks with UltraSSD_LRS storage account type. AdditionalCapabilities *AdditionalCapabilities // Policy for automatic repairs. AutomaticRepairsPolicy *AutomaticRepairsPolicy // Optional property which must either be set to True or omitted. ConstrainedMaximumCapacity *bool // When Overprovision is enabled, extensions are launched only on the requested number of VMs which are finally kept. This // property will hence ensure that the extensions do not run on the extra // overprovisioned VMs. DoNotRunExtensionsOnOverprovisionedVMs *bool // Specifies information about the dedicated host group that the virtual machine scale set resides in. Minimum api-version: // 2020-06-01. HostGroup *SubResource // Specifies the orchestration mode for the virtual machine scale set. OrchestrationMode *OrchestrationMode // Specifies whether the Virtual Machine Scale Set should be overprovisioned. Overprovision *bool // Fault Domain count for each placement group. PlatformFaultDomainCount *int32 // Specifies the desired targets for mixing Spot and Regular priority VMs within the same VMSS Flex instance. PriorityMixPolicy *PriorityMixPolicy // Specifies information about the proximity placement group that the virtual machine scale set should be assigned to. Minimum // api-version: 2018-04-01. ProximityPlacementGroup *SubResource // Policy for Resiliency ResiliencyPolicy *ResiliencyPolicy // Specifies the policies applied when scaling in Virtual Machines in the Virtual Machine Scale Set. ScaleInPolicy *ScaleInPolicy // The ScheduledEventsPolicy. ScheduledEventsPolicy *ScheduledEventsPolicy // When true this limits the scale set to a single placement group, of max size 100 virtual machines. NOTE: If singlePlacementGroup // is true, it may be modified to false. However, if singlePlacementGroup // is false, it may not be modified to true. SinglePlacementGroup *bool // Specifies the Spot Restore properties for the virtual machine scale set. SpotRestorePolicy *SpotRestorePolicy // The upgrade policy. UpgradePolicy *UpgradePolicy // The virtual machine profile. VirtualMachineProfile *VirtualMachineScaleSetVMProfile // Whether to force strictly even Virtual Machine distribution cross x-zones in case there is zone outage. zoneBalance property // can only be set if the zones property of the scale set contains more than // one zone. If there are no zones or only one zone specified, then zoneBalance property should not be set. ZoneBalance *bool // READ-ONLY; The provisioning state, which only appears in the response. ProvisioningState *string // READ-ONLY; Specifies the time at which the Virtual Machine Scale Set resource was created. Minimum api-version: 2021-11-01. TimeCreated *time.Time // READ-ONLY; Specifies the ID which uniquely identifies a Virtual Machine Scale Set. UniqueID *string }
VirtualMachineScaleSetProperties - Describes the properties of a Virtual Machine Scale Set.
func (VirtualMachineScaleSetProperties) MarshalJSON ¶
func (v VirtualMachineScaleSetProperties) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type VirtualMachineScaleSetProperties.
func (*VirtualMachineScaleSetProperties) UnmarshalJSON ¶
func (v *VirtualMachineScaleSetProperties) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type VirtualMachineScaleSetProperties.
type VirtualMachineScaleSetPublicIPAddressConfiguration ¶
type VirtualMachineScaleSetPublicIPAddressConfiguration struct { // REQUIRED; The publicIP address configuration name. Name *string // Describes a virtual machines scale set IP Configuration's PublicIPAddress configuration Properties *VirtualMachineScaleSetPublicIPAddressConfigurationProperties // Describes the public IP Sku. It can only be set with OrchestrationMode as Flexible. SKU *PublicIPAddressSKU }
VirtualMachineScaleSetPublicIPAddressConfiguration - Describes a virtual machines scale set IP Configuration's PublicIPAddress configuration
func (VirtualMachineScaleSetPublicIPAddressConfiguration) MarshalJSON ¶
func (v VirtualMachineScaleSetPublicIPAddressConfiguration) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type VirtualMachineScaleSetPublicIPAddressConfiguration.
func (*VirtualMachineScaleSetPublicIPAddressConfiguration) UnmarshalJSON ¶
func (v *VirtualMachineScaleSetPublicIPAddressConfiguration) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type VirtualMachineScaleSetPublicIPAddressConfiguration.
type VirtualMachineScaleSetPublicIPAddressConfigurationDNSSettings ¶
type VirtualMachineScaleSetPublicIPAddressConfigurationDNSSettings struct { // REQUIRED; The Domain name label.The concatenation of the domain name label and vm index will be the domain name labels // of the PublicIPAddress resources that will be created DomainNameLabel *string // The Domain name label scope.The concatenation of the hashed domain name label that generated according to the policy from // domain name label scope and vm index will be the domain name labels of the // PublicIPAddress resources that will be created DomainNameLabelScope *DomainNameLabelScopeTypes }
VirtualMachineScaleSetPublicIPAddressConfigurationDNSSettings - Describes a virtual machines scale sets network configuration's DNS settings.
func (VirtualMachineScaleSetPublicIPAddressConfigurationDNSSettings) MarshalJSON ¶
func (v VirtualMachineScaleSetPublicIPAddressConfigurationDNSSettings) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type VirtualMachineScaleSetPublicIPAddressConfigurationDNSSettings.
func (*VirtualMachineScaleSetPublicIPAddressConfigurationDNSSettings) UnmarshalJSON ¶
func (v *VirtualMachineScaleSetPublicIPAddressConfigurationDNSSettings) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type VirtualMachineScaleSetPublicIPAddressConfigurationDNSSettings.
type VirtualMachineScaleSetPublicIPAddressConfigurationProperties ¶
type VirtualMachineScaleSetPublicIPAddressConfigurationProperties struct { // The dns settings to be applied on the publicIP addresses . DNSSettings *VirtualMachineScaleSetPublicIPAddressConfigurationDNSSettings // Specify what happens to the public IP when the VM is deleted DeleteOption *DeleteOptions // The list of IP tags associated with the public IP address. IPTags []*VirtualMachineScaleSetIPTag // The idle timeout of the public IP address. IdleTimeoutInMinutes *int32 // Available from Api-Version 2019-07-01 onwards, it represents whether the specific ipconfiguration is IPv4 or IPv6. Default // is taken as IPv4. Possible values are: 'IPv4' and 'IPv6'. PublicIPAddressVersion *IPVersion // The PublicIPPrefix from which to allocate publicIP addresses. PublicIPPrefix *SubResource }
VirtualMachineScaleSetPublicIPAddressConfigurationProperties - Describes a virtual machines scale set IP Configuration's PublicIPAddress configuration
func (VirtualMachineScaleSetPublicIPAddressConfigurationProperties) MarshalJSON ¶
func (v VirtualMachineScaleSetPublicIPAddressConfigurationProperties) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type VirtualMachineScaleSetPublicIPAddressConfigurationProperties.
func (*VirtualMachineScaleSetPublicIPAddressConfigurationProperties) UnmarshalJSON ¶
func (v *VirtualMachineScaleSetPublicIPAddressConfigurationProperties) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type VirtualMachineScaleSetPublicIPAddressConfigurationProperties.
type VirtualMachineScaleSetReimageParameters ¶
type VirtualMachineScaleSetReimageParameters struct { // Specifies in decimal number, the version the OS disk should be reimaged to. If exact version is not provided, the OS disk // is reimaged to the existing version of OS Disk. ExactVersion *string // Parameter to force update ephemeral OS disk for a virtual machine scale set VM ForceUpdateOSDiskForEphemeral *bool // The virtual machine scale set instance ids. Omitting the virtual machine scale set instance ids will result in the operation // being performed on all virtual machines in the virtual machine scale set. InstanceIDs []*string // Specifies information required for reimaging the non-ephemeral OS disk. OSProfile *OSProfileProvisioningData // Specifies whether to reimage temp disk. Default value: false. Note: This temp disk reimage parameter is only supported // for VM/VMSS with Ephemeral OS disk. TempDisk *bool }
VirtualMachineScaleSetReimageParameters - Describes a Virtual Machine Scale Set VM Reimage Parameters.
func (VirtualMachineScaleSetReimageParameters) MarshalJSON ¶
func (v VirtualMachineScaleSetReimageParameters) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type VirtualMachineScaleSetReimageParameters.
func (*VirtualMachineScaleSetReimageParameters) UnmarshalJSON ¶
func (v *VirtualMachineScaleSetReimageParameters) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type VirtualMachineScaleSetReimageParameters.
type VirtualMachineScaleSetRollingUpgradesClient ¶
type VirtualMachineScaleSetRollingUpgradesClient struct {
// contains filtered or unexported fields
}
VirtualMachineScaleSetRollingUpgradesClient contains the methods for the VirtualMachineScaleSetRollingUpgrades group. Don't use this type directly, use NewVirtualMachineScaleSetRollingUpgradesClient() instead.
func NewVirtualMachineScaleSetRollingUpgradesClient ¶
func NewVirtualMachineScaleSetRollingUpgradesClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*VirtualMachineScaleSetRollingUpgradesClient, error)
NewVirtualMachineScaleSetRollingUpgradesClient creates a new instance of VirtualMachineScaleSetRollingUpgradesClient 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 (*VirtualMachineScaleSetRollingUpgradesClient) BeginCancel ¶
func (client *VirtualMachineScaleSetRollingUpgradesClient) BeginCancel(ctx context.Context, resourceGroupName string, vmScaleSetName string, options *VirtualMachineScaleSetRollingUpgradesClientBeginCancelOptions) (*runtime.Poller[VirtualMachineScaleSetRollingUpgradesClientCancelResponse], error)
BeginCancel - Cancels the current virtual machine scale set rolling upgrade. If the operation fails it returns an *azcore.ResponseError type.
Generated from API version 2024-03-01
- resourceGroupName - The name of the resource group.
- vmScaleSetName - The name of the VM scale set.
- options - VirtualMachineScaleSetRollingUpgradesClientBeginCancelOptions contains the optional parameters for the VirtualMachineScaleSetRollingUpgradesClient.BeginCancel method.
Example (VirtualMachineScaleSetRollingUpgradeCancelMaximumSetGen) ¶
Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/92de53a5f1e0e03c94b40475d2135d97148ed014/specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-03-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSetRollingUpgrade_Cancel_MaximumSet_Gen.json
cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() clientFactory, err := armcompute.NewClientFactory("<subscription-id>", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } poller, err := clientFactory.NewVirtualMachineScaleSetRollingUpgradesClient().BeginCancel(ctx, "rgcompute", "aaaaa", nil) if err != nil { log.Fatalf("failed to finish the request: %v", err) } _, err = poller.PollUntilDone(ctx, nil) if err != nil { log.Fatalf("failed to pull the result: %v", err) }
Output:
Example (VirtualMachineScaleSetRollingUpgradeCancelMinimumSetGen) ¶
Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/92de53a5f1e0e03c94b40475d2135d97148ed014/specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-03-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSetRollingUpgrade_Cancel_MinimumSet_Gen.json
cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() clientFactory, err := armcompute.NewClientFactory("<subscription-id>", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } poller, err := clientFactory.NewVirtualMachineScaleSetRollingUpgradesClient().BeginCancel(ctx, "rgcompute", "aaaaaa", nil) if err != nil { log.Fatalf("failed to finish the request: %v", err) } _, err = poller.PollUntilDone(ctx, nil) if err != nil { log.Fatalf("failed to pull the result: %v", err) }
Output:
func (*VirtualMachineScaleSetRollingUpgradesClient) BeginStartExtensionUpgrade ¶
func (client *VirtualMachineScaleSetRollingUpgradesClient) BeginStartExtensionUpgrade(ctx context.Context, resourceGroupName string, vmScaleSetName string, options *VirtualMachineScaleSetRollingUpgradesClientBeginStartExtensionUpgradeOptions) (*runtime.Poller[VirtualMachineScaleSetRollingUpgradesClientStartExtensionUpgradeResponse], error)
BeginStartExtensionUpgrade - Starts a rolling upgrade to move all extensions for all virtual machine scale set instances to the latest available extension version. Instances which are already running the latest extension versions are not affected. If the operation fails it returns an *azcore.ResponseError type.
Generated from API version 2024-03-01
- resourceGroupName - The name of the resource group.
- vmScaleSetName - The name of the VM scale set.
- options - VirtualMachineScaleSetRollingUpgradesClientBeginStartExtensionUpgradeOptions contains the optional parameters for the VirtualMachineScaleSetRollingUpgradesClient.BeginStartExtensionUpgrade method.
Example ¶
Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/92de53a5f1e0e03c94b40475d2135d97148ed014/specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-03-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSetExtension_RollingUpgrade.json
cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() clientFactory, err := armcompute.NewClientFactory("<subscription-id>", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } poller, err := clientFactory.NewVirtualMachineScaleSetRollingUpgradesClient().BeginStartExtensionUpgrade(ctx, "myResourceGroup", "{vmss-name}", nil) if err != nil { log.Fatalf("failed to finish the request: %v", err) } _, err = poller.PollUntilDone(ctx, nil) if err != nil { log.Fatalf("failed to pull the result: %v", err) }
Output:
func (*VirtualMachineScaleSetRollingUpgradesClient) BeginStartOSUpgrade ¶
func (client *VirtualMachineScaleSetRollingUpgradesClient) BeginStartOSUpgrade(ctx context.Context, resourceGroupName string, vmScaleSetName string, options *VirtualMachineScaleSetRollingUpgradesClientBeginStartOSUpgradeOptions) (*runtime.Poller[VirtualMachineScaleSetRollingUpgradesClientStartOSUpgradeResponse], error)
BeginStartOSUpgrade - Starts a rolling upgrade to move all virtual machine scale set instances to the latest available Platform Image OS version. Instances which are already running the latest available OS version are not affected. If the operation fails it returns an *azcore.ResponseError type.
Generated from API version 2024-03-01
- resourceGroupName - The name of the resource group.
- vmScaleSetName - The name of the VM scale set.
- options - VirtualMachineScaleSetRollingUpgradesClientBeginStartOSUpgradeOptions contains the optional parameters for the VirtualMachineScaleSetRollingUpgradesClient.BeginStartOSUpgrade method.
Example (VirtualMachineScaleSetRollingUpgradeStartOsUpgradeMaximumSetGen) ¶
Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/92de53a5f1e0e03c94b40475d2135d97148ed014/specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-03-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSetRollingUpgrade_StartOSUpgrade_MaximumSet_Gen.json
cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() clientFactory, err := armcompute.NewClientFactory("<subscription-id>", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } poller, err := clientFactory.NewVirtualMachineScaleSetRollingUpgradesClient().BeginStartOSUpgrade(ctx, "rgcompute", "aaaa", nil) if err != nil { log.Fatalf("failed to finish the request: %v", err) } _, err = poller.PollUntilDone(ctx, nil) if err != nil { log.Fatalf("failed to pull the result: %v", err) }
Output:
Example (VirtualMachineScaleSetRollingUpgradeStartOsUpgradeMinimumSetGen) ¶
Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/92de53a5f1e0e03c94b40475d2135d97148ed014/specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-03-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSetRollingUpgrade_StartOSUpgrade_MinimumSet_Gen.json
cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() clientFactory, err := armcompute.NewClientFactory("<subscription-id>", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } poller, err := clientFactory.NewVirtualMachineScaleSetRollingUpgradesClient().BeginStartOSUpgrade(ctx, "rgcompute", "aaaaaaaaaaaaaaaaaa", nil) if err != nil { log.Fatalf("failed to finish the request: %v", err) } _, err = poller.PollUntilDone(ctx, nil) if err != nil { log.Fatalf("failed to pull the result: %v", err) }
Output:
func (*VirtualMachineScaleSetRollingUpgradesClient) GetLatest ¶
func (client *VirtualMachineScaleSetRollingUpgradesClient) GetLatest(ctx context.Context, resourceGroupName string, vmScaleSetName string, options *VirtualMachineScaleSetRollingUpgradesClientGetLatestOptions) (VirtualMachineScaleSetRollingUpgradesClientGetLatestResponse, error)
GetLatest - Gets the status of the latest virtual machine scale set rolling upgrade. If the operation fails it returns an *azcore.ResponseError type.
Generated from API version 2024-03-01
- resourceGroupName - The name of the resource group.
- vmScaleSetName - The name of the VM scale set.
- options - VirtualMachineScaleSetRollingUpgradesClientGetLatestOptions contains the optional parameters for the VirtualMachineScaleSetRollingUpgradesClient.GetLatest method.
Example (VirtualMachineScaleSetRollingUpgradeGetLatestMaximumSetGen) ¶
Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/92de53a5f1e0e03c94b40475d2135d97148ed014/specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-03-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSetRollingUpgrade_GetLatest_MaximumSet_Gen.json
cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() clientFactory, err := armcompute.NewClientFactory("<subscription-id>", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } res, err := clientFactory.NewVirtualMachineScaleSetRollingUpgradesClient().GetLatest(ctx, "rgcompute", "aaaaaaaaaaaaaaaaaaaaaaaaa", nil) if err != nil { log.Fatalf("failed to finish the request: %v", err) } // You could use response here. We use blank identifier for just demo purposes. _ = res // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. // res.RollingUpgradeStatusInfo = armcompute.RollingUpgradeStatusInfo{ // Name: to.Ptr("aaaaaaaaaaaaaaaaaaa"), // Type: to.Ptr("aaaaaaaaaaaaaaaaaaaaa"), // ID: to.Ptr("aaaaaaaaaa"), // Location: to.Ptr("aaaaaa"), // Tags: map[string]*string{ // "key8533": to.Ptr("aaaaaaaaaaaaaaaaaaaaaaaa"), // }, // Properties: &armcompute.RollingUpgradeStatusInfoProperties{ // Error: &armcompute.APIError{ // Code: to.Ptr("aaaaaaa"), // Innererror: &armcompute.InnerError{ // Errordetail: to.Ptr("aaaaaaaaaaaaaaaaaaaaaaaa"), // Exceptiontype: to.Ptr("aaaaaaaaaaaaaaaaaaaaaaaaaaaaa"), // }, // Message: to.Ptr("aaaaaaaaa"), // Target: to.Ptr("aaaaaaa"), // Details: []*armcompute.APIErrorBase{ // { // Code: to.Ptr("aaaaaaaaaaaaaaaaaaaaaaaa"), // Message: to.Ptr("aa"), // Target: to.Ptr("aaaa"), // }}, // }, // Policy: &armcompute.RollingUpgradePolicy{ // EnableCrossZoneUpgrade: to.Ptr(true), // MaxBatchInstancePercent: to.Ptr[int32](49), // MaxSurge: to.Ptr(true), // MaxUnhealthyInstancePercent: to.Ptr[int32](81), // MaxUnhealthyUpgradedInstancePercent: to.Ptr[int32](98), // PauseTimeBetweenBatches: to.Ptr("aaaaaaaaaaaaaaa"), // PrioritizeUnhealthyInstances: to.Ptr(true), // RollbackFailedInstancesOnPolicyBreach: to.Ptr(true), // }, // Progress: &armcompute.RollingUpgradeProgressInfo{ // FailedInstanceCount: to.Ptr[int32](25), // InProgressInstanceCount: to.Ptr[int32](20), // PendingInstanceCount: to.Ptr[int32](27), // SuccessfulInstanceCount: to.Ptr[int32](6), // }, // RunningStatus: &armcompute.RollingUpgradeRunningStatus{ // Code: to.Ptr(armcompute.RollingUpgradeStatusCodeRollingForward), // LastAction: to.Ptr(armcompute.RollingUpgradeActionTypeStart), // LastActionTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-11-30T13:06:23.362Z"); return t}()), // StartTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-11-30T13:06:23.362Z"); return t}()), // }, // }, // }
Output:
Example (VirtualMachineScaleSetRollingUpgradeGetLatestMinimumSetGen) ¶
Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/92de53a5f1e0e03c94b40475d2135d97148ed014/specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-03-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSetRollingUpgrade_GetLatest_MinimumSet_Gen.json
cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() clientFactory, err := armcompute.NewClientFactory("<subscription-id>", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } res, err := clientFactory.NewVirtualMachineScaleSetRollingUpgradesClient().GetLatest(ctx, "rgcompute", "aaaaaaaaaaaaaaaaa", nil) if err != nil { log.Fatalf("failed to finish the request: %v", err) } // You could use response here. We use blank identifier for just demo purposes. _ = res // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. // res.RollingUpgradeStatusInfo = armcompute.RollingUpgradeStatusInfo{ // ID: to.Ptr("aaaaaaaaaa"), // Location: to.Ptr("aaaaaa"), // }
Output:
type VirtualMachineScaleSetRollingUpgradesClientBeginCancelOptions ¶
type VirtualMachineScaleSetRollingUpgradesClientBeginCancelOptions struct { // Resumes the LRO from the provided token. ResumeToken string }
VirtualMachineScaleSetRollingUpgradesClientBeginCancelOptions contains the optional parameters for the VirtualMachineScaleSetRollingUpgradesClient.BeginCancel method.
type VirtualMachineScaleSetRollingUpgradesClientBeginStartExtensionUpgradeOptions ¶
type VirtualMachineScaleSetRollingUpgradesClientBeginStartExtensionUpgradeOptions struct { // Resumes the LRO from the provided token. ResumeToken string }
VirtualMachineScaleSetRollingUpgradesClientBeginStartExtensionUpgradeOptions contains the optional parameters for the VirtualMachineScaleSetRollingUpgradesClient.BeginStartExtensionUpgrade method.
type VirtualMachineScaleSetRollingUpgradesClientBeginStartOSUpgradeOptions ¶
type VirtualMachineScaleSetRollingUpgradesClientBeginStartOSUpgradeOptions struct { // Resumes the LRO from the provided token. ResumeToken string }
VirtualMachineScaleSetRollingUpgradesClientBeginStartOSUpgradeOptions contains the optional parameters for the VirtualMachineScaleSetRollingUpgradesClient.BeginStartOSUpgrade method.
type VirtualMachineScaleSetRollingUpgradesClientCancelResponse ¶
type VirtualMachineScaleSetRollingUpgradesClientCancelResponse struct { }
VirtualMachineScaleSetRollingUpgradesClientCancelResponse contains the response from method VirtualMachineScaleSetRollingUpgradesClient.BeginCancel.
type VirtualMachineScaleSetRollingUpgradesClientGetLatestOptions ¶
type VirtualMachineScaleSetRollingUpgradesClientGetLatestOptions struct { }
VirtualMachineScaleSetRollingUpgradesClientGetLatestOptions contains the optional parameters for the VirtualMachineScaleSetRollingUpgradesClient.GetLatest method.
type VirtualMachineScaleSetRollingUpgradesClientGetLatestResponse ¶
type VirtualMachineScaleSetRollingUpgradesClientGetLatestResponse struct { // The status of the latest virtual machine scale set rolling upgrade. RollingUpgradeStatusInfo }
VirtualMachineScaleSetRollingUpgradesClientGetLatestResponse contains the response from method VirtualMachineScaleSetRollingUpgradesClient.GetLatest.
type VirtualMachineScaleSetRollingUpgradesClientStartExtensionUpgradeResponse ¶
type VirtualMachineScaleSetRollingUpgradesClientStartExtensionUpgradeResponse struct { }
VirtualMachineScaleSetRollingUpgradesClientStartExtensionUpgradeResponse contains the response from method VirtualMachineScaleSetRollingUpgradesClient.BeginStartExtensionUpgrade.
type VirtualMachineScaleSetRollingUpgradesClientStartOSUpgradeResponse ¶
type VirtualMachineScaleSetRollingUpgradesClientStartOSUpgradeResponse struct { }
VirtualMachineScaleSetRollingUpgradesClientStartOSUpgradeResponse contains the response from method VirtualMachineScaleSetRollingUpgradesClient.BeginStartOSUpgrade.
type VirtualMachineScaleSetSKU ¶
type VirtualMachineScaleSetSKU struct { // READ-ONLY; Specifies the number of virtual machines in the scale set. Capacity *VirtualMachineScaleSetSKUCapacity // READ-ONLY; The type of resource the sku applies to. ResourceType *string // READ-ONLY; The Sku. SKU *SKU }
VirtualMachineScaleSetSKU - Describes an available virtual machine scale set sku.
func (VirtualMachineScaleSetSKU) MarshalJSON ¶
func (v VirtualMachineScaleSetSKU) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type VirtualMachineScaleSetSKU.
func (*VirtualMachineScaleSetSKU) UnmarshalJSON ¶
func (v *VirtualMachineScaleSetSKU) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type VirtualMachineScaleSetSKU.
type VirtualMachineScaleSetSKUCapacity ¶
type VirtualMachineScaleSetSKUCapacity struct { // READ-ONLY; The default capacity. DefaultCapacity *int64 // READ-ONLY; The maximum capacity that can be set. Maximum *int64 // READ-ONLY; The minimum capacity. Minimum *int64 // READ-ONLY; The scale type applicable to the sku. ScaleType *VirtualMachineScaleSetSKUScaleType }
VirtualMachineScaleSetSKUCapacity - Describes scaling information of a sku.
func (VirtualMachineScaleSetSKUCapacity) MarshalJSON ¶
func (v VirtualMachineScaleSetSKUCapacity) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type VirtualMachineScaleSetSKUCapacity.
func (*VirtualMachineScaleSetSKUCapacity) UnmarshalJSON ¶
func (v *VirtualMachineScaleSetSKUCapacity) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type VirtualMachineScaleSetSKUCapacity.
type VirtualMachineScaleSetSKUScaleType ¶
type VirtualMachineScaleSetSKUScaleType string
VirtualMachineScaleSetSKUScaleType - The scale type applicable to the sku.
const ( VirtualMachineScaleSetSKUScaleTypeAutomatic VirtualMachineScaleSetSKUScaleType = "Automatic" VirtualMachineScaleSetSKUScaleTypeNone VirtualMachineScaleSetSKUScaleType = "None" )
func PossibleVirtualMachineScaleSetSKUScaleTypeValues ¶
func PossibleVirtualMachineScaleSetSKUScaleTypeValues() []VirtualMachineScaleSetSKUScaleType
PossibleVirtualMachineScaleSetSKUScaleTypeValues returns the possible values for the VirtualMachineScaleSetSKUScaleType const type.
type VirtualMachineScaleSetScaleInRules ¶
type VirtualMachineScaleSetScaleInRules string
const ( VirtualMachineScaleSetScaleInRulesDefault VirtualMachineScaleSetScaleInRules = "Default" VirtualMachineScaleSetScaleInRulesNewestVM VirtualMachineScaleSetScaleInRules = "NewestVM" VirtualMachineScaleSetScaleInRulesOldestVM VirtualMachineScaleSetScaleInRules = "OldestVM" )
func PossibleVirtualMachineScaleSetScaleInRulesValues ¶
func PossibleVirtualMachineScaleSetScaleInRulesValues() []VirtualMachineScaleSetScaleInRules
PossibleVirtualMachineScaleSetScaleInRulesValues returns the possible values for the VirtualMachineScaleSetScaleInRules const type.
type VirtualMachineScaleSetStorageProfile ¶
type VirtualMachineScaleSetStorageProfile struct { // Specifies the parameters that are used to add data disks to the virtual machines in the scale set. For more information // about disks, see About disks and VHDs for Azure virtual machines // [https://docs.microsoft.com/azure/virtual-machines/managed-disks-overview]. DataDisks []*VirtualMachineScaleSetDataDisk DiskControllerType *string // Specifies information about the image to use. You can specify information about platform images, marketplace images, or // virtual machine images. This element is required when you want to use a platform // image, marketplace image, or virtual machine image, but is not used in other creation operations. ImageReference *ImageReference // Specifies information about the operating system disk used by the virtual machines in the scale set. For more information // about disks, see About disks and VHDs for Azure virtual machines // [https://docs.microsoft.com/azure/virtual-machines/managed-disks-overview]. OSDisk *VirtualMachineScaleSetOSDisk }
VirtualMachineScaleSetStorageProfile - Describes a virtual machine scale set storage profile.
func (VirtualMachineScaleSetStorageProfile) MarshalJSON ¶
func (v VirtualMachineScaleSetStorageProfile) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type VirtualMachineScaleSetStorageProfile.
func (*VirtualMachineScaleSetStorageProfile) UnmarshalJSON ¶
func (v *VirtualMachineScaleSetStorageProfile) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type VirtualMachineScaleSetStorageProfile.
type VirtualMachineScaleSetUpdate ¶
type VirtualMachineScaleSetUpdate struct { // The identity of the virtual machine scale set, if configured. Identity *VirtualMachineScaleSetIdentity // The purchase plan when deploying a virtual machine scale set from VM Marketplace images. Plan *Plan // Describes the properties of a Virtual Machine Scale Set. Properties *VirtualMachineScaleSetUpdateProperties // The virtual machine scale set sku. SKU *SKU // Resource tags Tags map[string]*string }
VirtualMachineScaleSetUpdate - Describes a Virtual Machine Scale Set.
func (VirtualMachineScaleSetUpdate) MarshalJSON ¶
func (v VirtualMachineScaleSetUpdate) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type VirtualMachineScaleSetUpdate.
func (*VirtualMachineScaleSetUpdate) UnmarshalJSON ¶
func (v *VirtualMachineScaleSetUpdate) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type VirtualMachineScaleSetUpdate.
type VirtualMachineScaleSetUpdateIPConfiguration ¶
type VirtualMachineScaleSetUpdateIPConfiguration struct { // The IP configuration name. Name *string // Describes a virtual machine scale set network profile's IP configuration properties. Properties *VirtualMachineScaleSetUpdateIPConfigurationProperties }
VirtualMachineScaleSetUpdateIPConfiguration - Describes a virtual machine scale set network profile's IP configuration. NOTE: The subnet of a scale set may be modified as long as the original subnet and the new subnet are in the same virtual network
func (VirtualMachineScaleSetUpdateIPConfiguration) MarshalJSON ¶
func (v VirtualMachineScaleSetUpdateIPConfiguration) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type VirtualMachineScaleSetUpdateIPConfiguration.
func (*VirtualMachineScaleSetUpdateIPConfiguration) UnmarshalJSON ¶
func (v *VirtualMachineScaleSetUpdateIPConfiguration) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type VirtualMachineScaleSetUpdateIPConfiguration.
type VirtualMachineScaleSetUpdateIPConfigurationProperties ¶
type VirtualMachineScaleSetUpdateIPConfigurationProperties struct { // The application gateway backend address pools. ApplicationGatewayBackendAddressPools []*SubResource // Specifies an array of references to application security group. ApplicationSecurityGroups []*SubResource // The load balancer backend address pools. LoadBalancerBackendAddressPools []*SubResource // The load balancer inbound nat pools. LoadBalancerInboundNatPools []*SubResource // Specifies the primary IP Configuration in case the network interface has more than one IP Configuration. Primary *bool // Available from Api-Version 2017-03-30 onwards, it represents whether the specific ipconfiguration is IPv4 or IPv6. Default // is taken as IPv4. Possible values are: 'IPv4' and 'IPv6'. PrivateIPAddressVersion *IPVersion // The publicIPAddressConfiguration. PublicIPAddressConfiguration *VirtualMachineScaleSetUpdatePublicIPAddressConfiguration // The subnet. Subnet *APIEntityReference }
VirtualMachineScaleSetUpdateIPConfigurationProperties - Describes a virtual machine scale set network profile's IP configuration properties.
func (VirtualMachineScaleSetUpdateIPConfigurationProperties) MarshalJSON ¶
func (v VirtualMachineScaleSetUpdateIPConfigurationProperties) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type VirtualMachineScaleSetUpdateIPConfigurationProperties.
func (*VirtualMachineScaleSetUpdateIPConfigurationProperties) UnmarshalJSON ¶
func (v *VirtualMachineScaleSetUpdateIPConfigurationProperties) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type VirtualMachineScaleSetUpdateIPConfigurationProperties.
type VirtualMachineScaleSetUpdateNetworkConfiguration ¶
type VirtualMachineScaleSetUpdateNetworkConfiguration struct { // The network configuration name. Name *string // Describes a virtual machine scale set updatable network profile's IP configuration.Use this object for updating network // profile's IP Configuration. Properties *VirtualMachineScaleSetUpdateNetworkConfigurationProperties }
VirtualMachineScaleSetUpdateNetworkConfiguration - Describes a virtual machine scale set network profile's network configurations.
func (VirtualMachineScaleSetUpdateNetworkConfiguration) MarshalJSON ¶
func (v VirtualMachineScaleSetUpdateNetworkConfiguration) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type VirtualMachineScaleSetUpdateNetworkConfiguration.
func (*VirtualMachineScaleSetUpdateNetworkConfiguration) UnmarshalJSON ¶
func (v *VirtualMachineScaleSetUpdateNetworkConfiguration) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type VirtualMachineScaleSetUpdateNetworkConfiguration.
type VirtualMachineScaleSetUpdateNetworkConfigurationProperties ¶
type VirtualMachineScaleSetUpdateNetworkConfigurationProperties struct { // Specifies whether the Auxiliary mode is enabled for the Network Interface resource. AuxiliaryMode *NetworkInterfaceAuxiliaryMode // Specifies whether the Auxiliary sku is enabled for the Network Interface resource. AuxiliarySKU *NetworkInterfaceAuxiliarySKU // The dns settings to be applied on the network interfaces. DNSSettings *VirtualMachineScaleSetNetworkConfigurationDNSSettings // Specify what happens to the network interface when the VM is deleted DeleteOption *DeleteOptions // Specifies whether the network interface is disabled for tcp state tracking. DisableTCPStateTracking *bool // Specifies whether the network interface is accelerated networking-enabled. EnableAcceleratedNetworking *bool // Specifies whether the network interface is FPGA networking-enabled. EnableFpga *bool // Whether IP forwarding enabled on this NIC. EnableIPForwarding *bool // The virtual machine scale set IP Configuration. IPConfigurations []*VirtualMachineScaleSetUpdateIPConfiguration // The network security group. NetworkSecurityGroup *SubResource // Whether this is a primary NIC on a virtual machine. Primary *bool }
VirtualMachineScaleSetUpdateNetworkConfigurationProperties - Describes a virtual machine scale set updatable network profile's IP configuration.Use this object for updating network profile's IP Configuration.
func (VirtualMachineScaleSetUpdateNetworkConfigurationProperties) MarshalJSON ¶
func (v VirtualMachineScaleSetUpdateNetworkConfigurationProperties) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type VirtualMachineScaleSetUpdateNetworkConfigurationProperties.
func (*VirtualMachineScaleSetUpdateNetworkConfigurationProperties) UnmarshalJSON ¶
func (v *VirtualMachineScaleSetUpdateNetworkConfigurationProperties) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type VirtualMachineScaleSetUpdateNetworkConfigurationProperties.
type VirtualMachineScaleSetUpdateNetworkProfile ¶
type VirtualMachineScaleSetUpdateNetworkProfile struct { // A reference to a load balancer probe used to determine the health of an instance in the virtual machine scale set. The // reference will be in the form: // '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/loadBalancers/{loadBalancerName}/probes/{probeName}'. HealthProbe *APIEntityReference // specifies the Microsoft.Network API version used when creating networking resources in the Network Interface Configurations // for Virtual Machine Scale Set with orchestration mode 'Flexible' NetworkAPIVersion *NetworkAPIVersion // The list of network configurations. NetworkInterfaceConfigurations []*VirtualMachineScaleSetUpdateNetworkConfiguration }
VirtualMachineScaleSetUpdateNetworkProfile - Describes a virtual machine scale set network profile.
func (VirtualMachineScaleSetUpdateNetworkProfile) MarshalJSON ¶
func (v VirtualMachineScaleSetUpdateNetworkProfile) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type VirtualMachineScaleSetUpdateNetworkProfile.
func (*VirtualMachineScaleSetUpdateNetworkProfile) UnmarshalJSON ¶
func (v *VirtualMachineScaleSetUpdateNetworkProfile) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type VirtualMachineScaleSetUpdateNetworkProfile.
type VirtualMachineScaleSetUpdateOSDisk ¶
type VirtualMachineScaleSetUpdateOSDisk struct { // The caching type. Caching *CachingTypes // Specifies whether OS Disk should be deleted or detached upon VMSS Flex deletion (This feature is available for VMSS with // Flexible OrchestrationMode only). // Possible values: // Delete If this value is used, the OS disk is deleted when VMSS Flex VM is deleted. // Detach If this value is used, the OS disk is retained after VMSS Flex VM is deleted. // The default value is set to Delete. For an Ephemeral OS Disk, the default value is set to Delete. User cannot change the // delete option for Ephemeral OS Disk. DeleteOption *DiskDeleteOptionTypes // Specifies the ephemeral disk Settings for the operating system disk used by the virtual machine scale set. DiffDiskSettings *DiffDiskSettings // Specifies the size of an empty data disk in gigabytes. This element can be used to overwrite the size of the disk in a // virtual machine image. // diskSizeGB is the number of bytes x 1024^3 for the disk and the value cannot be larger than 1023 DiskSizeGB *int32 // The Source User Image VirtualHardDisk. This VirtualHardDisk will be copied before using it to attach to the Virtual Machine. // If SourceImage is provided, the destination VirtualHardDisk should not // exist. Image *VirtualHardDisk // The managed disk parameters. ManagedDisk *VirtualMachineScaleSetManagedDiskParameters // The list of virtual hard disk container uris. VhdContainers []*string // Specifies whether writeAccelerator should be enabled or disabled on the disk. WriteAcceleratorEnabled *bool }
VirtualMachineScaleSetUpdateOSDisk - Describes virtual machine scale set operating system disk Update Object. This should be used for Updating VMSS OS Disk.
func (VirtualMachineScaleSetUpdateOSDisk) MarshalJSON ¶
func (v VirtualMachineScaleSetUpdateOSDisk) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type VirtualMachineScaleSetUpdateOSDisk.
func (*VirtualMachineScaleSetUpdateOSDisk) UnmarshalJSON ¶
func (v *VirtualMachineScaleSetUpdateOSDisk) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type VirtualMachineScaleSetUpdateOSDisk.
type VirtualMachineScaleSetUpdateOSProfile ¶
type VirtualMachineScaleSetUpdateOSProfile struct { // A base-64 encoded string of custom data. CustomData *string // The Linux Configuration of the OS profile. LinuxConfiguration *LinuxConfiguration // The List of certificates for addition to the VM. Secrets []*VaultSecretGroup // The Windows Configuration of the OS profile. WindowsConfiguration *WindowsConfiguration }
VirtualMachineScaleSetUpdateOSProfile - Describes a virtual machine scale set OS profile.
func (VirtualMachineScaleSetUpdateOSProfile) MarshalJSON ¶
func (v VirtualMachineScaleSetUpdateOSProfile) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type VirtualMachineScaleSetUpdateOSProfile.
func (*VirtualMachineScaleSetUpdateOSProfile) UnmarshalJSON ¶
func (v *VirtualMachineScaleSetUpdateOSProfile) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type VirtualMachineScaleSetUpdateOSProfile.
type VirtualMachineScaleSetUpdateProperties ¶
type VirtualMachineScaleSetUpdateProperties struct { // Specifies additional capabilities enabled or disabled on the Virtual Machines in the Virtual Machine Scale Set. For instance: // whether the Virtual Machines have the capability to support attaching // managed data disks with UltraSSD_LRS storage account type. AdditionalCapabilities *AdditionalCapabilities // Policy for automatic repairs. AutomaticRepairsPolicy *AutomaticRepairsPolicy // When Overprovision is enabled, extensions are launched only on the requested number of VMs which are finally kept. This // property will hence ensure that the extensions do not run on the extra // overprovisioned VMs. DoNotRunExtensionsOnOverprovisionedVMs *bool // Specifies whether the Virtual Machine Scale Set should be overprovisioned. Overprovision *bool // Specifies the desired targets for mixing Spot and Regular priority VMs within the same VMSS Flex instance. PriorityMixPolicy *PriorityMixPolicy // Specifies information about the proximity placement group that the virtual machine scale set should be assigned to. // Minimum api-version: 2018-04-01. ProximityPlacementGroup *SubResource // Policy for Resiliency ResiliencyPolicy *ResiliencyPolicy // Specifies the policies applied when scaling in Virtual Machines in the Virtual Machine Scale Set. ScaleInPolicy *ScaleInPolicy // When true this limits the scale set to a single placement group, of max size 100 virtual machines. NOTE: If singlePlacementGroup // is true, it may be modified to false. However, if singlePlacementGroup // is false, it may not be modified to true. SinglePlacementGroup *bool // Specifies the Spot Restore properties for the virtual machine scale set. SpotRestorePolicy *SpotRestorePolicy // The upgrade policy. UpgradePolicy *UpgradePolicy // The virtual machine profile. VirtualMachineProfile *VirtualMachineScaleSetUpdateVMProfile }
VirtualMachineScaleSetUpdateProperties - Describes the properties of a Virtual Machine Scale Set.
func (VirtualMachineScaleSetUpdateProperties) MarshalJSON ¶
func (v VirtualMachineScaleSetUpdateProperties) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type VirtualMachineScaleSetUpdateProperties.
func (*VirtualMachineScaleSetUpdateProperties) UnmarshalJSON ¶
func (v *VirtualMachineScaleSetUpdateProperties) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type VirtualMachineScaleSetUpdateProperties.
type VirtualMachineScaleSetUpdatePublicIPAddressConfiguration ¶
type VirtualMachineScaleSetUpdatePublicIPAddressConfiguration struct { // The publicIP address configuration name. Name *string // Describes a virtual machines scale set IP Configuration's PublicIPAddress configuration Properties *VirtualMachineScaleSetUpdatePublicIPAddressConfigurationProperties }
VirtualMachineScaleSetUpdatePublicIPAddressConfiguration - Describes a virtual machines scale set IP Configuration's PublicIPAddress configuration
func (VirtualMachineScaleSetUpdatePublicIPAddressConfiguration) MarshalJSON ¶
func (v VirtualMachineScaleSetUpdatePublicIPAddressConfiguration) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type VirtualMachineScaleSetUpdatePublicIPAddressConfiguration.
func (*VirtualMachineScaleSetUpdatePublicIPAddressConfiguration) UnmarshalJSON ¶
func (v *VirtualMachineScaleSetUpdatePublicIPAddressConfiguration) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type VirtualMachineScaleSetUpdatePublicIPAddressConfiguration.
type VirtualMachineScaleSetUpdatePublicIPAddressConfigurationProperties ¶
type VirtualMachineScaleSetUpdatePublicIPAddressConfigurationProperties struct { // The dns settings to be applied on the publicIP addresses . DNSSettings *VirtualMachineScaleSetPublicIPAddressConfigurationDNSSettings // Specify what happens to the public IP when the VM is deleted DeleteOption *DeleteOptions // The idle timeout of the public IP address. IdleTimeoutInMinutes *int32 // The PublicIPPrefix from which to allocate publicIP addresses. PublicIPPrefix *SubResource }
VirtualMachineScaleSetUpdatePublicIPAddressConfigurationProperties - Describes a virtual machines scale set IP Configuration's PublicIPAddress configuration
func (VirtualMachineScaleSetUpdatePublicIPAddressConfigurationProperties) MarshalJSON ¶
func (v VirtualMachineScaleSetUpdatePublicIPAddressConfigurationProperties) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type VirtualMachineScaleSetUpdatePublicIPAddressConfigurationProperties.
func (*VirtualMachineScaleSetUpdatePublicIPAddressConfigurationProperties) UnmarshalJSON ¶
func (v *VirtualMachineScaleSetUpdatePublicIPAddressConfigurationProperties) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type VirtualMachineScaleSetUpdatePublicIPAddressConfigurationProperties.
type VirtualMachineScaleSetUpdateStorageProfile ¶
type VirtualMachineScaleSetUpdateStorageProfile struct { // The data disks. DataDisks []*VirtualMachineScaleSetDataDisk DiskControllerType *string // The image reference. ImageReference *ImageReference // The OS disk. OSDisk *VirtualMachineScaleSetUpdateOSDisk }
VirtualMachineScaleSetUpdateStorageProfile - Describes a virtual machine scale set storage profile.
func (VirtualMachineScaleSetUpdateStorageProfile) MarshalJSON ¶
func (v VirtualMachineScaleSetUpdateStorageProfile) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type VirtualMachineScaleSetUpdateStorageProfile.
func (*VirtualMachineScaleSetUpdateStorageProfile) UnmarshalJSON ¶
func (v *VirtualMachineScaleSetUpdateStorageProfile) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type VirtualMachineScaleSetUpdateStorageProfile.
type VirtualMachineScaleSetUpdateVMProfile ¶
type VirtualMachineScaleSetUpdateVMProfile struct { // Specifies the billing related details of a Azure Spot VMSS. Minimum api-version: 2019-03-01. BillingProfile *BillingProfile // The virtual machine scale set diagnostics profile. DiagnosticsProfile *DiagnosticsProfile // The virtual machine scale set extension profile. ExtensionProfile *VirtualMachineScaleSetExtensionProfile // Specifies the hardware profile related details of a scale set. Minimum api-version: 2021-11-01. HardwareProfile *VirtualMachineScaleSetHardwareProfile // The license type, which is for bring your own license scenario. LicenseType *string // The virtual machine scale set network profile. NetworkProfile *VirtualMachineScaleSetUpdateNetworkProfile // The virtual machine scale set OS profile. OSProfile *VirtualMachineScaleSetUpdateOSProfile // Specifies Scheduled Event related configurations. ScheduledEventsProfile *ScheduledEventsProfile // The virtual machine scale set Security profile SecurityProfile *SecurityProfile // The virtual machine scale set storage profile. StorageProfile *VirtualMachineScaleSetUpdateStorageProfile // UserData for the VM, which must be base-64 encoded. Customer should not pass any secrets in here. // Minimum api-version: 2021-03-01 UserData *string }
VirtualMachineScaleSetUpdateVMProfile - Describes a virtual machine scale set virtual machine profile.
func (VirtualMachineScaleSetUpdateVMProfile) MarshalJSON ¶
func (v VirtualMachineScaleSetUpdateVMProfile) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type VirtualMachineScaleSetUpdateVMProfile.
func (*VirtualMachineScaleSetUpdateVMProfile) UnmarshalJSON ¶
func (v *VirtualMachineScaleSetUpdateVMProfile) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type VirtualMachineScaleSetUpdateVMProfile.
type VirtualMachineScaleSetVM ¶
type VirtualMachineScaleSetVM struct { // REQUIRED; Resource location Location *string // The identity of the virtual machine, if configured. Identity *VirtualMachineIdentity // Specifies information about the marketplace image used to create the virtual machine. This element is only used for marketplace // images. Before you can use a marketplace image from an API, you must // enable the image for programmatic use. In the Azure portal, find the marketplace image that you want to use and then click // Want to deploy programmatically, Get Started ->. Enter any required // information and then click Save. Plan *Plan // Describes the properties of a virtual machine scale set virtual machine. Properties *VirtualMachineScaleSetVMProperties // Resource tags Tags map[string]*string // READ-ONLY; Etag is property returned in Update/Get response of the VMSS VM, so that customer can supply it in the header // to ensure optimistic updates. Etag *string // READ-ONLY; Resource Id ID *string // READ-ONLY; The virtual machine instance ID. InstanceID *string // READ-ONLY; Resource name Name *string // READ-ONLY; The virtual machine child extension resources. Resources []*VirtualMachineExtension // READ-ONLY; The virtual machine SKU. SKU *SKU // READ-ONLY; Resource type Type *string // READ-ONLY; The virtual machine zones. Zones []*string }
VirtualMachineScaleSetVM - Describes a virtual machine scale set virtual machine.
func (VirtualMachineScaleSetVM) MarshalJSON ¶
func (v VirtualMachineScaleSetVM) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type VirtualMachineScaleSetVM.
func (*VirtualMachineScaleSetVM) UnmarshalJSON ¶
func (v *VirtualMachineScaleSetVM) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type VirtualMachineScaleSetVM.
type VirtualMachineScaleSetVMExtension ¶
type VirtualMachineScaleSetVMExtension struct { // The location of the extension. Location *string // Describes the properties of a Virtual Machine Extension. Properties *VirtualMachineExtensionProperties // READ-ONLY; Resource Id ID *string // READ-ONLY; The name of the extension. Name *string // READ-ONLY; Resource type Type *string }
VirtualMachineScaleSetVMExtension - Describes a VMSS VM Extension.
func (VirtualMachineScaleSetVMExtension) MarshalJSON ¶
func (v VirtualMachineScaleSetVMExtension) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type VirtualMachineScaleSetVMExtension.
func (*VirtualMachineScaleSetVMExtension) UnmarshalJSON ¶
func (v *VirtualMachineScaleSetVMExtension) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type VirtualMachineScaleSetVMExtension.
type VirtualMachineScaleSetVMExtensionUpdate ¶
type VirtualMachineScaleSetVMExtensionUpdate struct { // Describes the properties of a Virtual Machine Extension. Properties *VirtualMachineExtensionUpdateProperties // READ-ONLY; Resource Id ID *string // READ-ONLY; The name of the extension. Name *string // READ-ONLY; Resource type Type *string }
VirtualMachineScaleSetVMExtensionUpdate - Describes a VMSS VM Extension.
func (VirtualMachineScaleSetVMExtensionUpdate) MarshalJSON ¶
func (v VirtualMachineScaleSetVMExtensionUpdate) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type VirtualMachineScaleSetVMExtensionUpdate.
func (*VirtualMachineScaleSetVMExtensionUpdate) UnmarshalJSON ¶
func (v *VirtualMachineScaleSetVMExtensionUpdate) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type VirtualMachineScaleSetVMExtensionUpdate.
type VirtualMachineScaleSetVMExtensionsClient ¶
type VirtualMachineScaleSetVMExtensionsClient struct {
// contains filtered or unexported fields
}
VirtualMachineScaleSetVMExtensionsClient contains the methods for the VirtualMachineScaleSetVMExtensions group. Don't use this type directly, use NewVirtualMachineScaleSetVMExtensionsClient() instead.
func NewVirtualMachineScaleSetVMExtensionsClient ¶
func NewVirtualMachineScaleSetVMExtensionsClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*VirtualMachineScaleSetVMExtensionsClient, error)
NewVirtualMachineScaleSetVMExtensionsClient creates a new instance of VirtualMachineScaleSetVMExtensionsClient 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 (*VirtualMachineScaleSetVMExtensionsClient) BeginCreateOrUpdate ¶
func (client *VirtualMachineScaleSetVMExtensionsClient) BeginCreateOrUpdate(ctx context.Context, resourceGroupName string, vmScaleSetName string, instanceID string, vmExtensionName string, extensionParameters VirtualMachineScaleSetVMExtension, options *VirtualMachineScaleSetVMExtensionsClientBeginCreateOrUpdateOptions) (*runtime.Poller[VirtualMachineScaleSetVMExtensionsClientCreateOrUpdateResponse], error)
BeginCreateOrUpdate - The operation to create or update the VMSS VM extension. If the operation fails it returns an *azcore.ResponseError type.
Generated from API version 2024-03-01
- resourceGroupName - The name of the resource group.
- vmScaleSetName - The name of the VM scale set.
- instanceID - The instance ID of the virtual machine.
- vmExtensionName - The name of the virtual machine extension.
- extensionParameters - Parameters supplied to the Create Virtual Machine Extension operation.
- options - VirtualMachineScaleSetVMExtensionsClientBeginCreateOrUpdateOptions contains the optional parameters for the VirtualMachineScaleSetVMExtensionsClient.BeginCreateOrUpdate method.
Example ¶
Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/92de53a5f1e0e03c94b40475d2135d97148ed014/specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-03-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSetVMExtension_Create.json
cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() clientFactory, err := armcompute.NewClientFactory("<subscription-id>", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } poller, err := clientFactory.NewVirtualMachineScaleSetVMExtensionsClient().BeginCreateOrUpdate(ctx, "myResourceGroup", "myvmScaleSet", "0", "myVMExtension", armcompute.VirtualMachineScaleSetVMExtension{ Properties: &armcompute.VirtualMachineExtensionProperties{ Type: to.Ptr("extType"), AutoUpgradeMinorVersion: to.Ptr(true), Publisher: to.Ptr("extPublisher"), Settings: map[string]any{ "UserName": "xyz@microsoft.com", }, TypeHandlerVersion: to.Ptr("1.2"), }, }, nil) if err != nil { log.Fatalf("failed to finish the request: %v", err) } res, err := poller.PollUntilDone(ctx, nil) if err != nil { log.Fatalf("failed to pull the result: %v", err) } // You could use response here. We use blank identifier for just demo purposes. _ = res // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. // res.VirtualMachineScaleSetVMExtension = armcompute.VirtualMachineScaleSetVMExtension{ // ID: to.Ptr("/subscriptions/{subscriptionId}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/virtualMachineScaleSets/myvmScaleSet/virtualMachines/0/extensions/myVMExtension"), // Name: to.Ptr("myVMExtension"), // Type: to.Ptr("Microsoft.Compute/virtualMachineScaleSets/virtualMachines/extensions"), // Properties: &armcompute.VirtualMachineExtensionProperties{ // Type: to.Ptr("extType"), // AutoUpgradeMinorVersion: to.Ptr(true), // ProvisioningState: to.Ptr("Succeeded"), // Publisher: to.Ptr("extPublisher"), // Settings: map[string]any{ // "UserName": "xyz@microsoft.com", // }, // TypeHandlerVersion: to.Ptr("1.2"), // }, // }
Output:
func (*VirtualMachineScaleSetVMExtensionsClient) BeginDelete ¶
func (client *VirtualMachineScaleSetVMExtensionsClient) BeginDelete(ctx context.Context, resourceGroupName string, vmScaleSetName string, instanceID string, vmExtensionName string, options *VirtualMachineScaleSetVMExtensionsClientBeginDeleteOptions) (*runtime.Poller[VirtualMachineScaleSetVMExtensionsClientDeleteResponse], error)
BeginDelete - The operation to delete the VMSS VM extension. If the operation fails it returns an *azcore.ResponseError type.
Generated from API version 2024-03-01
- resourceGroupName - The name of the resource group.
- vmScaleSetName - The name of the VM scale set.
- instanceID - The instance ID of the virtual machine.
- vmExtensionName - The name of the virtual machine extension.
- options - VirtualMachineScaleSetVMExtensionsClientBeginDeleteOptions contains the optional parameters for the VirtualMachineScaleSetVMExtensionsClient.BeginDelete method.
Example ¶
Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/92de53a5f1e0e03c94b40475d2135d97148ed014/specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-03-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSetVMExtension_Delete.json
cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() clientFactory, err := armcompute.NewClientFactory("<subscription-id>", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } poller, err := clientFactory.NewVirtualMachineScaleSetVMExtensionsClient().BeginDelete(ctx, "myResourceGroup", "myvmScaleSet", "0", "myVMExtension", nil) if err != nil { log.Fatalf("failed to finish the request: %v", err) } _, err = poller.PollUntilDone(ctx, nil) if err != nil { log.Fatalf("failed to pull the result: %v", err) }
Output:
func (*VirtualMachineScaleSetVMExtensionsClient) BeginUpdate ¶
func (client *VirtualMachineScaleSetVMExtensionsClient) BeginUpdate(ctx context.Context, resourceGroupName string, vmScaleSetName string, instanceID string, vmExtensionName string, extensionParameters VirtualMachineScaleSetVMExtensionUpdate, options *VirtualMachineScaleSetVMExtensionsClientBeginUpdateOptions) (*runtime.Poller[VirtualMachineScaleSetVMExtensionsClientUpdateResponse], error)
BeginUpdate - The operation to update the VMSS VM extension. If the operation fails it returns an *azcore.ResponseError type.
Generated from API version 2024-03-01
- resourceGroupName - The name of the resource group.
- vmScaleSetName - The name of the VM scale set.
- instanceID - The instance ID of the virtual machine.
- vmExtensionName - The name of the virtual machine extension.
- extensionParameters - Parameters supplied to the Update Virtual Machine Extension operation.
- options - VirtualMachineScaleSetVMExtensionsClientBeginUpdateOptions contains the optional parameters for the VirtualMachineScaleSetVMExtensionsClient.BeginUpdate method.
Example ¶
Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/92de53a5f1e0e03c94b40475d2135d97148ed014/specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-03-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSetVMExtension_Update.json
cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() clientFactory, err := armcompute.NewClientFactory("<subscription-id>", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } poller, err := clientFactory.NewVirtualMachineScaleSetVMExtensionsClient().BeginUpdate(ctx, "myResourceGroup", "myvmScaleSet", "0", "myVMExtension", armcompute.VirtualMachineScaleSetVMExtensionUpdate{ Properties: &armcompute.VirtualMachineExtensionUpdateProperties{ Type: to.Ptr("extType"), AutoUpgradeMinorVersion: to.Ptr(true), Publisher: to.Ptr("extPublisher"), Settings: map[string]any{ "UserName": "xyz@microsoft.com", }, TypeHandlerVersion: to.Ptr("1.2"), }, }, nil) if err != nil { log.Fatalf("failed to finish the request: %v", err) } res, err := poller.PollUntilDone(ctx, nil) if err != nil { log.Fatalf("failed to pull the result: %v", err) } // You could use response here. We use blank identifier for just demo purposes. _ = res // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. // res.VirtualMachineScaleSetVMExtension = armcompute.VirtualMachineScaleSetVMExtension{ // ID: to.Ptr("/subscriptions/{subscriptionId}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/virtualMachineScaleSets/myvmScaleSet/virtualMachines/0/extensions/myVMExtension"), // Name: to.Ptr("myVMExtension"), // Type: to.Ptr("Microsoft.Compute/virtualMachineScaleSets/virtualMachines/extensions"), // Properties: &armcompute.VirtualMachineExtensionProperties{ // Type: to.Ptr("extType"), // AutoUpgradeMinorVersion: to.Ptr(true), // ProvisioningState: to.Ptr("Succeeded"), // Publisher: to.Ptr("extPublisher"), // Settings: map[string]any{ // "UserName": "xyz@microsoft.com", // }, // TypeHandlerVersion: to.Ptr("1.2"), // }, // }
Output:
func (*VirtualMachineScaleSetVMExtensionsClient) Get ¶
func (client *VirtualMachineScaleSetVMExtensionsClient) Get(ctx context.Context, resourceGroupName string, vmScaleSetName string, instanceID string, vmExtensionName string, options *VirtualMachineScaleSetVMExtensionsClientGetOptions) (VirtualMachineScaleSetVMExtensionsClientGetResponse, error)
Get - The operation to get the VMSS VM extension. If the operation fails it returns an *azcore.ResponseError type.
Generated from API version 2024-03-01
- resourceGroupName - The name of the resource group.
- vmScaleSetName - The name of the VM scale set.
- instanceID - The instance ID of the virtual machine.
- vmExtensionName - The name of the virtual machine extension.
- options - VirtualMachineScaleSetVMExtensionsClientGetOptions contains the optional parameters for the VirtualMachineScaleSetVMExtensionsClient.Get method.
Example ¶
Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/92de53a5f1e0e03c94b40475d2135d97148ed014/specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-03-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSetVMExtension_Get.json
cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() clientFactory, err := armcompute.NewClientFactory("<subscription-id>", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } res, err := clientFactory.NewVirtualMachineScaleSetVMExtensionsClient().Get(ctx, "myResourceGroup", "myvmScaleSet", "0", "myVMExtension", &armcompute.VirtualMachineScaleSetVMExtensionsClientGetOptions{Expand: nil}) if err != nil { log.Fatalf("failed to finish the request: %v", err) } // You could use response here. We use blank identifier for just demo purposes. _ = res // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. // res.VirtualMachineScaleSetVMExtension = armcompute.VirtualMachineScaleSetVMExtension{ // ID: to.Ptr("/subscriptions/{subscriptionId}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/virtualMachineScaleSets/myvmScaleSet/virtualMachines/0/extensions/myVMExtension"), // Name: to.Ptr("myVMExtension"), // Type: to.Ptr("Microsoft.Compute/virtualMachineScaleSets/virtualMachines/extensions"), // Properties: &armcompute.VirtualMachineExtensionProperties{ // Type: to.Ptr("extType"), // AutoUpgradeMinorVersion: to.Ptr(true), // ProvisioningState: to.Ptr("Succeeded"), // Publisher: to.Ptr("extPublisher"), // Settings: map[string]any{ // "UserName": "xyz@microsoft.com", // }, // TypeHandlerVersion: to.Ptr("1.2"), // }, // }
Output:
func (*VirtualMachineScaleSetVMExtensionsClient) List ¶
func (client *VirtualMachineScaleSetVMExtensionsClient) List(ctx context.Context, resourceGroupName string, vmScaleSetName string, instanceID string, options *VirtualMachineScaleSetVMExtensionsClientListOptions) (VirtualMachineScaleSetVMExtensionsClientListResponse, error)
List - The operation to get all extensions of an instance in Virtual Machine Scaleset. If the operation fails it returns an *azcore.ResponseError type.
Generated from API version 2024-03-01
- resourceGroupName - The name of the resource group.
- vmScaleSetName - The name of the VM scale set.
- instanceID - The instance ID of the virtual machine.
- options - VirtualMachineScaleSetVMExtensionsClientListOptions contains the optional parameters for the VirtualMachineScaleSetVMExtensionsClient.List method.
Example ¶
Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/92de53a5f1e0e03c94b40475d2135d97148ed014/specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-03-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSetVMExtension_List.json
cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() clientFactory, err := armcompute.NewClientFactory("<subscription-id>", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } res, err := clientFactory.NewVirtualMachineScaleSetVMExtensionsClient().List(ctx, "myResourceGroup", "myvmScaleSet", "0", &armcompute.VirtualMachineScaleSetVMExtensionsClientListOptions{Expand: nil}) if err != nil { log.Fatalf("failed to finish the request: %v", err) } // You could use response here. We use blank identifier for just demo purposes. _ = res // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. // res.VirtualMachineScaleSetVMExtensionsListResult = armcompute.VirtualMachineScaleSetVMExtensionsListResult{ // Value: []*armcompute.VirtualMachineScaleSetVMExtension{ // { // ID: to.Ptr("/subscriptions/{subscriptionId}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/virtualMachineScaleSets/myvmScaleSet/virtualMachines/0/extensions/myVMExtension"), // Name: to.Ptr("myVMExtension"), // Type: to.Ptr("Microsoft.Compute/virtualMachineScaleSets/virtualMachines/extensions"), // Properties: &armcompute.VirtualMachineExtensionProperties{ // Type: to.Ptr("extType"), // AutoUpgradeMinorVersion: to.Ptr(true), // ProvisioningState: to.Ptr("Succeeded"), // Publisher: to.Ptr("extPublisher"), // Settings: map[string]any{ // "UserName": "xyz@microsoft.com", // }, // TypeHandlerVersion: to.Ptr("1.2"), // }, // }, // { // ID: to.Ptr("/subscriptions/{subscriptionId}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/virtualMachineScaleSets/myvmScaleSet/virtualMachines/0/extensions/myVMExtension1"), // Name: to.Ptr("myVMExtension1"), // Type: to.Ptr("Microsoft.Compute/virtualMachineScaleSets/virtualMachines/extensions"), // Properties: &armcompute.VirtualMachineExtensionProperties{ // Type: to.Ptr("extType1"), // AutoUpgradeMinorVersion: to.Ptr(true), // ProvisioningState: to.Ptr("Succeeded"), // Publisher: to.Ptr("extPublisher1"), // Settings: map[string]any{ // "UserName": "xyz@microsoft.com", // }, // TypeHandlerVersion: to.Ptr("1.0"), // }, // }}, // }
Output:
type VirtualMachineScaleSetVMExtensionsClientBeginCreateOrUpdateOptions ¶
type VirtualMachineScaleSetVMExtensionsClientBeginCreateOrUpdateOptions struct { // Resumes the LRO from the provided token. ResumeToken string }
VirtualMachineScaleSetVMExtensionsClientBeginCreateOrUpdateOptions contains the optional parameters for the VirtualMachineScaleSetVMExtensionsClient.BeginCreateOrUpdate method.
type VirtualMachineScaleSetVMExtensionsClientBeginDeleteOptions ¶
type VirtualMachineScaleSetVMExtensionsClientBeginDeleteOptions struct { // Resumes the LRO from the provided token. ResumeToken string }
VirtualMachineScaleSetVMExtensionsClientBeginDeleteOptions contains the optional parameters for the VirtualMachineScaleSetVMExtensionsClient.BeginDelete method.
type VirtualMachineScaleSetVMExtensionsClientBeginUpdateOptions ¶
type VirtualMachineScaleSetVMExtensionsClientBeginUpdateOptions struct { // Resumes the LRO from the provided token. ResumeToken string }
VirtualMachineScaleSetVMExtensionsClientBeginUpdateOptions contains the optional parameters for the VirtualMachineScaleSetVMExtensionsClient.BeginUpdate method.
type VirtualMachineScaleSetVMExtensionsClientCreateOrUpdateResponse ¶
type VirtualMachineScaleSetVMExtensionsClientCreateOrUpdateResponse struct { // Describes a VMSS VM Extension. VirtualMachineScaleSetVMExtension }
VirtualMachineScaleSetVMExtensionsClientCreateOrUpdateResponse contains the response from method VirtualMachineScaleSetVMExtensionsClient.BeginCreateOrUpdate.
type VirtualMachineScaleSetVMExtensionsClientDeleteResponse ¶
type VirtualMachineScaleSetVMExtensionsClientDeleteResponse struct { }
VirtualMachineScaleSetVMExtensionsClientDeleteResponse contains the response from method VirtualMachineScaleSetVMExtensionsClient.BeginDelete.
type VirtualMachineScaleSetVMExtensionsClientGetOptions ¶
type VirtualMachineScaleSetVMExtensionsClientGetOptions struct { // The expand expression to apply on the operation. Expand *string }
VirtualMachineScaleSetVMExtensionsClientGetOptions contains the optional parameters for the VirtualMachineScaleSetVMExtensionsClient.Get method.
type VirtualMachineScaleSetVMExtensionsClientGetResponse ¶
type VirtualMachineScaleSetVMExtensionsClientGetResponse struct { // Describes a VMSS VM Extension. VirtualMachineScaleSetVMExtension }
VirtualMachineScaleSetVMExtensionsClientGetResponse contains the response from method VirtualMachineScaleSetVMExtensionsClient.Get.
type VirtualMachineScaleSetVMExtensionsClientListOptions ¶
type VirtualMachineScaleSetVMExtensionsClientListOptions struct { // The expand expression to apply on the operation. Expand *string }
VirtualMachineScaleSetVMExtensionsClientListOptions contains the optional parameters for the VirtualMachineScaleSetVMExtensionsClient.List method.
type VirtualMachineScaleSetVMExtensionsClientListResponse ¶
type VirtualMachineScaleSetVMExtensionsClientListResponse struct { // The List VMSS VM Extension operation response VirtualMachineScaleSetVMExtensionsListResult }
VirtualMachineScaleSetVMExtensionsClientListResponse contains the response from method VirtualMachineScaleSetVMExtensionsClient.List.
type VirtualMachineScaleSetVMExtensionsClientUpdateResponse ¶
type VirtualMachineScaleSetVMExtensionsClientUpdateResponse struct { // Describes a VMSS VM Extension. VirtualMachineScaleSetVMExtension }
VirtualMachineScaleSetVMExtensionsClientUpdateResponse contains the response from method VirtualMachineScaleSetVMExtensionsClient.BeginUpdate.
type VirtualMachineScaleSetVMExtensionsListResult ¶
type VirtualMachineScaleSetVMExtensionsListResult struct { // The list of VMSS VM extensions Value []*VirtualMachineScaleSetVMExtension }
VirtualMachineScaleSetVMExtensionsListResult - The List VMSS VM Extension operation response
func (VirtualMachineScaleSetVMExtensionsListResult) MarshalJSON ¶
func (v VirtualMachineScaleSetVMExtensionsListResult) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type VirtualMachineScaleSetVMExtensionsListResult.
func (*VirtualMachineScaleSetVMExtensionsListResult) UnmarshalJSON ¶
func (v *VirtualMachineScaleSetVMExtensionsListResult) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type VirtualMachineScaleSetVMExtensionsListResult.
type VirtualMachineScaleSetVMExtensionsSummary ¶
type VirtualMachineScaleSetVMExtensionsSummary struct { // READ-ONLY; The extension name. Name *string // READ-ONLY; The extensions information. StatusesSummary []*VirtualMachineStatusCodeCount }
VirtualMachineScaleSetVMExtensionsSummary - Extensions summary for virtual machines of a virtual machine scale set.
func (VirtualMachineScaleSetVMExtensionsSummary) MarshalJSON ¶
func (v VirtualMachineScaleSetVMExtensionsSummary) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type VirtualMachineScaleSetVMExtensionsSummary.
func (*VirtualMachineScaleSetVMExtensionsSummary) UnmarshalJSON ¶
func (v *VirtualMachineScaleSetVMExtensionsSummary) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type VirtualMachineScaleSetVMExtensionsSummary.
type VirtualMachineScaleSetVMInstanceIDs ¶
type VirtualMachineScaleSetVMInstanceIDs struct { // The virtual machine scale set instance ids. Omitting the virtual machine scale set instance ids will result in the operation // being performed on all virtual machines in the virtual machine scale set. InstanceIDs []*string }
VirtualMachineScaleSetVMInstanceIDs - Specifies a list of virtual machine instance IDs from the VM scale set.
func (VirtualMachineScaleSetVMInstanceIDs) MarshalJSON ¶
func (v VirtualMachineScaleSetVMInstanceIDs) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type VirtualMachineScaleSetVMInstanceIDs.
func (*VirtualMachineScaleSetVMInstanceIDs) UnmarshalJSON ¶
func (v *VirtualMachineScaleSetVMInstanceIDs) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type VirtualMachineScaleSetVMInstanceIDs.
type VirtualMachineScaleSetVMInstanceRequiredIDs ¶
type VirtualMachineScaleSetVMInstanceRequiredIDs struct { // REQUIRED; The virtual machine scale set instance ids. InstanceIDs []*string }
VirtualMachineScaleSetVMInstanceRequiredIDs - Specifies a list of virtual machine instance IDs from the VM scale set.
func (VirtualMachineScaleSetVMInstanceRequiredIDs) MarshalJSON ¶
func (v VirtualMachineScaleSetVMInstanceRequiredIDs) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type VirtualMachineScaleSetVMInstanceRequiredIDs.
func (*VirtualMachineScaleSetVMInstanceRequiredIDs) UnmarshalJSON ¶
func (v *VirtualMachineScaleSetVMInstanceRequiredIDs) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type VirtualMachineScaleSetVMInstanceRequiredIDs.
type VirtualMachineScaleSetVMInstanceView ¶
type VirtualMachineScaleSetVMInstanceView struct { // Boot Diagnostics is a debugging feature which allows you to view Console Output and Screenshot to diagnose VM status. You // can easily view the output of your console log. Azure also enables you to see // a screenshot of the VM from the hypervisor. BootDiagnostics *BootDiagnosticsInstanceView // Specifies the host OS name of the virtual machine. // This name cannot be updated after the VM is created. // Max-length (Windows): 15 characters // Max-length (Linux): 64 characters. // For naming conventions and restrictions see Azure infrastructure services implementation guidelines // [https://docs.microsoft.com/azure/virtual-machines/virtual-machines-linux-infrastructure-subscription-accounts-guidelines?toc=%2fazure%2fvirtual-machines%2flinux%2ftoc.json#1-naming-conventions]. ComputerName *string // The disks information. Disks []*DiskInstanceView // The extensions information. Extensions []*VirtualMachineExtensionInstanceView // The hypervisor generation of the Virtual Machine [V1, V2] HyperVGeneration *HyperVGeneration // The Maintenance Operation status on the virtual machine. MaintenanceRedeployStatus *MaintenanceRedeployStatus // The Operating System running on the hybrid machine. OSName *string // The version of Operating System running on the hybrid machine. OSVersion *string // The placement group in which the VM is running. If the VM is deallocated it will not have a placementGroupId. PlacementGroupID *string // The Fault Domain count. PlatformFaultDomain *int32 // The Update Domain count. PlatformUpdateDomain *int32 // The Remote desktop certificate thumbprint. RdpThumbPrint *string // The resource status information. Statuses []*InstanceViewStatus // The VM Agent running on the virtual machine. VMAgent *VirtualMachineAgentInstanceView // READ-ONLY; Resource id of the dedicated host, on which the virtual machine is allocated through automatic placement, when // the virtual machine is associated with a dedicated host group that has automatic // placement enabled. Minimum api-version: 2020-06-01. AssignedHost *string // READ-ONLY; The health status for the VM. VMHealth *VirtualMachineHealthStatus }
VirtualMachineScaleSetVMInstanceView - The instance view of a virtual machine scale set VM.
func (VirtualMachineScaleSetVMInstanceView) MarshalJSON ¶
func (v VirtualMachineScaleSetVMInstanceView) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type VirtualMachineScaleSetVMInstanceView.
func (*VirtualMachineScaleSetVMInstanceView) UnmarshalJSON ¶
func (v *VirtualMachineScaleSetVMInstanceView) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type VirtualMachineScaleSetVMInstanceView.
type VirtualMachineScaleSetVMListResult ¶
type VirtualMachineScaleSetVMListResult struct { // REQUIRED; The list of virtual machine scale sets VMs. Value []*VirtualMachineScaleSetVM // The uri to fetch the next page of Virtual Machine Scale Set VMs. Call ListNext() with this to fetch the next page of VMSS // VMs NextLink *string }
VirtualMachineScaleSetVMListResult - The List Virtual Machine Scale Set VMs operation response.
func (VirtualMachineScaleSetVMListResult) MarshalJSON ¶
func (v VirtualMachineScaleSetVMListResult) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type VirtualMachineScaleSetVMListResult.
func (*VirtualMachineScaleSetVMListResult) UnmarshalJSON ¶
func (v *VirtualMachineScaleSetVMListResult) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type VirtualMachineScaleSetVMListResult.
type VirtualMachineScaleSetVMNetworkProfileConfiguration ¶
type VirtualMachineScaleSetVMNetworkProfileConfiguration struct { // The list of network configurations. NetworkInterfaceConfigurations []*VirtualMachineScaleSetNetworkConfiguration }
VirtualMachineScaleSetVMNetworkProfileConfiguration - Describes a virtual machine scale set VM network profile.
func (VirtualMachineScaleSetVMNetworkProfileConfiguration) MarshalJSON ¶
func (v VirtualMachineScaleSetVMNetworkProfileConfiguration) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type VirtualMachineScaleSetVMNetworkProfileConfiguration.
func (*VirtualMachineScaleSetVMNetworkProfileConfiguration) UnmarshalJSON ¶
func (v *VirtualMachineScaleSetVMNetworkProfileConfiguration) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type VirtualMachineScaleSetVMNetworkProfileConfiguration.
type VirtualMachineScaleSetVMProfile ¶
type VirtualMachineScaleSetVMProfile struct { // Specifies the gallery applications that should be made available to the VM/VMSS ApplicationProfile *ApplicationProfile // Specifies the billing related details of a Azure Spot VMSS. Minimum api-version: 2019-03-01. BillingProfile *BillingProfile // Specifies the capacity reservation related details of a scale set. Minimum api-version: 2021-04-01. CapacityReservation *CapacityReservationProfile // Specifies the boot diagnostic settings state. Minimum api-version: 2015-06-15. DiagnosticsProfile *DiagnosticsProfile // Specifies the eviction policy for the Azure Spot virtual machine and Azure Spot scale set. For Azure Spot virtual machines, // both 'Deallocate' and 'Delete' are supported and the minimum api-version is // 2019-03-01. For Azure Spot scale sets, both 'Deallocate' and 'Delete' are supported and the minimum api-version is 2017-10-30-preview. EvictionPolicy *VirtualMachineEvictionPolicyTypes // Specifies a collection of settings for extensions installed on virtual machines in the scale set. ExtensionProfile *VirtualMachineScaleSetExtensionProfile // Specifies the hardware profile related details of a scale set. Minimum api-version: 2021-11-01. HardwareProfile *VirtualMachineScaleSetHardwareProfile // Specifies that the image or disk that is being used was licensed on-premises. // Possible values for Windows Server operating system are: // WindowsClient // WindowsServer // Possible values for Linux Server operating system are: // RHELBYOS (for RHEL) // SLESBYOS (for SUSE) // For more information, see Azure Hybrid Use Benefit for Windows Server [https://docs.microsoft.com/azure/virtual-machines/windows/hybrid-use-benefit-licensing] // Azure Hybrid Use Benefit for Linux Server [https://docs.microsoft.com/azure/virtual-machines/linux/azure-hybrid-benefit-linux] // Minimum api-version: 2015-06-15 LicenseType *string // Specifies properties of the network interfaces of the virtual machines in the scale set. NetworkProfile *VirtualMachineScaleSetNetworkProfile // Specifies the operating system settings for the virtual machines in the scale set. OSProfile *VirtualMachineScaleSetOSProfile // Specifies the priority for the virtual machines in the scale set. Minimum api-version: 2017-10-30-preview. Priority *VirtualMachinePriorityTypes // Specifies Scheduled Event related configurations. ScheduledEventsProfile *ScheduledEventsProfile // Specifies the security posture to be used for all virtual machines in the scale set. Minimum api-version: 2023-03-01 SecurityPostureReference *SecurityPostureReference // Specifies the Security related profile settings for the virtual machines in the scale set. SecurityProfile *SecurityProfile // Specifies the service artifact reference id used to set same image version for all virtual machines in the scale set when // using 'latest' image version. Minimum api-version: 2022-11-01 ServiceArtifactReference *ServiceArtifactReference // Specifies the storage settings for the virtual machine disks. StorageProfile *VirtualMachineScaleSetStorageProfile // UserData for the virtual machines in the scale set, which must be base-64 encoded. Customer should not pass any secrets // in here. Minimum api-version: 2021-03-01. UserData *string // READ-ONLY; Specifies the time in which this VM profile for the Virtual Machine Scale Set was created. Minimum API version // for this property is 2024-03-01. This value will be added to VMSS Flex VM tags when // creating/updating the VMSS VM Profile with minimum api-version 2024-03-01. TimeCreated *time.Time }
VirtualMachineScaleSetVMProfile - Describes a virtual machine scale set virtual machine profile.
func (VirtualMachineScaleSetVMProfile) MarshalJSON ¶
func (v VirtualMachineScaleSetVMProfile) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type VirtualMachineScaleSetVMProfile.
func (*VirtualMachineScaleSetVMProfile) UnmarshalJSON ¶
func (v *VirtualMachineScaleSetVMProfile) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type VirtualMachineScaleSetVMProfile.
type VirtualMachineScaleSetVMProperties ¶
type VirtualMachineScaleSetVMProperties struct { // Specifies additional capabilities enabled or disabled on the virtual machine in the scale set. For instance: whether the // virtual machine has the capability to support attaching managed data disks with // UltraSSD_LRS storage account type. AdditionalCapabilities *AdditionalCapabilities // 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. AvailabilitySet *SubResource // Specifies the boot diagnostic settings state. Minimum api-version: 2015-06-15. DiagnosticsProfile *DiagnosticsProfile // Specifies the hardware settings for the virtual machine. HardwareProfile *HardwareProfile // Specifies that the image or disk that is being used was licensed on-premises. // Possible values for Windows Server operating system are: // WindowsClient // WindowsServer // Possible values for Linux Server operating system are: // RHELBYOS (for RHEL) // SLESBYOS (for SUSE) // For more information, see Azure Hybrid Use Benefit for Windows Server [https://docs.microsoft.com/azure/virtual-machines/windows/hybrid-use-benefit-licensing] // Azure Hybrid Use Benefit for Linux Server [https://docs.microsoft.com/azure/virtual-machines/linux/azure-hybrid-benefit-linux] // Minimum api-version: 2015-06-15 LicenseType *string // Specifies the network interfaces of the virtual machine. NetworkProfile *NetworkProfile // Specifies the network profile configuration of the virtual machine. NetworkProfileConfiguration *VirtualMachineScaleSetVMNetworkProfileConfiguration // Specifies the operating system settings for the virtual machine. OSProfile *OSProfile // Specifies the protection policy of the virtual machine. ProtectionPolicy *VirtualMachineScaleSetVMProtectionPolicy // Specifies the Security related profile settings for the virtual machine. SecurityProfile *SecurityProfile // Specifies the storage settings for the virtual machine disks. StorageProfile *StorageProfile // UserData for the VM, which must be base-64 encoded. Customer should not pass any secrets in here. // Minimum api-version: 2021-03-01 UserData *string // READ-ONLY; The virtual machine instance view. InstanceView *VirtualMachineScaleSetVMInstanceView // READ-ONLY; Specifies whether the latest model has been applied to the virtual machine. LatestModelApplied *bool // READ-ONLY; Specifies whether the model applied to the virtual machine is the model of the virtual machine scale set or // the customized model for the virtual machine. ModelDefinitionApplied *string // READ-ONLY; The provisioning state, which only appears in the response. ProvisioningState *string // READ-ONLY; Specifies the time at which the Virtual Machine resource was created. // Minimum api-version: 2021-11-01. TimeCreated *time.Time // READ-ONLY; Azure VM unique ID. VMID *string }
VirtualMachineScaleSetVMProperties - Describes the properties of a virtual machine scale set virtual machine.
func (VirtualMachineScaleSetVMProperties) MarshalJSON ¶
func (v VirtualMachineScaleSetVMProperties) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type VirtualMachineScaleSetVMProperties.
func (*VirtualMachineScaleSetVMProperties) UnmarshalJSON ¶
func (v *VirtualMachineScaleSetVMProperties) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type VirtualMachineScaleSetVMProperties.
type VirtualMachineScaleSetVMProtectionPolicy ¶
type VirtualMachineScaleSetVMProtectionPolicy struct { // Indicates that the virtual machine scale set VM shouldn't be considered for deletion during a scale-in operation. ProtectFromScaleIn *bool // Indicates that model updates or actions (including scale-in) initiated on the virtual machine scale set should not be applied // to the virtual machine scale set VM. ProtectFromScaleSetActions *bool }
VirtualMachineScaleSetVMProtectionPolicy - The protection policy of a virtual machine scale set VM.
func (VirtualMachineScaleSetVMProtectionPolicy) MarshalJSON ¶
func (v VirtualMachineScaleSetVMProtectionPolicy) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type VirtualMachineScaleSetVMProtectionPolicy.
func (*VirtualMachineScaleSetVMProtectionPolicy) UnmarshalJSON ¶
func (v *VirtualMachineScaleSetVMProtectionPolicy) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type VirtualMachineScaleSetVMProtectionPolicy.
type VirtualMachineScaleSetVMReimageParameters ¶
type VirtualMachineScaleSetVMReimageParameters struct { // Specifies in decimal number, the version the OS disk should be reimaged to. If exact version is not provided, the OS disk // is reimaged to the existing version of OS Disk. ExactVersion *string // Parameter to force update ephemeral OS disk for a virtual machine scale set VM ForceUpdateOSDiskForEphemeral *bool // Specifies information required for reimaging the non-ephemeral OS disk. OSProfile *OSProfileProvisioningData // Specifies whether to reimage temp disk. Default value: false. Note: This temp disk reimage parameter is only supported // for VM/VMSS with Ephemeral OS disk. TempDisk *bool }
VirtualMachineScaleSetVMReimageParameters - Describes a Virtual Machine Scale Set VM Reimage Parameters.
func (VirtualMachineScaleSetVMReimageParameters) MarshalJSON ¶
func (v VirtualMachineScaleSetVMReimageParameters) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type VirtualMachineScaleSetVMReimageParameters.
func (*VirtualMachineScaleSetVMReimageParameters) UnmarshalJSON ¶
func (v *VirtualMachineScaleSetVMReimageParameters) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type VirtualMachineScaleSetVMReimageParameters.
type VirtualMachineScaleSetVMRunCommandsClient ¶
type VirtualMachineScaleSetVMRunCommandsClient struct {
// contains filtered or unexported fields
}
VirtualMachineScaleSetVMRunCommandsClient contains the methods for the VirtualMachineScaleSetVMRunCommands group. Don't use this type directly, use NewVirtualMachineScaleSetVMRunCommandsClient() instead.
func NewVirtualMachineScaleSetVMRunCommandsClient ¶
func NewVirtualMachineScaleSetVMRunCommandsClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*VirtualMachineScaleSetVMRunCommandsClient, error)
NewVirtualMachineScaleSetVMRunCommandsClient creates a new instance of VirtualMachineScaleSetVMRunCommandsClient 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 (*VirtualMachineScaleSetVMRunCommandsClient) BeginCreateOrUpdate ¶
func (client *VirtualMachineScaleSetVMRunCommandsClient) BeginCreateOrUpdate(ctx context.Context, resourceGroupName string, vmScaleSetName string, instanceID string, runCommandName string, runCommand VirtualMachineRunCommand, options *VirtualMachineScaleSetVMRunCommandsClientBeginCreateOrUpdateOptions) (*runtime.Poller[VirtualMachineScaleSetVMRunCommandsClientCreateOrUpdateResponse], error)
BeginCreateOrUpdate - The operation to create or update the VMSS VM run command. If the operation fails it returns an *azcore.ResponseError type.
Generated from API version 2024-03-01
- resourceGroupName - The name of the resource group.
- vmScaleSetName - The name of the VM scale set.
- instanceID - The instance ID of the virtual machine.
- runCommandName - The name of the virtual machine run command.
- runCommand - Parameters supplied to the Create Virtual Machine RunCommand operation.
- options - VirtualMachineScaleSetVMRunCommandsClientBeginCreateOrUpdateOptions contains the optional parameters for the VirtualMachineScaleSetVMRunCommandsClient.BeginCreateOrUpdate method.
Example ¶
Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/92de53a5f1e0e03c94b40475d2135d97148ed014/specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-03-01/examples/runCommandExamples/VirtualMachineScaleSetVMRunCommand_CreateOrUpdate.json
cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() clientFactory, err := armcompute.NewClientFactory("<subscription-id>", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } poller, err := clientFactory.NewVirtualMachineScaleSetVMRunCommandsClient().BeginCreateOrUpdate(ctx, "myResourceGroup", "myvmScaleSet", "0", "myRunCommand", armcompute.VirtualMachineRunCommand{ Location: to.Ptr("West US"), Properties: &armcompute.VirtualMachineRunCommandProperties{ AsyncExecution: to.Ptr(false), ErrorBlobManagedIdentity: &armcompute.RunCommandManagedIdentity{}, ErrorBlobURI: to.Ptr("https://mystorageaccount.blob.core.windows.net/mycontainer/MyScriptError.txt"), OutputBlobManagedIdentity: &armcompute.RunCommandManagedIdentity{ ClientID: to.Ptr("22d35efb-0c99-4041-8c5b-6d24db33a69a"), }, OutputBlobURI: to.Ptr("https://mystorageaccount.blob.core.windows.net/myscriptoutputcontainer/MyScriptoutput.txt"), Parameters: []*armcompute.RunCommandInputParameter{ { Name: to.Ptr("param1"), Value: to.Ptr("value1"), }, { Name: to.Ptr("param2"), Value: to.Ptr("value2"), }}, RunAsPassword: to.Ptr("<runAsPassword>"), RunAsUser: to.Ptr("user1"), Source: &armcompute.VirtualMachineRunCommandScriptSource{ ScriptURI: to.Ptr("https://mystorageaccount.blob.core.windows.net/scriptcontainer/MyScript.ps1"), ScriptURIManagedIdentity: &armcompute.RunCommandManagedIdentity{ ObjectID: to.Ptr("4231e4d2-33e4-4e23-96b2-17888afa6072"), }, }, TimeoutInSeconds: to.Ptr[int32](3600), TreatFailureAsDeploymentFailure: to.Ptr(true), }, }, nil) if err != nil { log.Fatalf("failed to finish the request: %v", err) } res, err := poller.PollUntilDone(ctx, nil) if err != nil { log.Fatalf("failed to pull the result: %v", err) } // You could use response here. We use blank identifier for just demo purposes. _ = res // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. // res.VirtualMachineRunCommand = armcompute.VirtualMachineRunCommand{ // Name: to.Ptr("myRunCommand"), // Type: to.Ptr("Microsoft.Compute/virtualMachineScaleSets/virtualMachines/runCommands"), // ID: to.Ptr("/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/virtualMachineScaleSets/myvmScaleSet/virtualMachines/0/runCommands/myRunCommand"), // Location: to.Ptr("westus"), // Properties: &armcompute.VirtualMachineRunCommandProperties{ // AsyncExecution: to.Ptr(false), // ErrorBlobURI: to.Ptr("https://mystorageaccount.blob.core.windows.net/mycontainer/MyScriptError.txt"), // OutputBlobURI: to.Ptr("https://mystorageaccount.blob.core.windows.net/myscriptoutputcontainer/MyScriptoutput.txt"), // Parameters: []*armcompute.RunCommandInputParameter{ // { // Name: to.Ptr("param1"), // Value: to.Ptr("value1"), // }, // { // Name: to.Ptr("param2"), // Value: to.Ptr("value2"), // }}, // ProvisioningState: to.Ptr("Succeeded"), // RunAsUser: to.Ptr("user1"), // Source: &armcompute.VirtualMachineRunCommandScriptSource{ // ScriptURI: to.Ptr("https://mystorageaccount.blob.core.windows.net/scriptcontainer/MyScript.ps1"), // }, // TimeoutInSeconds: to.Ptr[int32](3600), // TreatFailureAsDeploymentFailure: to.Ptr(true), // }, // }
Output:
func (*VirtualMachineScaleSetVMRunCommandsClient) BeginDelete ¶
func (client *VirtualMachineScaleSetVMRunCommandsClient) BeginDelete(ctx context.Context, resourceGroupName string, vmScaleSetName string, instanceID string, runCommandName string, options *VirtualMachineScaleSetVMRunCommandsClientBeginDeleteOptions) (*runtime.Poller[VirtualMachineScaleSetVMRunCommandsClientDeleteResponse], error)
BeginDelete - The operation to delete the VMSS VM run command. If the operation fails it returns an *azcore.ResponseError type.
Generated from API version 2024-03-01
- resourceGroupName - The name of the resource group.
- vmScaleSetName - The name of the VM scale set.
- instanceID - The instance ID of the virtual machine.
- runCommandName - The name of the virtual machine run command.
- options - VirtualMachineScaleSetVMRunCommandsClientBeginDeleteOptions contains the optional parameters for the VirtualMachineScaleSetVMRunCommandsClient.BeginDelete method.
Example ¶
Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/92de53a5f1e0e03c94b40475d2135d97148ed014/specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-03-01/examples/runCommandExamples/VirtualMachineScaleSetVMRunCommand_Delete.json
cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() clientFactory, err := armcompute.NewClientFactory("<subscription-id>", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } poller, err := clientFactory.NewVirtualMachineScaleSetVMRunCommandsClient().BeginDelete(ctx, "myResourceGroup", "myvmScaleSet", "0", "myRunCommand", nil) if err != nil { log.Fatalf("failed to finish the request: %v", err) } _, err = poller.PollUntilDone(ctx, nil) if err != nil { log.Fatalf("failed to pull the result: %v", err) }
Output:
func (*VirtualMachineScaleSetVMRunCommandsClient) BeginUpdate ¶
func (client *VirtualMachineScaleSetVMRunCommandsClient) BeginUpdate(ctx context.Context, resourceGroupName string, vmScaleSetName string, instanceID string, runCommandName string, runCommand VirtualMachineRunCommandUpdate, options *VirtualMachineScaleSetVMRunCommandsClientBeginUpdateOptions) (*runtime.Poller[VirtualMachineScaleSetVMRunCommandsClientUpdateResponse], error)
BeginUpdate - The operation to update the VMSS VM run command. If the operation fails it returns an *azcore.ResponseError type.
Generated from API version 2024-03-01
- resourceGroupName - The name of the resource group.
- vmScaleSetName - The name of the VM scale set.
- instanceID - The instance ID of the virtual machine.
- runCommandName - The name of the virtual machine run command.
- runCommand - Parameters supplied to the Update Virtual Machine RunCommand operation.
- options - VirtualMachineScaleSetVMRunCommandsClientBeginUpdateOptions contains the optional parameters for the VirtualMachineScaleSetVMRunCommandsClient.BeginUpdate method.
Example ¶
Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/92de53a5f1e0e03c94b40475d2135d97148ed014/specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-03-01/examples/runCommandExamples/VirtualMachineScaleSetVMRunCommand_Update.json
cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() clientFactory, err := armcompute.NewClientFactory("<subscription-id>", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } poller, err := clientFactory.NewVirtualMachineScaleSetVMRunCommandsClient().BeginUpdate(ctx, "myResourceGroup", "myvmScaleSet", "0", "myRunCommand", armcompute.VirtualMachineRunCommandUpdate{ Properties: &armcompute.VirtualMachineRunCommandProperties{ Source: &armcompute.VirtualMachineRunCommandScriptSource{ ScriptURI: to.Ptr("https://mystorageaccount.blob.core.windows.net/scriptcontainer/MyScript.ps1"), ScriptURIManagedIdentity: &armcompute.RunCommandManagedIdentity{ ObjectID: to.Ptr("4231e4d2-33e4-4e23-96b2-17888afa6072"), }, }, }, }, nil) if err != nil { log.Fatalf("failed to finish the request: %v", err) } res, err := poller.PollUntilDone(ctx, nil) if err != nil { log.Fatalf("failed to pull the result: %v", err) } // You could use response here. We use blank identifier for just demo purposes. _ = res // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. // res.VirtualMachineRunCommand = armcompute.VirtualMachineRunCommand{ // Name: to.Ptr("myRunCommand"), // Type: to.Ptr("Microsoft.Compute/virtualMachineScaleSets/virtualMachines/runCommands"), // ID: to.Ptr("/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/virtualMachineScaleSets/myvmScaleSet/virtualMachines/0/runCommands/myRunCommand"), // Location: to.Ptr("westus"), // Tags: map[string]*string{ // "tag1": to.Ptr("value1"), // "tag2": to.Ptr("value2"), // }, // Properties: &armcompute.VirtualMachineRunCommandProperties{ // AsyncExecution: to.Ptr(false), // ErrorBlobURI: to.Ptr("https://mystorageaccount.blob.core.windows.net/mycontainer/MyScriptError.txt"), // OutputBlobURI: to.Ptr("https://mystorageaccount.blob.core.windows.net/myscriptoutputcontainer/MyScriptoutput.txt"), // Parameters: []*armcompute.RunCommandInputParameter{ // { // Name: to.Ptr("param1"), // Value: to.Ptr("value1"), // }, // { // Name: to.Ptr("param2"), // Value: to.Ptr("value2"), // }}, // ProvisioningState: to.Ptr("Succeeded"), // RunAsUser: to.Ptr("user1"), // Source: &armcompute.VirtualMachineRunCommandScriptSource{ // ScriptURI: to.Ptr("https://mystorageaccount.blob.core.windows.net/scriptcontainer/MyScript.ps1"), // }, // TimeoutInSeconds: to.Ptr[int32](3600), // TreatFailureAsDeploymentFailure: to.Ptr(false), // }, // }
Output:
func (*VirtualMachineScaleSetVMRunCommandsClient) Get ¶
func (client *VirtualMachineScaleSetVMRunCommandsClient) Get(ctx context.Context, resourceGroupName string, vmScaleSetName string, instanceID string, runCommandName string, options *VirtualMachineScaleSetVMRunCommandsClientGetOptions) (VirtualMachineScaleSetVMRunCommandsClientGetResponse, error)
Get - The operation to get the VMSS VM run command. If the operation fails it returns an *azcore.ResponseError type.
Generated from API version 2024-03-01
- resourceGroupName - The name of the resource group.
- vmScaleSetName - The name of the VM scale set.
- instanceID - The instance ID of the virtual machine.
- runCommandName - The name of the virtual machine run command.
- options - VirtualMachineScaleSetVMRunCommandsClientGetOptions contains the optional parameters for the VirtualMachineScaleSetVMRunCommandsClient.Get method.
Example ¶
Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/92de53a5f1e0e03c94b40475d2135d97148ed014/specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-03-01/examples/runCommandExamples/VirtualMachineScaleSetVMRunCommand_Get.json
cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() clientFactory, err := armcompute.NewClientFactory("<subscription-id>", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } res, err := clientFactory.NewVirtualMachineScaleSetVMRunCommandsClient().Get(ctx, "myResourceGroup", "myvmScaleSet", "0", "myRunCommand", &armcompute.VirtualMachineScaleSetVMRunCommandsClientGetOptions{Expand: nil}) if err != nil { log.Fatalf("failed to finish the request: %v", err) } // You could use response here. We use blank identifier for just demo purposes. _ = res // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. // res.VirtualMachineRunCommand = armcompute.VirtualMachineRunCommand{ // Name: to.Ptr("myRunCommand"), // Type: to.Ptr("Microsoft.Compute/virtualMachineScaleSets/virtualMachines/runCommands"), // ID: to.Ptr("/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/virtualMachineScaleSets/myvmScaleSet/virtualMachines/0/runCommands/myRunCommand"), // Location: to.Ptr("westus"), // Tags: map[string]*string{ // "tag1": to.Ptr("value1"), // "tag2": to.Ptr("value2"), // }, // Properties: &armcompute.VirtualMachineRunCommandProperties{ // AsyncExecution: to.Ptr(false), // ErrorBlobURI: to.Ptr("https://mystorageaccount.blob.core.windows.net/mycontainer/MyScriptError.txt"), // OutputBlobURI: to.Ptr("https://mystorageaccount.blob.core.windows.net/myscriptoutputcontainer/MyScriptoutput.txt"), // Parameters: []*armcompute.RunCommandInputParameter{ // { // Name: to.Ptr("param1"), // Value: to.Ptr("value1"), // }, // { // Name: to.Ptr("param2"), // Value: to.Ptr("value2"), // }}, // ProvisioningState: to.Ptr("Succeeded"), // RunAsUser: to.Ptr("user1"), // Source: &armcompute.VirtualMachineRunCommandScriptSource{ // ScriptURI: to.Ptr("https://gist.githubusercontent.com/myusername/75fd3634w7511116063c60bcc50bee0/raw/04a4c68ac9e1d36asfasdc64bd1d889b104c7abdb8/HelloWorld.ps1"), // }, // TimeoutInSeconds: to.Ptr[int32](3600), // TreatFailureAsDeploymentFailure: to.Ptr(false), // }, // }
Output:
func (*VirtualMachineScaleSetVMRunCommandsClient) NewListPager ¶
func (client *VirtualMachineScaleSetVMRunCommandsClient) NewListPager(resourceGroupName string, vmScaleSetName string, instanceID string, options *VirtualMachineScaleSetVMRunCommandsClientListOptions) *runtime.Pager[VirtualMachineScaleSetVMRunCommandsClientListResponse]
NewListPager - The operation to get all run commands of an instance in Virtual Machine Scaleset.
Generated from API version 2024-03-01
- resourceGroupName - The name of the resource group.
- vmScaleSetName - The name of the VM scale set.
- instanceID - The instance ID of the virtual machine.
- options - VirtualMachineScaleSetVMRunCommandsClientListOptions contains the optional parameters for the VirtualMachineScaleSetVMRunCommandsClient.NewListPager method.
Example ¶
Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/92de53a5f1e0e03c94b40475d2135d97148ed014/specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-03-01/examples/runCommandExamples/VirtualMachineScaleSetVMRunCommand_List.json
cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() clientFactory, err := armcompute.NewClientFactory("<subscription-id>", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } pager := clientFactory.NewVirtualMachineScaleSetVMRunCommandsClient().NewListPager("myResourceGroup", "myvmScaleSet", "0", &armcompute.VirtualMachineScaleSetVMRunCommandsClientListOptions{Expand: nil}) for pager.More() { page, err := pager.NextPage(ctx) if err != nil { log.Fatalf("failed to advance page: %v", err) } for _, v := range page.Value { // You could use page here. We use blank identifier for just demo purposes. _ = v } // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. // page.VirtualMachineRunCommandsListResult = armcompute.VirtualMachineRunCommandsListResult{ // Value: []*armcompute.VirtualMachineRunCommand{ // { // Name: to.Ptr("myRunCommand"), // Type: to.Ptr("Microsoft.Compute/virtualMachineScaleSets/virtualMachines/runCommands"), // ID: to.Ptr("/subscriptions/{subscriptionId}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/virtualMachineScaleSets/myvmScaleSet/virtualMachines/0/runCommands/myRunCommand"), // Location: to.Ptr("westus"), // Properties: &armcompute.VirtualMachineRunCommandProperties{ // AsyncExecution: to.Ptr(false), // ErrorBlobURI: to.Ptr("https://mystorageaccount.blob.core.windows.net/mycontainer/MyScriptError.txt"), // OutputBlobURI: to.Ptr("https://mystorageaccount.blob.core.windows.net/myscriptoutputcontainer/MyScriptoutput.txt"), // Parameters: []*armcompute.RunCommandInputParameter{ // { // Name: to.Ptr("param1"), // Value: to.Ptr("value1"), // }, // { // Name: to.Ptr("param2"), // Value: to.Ptr("value2"), // }}, // ProvisioningState: to.Ptr("Succeeded"), // RunAsUser: to.Ptr("user1"), // Source: &armcompute.VirtualMachineRunCommandScriptSource{ // Script: to.Ptr("Write-Host Hello World! ; Remove-Item C: est estFile.txt"), // }, // TimeoutInSeconds: to.Ptr[int32](0), // TreatFailureAsDeploymentFailure: to.Ptr(false), // }, // }}, // } }
Output:
type VirtualMachineScaleSetVMRunCommandsClientBeginCreateOrUpdateOptions ¶
type VirtualMachineScaleSetVMRunCommandsClientBeginCreateOrUpdateOptions struct { // Resumes the LRO from the provided token. ResumeToken string }
VirtualMachineScaleSetVMRunCommandsClientBeginCreateOrUpdateOptions contains the optional parameters for the VirtualMachineScaleSetVMRunCommandsClient.BeginCreateOrUpdate method.
type VirtualMachineScaleSetVMRunCommandsClientBeginDeleteOptions ¶
type VirtualMachineScaleSetVMRunCommandsClientBeginDeleteOptions struct { // Resumes the LRO from the provided token. ResumeToken string }
VirtualMachineScaleSetVMRunCommandsClientBeginDeleteOptions contains the optional parameters for the VirtualMachineScaleSetVMRunCommandsClient.BeginDelete method.
type VirtualMachineScaleSetVMRunCommandsClientBeginUpdateOptions ¶
type VirtualMachineScaleSetVMRunCommandsClientBeginUpdateOptions struct { // Resumes the LRO from the provided token. ResumeToken string }
VirtualMachineScaleSetVMRunCommandsClientBeginUpdateOptions contains the optional parameters for the VirtualMachineScaleSetVMRunCommandsClient.BeginUpdate method.
type VirtualMachineScaleSetVMRunCommandsClientCreateOrUpdateResponse ¶
type VirtualMachineScaleSetVMRunCommandsClientCreateOrUpdateResponse struct { // Describes a Virtual Machine run command. VirtualMachineRunCommand }
VirtualMachineScaleSetVMRunCommandsClientCreateOrUpdateResponse contains the response from method VirtualMachineScaleSetVMRunCommandsClient.BeginCreateOrUpdate.
type VirtualMachineScaleSetVMRunCommandsClientDeleteResponse ¶
type VirtualMachineScaleSetVMRunCommandsClientDeleteResponse struct { }
VirtualMachineScaleSetVMRunCommandsClientDeleteResponse contains the response from method VirtualMachineScaleSetVMRunCommandsClient.BeginDelete.
type VirtualMachineScaleSetVMRunCommandsClientGetOptions ¶
type VirtualMachineScaleSetVMRunCommandsClientGetOptions struct { // The expand expression to apply on the operation. Expand *string }
VirtualMachineScaleSetVMRunCommandsClientGetOptions contains the optional parameters for the VirtualMachineScaleSetVMRunCommandsClient.Get method.
type VirtualMachineScaleSetVMRunCommandsClientGetResponse ¶
type VirtualMachineScaleSetVMRunCommandsClientGetResponse struct { // Describes a Virtual Machine run command. VirtualMachineRunCommand }
VirtualMachineScaleSetVMRunCommandsClientGetResponse contains the response from method VirtualMachineScaleSetVMRunCommandsClient.Get.
type VirtualMachineScaleSetVMRunCommandsClientListOptions ¶
type VirtualMachineScaleSetVMRunCommandsClientListOptions struct { // The expand expression to apply on the operation. Expand *string }
VirtualMachineScaleSetVMRunCommandsClientListOptions contains the optional parameters for the VirtualMachineScaleSetVMRunCommandsClient.NewListPager method.
type VirtualMachineScaleSetVMRunCommandsClientListResponse ¶
type VirtualMachineScaleSetVMRunCommandsClientListResponse struct { // The List run command operation response VirtualMachineRunCommandsListResult }
VirtualMachineScaleSetVMRunCommandsClientListResponse contains the response from method VirtualMachineScaleSetVMRunCommandsClient.NewListPager.
type VirtualMachineScaleSetVMRunCommandsClientUpdateResponse ¶
type VirtualMachineScaleSetVMRunCommandsClientUpdateResponse struct { // Describes a Virtual Machine run command. VirtualMachineRunCommand }
VirtualMachineScaleSetVMRunCommandsClientUpdateResponse contains the response from method VirtualMachineScaleSetVMRunCommandsClient.BeginUpdate.
type VirtualMachineScaleSetVMsClient ¶
type VirtualMachineScaleSetVMsClient struct {
// contains filtered or unexported fields
}
VirtualMachineScaleSetVMsClient contains the methods for the VirtualMachineScaleSetVMs group. Don't use this type directly, use NewVirtualMachineScaleSetVMsClient() instead.
func NewVirtualMachineScaleSetVMsClient ¶
func NewVirtualMachineScaleSetVMsClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*VirtualMachineScaleSetVMsClient, error)
NewVirtualMachineScaleSetVMsClient creates a new instance of VirtualMachineScaleSetVMsClient 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 (*VirtualMachineScaleSetVMsClient) BeginApproveRollingUpgrade ¶ added in v5.4.0
func (client *VirtualMachineScaleSetVMsClient) BeginApproveRollingUpgrade(ctx context.Context, resourceGroupName string, vmScaleSetName string, instanceID string, options *VirtualMachineScaleSetVMsClientBeginApproveRollingUpgradeOptions) (*runtime.Poller[VirtualMachineScaleSetVMsClientApproveRollingUpgradeResponse], error)
BeginApproveRollingUpgrade - Approve upgrade on deferred rolling upgrade for OS disk on a VM scale set instance. If the operation fails it returns an *azcore.ResponseError type.
Generated from API version 2024-03-01
- resourceGroupName - The name of the resource group.
- vmScaleSetName - The name of the VM scale set.
- instanceID - The instance ID of the virtual machine.
- options - VirtualMachineScaleSetVMsClientBeginApproveRollingUpgradeOptions contains the optional parameters for the VirtualMachineScaleSetVMsClient.BeginApproveRollingUpgrade method.
Example ¶
Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/92de53a5f1e0e03c94b40475d2135d97148ed014/specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-03-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSetVM_ApproveRollingUpgrade.json
cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() clientFactory, err := armcompute.NewClientFactory("<subscription-id>", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } poller, err := clientFactory.NewVirtualMachineScaleSetVMsClient().BeginApproveRollingUpgrade(ctx, "rgcompute", "vmssToApproveRollingUpgradeOn", "0123", nil) if err != nil { log.Fatalf("failed to finish the request: %v", err) } _, err = poller.PollUntilDone(ctx, nil) if err != nil { log.Fatalf("failed to pull the result: %v", err) }
Output:
func (*VirtualMachineScaleSetVMsClient) BeginAttachDetachDataDisks ¶ added in v5.4.0
func (client *VirtualMachineScaleSetVMsClient) BeginAttachDetachDataDisks(ctx context.Context, resourceGroupName string, vmScaleSetName string, instanceID string, parameters AttachDetachDataDisksRequest, options *VirtualMachineScaleSetVMsClientBeginAttachDetachDataDisksOptions) (*runtime.Poller[VirtualMachineScaleSetVMsClientAttachDetachDataDisksResponse], error)
BeginAttachDetachDataDisks - Attach and detach data disks to/from a virtual machine in a VM scale set. If the operation fails it returns an *azcore.ResponseError type.
Generated from API version 2024-03-01
- resourceGroupName - The name of the resource group.
- vmScaleSetName - The name of the VM scale set.
- instanceID - The instance ID of the virtual machine.
- parameters - Parameters supplied to the attach and detach data disks operation on a Virtual Machine Scale Sets VM.
- options - VirtualMachineScaleSetVMsClientBeginAttachDetachDataDisksOptions contains the optional parameters for the VirtualMachineScaleSetVMsClient.BeginAttachDetachDataDisks method.
Example (VirtualMachineScaleSetVmAttachDetachDataDisksMaximumSetGen) ¶
Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/92de53a5f1e0e03c94b40475d2135d97148ed014/specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-03-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSetVM_AttachDetachDataDisks_MaximumSet_Gen.json
cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() clientFactory, err := armcompute.NewClientFactory("<subscription-id>", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } poller, err := clientFactory.NewVirtualMachineScaleSetVMsClient().BeginAttachDetachDataDisks(ctx, "rgcompute", "azure-vmscaleset", "0", armcompute.AttachDetachDataDisksRequest{ DataDisksToAttach: []*armcompute.DataDisksToAttach{ { Caching: to.Ptr(armcompute.CachingTypesReadOnly), DiskEncryptionSet: &armcompute.DiskEncryptionSetParameters{ ID: to.Ptr("/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/diskEncryptionSets/{existing-diskEncryptionSet-name}"), }, DiskID: to.Ptr("/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/disks/vmss3176_vmss3176_0_disk2_6c4f554bdafa49baa780eb2d128ff39d"), Lun: to.Ptr[int32](1), WriteAcceleratorEnabled: to.Ptr(true), }, { Caching: to.Ptr(armcompute.CachingTypesReadWrite), DiskEncryptionSet: &armcompute.DiskEncryptionSetParameters{ ID: to.Ptr("/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/diskEncryptionSets/{existing-diskEncryptionSet-name}"), }, DiskID: to.Ptr("/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/disks/vmss3176_vmss3176_2_disk3_7d5e664bdafa49baa780eb2d128ff38e"), Lun: to.Ptr[int32](2), WriteAcceleratorEnabled: to.Ptr(false), }}, DataDisksToDetach: []*armcompute.DataDisksToDetach{ { DetachOption: to.Ptr(armcompute.DiskDetachOptionTypesForceDetach), DiskID: to.Ptr("/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/disks/vmss3176_vmss3176_1_disk1_1a4e784bdafa49baa780eb2d128ff65x"), }, { DetachOption: to.Ptr(armcompute.DiskDetachOptionTypesForceDetach), DiskID: to.Ptr("/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/disks/vmss3176_vmss3176_4_disk4_4d4e784bdafa49baa780eb2d256ff41z"), }}, }, nil) if err != nil { log.Fatalf("failed to finish the request: %v", err) } res, err := poller.PollUntilDone(ctx, nil) if err != nil { log.Fatalf("failed to pull the result: %v", err) } // You could use response here. We use blank identifier for just demo purposes. _ = res // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. // res.StorageProfile = armcompute.StorageProfile{ // DataDisks: []*armcompute.DataDisk{ // { // Name: to.Ptr("vmss3176_vmss3176_0_disk2_6c4f554bdafa49baa780eb2d128ff39d"), // Caching: to.Ptr(armcompute.CachingTypesReadOnly), // CreateOption: to.Ptr(armcompute.DiskCreateOptionTypesAttach), // DiskSizeGB: to.Ptr[int32](30), // Lun: to.Ptr[int32](1), // ManagedDisk: &armcompute.ManagedDiskParameters{ // ID: to.Ptr("/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/disks/vmss3176_vmss3176_0_disk2_6c4f554bdafa49baa780eb2d128ff39d"), // DiskEncryptionSet: &armcompute.DiskEncryptionSetParameters{ // ID: to.Ptr("/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/diskEncryptionSets/{existing-diskEncryptionSet-name}"), // }, // StorageAccountType: to.Ptr(armcompute.StorageAccountTypesPremiumLRS), // }, // WriteAcceleratorEnabled: to.Ptr(true), // }, // { // Name: to.Ptr("vmss3176_vmss3176_2_disk3_7d5e664bdafa49baa780eb2d128ff38e"), // Caching: to.Ptr(armcompute.CachingTypesReadWrite), // CreateOption: to.Ptr(armcompute.DiskCreateOptionTypesAttach), // DiskSizeGB: to.Ptr[int32](100), // Lun: to.Ptr[int32](2), // ManagedDisk: &armcompute.ManagedDiskParameters{ // ID: to.Ptr("/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/disks/vmss3176_vmss3176_2_disk3_7d5e664bdafa49baa780eb2d128ff38e"), // DiskEncryptionSet: &armcompute.DiskEncryptionSetParameters{ // ID: to.Ptr("/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/diskEncryptionSets/{existing-diskEncryptionSet-name}"), // }, // StorageAccountType: to.Ptr(armcompute.StorageAccountTypesPremiumLRS), // }, // WriteAcceleratorEnabled: to.Ptr(false), // }}, // ImageReference: &armcompute.ImageReference{ // Offer: to.Ptr("WindowsServer"), // Publisher: to.Ptr("MicrosoftWindowsServer"), // SKU: to.Ptr("2016-Datacenter"), // Version: to.Ptr("latest"), // }, // OSDisk: &armcompute.OSDisk{ // Name: to.Ptr("myOsDisk"), // Caching: to.Ptr(armcompute.CachingTypesReadWrite), // CreateOption: to.Ptr(armcompute.DiskCreateOptionTypesFromImage), // DiskSizeGB: to.Ptr[int32](30), // ManagedDisk: &armcompute.ManagedDiskParameters{ // ID: to.Ptr("/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/disks/myOsDisk"), // StorageAccountType: to.Ptr(armcompute.StorageAccountTypesPremiumLRS), // }, // OSType: to.Ptr(armcompute.OperatingSystemTypesWindows), // }, // }
Output:
Example (VirtualMachineScaleSetVmAttachDetachDataDisksMinimumSetGen) ¶
Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/92de53a5f1e0e03c94b40475d2135d97148ed014/specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-03-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSetVM_AttachDetachDataDisks_MinimumSet_Gen.json
cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() clientFactory, err := armcompute.NewClientFactory("<subscription-id>", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } poller, err := clientFactory.NewVirtualMachineScaleSetVMsClient().BeginAttachDetachDataDisks(ctx, "rgcompute", "azure-vmscaleset", "0", armcompute.AttachDetachDataDisksRequest{ DataDisksToAttach: []*armcompute.DataDisksToAttach{ { DiskID: to.Ptr("/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/disks/vmss3176_vmss3176_0_disk2_6c4f554bdafa49baa780eb2d128ff39d"), }}, DataDisksToDetach: []*armcompute.DataDisksToDetach{ { DiskID: to.Ptr("/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/disks/vmss3176_vmss3176_1_disk1_1a4e784bdafa49baa780eb2d128ff65x"), }}, }, nil) if err != nil { log.Fatalf("failed to finish the request: %v", err) } res, err := poller.PollUntilDone(ctx, nil) if err != nil { log.Fatalf("failed to pull the result: %v", err) } // You could use response here. We use blank identifier for just demo purposes. _ = res // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. // res.StorageProfile = armcompute.StorageProfile{ // DataDisks: []*armcompute.DataDisk{ // { // Name: to.Ptr("vmss3176_vmss3176_0_disk2_6c4f554bdafa49baa780eb2d128ff39d"), // Caching: to.Ptr(armcompute.CachingTypesReadWrite), // CreateOption: to.Ptr(armcompute.DiskCreateOptionTypesAttach), // DiskSizeGB: to.Ptr[int32](30), // Lun: to.Ptr[int32](0), // ManagedDisk: &armcompute.ManagedDiskParameters{ // ID: to.Ptr("/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/disks/vmss3176_vmss3176_0_disk2_6c4f554bdafa49baa780eb2d128ff39d"), // StorageAccountType: to.Ptr(armcompute.StorageAccountTypesPremiumLRS), // }, // }}, // ImageReference: &armcompute.ImageReference{ // Offer: to.Ptr("WindowsServer"), // Publisher: to.Ptr("MicrosoftWindowsServer"), // SKU: to.Ptr("2016-Datacenter"), // Version: to.Ptr("latest"), // }, // OSDisk: &armcompute.OSDisk{ // Name: to.Ptr("myOsDisk"), // Caching: to.Ptr(armcompute.CachingTypesReadWrite), // CreateOption: to.Ptr(armcompute.DiskCreateOptionTypesFromImage), // DiskSizeGB: to.Ptr[int32](30), // ManagedDisk: &armcompute.ManagedDiskParameters{ // ID: to.Ptr("/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/disks/myOsDisk"), // StorageAccountType: to.Ptr(armcompute.StorageAccountTypesPremiumLRS), // }, // OSType: to.Ptr(armcompute.OperatingSystemTypesWindows), // }, // }
Output:
func (*VirtualMachineScaleSetVMsClient) BeginDeallocate ¶
func (client *VirtualMachineScaleSetVMsClient) BeginDeallocate(ctx context.Context, resourceGroupName string, vmScaleSetName string, instanceID string, options *VirtualMachineScaleSetVMsClientBeginDeallocateOptions) (*runtime.Poller[VirtualMachineScaleSetVMsClientDeallocateResponse], error)
BeginDeallocate - Deallocates a specific virtual machine in a VM scale set. Shuts down the virtual machine and releases the compute resources it uses. You are not billed for the compute resources of this virtual machine once it is deallocated. If the operation fails it returns an *azcore.ResponseError type.
Generated from API version 2024-03-01
- resourceGroupName - The name of the resource group.
- vmScaleSetName - The name of the VM scale set.
- instanceID - The instance ID of the virtual machine.
- options - VirtualMachineScaleSetVMsClientBeginDeallocateOptions contains the optional parameters for the VirtualMachineScaleSetVMsClient.BeginDeallocate method.
Example (VirtualMachineScaleSetVmDeallocateMaximumSetGen) ¶
Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/92de53a5f1e0e03c94b40475d2135d97148ed014/specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-03-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSetVM_Deallocate_MaximumSet_Gen.json
cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() clientFactory, err := armcompute.NewClientFactory("<subscription-id>", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } poller, err := clientFactory.NewVirtualMachineScaleSetVMsClient().BeginDeallocate(ctx, "rgcompute", "aaaaaaaaaaaaaaaaaaaaaaaa", "aaaaaaaaaaaaaaaaaaaaaa", nil) if err != nil { log.Fatalf("failed to finish the request: %v", err) } _, err = poller.PollUntilDone(ctx, nil) if err != nil { log.Fatalf("failed to pull the result: %v", err) }
Output:
Example (VirtualMachineScaleSetVmDeallocateMinimumSetGen) ¶
Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/92de53a5f1e0e03c94b40475d2135d97148ed014/specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-03-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSetVM_Deallocate_MinimumSet_Gen.json
cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() clientFactory, err := armcompute.NewClientFactory("<subscription-id>", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } poller, err := clientFactory.NewVirtualMachineScaleSetVMsClient().BeginDeallocate(ctx, "rgcompute", "aaaaaaaaaaaaaaaaaaaaaaaa", "aaaaaa", nil) if err != nil { log.Fatalf("failed to finish the request: %v", err) } _, err = poller.PollUntilDone(ctx, nil) if err != nil { log.Fatalf("failed to pull the result: %v", err) }
Output:
func (*VirtualMachineScaleSetVMsClient) BeginDelete ¶
func (client *VirtualMachineScaleSetVMsClient) BeginDelete(ctx context.Context, resourceGroupName string, vmScaleSetName string, instanceID string, options *VirtualMachineScaleSetVMsClientBeginDeleteOptions) (*runtime.Poller[VirtualMachineScaleSetVMsClientDeleteResponse], error)
BeginDelete - Deletes a virtual machine from a VM scale set. If the operation fails it returns an *azcore.ResponseError type.
Generated from API version 2024-03-01
- resourceGroupName - The name of the resource group.
- vmScaleSetName - The name of the VM scale set.
- instanceID - The instance ID of the virtual machine.
- options - VirtualMachineScaleSetVMsClientBeginDeleteOptions contains the optional parameters for the VirtualMachineScaleSetVMsClient.BeginDelete method.
Example ¶
Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/92de53a5f1e0e03c94b40475d2135d97148ed014/specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-03-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSetVM_Delete_Force.json
cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() clientFactory, err := armcompute.NewClientFactory("<subscription-id>", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } poller, err := clientFactory.NewVirtualMachineScaleSetVMsClient().BeginDelete(ctx, "myResourceGroup", "myvmScaleSet", "0", &armcompute.VirtualMachineScaleSetVMsClientBeginDeleteOptions{ForceDeletion: to.Ptr(true)}) if err != nil { log.Fatalf("failed to finish the request: %v", err) } _, err = poller.PollUntilDone(ctx, nil) if err != nil { log.Fatalf("failed to pull the result: %v", err) }
Output:
func (*VirtualMachineScaleSetVMsClient) BeginPerformMaintenance ¶
func (client *VirtualMachineScaleSetVMsClient) BeginPerformMaintenance(ctx context.Context, resourceGroupName string, vmScaleSetName string, instanceID string, options *VirtualMachineScaleSetVMsClientBeginPerformMaintenanceOptions) (*runtime.Poller[VirtualMachineScaleSetVMsClientPerformMaintenanceResponse], error)
BeginPerformMaintenance - Performs maintenance on a virtual machine in a VM scale set. If the operation fails it returns an *azcore.ResponseError type.
Generated from API version 2024-03-01
- resourceGroupName - The name of the resource group.
- vmScaleSetName - The name of the VM scale set.
- instanceID - The instance ID of the virtual machine.
- options - VirtualMachineScaleSetVMsClientBeginPerformMaintenanceOptions contains the optional parameters for the VirtualMachineScaleSetVMsClient.BeginPerformMaintenance method.
Example (VirtualMachineScaleSetVmPerformMaintenanceMaximumSetGen) ¶
Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/92de53a5f1e0e03c94b40475d2135d97148ed014/specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-03-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSetVM_PerformMaintenance_MaximumSet_Gen.json
cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() clientFactory, err := armcompute.NewClientFactory("<subscription-id>", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } poller, err := clientFactory.NewVirtualMachineScaleSetVMsClient().BeginPerformMaintenance(ctx, "rgcompute", "aaaaaaaaaaaaaa", "aaaaaaaaaaaa", nil) if err != nil { log.Fatalf("failed to finish the request: %v", err) } _, err = poller.PollUntilDone(ctx, nil) if err != nil { log.Fatalf("failed to pull the result: %v", err) }
Output:
Example (VirtualMachineScaleSetVmPerformMaintenanceMinimumSetGen) ¶
Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/92de53a5f1e0e03c94b40475d2135d97148ed014/specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-03-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSetVM_PerformMaintenance_MinimumSet_Gen.json
cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() clientFactory, err := armcompute.NewClientFactory("<subscription-id>", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } poller, err := clientFactory.NewVirtualMachineScaleSetVMsClient().BeginPerformMaintenance(ctx, "rgcompute", "aaaaaaaaaa", "aaaa", nil) if err != nil { log.Fatalf("failed to finish the request: %v", err) } _, err = poller.PollUntilDone(ctx, nil) if err != nil { log.Fatalf("failed to pull the result: %v", err) }
Output:
func (*VirtualMachineScaleSetVMsClient) BeginPowerOff ¶
func (client *VirtualMachineScaleSetVMsClient) BeginPowerOff(ctx context.Context, resourceGroupName string, vmScaleSetName string, instanceID string, options *VirtualMachineScaleSetVMsClientBeginPowerOffOptions) (*runtime.Poller[VirtualMachineScaleSetVMsClientPowerOffResponse], error)
BeginPowerOff - Power off (stop) a virtual machine in a VM scale set. Note that resources are still attached and you are getting charged for the resources. Instead, use deallocate to release resources and avoid charges. If the operation fails it returns an *azcore.ResponseError type.
Generated from API version 2024-03-01
- resourceGroupName - The name of the resource group.
- vmScaleSetName - The name of the VM scale set.
- instanceID - The instance ID of the virtual machine.
- options - VirtualMachineScaleSetVMsClientBeginPowerOffOptions contains the optional parameters for the VirtualMachineScaleSetVMsClient.BeginPowerOff method.
Example (VirtualMachineScaleSetVmPowerOffMaximumSetGen) ¶
Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/92de53a5f1e0e03c94b40475d2135d97148ed014/specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-03-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSetVM_PowerOff_MaximumSet_Gen.json
cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() clientFactory, err := armcompute.NewClientFactory("<subscription-id>", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } poller, err := clientFactory.NewVirtualMachineScaleSetVMsClient().BeginPowerOff(ctx, "rgcompute", "aaaaaa", "aaaaaaaaa", &armcompute.VirtualMachineScaleSetVMsClientBeginPowerOffOptions{SkipShutdown: to.Ptr(true)}) if err != nil { log.Fatalf("failed to finish the request: %v", err) } _, err = poller.PollUntilDone(ctx, nil) if err != nil { log.Fatalf("failed to pull the result: %v", err) }
Output:
Example (VirtualMachineScaleSetVmPowerOffMinimumSetGen) ¶
Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/92de53a5f1e0e03c94b40475d2135d97148ed014/specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-03-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSetVM_PowerOff_MinimumSet_Gen.json
cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() clientFactory, err := armcompute.NewClientFactory("<subscription-id>", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } poller, err := clientFactory.NewVirtualMachineScaleSetVMsClient().BeginPowerOff(ctx, "rgcompute", "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "aaaaaaaaaaaaaaaaaaaaaa", &armcompute.VirtualMachineScaleSetVMsClientBeginPowerOffOptions{SkipShutdown: nil}) if err != nil { log.Fatalf("failed to finish the request: %v", err) } _, err = poller.PollUntilDone(ctx, nil) if err != nil { log.Fatalf("failed to pull the result: %v", err) }
Output:
func (*VirtualMachineScaleSetVMsClient) BeginRedeploy ¶
func (client *VirtualMachineScaleSetVMsClient) BeginRedeploy(ctx context.Context, resourceGroupName string, vmScaleSetName string, instanceID string, options *VirtualMachineScaleSetVMsClientBeginRedeployOptions) (*runtime.Poller[VirtualMachineScaleSetVMsClientRedeployResponse], error)
BeginRedeploy - Shuts down the virtual machine in the virtual machine scale set, moves it to a new node, and powers it back on. If the operation fails it returns an *azcore.ResponseError type.
Generated from API version 2024-03-01
- resourceGroupName - The name of the resource group.
- vmScaleSetName - The name of the VM scale set.
- instanceID - The instance ID of the virtual machine.
- options - VirtualMachineScaleSetVMsClientBeginRedeployOptions contains the optional parameters for the VirtualMachineScaleSetVMsClient.BeginRedeploy method.
Example (VirtualMachineScaleSetVmRedeployMaximumSetGen) ¶
Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/92de53a5f1e0e03c94b40475d2135d97148ed014/specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-03-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSetVM_Redeploy_MaximumSet_Gen.json
cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() clientFactory, err := armcompute.NewClientFactory("<subscription-id>", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } poller, err := clientFactory.NewVirtualMachineScaleSetVMsClient().BeginRedeploy(ctx, "rgcompute", "aaaaaaaaaaaaaaaaaaaaaaa", "aaaaaaaaaaaaaaaaaaaaaaaaaaaaa", nil) if err != nil { log.Fatalf("failed to finish the request: %v", err) } _, err = poller.PollUntilDone(ctx, nil) if err != nil { log.Fatalf("failed to pull the result: %v", err) }
Output:
Example (VirtualMachineScaleSetVmRedeployMinimumSetGen) ¶
Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/92de53a5f1e0e03c94b40475d2135d97148ed014/specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-03-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSetVM_Redeploy_MinimumSet_Gen.json
cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() clientFactory, err := armcompute.NewClientFactory("<subscription-id>", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } poller, err := clientFactory.NewVirtualMachineScaleSetVMsClient().BeginRedeploy(ctx, "rgcompute", "aaaaaaaaaaaaa", "aaaaaaaaaaaaaaaaaaaaaaaaaaaaa", nil) if err != nil { log.Fatalf("failed to finish the request: %v", err) } _, err = poller.PollUntilDone(ctx, nil) if err != nil { log.Fatalf("failed to pull the result: %v", err) }
Output:
func (*VirtualMachineScaleSetVMsClient) BeginReimage ¶
func (client *VirtualMachineScaleSetVMsClient) BeginReimage(ctx context.Context, resourceGroupName string, vmScaleSetName string, instanceID string, options *VirtualMachineScaleSetVMsClientBeginReimageOptions) (*runtime.Poller[VirtualMachineScaleSetVMsClientReimageResponse], error)
BeginReimage - Reimages (upgrade the operating system) a specific virtual machine in a VM scale set. If the operation fails it returns an *azcore.ResponseError type.
Generated from API version 2024-03-01
- resourceGroupName - The name of the resource group.
- vmScaleSetName - The name of the VM scale set.
- instanceID - The instance ID of the virtual machine.
- options - VirtualMachineScaleSetVMsClientBeginReimageOptions contains the optional parameters for the VirtualMachineScaleSetVMsClient.BeginReimage method.
Example (VirtualMachineScaleSetVmReimageMaximumSetGen) ¶
Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/92de53a5f1e0e03c94b40475d2135d97148ed014/specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-03-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSetVM_Reimage_MaximumSet_Gen.json
cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() clientFactory, err := armcompute.NewClientFactory("<subscription-id>", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } poller, err := clientFactory.NewVirtualMachineScaleSetVMsClient().BeginReimage(ctx, "rgcompute", "aaaaaaaaaaaaaaaa", "aaaaaaaaaaaaaaaaaaaaaaaaaaaaa", &armcompute.VirtualMachineScaleSetVMsClientBeginReimageOptions{VMScaleSetVMReimageInput: &armcompute.VirtualMachineScaleSetVMReimageParameters{ TempDisk: to.Ptr(true), ForceUpdateOSDiskForEphemeral: to.Ptr(true), }, }) if err != nil { log.Fatalf("failed to finish the request: %v", err) } _, err = poller.PollUntilDone(ctx, nil) if err != nil { log.Fatalf("failed to pull the result: %v", err) }
Output:
Example (VirtualMachineScaleSetVmReimageMinimumSetGen) ¶
Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/92de53a5f1e0e03c94b40475d2135d97148ed014/specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-03-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSetVM_Reimage_MinimumSet_Gen.json
cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() clientFactory, err := armcompute.NewClientFactory("<subscription-id>", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } poller, err := clientFactory.NewVirtualMachineScaleSetVMsClient().BeginReimage(ctx, "rgcompute", "aaaaaaa", "aaaaaaaaaaaaa", &armcompute.VirtualMachineScaleSetVMsClientBeginReimageOptions{VMScaleSetVMReimageInput: nil}) if err != nil { log.Fatalf("failed to finish the request: %v", err) } _, err = poller.PollUntilDone(ctx, nil) if err != nil { log.Fatalf("failed to pull the result: %v", err) }
Output:
func (*VirtualMachineScaleSetVMsClient) BeginReimageAll ¶
func (client *VirtualMachineScaleSetVMsClient) BeginReimageAll(ctx context.Context, resourceGroupName string, vmScaleSetName string, instanceID string, options *VirtualMachineScaleSetVMsClientBeginReimageAllOptions) (*runtime.Poller[VirtualMachineScaleSetVMsClientReimageAllResponse], error)
BeginReimageAll - Allows you to re-image all the disks ( including data disks ) in the a VM scale set instance. This operation is only supported for managed disks. If the operation fails it returns an *azcore.ResponseError type.
Generated from API version 2024-03-01
- resourceGroupName - The name of the resource group.
- vmScaleSetName - The name of the VM scale set.
- instanceID - The instance ID of the virtual machine.
- options - VirtualMachineScaleSetVMsClientBeginReimageAllOptions contains the optional parameters for the VirtualMachineScaleSetVMsClient.BeginReimageAll method.
Example (VirtualMachineScaleSetVmReimageAllMaximumSetGen) ¶
Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/92de53a5f1e0e03c94b40475d2135d97148ed014/specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-03-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSetVM_ReimageAll_MaximumSet_Gen.json
cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() clientFactory, err := armcompute.NewClientFactory("<subscription-id>", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } poller, err := clientFactory.NewVirtualMachineScaleSetVMsClient().BeginReimageAll(ctx, "rgcompute", "aaaaaaaaaaaaaaaaaaaaaaaa", "aaaaaaaaaaaaaaaaaaa", nil) if err != nil { log.Fatalf("failed to finish the request: %v", err) } _, err = poller.PollUntilDone(ctx, nil) if err != nil { log.Fatalf("failed to pull the result: %v", err) }
Output:
Example (VirtualMachineScaleSetVmReimageAllMinimumSetGen) ¶
Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/92de53a5f1e0e03c94b40475d2135d97148ed014/specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-03-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSetVM_ReimageAll_MinimumSet_Gen.json
cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() clientFactory, err := armcompute.NewClientFactory("<subscription-id>", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } poller, err := clientFactory.NewVirtualMachineScaleSetVMsClient().BeginReimageAll(ctx, "rgcompute", "aaaaaaaaaaaaaaaaaaaaaaaaa", "aaaaaaaaaaaaaaaaaaaaaaaaaaaa", nil) if err != nil { log.Fatalf("failed to finish the request: %v", err) } _, err = poller.PollUntilDone(ctx, nil) if err != nil { log.Fatalf("failed to pull the result: %v", err) }
Output:
func (*VirtualMachineScaleSetVMsClient) BeginRestart ¶
func (client *VirtualMachineScaleSetVMsClient) BeginRestart(ctx context.Context, resourceGroupName string, vmScaleSetName string, instanceID string, options *VirtualMachineScaleSetVMsClientBeginRestartOptions) (*runtime.Poller[VirtualMachineScaleSetVMsClientRestartResponse], error)
BeginRestart - Restarts a virtual machine in a VM scale set. If the operation fails it returns an *azcore.ResponseError type.
Generated from API version 2024-03-01
- resourceGroupName - The name of the resource group.
- vmScaleSetName - The name of the VM scale set.
- instanceID - The instance ID of the virtual machine.
- options - VirtualMachineScaleSetVMsClientBeginRestartOptions contains the optional parameters for the VirtualMachineScaleSetVMsClient.BeginRestart method.
Example (VirtualMachineScaleSetVmRestartMaximumSetGen) ¶
Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/92de53a5f1e0e03c94b40475d2135d97148ed014/specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-03-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSetVM_Restart_MaximumSet_Gen.json
cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() clientFactory, err := armcompute.NewClientFactory("<subscription-id>", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } poller, err := clientFactory.NewVirtualMachineScaleSetVMsClient().BeginRestart(ctx, "rgcompute", "aa", "aaaaaaaaaaaaaaaaa", nil) if err != nil { log.Fatalf("failed to finish the request: %v", err) } _, err = poller.PollUntilDone(ctx, nil) if err != nil { log.Fatalf("failed to pull the result: %v", err) }
Output:
Example (VirtualMachineScaleSetVmRestartMinimumSetGen) ¶
Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/92de53a5f1e0e03c94b40475d2135d97148ed014/specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-03-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSetVM_Restart_MinimumSet_Gen.json
cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() clientFactory, err := armcompute.NewClientFactory("<subscription-id>", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } poller, err := clientFactory.NewVirtualMachineScaleSetVMsClient().BeginRestart(ctx, "rgcompute", "aaaaaaaaaaaa", "aaaaaa", nil) if err != nil { log.Fatalf("failed to finish the request: %v", err) } _, err = poller.PollUntilDone(ctx, nil) if err != nil { log.Fatalf("failed to pull the result: %v", err) }
Output:
func (*VirtualMachineScaleSetVMsClient) BeginRunCommand ¶
func (client *VirtualMachineScaleSetVMsClient) BeginRunCommand(ctx context.Context, resourceGroupName string, vmScaleSetName string, instanceID string, parameters RunCommandInput, options *VirtualMachineScaleSetVMsClientBeginRunCommandOptions) (*runtime.Poller[VirtualMachineScaleSetVMsClientRunCommandResponse], error)
BeginRunCommand - Run command on a virtual machine in a VM scale set. If the operation fails it returns an *azcore.ResponseError type.
Generated from API version 2024-03-01
- resourceGroupName - The name of the resource group.
- vmScaleSetName - The name of the VM scale set.
- instanceID - The instance ID of the virtual machine.
- parameters - Parameters supplied to the Run command operation.
- options - VirtualMachineScaleSetVMsClientBeginRunCommandOptions contains the optional parameters for the VirtualMachineScaleSetVMsClient.BeginRunCommand method.
Example ¶
Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/92de53a5f1e0e03c94b40475d2135d97148ed014/specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-03-01/examples/runCommandExamples/VirtualMachineScaleSetVMRunCommand.json
cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() clientFactory, err := armcompute.NewClientFactory("<subscription-id>", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } poller, err := clientFactory.NewVirtualMachineScaleSetVMsClient().BeginRunCommand(ctx, "myResourceGroup", "myVirtualMachineScaleSet", "0", armcompute.RunCommandInput{ CommandID: to.Ptr("RunPowerShellScript"), Script: []*string{ to.Ptr("Write-Host Hello World!")}, }, nil) if err != nil { log.Fatalf("failed to finish the request: %v", err) } res, err := poller.PollUntilDone(ctx, nil) if err != nil { log.Fatalf("failed to pull the result: %v", err) } // You could use response here. We use blank identifier for just demo purposes. _ = res // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. // res.RunCommandResult = armcompute.RunCommandResult{ // Value: []*armcompute.InstanceViewStatus{ // { // Code: to.Ptr("ComponentStatus/StdOut/succeeded"), // DisplayStatus: to.Ptr("Provisioning succeeded"), // Level: to.Ptr(armcompute.StatusLevelTypesInfo), // Message: to.Ptr("Hello World!"), // }, // { // Code: to.Ptr("ComponentStatus/StdErr/succeeded"), // DisplayStatus: to.Ptr("Provisioning succeeded"), // Level: to.Ptr(armcompute.StatusLevelTypesInfo), // Message: to.Ptr(""), // }}, // }
Output:
func (*VirtualMachineScaleSetVMsClient) BeginStart ¶
func (client *VirtualMachineScaleSetVMsClient) BeginStart(ctx context.Context, resourceGroupName string, vmScaleSetName string, instanceID string, options *VirtualMachineScaleSetVMsClientBeginStartOptions) (*runtime.Poller[VirtualMachineScaleSetVMsClientStartResponse], error)
BeginStart - Starts a virtual machine in a VM scale set. If the operation fails it returns an *azcore.ResponseError type.
Generated from API version 2024-03-01
- resourceGroupName - The name of the resource group.
- vmScaleSetName - The name of the VM scale set.
- instanceID - The instance ID of the virtual machine.
- options - VirtualMachineScaleSetVMsClientBeginStartOptions contains the optional parameters for the VirtualMachineScaleSetVMsClient.BeginStart method.
Example (VirtualMachineScaleSetVmStartMaximumSetGen) ¶
Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/92de53a5f1e0e03c94b40475d2135d97148ed014/specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-03-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSetVM_Start_MaximumSet_Gen.json
cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() clientFactory, err := armcompute.NewClientFactory("<subscription-id>", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } poller, err := clientFactory.NewVirtualMachineScaleSetVMsClient().BeginStart(ctx, "rgcompute", "aaaaaaaaaaaaaa", "aaaaaaaaaaaaa", nil) if err != nil { log.Fatalf("failed to finish the request: %v", err) } _, err = poller.PollUntilDone(ctx, nil) if err != nil { log.Fatalf("failed to pull the result: %v", err) }
Output:
Example (VirtualMachineScaleSetVmStartMinimumSetGen) ¶
Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/92de53a5f1e0e03c94b40475d2135d97148ed014/specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-03-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSetVM_Start_MinimumSet_Gen.json
cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() clientFactory, err := armcompute.NewClientFactory("<subscription-id>", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } poller, err := clientFactory.NewVirtualMachineScaleSetVMsClient().BeginStart(ctx, "rgcompute", "aaaaaaaaaaaaaaaaaaaaaaaa", "aaaaaaaaaaaaaaaaa", nil) if err != nil { log.Fatalf("failed to finish the request: %v", err) } _, err = poller.PollUntilDone(ctx, nil) if err != nil { log.Fatalf("failed to pull the result: %v", err) }
Output:
func (*VirtualMachineScaleSetVMsClient) BeginUpdate ¶
func (client *VirtualMachineScaleSetVMsClient) BeginUpdate(ctx context.Context, resourceGroupName string, vmScaleSetName string, instanceID string, parameters VirtualMachineScaleSetVM, options *VirtualMachineScaleSetVMsClientBeginUpdateOptions) (*runtime.Poller[VirtualMachineScaleSetVMsClientUpdateResponse], error)
BeginUpdate - Updates a virtual machine of a VM scale set. If the operation fails it returns an *azcore.ResponseError type.
Generated from API version 2024-03-01
- resourceGroupName - The name of the resource group.
- vmScaleSetName - The name of the VM scale set where the extension should be create or updated.
- instanceID - The instance ID of the virtual machine.
- parameters - Parameters supplied to the Update Virtual Machine Scale Sets VM operation.
- options - VirtualMachineScaleSetVMsClientBeginUpdateOptions contains the optional parameters for the VirtualMachineScaleSetVMsClient.BeginUpdate method.
Example (VirtualMachineScaleSetVmUpdateMaximumSetGen) ¶
Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/92de53a5f1e0e03c94b40475d2135d97148ed014/specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-03-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSetVM_Update_MaximumSet_Gen.json
cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() clientFactory, err := armcompute.NewClientFactory("<subscription-id>", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } poller, err := clientFactory.NewVirtualMachineScaleSetVMsClient().BeginUpdate(ctx, "rgcompute", "aaaaaaaaaaaaaa", "aaaaaaaaaaaaaaaaaaaaaaaaaaaaa", armcompute.VirtualMachineScaleSetVM{ Location: to.Ptr("westus"), Tags: map[string]*string{}, Plan: &armcompute.Plan{ Name: to.Ptr("aaaaaaaaaa"), Product: to.Ptr("aaaaaaaaaaaaaaaaaaaa"), PromotionCode: to.Ptr("aaaaaaaaaaaaaaaaaaaa"), Publisher: to.Ptr("aaaaaaaaaaaaaaaaaaaaaa"), }, Properties: &armcompute.VirtualMachineScaleSetVMProperties{ AdditionalCapabilities: &armcompute.AdditionalCapabilities{ HibernationEnabled: to.Ptr(true), UltraSSDEnabled: to.Ptr(true), }, AvailabilitySet: &armcompute.SubResource{ ID: to.Ptr("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/availabilitySets/{availabilitySetName}"), }, DiagnosticsProfile: &armcompute.DiagnosticsProfile{ BootDiagnostics: &armcompute.BootDiagnostics{ Enabled: to.Ptr(true), StorageURI: to.Ptr("aaaaaaaaaaaaa"), }, }, HardwareProfile: &armcompute.HardwareProfile{ VMSize: to.Ptr(armcompute.VirtualMachineSizeTypesBasicA0), VMSizeProperties: &armcompute.VMSizeProperties{ VCPUsAvailable: to.Ptr[int32](9), VCPUsPerCore: to.Ptr[int32](12), }, }, InstanceView: &armcompute.VirtualMachineScaleSetVMInstanceView{ BootDiagnostics: &armcompute.BootDiagnosticsInstanceView{ Status: &armcompute.InstanceViewStatus{ Code: to.Ptr("aaaaaaaaaaaaaaaaaaaaaaa"), DisplayStatus: to.Ptr("aaaaaa"), Level: to.Ptr(armcompute.StatusLevelTypesInfo), Message: to.Ptr("a"), Time: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-11-30T12:58:26.522Z"); return t }()), }, }, Disks: []*armcompute.DiskInstanceView{ { Name: to.Ptr("aaaaaaaaaaa"), EncryptionSettings: []*armcompute.DiskEncryptionSettings{ { DiskEncryptionKey: &armcompute.KeyVaultSecretReference{ SecretURL: to.Ptr("aaaaaaaa"), SourceVault: &armcompute.SubResource{ ID: to.Ptr("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/availabilitySets/{availabilitySetName}"), }, }, Enabled: to.Ptr(true), KeyEncryptionKey: &armcompute.KeyVaultKeyReference{ KeyURL: to.Ptr("aaaaaaaaaaaaaa"), SourceVault: &armcompute.SubResource{ ID: to.Ptr("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/availabilitySets/{availabilitySetName}"), }, }, }}, Statuses: []*armcompute.InstanceViewStatus{ { Code: to.Ptr("aaaaaaaaaaaaaaaaaaaaaaa"), DisplayStatus: to.Ptr("aaaaaa"), Level: to.Ptr(armcompute.StatusLevelTypesInfo), Message: to.Ptr("a"), Time: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-11-30T12:58:26.522Z"); return t }()), }}, }}, MaintenanceRedeployStatus: &armcompute.MaintenanceRedeployStatus{ IsCustomerInitiatedMaintenanceAllowed: to.Ptr(true), LastOperationMessage: to.Ptr("aaaaaa"), LastOperationResultCode: to.Ptr(armcompute.MaintenanceOperationResultCodeTypesNone), MaintenanceWindowEndTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-11-30T12:58:26.531Z"); return t }()), MaintenanceWindowStartTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-11-30T12:58:26.531Z"); return t }()), PreMaintenanceWindowEndTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-11-30T12:58:26.531Z"); return t }()), PreMaintenanceWindowStartTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-11-30T12:58:26.531Z"); return t }()), }, PlacementGroupID: to.Ptr("aaa"), PlatformFaultDomain: to.Ptr[int32](14), PlatformUpdateDomain: to.Ptr[int32](23), RdpThumbPrint: to.Ptr("aaaaaaaaaaaaaaaaaaaaaaaaaaa"), Statuses: []*armcompute.InstanceViewStatus{ { Code: to.Ptr("aaaaaaaaaaaaaaaaaaaaaaa"), DisplayStatus: to.Ptr("aaaaaa"), Level: to.Ptr(armcompute.StatusLevelTypesInfo), Message: to.Ptr("a"), Time: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-11-30T12:58:26.522Z"); return t }()), }}, VMAgent: &armcompute.VirtualMachineAgentInstanceView{ ExtensionHandlers: []*armcompute.VirtualMachineExtensionHandlerInstanceView{ { Type: to.Ptr("aaaaaaaaaaaaa"), Status: &armcompute.InstanceViewStatus{ Code: to.Ptr("aaaaaaaaaaaaaaaaaaaaaaa"), DisplayStatus: to.Ptr("aaaaaa"), Level: to.Ptr(armcompute.StatusLevelTypesInfo), Message: to.Ptr("a"), Time: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-11-30T12:58:26.522Z"); return t }()), }, TypeHandlerVersion: to.Ptr("aaaaa"), }}, Statuses: []*armcompute.InstanceViewStatus{ { Code: to.Ptr("aaaaaaaaaaaaaaaaaaaaaaa"), DisplayStatus: to.Ptr("aaaaaa"), Level: to.Ptr(armcompute.StatusLevelTypesInfo), Message: to.Ptr("a"), Time: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-11-30T12:58:26.522Z"); return t }()), }}, VMAgentVersion: to.Ptr("aaaaaaaaaaaaaaaaaaaaaaa"), }, VMHealth: &armcompute.VirtualMachineHealthStatus{ Status: &armcompute.InstanceViewStatus{ Code: to.Ptr("aaaaaaaaaaaaaaaaaaaaaaa"), DisplayStatus: to.Ptr("aaaaaa"), Level: to.Ptr(armcompute.StatusLevelTypesInfo), Message: to.Ptr("a"), Time: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-11-30T12:58:26.522Z"); return t }()), }, }, Extensions: []*armcompute.VirtualMachineExtensionInstanceView{ { Name: to.Ptr("aaaaaaaaaaaaaaaaa"), Type: to.Ptr("aaaaaaaaa"), Statuses: []*armcompute.InstanceViewStatus{ { Code: to.Ptr("aaaaaaaaaaaaaaaaaaaaaaa"), DisplayStatus: to.Ptr("aaaaaa"), Level: to.Ptr(armcompute.StatusLevelTypesInfo), Message: to.Ptr("a"), Time: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-11-30T12:58:26.522Z"); return t }()), }}, Substatuses: []*armcompute.InstanceViewStatus{ { Code: to.Ptr("aaaaaaaaaaaaaaaaaaaaaaa"), DisplayStatus: to.Ptr("aaaaaa"), Level: to.Ptr(armcompute.StatusLevelTypesInfo), Message: to.Ptr("a"), Time: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-11-30T12:58:26.522Z"); return t }()), }}, TypeHandlerVersion: to.Ptr("aaaaaaaaaaaaaaaaaaaaaaaaaa"), }}, }, LicenseType: to.Ptr("aaaaaaaaaa"), NetworkProfile: &armcompute.NetworkProfile{ NetworkAPIVersion: to.Ptr(armcompute.NetworkAPIVersionTwoThousandTwenty1101), NetworkInterfaceConfigurations: []*armcompute.VirtualMachineNetworkInterfaceConfiguration{ { Name: to.Ptr("aaaaaaaaaaa"), Properties: &armcompute.VirtualMachineNetworkInterfaceConfigurationProperties{ DeleteOption: to.Ptr(armcompute.DeleteOptionsDelete), DNSSettings: &armcompute.VirtualMachineNetworkInterfaceDNSSettingsConfiguration{ DNSServers: []*string{ to.Ptr("aaaaaa")}, }, DscpConfiguration: &armcompute.SubResource{ ID: to.Ptr("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/availabilitySets/{availabilitySetName}"), }, EnableAcceleratedNetworking: to.Ptr(true), EnableFpga: to.Ptr(true), EnableIPForwarding: to.Ptr(true), IPConfigurations: []*armcompute.VirtualMachineNetworkInterfaceIPConfiguration{ { Name: to.Ptr("aa"), Properties: &armcompute.VirtualMachineNetworkInterfaceIPConfigurationProperties{ ApplicationGatewayBackendAddressPools: []*armcompute.SubResource{ { ID: to.Ptr("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/availabilitySets/{availabilitySetName}"), }}, ApplicationSecurityGroups: []*armcompute.SubResource{ { ID: to.Ptr("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/availabilitySets/{availabilitySetName}"), }}, LoadBalancerBackendAddressPools: []*armcompute.SubResource{ { ID: to.Ptr("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/availabilitySets/{availabilitySetName}"), }}, Primary: to.Ptr(true), PrivateIPAddressVersion: to.Ptr(armcompute.IPVersionsIPv4), PublicIPAddressConfiguration: &armcompute.VirtualMachinePublicIPAddressConfiguration{ Name: to.Ptr("aaaaaaaaaaaaaaaaaaaaaaaaaaaaa"), Properties: &armcompute.VirtualMachinePublicIPAddressConfigurationProperties{ DeleteOption: to.Ptr(armcompute.DeleteOptionsDelete), DNSSettings: &armcompute.VirtualMachinePublicIPAddressDNSSettingsConfiguration{ DomainNameLabel: to.Ptr("aaaaaaaaaaaaaaaaaaaaaaaaa"), }, IdleTimeoutInMinutes: to.Ptr[int32](2), IPTags: []*armcompute.VirtualMachineIPTag{ { IPTagType: to.Ptr("aaaaaaaaaaaaaaaaaaaaaaaaa"), Tag: to.Ptr("aaaaaaaaaaaaaaaaaaaa"), }}, PublicIPAddressVersion: to.Ptr(armcompute.IPVersionsIPv4), PublicIPAllocationMethod: to.Ptr(armcompute.PublicIPAllocationMethodDynamic), PublicIPPrefix: &armcompute.SubResource{ ID: to.Ptr("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/availabilitySets/{availabilitySetName}"), }, }, SKU: &armcompute.PublicIPAddressSKU{ Name: to.Ptr(armcompute.PublicIPAddressSKUNameBasic), Tier: to.Ptr(armcompute.PublicIPAddressSKUTierRegional), }, }, Subnet: &armcompute.SubResource{ ID: to.Ptr("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/availabilitySets/{availabilitySetName}"), }, }, }}, NetworkSecurityGroup: &armcompute.SubResource{ ID: to.Ptr("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/availabilitySets/{availabilitySetName}"), }, Primary: to.Ptr(true), }, }}, NetworkInterfaces: []*armcompute.NetworkInterfaceReference{ { ID: to.Ptr("/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/virtualMachineScaleSets/{vmss-name}/virtualMachines/0/networkInterfaces/vmsstestnetconfig5415"), Properties: &armcompute.NetworkInterfaceReferenceProperties{ DeleteOption: to.Ptr(armcompute.DeleteOptionsDelete), Primary: to.Ptr(true), }, }}, }, NetworkProfileConfiguration: &armcompute.VirtualMachineScaleSetVMNetworkProfileConfiguration{ NetworkInterfaceConfigurations: []*armcompute.VirtualMachineScaleSetNetworkConfiguration{ { Name: to.Ptr("vmsstestnetconfig5415"), Properties: &armcompute.VirtualMachineScaleSetNetworkConfigurationProperties{ DeleteOption: to.Ptr(armcompute.DeleteOptionsDelete), DNSSettings: &armcompute.VirtualMachineScaleSetNetworkConfigurationDNSSettings{ DNSServers: []*string{}, }, EnableAcceleratedNetworking: to.Ptr(true), EnableFpga: to.Ptr(true), EnableIPForwarding: to.Ptr(true), IPConfigurations: []*armcompute.VirtualMachineScaleSetIPConfiguration{ { Name: to.Ptr("vmsstestnetconfig9693"), Properties: &armcompute.VirtualMachineScaleSetIPConfigurationProperties{ ApplicationGatewayBackendAddressPools: []*armcompute.SubResource{ { ID: to.Ptr("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/availabilitySets/{availabilitySetName}"), }}, ApplicationSecurityGroups: []*armcompute.SubResource{ { ID: to.Ptr("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/availabilitySets/{availabilitySetName}"), }}, LoadBalancerBackendAddressPools: []*armcompute.SubResource{ { ID: to.Ptr("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/availabilitySets/{availabilitySetName}"), }}, LoadBalancerInboundNatPools: []*armcompute.SubResource{ { ID: to.Ptr("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/availabilitySets/{availabilitySetName}"), }}, Primary: to.Ptr(true), PrivateIPAddressVersion: to.Ptr(armcompute.IPVersionIPv4), PublicIPAddressConfiguration: &armcompute.VirtualMachineScaleSetPublicIPAddressConfiguration{ Name: to.Ptr("aaaaaaaaaaaaaaaaaa"), Properties: &armcompute.VirtualMachineScaleSetPublicIPAddressConfigurationProperties{ DeleteOption: to.Ptr(armcompute.DeleteOptionsDelete), DNSSettings: &armcompute.VirtualMachineScaleSetPublicIPAddressConfigurationDNSSettings{ DomainNameLabel: to.Ptr("aaaaaaaaaaaaaaaaaa"), }, IdleTimeoutInMinutes: to.Ptr[int32](18), IPTags: []*armcompute.VirtualMachineScaleSetIPTag{ { IPTagType: to.Ptr("aaaaaaa"), Tag: to.Ptr("aaaaaaaaaaaaaaaaaaaaaaaaaaa"), }}, PublicIPAddressVersion: to.Ptr(armcompute.IPVersionIPv4), PublicIPPrefix: &armcompute.SubResource{ ID: to.Ptr("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/availabilitySets/{availabilitySetName}"), }, }, SKU: &armcompute.PublicIPAddressSKU{ Name: to.Ptr(armcompute.PublicIPAddressSKUNameBasic), Tier: to.Ptr(armcompute.PublicIPAddressSKUTierRegional), }, }, Subnet: &armcompute.APIEntityReference{ ID: to.Ptr("/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/virtualNetworks/vn4071/subnets/sn5503"), }, }, }}, NetworkSecurityGroup: &armcompute.SubResource{ ID: to.Ptr("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/availabilitySets/{availabilitySetName}"), }, Primary: to.Ptr(true), }, }}, }, OSProfile: &armcompute.OSProfile{ AdminPassword: to.Ptr("aaaaaaaaaaaaaaaa"), AdminUsername: to.Ptr("Foo12"), AllowExtensionOperations: to.Ptr(true), ComputerName: to.Ptr("test000000"), CustomData: to.Ptr("aaaa"), LinuxConfiguration: &armcompute.LinuxConfiguration{ DisablePasswordAuthentication: to.Ptr(true), PatchSettings: &armcompute.LinuxPatchSettings{ AssessmentMode: to.Ptr(armcompute.LinuxPatchAssessmentModeImageDefault), PatchMode: to.Ptr(armcompute.LinuxVMGuestPatchModeImageDefault), }, ProvisionVMAgent: to.Ptr(true), SSH: &armcompute.SSHConfiguration{ PublicKeys: []*armcompute.SSHPublicKey{ { Path: to.Ptr("aaa"), KeyData: to.Ptr("aaaaaa"), }}, }, }, RequireGuestProvisionSignal: to.Ptr(true), Secrets: []*armcompute.VaultSecretGroup{}, WindowsConfiguration: &armcompute.WindowsConfiguration{ AdditionalUnattendContent: []*armcompute.AdditionalUnattendContent{ { ComponentName: to.Ptr("Microsoft-Windows-Shell-Setup"), Content: to.Ptr("aaaaaaaaaaaaaaaaaaaa"), PassName: to.Ptr("OobeSystem"), SettingName: to.Ptr(armcompute.SettingNamesAutoLogon), }}, EnableAutomaticUpdates: to.Ptr(true), PatchSettings: &armcompute.PatchSettings{ AssessmentMode: to.Ptr(armcompute.WindowsPatchAssessmentModeImageDefault), EnableHotpatching: to.Ptr(true), PatchMode: to.Ptr(armcompute.WindowsVMGuestPatchModeManual), }, ProvisionVMAgent: to.Ptr(true), TimeZone: to.Ptr("aaaaaaaaaaaaaaaaaaaaaaaaaaa"), WinRM: &armcompute.WinRMConfiguration{ Listeners: []*armcompute.WinRMListener{ { CertificateURL: to.Ptr("aaaaaaaaaaaaaaaaaaaaaa"), Protocol: to.Ptr(armcompute.ProtocolTypesHTTP), }}, }, }, }, ProtectionPolicy: &armcompute.VirtualMachineScaleSetVMProtectionPolicy{ ProtectFromScaleIn: to.Ptr(true), ProtectFromScaleSetActions: to.Ptr(true), }, SecurityProfile: &armcompute.SecurityProfile{ EncryptionAtHost: to.Ptr(true), SecurityType: to.Ptr(armcompute.SecurityTypesTrustedLaunch), UefiSettings: &armcompute.UefiSettings{ SecureBootEnabled: to.Ptr(true), VTpmEnabled: to.Ptr(true), }, }, StorageProfile: &armcompute.StorageProfile{ DataDisks: []*armcompute.DataDisk{ { Name: to.Ptr("vmss3176_vmss3176_0_disk2_6c4f554bdafa49baa780eb2d128ff39d"), Caching: to.Ptr(armcompute.CachingTypesNone), CreateOption: to.Ptr(armcompute.DiskCreateOptionTypesEmpty), DeleteOption: to.Ptr(armcompute.DiskDeleteOptionTypesDelete), DetachOption: to.Ptr(armcompute.DiskDetachOptionTypesForceDetach), DiskSizeGB: to.Ptr[int32](128), Image: &armcompute.VirtualHardDisk{ URI: to.Ptr("https://{storageAccountName}.blob.core.windows.net/{containerName}/{vhdName}.vhd"), }, Lun: to.Ptr[int32](1), ManagedDisk: &armcompute.ManagedDiskParameters{ ID: to.Ptr("/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/disks/vmss3176_vmss3176_0_disk2_6c4f554bdafa49baa780eb2d128ff39d"), DiskEncryptionSet: &armcompute.DiskEncryptionSetParameters{ ID: to.Ptr("aaaaaaaaaaaa"), }, StorageAccountType: to.Ptr(armcompute.StorageAccountTypesStandardLRS), }, ToBeDetached: to.Ptr(true), Vhd: &armcompute.VirtualHardDisk{ URI: to.Ptr("https://{storageAccountName}.blob.core.windows.net/{containerName}/{vhdName}.vhd"), }, WriteAcceleratorEnabled: to.Ptr(true), }}, ImageReference: &armcompute.ImageReference{ ID: to.Ptr("a"), Offer: to.Ptr("WindowsServer"), Publisher: to.Ptr("MicrosoftWindowsServer"), SharedGalleryImageID: to.Ptr("aaaaaaaaaaaaaaaaaaaa"), SKU: to.Ptr("2012-R2-Datacenter"), Version: to.Ptr("4.127.20180315"), }, OSDisk: &armcompute.OSDisk{ Name: to.Ptr("vmss3176_vmss3176_0_OsDisk_1_6d72b805e50e4de6830303c5055077fc"), Caching: to.Ptr(armcompute.CachingTypesNone), CreateOption: to.Ptr(armcompute.DiskCreateOptionTypesFromImage), DeleteOption: to.Ptr(armcompute.DiskDeleteOptionTypesDelete), DiffDiskSettings: &armcompute.DiffDiskSettings{ Option: to.Ptr(armcompute.DiffDiskOptionsLocal), Placement: to.Ptr(armcompute.DiffDiskPlacementCacheDisk), }, DiskSizeGB: to.Ptr[int32](127), EncryptionSettings: &armcompute.DiskEncryptionSettings{ DiskEncryptionKey: &armcompute.KeyVaultSecretReference{ SecretURL: to.Ptr("aaaaaaaa"), SourceVault: &armcompute.SubResource{ ID: to.Ptr("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/availabilitySets/{availabilitySetName}"), }, }, Enabled: to.Ptr(true), KeyEncryptionKey: &armcompute.KeyVaultKeyReference{ KeyURL: to.Ptr("aaaaaaaaaaaaaa"), SourceVault: &armcompute.SubResource{ ID: to.Ptr("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/availabilitySets/{availabilitySetName}"), }, }, }, Image: &armcompute.VirtualHardDisk{ URI: to.Ptr("https://{storageAccountName}.blob.core.windows.net/{containerName}/{vhdName}.vhd"), }, ManagedDisk: &armcompute.ManagedDiskParameters{ ID: to.Ptr("/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/disks/vmss3176_vmss3176_0_OsDisk_1_6d72b805e50e4de6830303c5055077fc"), DiskEncryptionSet: &armcompute.DiskEncryptionSetParameters{ ID: to.Ptr("aaaaaaaaaaaa"), }, StorageAccountType: to.Ptr(armcompute.StorageAccountTypesStandardLRS), }, OSType: to.Ptr(armcompute.OperatingSystemTypesWindows), Vhd: &armcompute.VirtualHardDisk{ URI: to.Ptr("https://{storageAccountName}.blob.core.windows.net/{containerName}/{vhdName}.vhd"), }, WriteAcceleratorEnabled: to.Ptr(true), }, }, UserData: to.Ptr("RXhhbXBsZSBVc2VyRGF0YQ=="), }, SKU: &armcompute.SKU{ Name: to.Ptr("Classic"), Capacity: to.Ptr[int64](29), Tier: to.Ptr("aaaaaaaaaaaaaa"), }, }, &armcompute.VirtualMachineScaleSetVMsClientBeginUpdateOptions{IfMatch: nil, IfNoneMatch: nil, }) if err != nil { log.Fatalf("failed to finish the request: %v", err) } res, err := poller.PollUntilDone(ctx, nil) if err != nil { log.Fatalf("failed to pull the result: %v", err) } // You could use response here. We use blank identifier for just demo purposes. _ = res // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. // res.VirtualMachineScaleSetVM = armcompute.VirtualMachineScaleSetVM{ // Name: to.Ptr("{vmss-vm-name}"), // Type: to.Ptr("Microsoft.Compute/virtualMachines"), // ID: to.Ptr("/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/virtualMachineScaleSets/{vmss-name}/virtualMachines/0"), // Location: to.Ptr("westus"), // Tags: map[string]*string{ // }, // InstanceID: to.Ptr("aaaaaaaaaaaa"), // Plan: &armcompute.Plan{ // Name: to.Ptr("aaaaaaaaaa"), // Product: to.Ptr("aaaaaaaaaaaaaaaaaaaa"), // PromotionCode: to.Ptr("aaaaaaaaaaaaaaaaaaaa"), // Publisher: to.Ptr("aaaaaaaaaaaaaaaaaaaaaa"), // }, // Properties: &armcompute.VirtualMachineScaleSetVMProperties{ // AdditionalCapabilities: &armcompute.AdditionalCapabilities{ // HibernationEnabled: to.Ptr(true), // UltraSSDEnabled: to.Ptr(true), // }, // AvailabilitySet: &armcompute.SubResource{ // ID: to.Ptr("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/availabilitySets/{availabilitySetName}"), // }, // DiagnosticsProfile: &armcompute.DiagnosticsProfile{ // BootDiagnostics: &armcompute.BootDiagnostics{ // Enabled: to.Ptr(true), // StorageURI: to.Ptr("aaaaaaaaaaaaa"), // }, // }, // HardwareProfile: &armcompute.HardwareProfile{ // VMSize: to.Ptr(armcompute.VirtualMachineSizeTypesBasicA0), // VMSizeProperties: &armcompute.VMSizeProperties{ // VCPUsAvailable: to.Ptr[int32](9), // VCPUsPerCore: to.Ptr[int32](12), // }, // }, // InstanceView: &armcompute.VirtualMachineScaleSetVMInstanceView{ // AssignedHost: to.Ptr("aaaaaaa"), // BootDiagnostics: &armcompute.BootDiagnosticsInstanceView{ // ConsoleScreenshotBlobURI: to.Ptr("aaaaaaaaaaaaaaaaaaaaaaaaa"), // SerialConsoleLogBlobURI: to.Ptr("aaaaaaaa"), // Status: &armcompute.InstanceViewStatus{ // Code: to.Ptr("aaaaaaaaaaaaaaaaaaaaaaa"), // DisplayStatus: to.Ptr("aaaaaa"), // Level: to.Ptr(armcompute.StatusLevelTypesInfo), // Message: to.Ptr("a"), // Time: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-11-30T12:58:26.522Z"); return t}()), // }, // }, // Disks: []*armcompute.DiskInstanceView{ // { // Name: to.Ptr("aaaaaaaaaaa"), // EncryptionSettings: []*armcompute.DiskEncryptionSettings{ // { // DiskEncryptionKey: &armcompute.KeyVaultSecretReference{ // SecretURL: to.Ptr("aaaaaaaa"), // SourceVault: &armcompute.SubResource{ // ID: to.Ptr("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/availabilitySets/{availabilitySetName}"), // }, // }, // Enabled: to.Ptr(true), // KeyEncryptionKey: &armcompute.KeyVaultKeyReference{ // KeyURL: to.Ptr("aaaaaaaaaaaaaa"), // SourceVault: &armcompute.SubResource{ // ID: to.Ptr("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/availabilitySets/{availabilitySetName}"), // }, // }, // }}, // Statuses: []*armcompute.InstanceViewStatus{ // { // Code: to.Ptr("aaaaaaaaaaaaaaaaaaaaaaa"), // DisplayStatus: to.Ptr("aaaaaa"), // Level: to.Ptr(armcompute.StatusLevelTypesInfo), // Message: to.Ptr("a"), // Time: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-11-30T12:58:26.522Z"); return t}()), // }}, // }}, // MaintenanceRedeployStatus: &armcompute.MaintenanceRedeployStatus{ // IsCustomerInitiatedMaintenanceAllowed: to.Ptr(true), // LastOperationMessage: to.Ptr("aaaaaa"), // LastOperationResultCode: to.Ptr(armcompute.MaintenanceOperationResultCodeTypesNone), // MaintenanceWindowEndTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-11-30T12:58:26.531Z"); return t}()), // MaintenanceWindowStartTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-11-30T12:58:26.531Z"); return t}()), // PreMaintenanceWindowEndTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-11-30T12:58:26.531Z"); return t}()), // PreMaintenanceWindowStartTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-11-30T12:58:26.531Z"); return t}()), // }, // PlacementGroupID: to.Ptr("aaa"), // PlatformFaultDomain: to.Ptr[int32](14), // PlatformUpdateDomain: to.Ptr[int32](23), // RdpThumbPrint: to.Ptr("aaaaaaaaaaaaaaaaaaaaaaaaaaa"), // Statuses: []*armcompute.InstanceViewStatus{ // { // Code: to.Ptr("aaaaaaaaaaaaaaaaaaaaaaa"), // DisplayStatus: to.Ptr("aaaaaa"), // Level: to.Ptr(armcompute.StatusLevelTypesInfo), // Message: to.Ptr("a"), // Time: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-11-30T12:58:26.522Z"); return t}()), // }}, // VMAgent: &armcompute.VirtualMachineAgentInstanceView{ // ExtensionHandlers: []*armcompute.VirtualMachineExtensionHandlerInstanceView{ // { // Type: to.Ptr("aaaaaaaaaaaaa"), // Status: &armcompute.InstanceViewStatus{ // Code: to.Ptr("aaaaaaaaaaaaaaaaaaaaaaa"), // DisplayStatus: to.Ptr("aaaaaa"), // Level: to.Ptr(armcompute.StatusLevelTypesInfo), // Message: to.Ptr("a"), // Time: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-11-30T12:58:26.522Z"); return t}()), // }, // TypeHandlerVersion: to.Ptr("aaaaa"), // }}, // Statuses: []*armcompute.InstanceViewStatus{ // { // Code: to.Ptr("aaaaaaaaaaaaaaaaaaaaaaa"), // DisplayStatus: to.Ptr("aaaaaa"), // Level: to.Ptr(armcompute.StatusLevelTypesInfo), // Message: to.Ptr("a"), // Time: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-11-30T12:58:26.522Z"); return t}()), // }}, // VMAgentVersion: to.Ptr("aaaaaaaaaaaaaaaaaaaaaaa"), // }, // VMHealth: &armcompute.VirtualMachineHealthStatus{ // Status: &armcompute.InstanceViewStatus{ // Code: to.Ptr("aaaaaaaaaaaaaaaaaaaaaaa"), // DisplayStatus: to.Ptr("aaaaaa"), // Level: to.Ptr(armcompute.StatusLevelTypesInfo), // Message: to.Ptr("a"), // Time: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-11-30T12:58:26.522Z"); return t}()), // }, // }, // Extensions: []*armcompute.VirtualMachineExtensionInstanceView{ // { // Name: to.Ptr("aaaaaaaaaaaaaaaaa"), // Type: to.Ptr("aaaaaaaaa"), // Statuses: []*armcompute.InstanceViewStatus{ // { // Code: to.Ptr("aaaaaaaaaaaaaaaaaaaaaaa"), // DisplayStatus: to.Ptr("aaaaaa"), // Level: to.Ptr(armcompute.StatusLevelTypesInfo), // Message: to.Ptr("a"), // Time: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-11-30T12:58:26.522Z"); return t}()), // }}, // Substatuses: []*armcompute.InstanceViewStatus{ // { // Code: to.Ptr("aaaaaaaaaaaaaaaaaaaaaaa"), // DisplayStatus: to.Ptr("aaaaaa"), // Level: to.Ptr(armcompute.StatusLevelTypesInfo), // Message: to.Ptr("a"), // Time: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-11-30T12:58:26.522Z"); return t}()), // }}, // TypeHandlerVersion: to.Ptr("aaaaaaaaaaaaaaaaaaaaaaaaaa"), // }}, // }, // LatestModelApplied: to.Ptr(true), // LicenseType: to.Ptr("aaaaaaaaaa"), // ModelDefinitionApplied: to.Ptr("VirtualMachineScaleSet"), // NetworkProfile: &armcompute.NetworkProfile{ // NetworkAPIVersion: to.Ptr(armcompute.NetworkAPIVersionTwoThousandTwenty1101), // NetworkInterfaceConfigurations: []*armcompute.VirtualMachineNetworkInterfaceConfiguration{ // { // Name: to.Ptr("aaaaaaaaaaa"), // Properties: &armcompute.VirtualMachineNetworkInterfaceConfigurationProperties{ // DeleteOption: to.Ptr(armcompute.DeleteOptionsDelete), // DNSSettings: &armcompute.VirtualMachineNetworkInterfaceDNSSettingsConfiguration{ // DNSServers: []*string{ // to.Ptr("aaaaaa")}, // }, // DscpConfiguration: &armcompute.SubResource{ // ID: to.Ptr("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/availabilitySets/{availabilitySetName}"), // }, // EnableAcceleratedNetworking: to.Ptr(true), // EnableFpga: to.Ptr(true), // EnableIPForwarding: to.Ptr(true), // IPConfigurations: []*armcompute.VirtualMachineNetworkInterfaceIPConfiguration{ // { // Name: to.Ptr("aa"), // Properties: &armcompute.VirtualMachineNetworkInterfaceIPConfigurationProperties{ // ApplicationGatewayBackendAddressPools: []*armcompute.SubResource{ // { // ID: to.Ptr("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/availabilitySets/{availabilitySetName}"), // }}, // ApplicationSecurityGroups: []*armcompute.SubResource{ // { // ID: to.Ptr("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/availabilitySets/{availabilitySetName}"), // }}, // LoadBalancerBackendAddressPools: []*armcompute.SubResource{ // { // ID: to.Ptr("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/availabilitySets/{availabilitySetName}"), // }}, // Primary: to.Ptr(true), // PrivateIPAddressVersion: to.Ptr(armcompute.IPVersionsIPv4), // PublicIPAddressConfiguration: &armcompute.VirtualMachinePublicIPAddressConfiguration{ // Name: to.Ptr("aaaaaaaaaaaaaaaaaaaaaaaaaaaaa"), // Properties: &armcompute.VirtualMachinePublicIPAddressConfigurationProperties{ // DeleteOption: to.Ptr(armcompute.DeleteOptionsDelete), // DNSSettings: &armcompute.VirtualMachinePublicIPAddressDNSSettingsConfiguration{ // DomainNameLabel: to.Ptr("aaaaaaaaaaaaaaaaaaaaaaaaa"), // }, // IdleTimeoutInMinutes: to.Ptr[int32](2), // IPTags: []*armcompute.VirtualMachineIPTag{ // { // IPTagType: to.Ptr("aaaaaaaaaaaaaaaaaaaaaaaaa"), // Tag: to.Ptr("aaaaaaaaaaaaaaaaaaaa"), // }}, // PublicIPAddressVersion: to.Ptr(armcompute.IPVersionsIPv4), // PublicIPAllocationMethod: to.Ptr(armcompute.PublicIPAllocationMethodDynamic), // PublicIPPrefix: &armcompute.SubResource{ // ID: to.Ptr("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/availabilitySets/{availabilitySetName}"), // }, // }, // SKU: &armcompute.PublicIPAddressSKU{ // Name: to.Ptr(armcompute.PublicIPAddressSKUNameBasic), // Tier: to.Ptr(armcompute.PublicIPAddressSKUTierRegional), // }, // }, // Subnet: &armcompute.SubResource{ // ID: to.Ptr("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/availabilitySets/{availabilitySetName}"), // }, // }, // }}, // NetworkSecurityGroup: &armcompute.SubResource{ // ID: to.Ptr("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/availabilitySets/{availabilitySetName}"), // }, // Primary: to.Ptr(true), // }, // }}, // NetworkInterfaces: []*armcompute.NetworkInterfaceReference{ // { // ID: to.Ptr("/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/virtualMachineScaleSets/{vmss-name}/virtualMachines/0/networkInterfaces/vmsstestnetconfig5415"), // Properties: &armcompute.NetworkInterfaceReferenceProperties{ // DeleteOption: to.Ptr(armcompute.DeleteOptionsDelete), // Primary: to.Ptr(true), // }, // }}, // }, // NetworkProfileConfiguration: &armcompute.VirtualMachineScaleSetVMNetworkProfileConfiguration{ // NetworkInterfaceConfigurations: []*armcompute.VirtualMachineScaleSetNetworkConfiguration{ // { // Name: to.Ptr("vmsstestnetconfig5415"), // Properties: &armcompute.VirtualMachineScaleSetNetworkConfigurationProperties{ // DeleteOption: to.Ptr(armcompute.DeleteOptionsDelete), // DNSSettings: &armcompute.VirtualMachineScaleSetNetworkConfigurationDNSSettings{ // DNSServers: []*string{ // }, // }, // EnableAcceleratedNetworking: to.Ptr(true), // EnableFpga: to.Ptr(true), // EnableIPForwarding: to.Ptr(true), // IPConfigurations: []*armcompute.VirtualMachineScaleSetIPConfiguration{ // { // Name: to.Ptr("vmsstestnetconfig9693"), // Properties: &armcompute.VirtualMachineScaleSetIPConfigurationProperties{ // ApplicationGatewayBackendAddressPools: []*armcompute.SubResource{ // { // ID: to.Ptr("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/availabilitySets/{availabilitySetName}"), // }}, // ApplicationSecurityGroups: []*armcompute.SubResource{ // { // ID: to.Ptr("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/availabilitySets/{availabilitySetName}"), // }}, // LoadBalancerBackendAddressPools: []*armcompute.SubResource{ // { // ID: to.Ptr("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/availabilitySets/{availabilitySetName}"), // }}, // LoadBalancerInboundNatPools: []*armcompute.SubResource{ // { // ID: to.Ptr("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/availabilitySets/{availabilitySetName}"), // }}, // Primary: to.Ptr(true), // PrivateIPAddressVersion: to.Ptr(armcompute.IPVersionIPv4), // PublicIPAddressConfiguration: &armcompute.VirtualMachineScaleSetPublicIPAddressConfiguration{ // Name: to.Ptr("aaaaaaaaaaaaaaaaaa"), // Properties: &armcompute.VirtualMachineScaleSetPublicIPAddressConfigurationProperties{ // DeleteOption: to.Ptr(armcompute.DeleteOptionsDelete), // DNSSettings: &armcompute.VirtualMachineScaleSetPublicIPAddressConfigurationDNSSettings{ // DomainNameLabel: to.Ptr("aaaaaaaaaaaaaaaaaa"), // }, // IdleTimeoutInMinutes: to.Ptr[int32](18), // IPTags: []*armcompute.VirtualMachineScaleSetIPTag{ // { // IPTagType: to.Ptr("aaaaaaa"), // Tag: to.Ptr("aaaaaaaaaaaaaaaaaaaaaaaaaaa"), // }}, // PublicIPAddressVersion: to.Ptr(armcompute.IPVersionIPv4), // PublicIPPrefix: &armcompute.SubResource{ // ID: to.Ptr("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/availabilitySets/{availabilitySetName}"), // }, // }, // SKU: &armcompute.PublicIPAddressSKU{ // Name: to.Ptr(armcompute.PublicIPAddressSKUNameBasic), // Tier: to.Ptr(armcompute.PublicIPAddressSKUTierRegional), // }, // }, // Subnet: &armcompute.APIEntityReference{ // ID: to.Ptr("/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/virtualNetworks/vn4071/subnets/sn5503"), // }, // }, // }}, // NetworkSecurityGroup: &armcompute.SubResource{ // ID: to.Ptr("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/availabilitySets/{availabilitySetName}"), // }, // Primary: to.Ptr(true), // }, // }}, // }, // OSProfile: &armcompute.OSProfile{ // AdminUsername: to.Ptr("Foo12"), // AllowExtensionOperations: to.Ptr(true), // ComputerName: to.Ptr("test000000"), // CustomData: to.Ptr("aaaa"), // LinuxConfiguration: &armcompute.LinuxConfiguration{ // DisablePasswordAuthentication: to.Ptr(true), // PatchSettings: &armcompute.LinuxPatchSettings{ // AssessmentMode: to.Ptr(armcompute.LinuxPatchAssessmentModeImageDefault), // PatchMode: to.Ptr(armcompute.LinuxVMGuestPatchModeImageDefault), // }, // ProvisionVMAgent: to.Ptr(true), // SSH: &armcompute.SSHConfiguration{ // PublicKeys: []*armcompute.SSHPublicKey{ // { // Path: to.Ptr("aaa"), // KeyData: to.Ptr("aaaaaa"), // }}, // }, // }, // RequireGuestProvisionSignal: to.Ptr(true), // Secrets: []*armcompute.VaultSecretGroup{ // }, // WindowsConfiguration: &armcompute.WindowsConfiguration{ // AdditionalUnattendContent: []*armcompute.AdditionalUnattendContent{ // { // ComponentName: to.Ptr("Microsoft-Windows-Shell-Setup"), // Content: to.Ptr("aaaaaaaaaaaaaaaaaaaa"), // PassName: to.Ptr("OobeSystem"), // SettingName: to.Ptr(armcompute.SettingNamesAutoLogon), // }}, // EnableAutomaticUpdates: to.Ptr(true), // PatchSettings: &armcompute.PatchSettings{ // AssessmentMode: to.Ptr(armcompute.WindowsPatchAssessmentModeImageDefault), // EnableHotpatching: to.Ptr(true), // PatchMode: to.Ptr(armcompute.WindowsVMGuestPatchModeManual), // }, // ProvisionVMAgent: to.Ptr(true), // TimeZone: to.Ptr("aaaaaaaaaaaaaaaaaaaaaaaaaaa"), // WinRM: &armcompute.WinRMConfiguration{ // Listeners: []*armcompute.WinRMListener{ // { // CertificateURL: to.Ptr("aaaaaaaaaaaaaaaaaaaaaa"), // Protocol: to.Ptr(armcompute.ProtocolTypesHTTP), // }}, // }, // }, // }, // ProtectionPolicy: &armcompute.VirtualMachineScaleSetVMProtectionPolicy{ // ProtectFromScaleIn: to.Ptr(true), // ProtectFromScaleSetActions: to.Ptr(true), // }, // ProvisioningState: to.Ptr("Succeeded"), // SecurityProfile: &armcompute.SecurityProfile{ // EncryptionAtHost: to.Ptr(true), // SecurityType: to.Ptr(armcompute.SecurityTypesTrustedLaunch), // UefiSettings: &armcompute.UefiSettings{ // SecureBootEnabled: to.Ptr(true), // VTpmEnabled: to.Ptr(true), // }, // }, // StorageProfile: &armcompute.StorageProfile{ // DataDisks: []*armcompute.DataDisk{ // { // Name: to.Ptr("vmss3176_vmss3176_0_disk2_6c4f554bdafa49baa780eb2d128ff39d"), // Caching: to.Ptr(armcompute.CachingTypesNone), // CreateOption: to.Ptr(armcompute.DiskCreateOptionTypesEmpty), // DeleteOption: to.Ptr(armcompute.DiskDeleteOptionTypesDelete), // DetachOption: to.Ptr(armcompute.DiskDetachOptionTypesForceDetach), // DiskIOPSReadWrite: to.Ptr[int64](18), // DiskMBpsReadWrite: to.Ptr[int64](29), // DiskSizeGB: to.Ptr[int32](128), // Image: &armcompute.VirtualHardDisk{ // URI: to.Ptr("https://{storageAccountName}.blob.core.windows.net/{containerName}/{vhdName}.vhd"), // }, // Lun: to.Ptr[int32](1), // ManagedDisk: &armcompute.ManagedDiskParameters{ // ID: to.Ptr("/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/disks/vmss3176_vmss3176_0_disk2_6c4f554bdafa49baa780eb2d128ff39d"), // DiskEncryptionSet: &armcompute.DiskEncryptionSetParameters{ // ID: to.Ptr("aaaaaaaaaaaa"), // }, // StorageAccountType: to.Ptr(armcompute.StorageAccountTypesStandardLRS), // }, // ToBeDetached: to.Ptr(true), // Vhd: &armcompute.VirtualHardDisk{ // URI: to.Ptr("https://{storageAccountName}.blob.core.windows.net/{containerName}/{vhdName}.vhd"), // }, // WriteAcceleratorEnabled: to.Ptr(true), // }}, // ImageReference: &armcompute.ImageReference{ // ID: to.Ptr("a"), // ExactVersion: to.Ptr("4.127.20180315"), // Offer: to.Ptr("WindowsServer"), // Publisher: to.Ptr("MicrosoftWindowsServer"), // SharedGalleryImageID: to.Ptr("aaaaaaaaaaaaaaaaaaaa"), // SKU: to.Ptr("2012-R2-Datacenter"), // Version: to.Ptr("4.127.20180315"), // }, // OSDisk: &armcompute.OSDisk{ // Name: to.Ptr("vmss3176_vmss3176_0_OsDisk_1_6d72b805e50e4de6830303c5055077fc"), // Caching: to.Ptr(armcompute.CachingTypesNone), // CreateOption: to.Ptr(armcompute.DiskCreateOptionTypesFromImage), // DeleteOption: to.Ptr(armcompute.DiskDeleteOptionTypesDelete), // DiffDiskSettings: &armcompute.DiffDiskSettings{ // Option: to.Ptr(armcompute.DiffDiskOptionsLocal), // Placement: to.Ptr(armcompute.DiffDiskPlacementCacheDisk), // }, // DiskSizeGB: to.Ptr[int32](127), // EncryptionSettings: &armcompute.DiskEncryptionSettings{ // DiskEncryptionKey: &armcompute.KeyVaultSecretReference{ // SecretURL: to.Ptr("aaaaaaaa"), // SourceVault: &armcompute.SubResource{ // ID: to.Ptr("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/availabilitySets/{availabilitySetName}"), // }, // }, // Enabled: to.Ptr(true), // KeyEncryptionKey: &armcompute.KeyVaultKeyReference{ // KeyURL: to.Ptr("aaaaaaaaaaaaaa"), // SourceVault: &armcompute.SubResource{ // ID: to.Ptr("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/availabilitySets/{availabilitySetName}"), // }, // }, // }, // Image: &armcompute.VirtualHardDisk{ // URI: to.Ptr("https://{storageAccountName}.blob.core.windows.net/{containerName}/{vhdName}.vhd"), // }, // ManagedDisk: &armcompute.ManagedDiskParameters{ // ID: to.Ptr("/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/disks/vmss3176_vmss3176_0_OsDisk_1_6d72b805e50e4de6830303c5055077fc"), // DiskEncryptionSet: &armcompute.DiskEncryptionSetParameters{ // ID: to.Ptr("aaaaaaaaaaaa"), // }, // StorageAccountType: to.Ptr(armcompute.StorageAccountTypesStandardLRS), // }, // OSType: to.Ptr(armcompute.OperatingSystemTypesWindows), // Vhd: &armcompute.VirtualHardDisk{ // URI: to.Ptr("https://{storageAccountName}.blob.core.windows.net/{containerName}/{vhdName}.vhd"), // }, // WriteAcceleratorEnabled: to.Ptr(true), // }, // }, // UserData: to.Ptr("RXhhbXBsZSBVc2VyRGF0YQ=="), // VMID: to.Ptr("42af9fdf-b906-4ad7-9905-8316209ff619"), // }, // Resources: []*armcompute.VirtualMachineExtension{ // { // Name: to.Ptr("CustomScriptExtension-DSC"), // Type: to.Ptr("Microsoft.Compute/virtualMachines/extensions"), // ID: to.Ptr("/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/virtualMachines/myVM/extensions/CustomScriptExtension-DSC"), // Location: to.Ptr("westus"), // Tags: map[string]*string{ // }, // Properties: &armcompute.VirtualMachineExtensionProperties{ // Type: to.Ptr("CustomScriptExtension"), // AutoUpgradeMinorVersion: to.Ptr(true), // EnableAutomaticUpgrade: to.Ptr(true), // ForceUpdateTag: to.Ptr("aaaaaaa"), // InstanceView: &armcompute.VirtualMachineExtensionInstanceView{ // Name: to.Ptr("aaaaaaaaaaaaaaaaa"), // Type: to.Ptr("aaaaaaaaa"), // Statuses: []*armcompute.InstanceViewStatus{ // { // Code: to.Ptr("aaaaaaaaaaaaaaaaaaaaaaa"), // DisplayStatus: to.Ptr("aaaaaa"), // Level: to.Ptr(armcompute.StatusLevelTypesInfo), // Message: to.Ptr("a"), // Time: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-11-30T12:58:26.522Z"); return t}()), // }}, // Substatuses: []*armcompute.InstanceViewStatus{ // { // Code: to.Ptr("aaaaaaaaaaaaaaaaaaaaaaa"), // DisplayStatus: to.Ptr("aaaaaa"), // Level: to.Ptr(armcompute.StatusLevelTypesInfo), // Message: to.Ptr("a"), // Time: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-11-30T12:58:26.522Z"); return t}()), // }}, // TypeHandlerVersion: to.Ptr("aaaaaaaaaaaaaaaaaaaaaaaaaa"), // }, // ProtectedSettings: map[string]any{ // }, // ProvisioningState: to.Ptr("Succeeded"), // Publisher: to.Ptr("Microsoft.Compute"), // Settings: map[string]any{ // }, // SuppressFailures: to.Ptr(true), // TypeHandlerVersion: to.Ptr("1.9"), // }, // }}, // SKU: &armcompute.SKU{ // Name: to.Ptr("Classic"), // Capacity: to.Ptr[int64](29), // Tier: to.Ptr("aaaaaaaaaaaaaa"), // }, // Zones: []*string{ // to.Ptr("a")}, // }
Output:
Example (VirtualMachineScaleSetVmUpdateMinimumSetGen) ¶
Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/92de53a5f1e0e03c94b40475d2135d97148ed014/specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-03-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSetVM_Update_MinimumSet_Gen.json
cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() clientFactory, err := armcompute.NewClientFactory("<subscription-id>", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } poller, err := clientFactory.NewVirtualMachineScaleSetVMsClient().BeginUpdate(ctx, "rgcompute", "aaaaaaaaaaaaaaaaaa", "aaaaaaaaaaaaaaaaaaaa", armcompute.VirtualMachineScaleSetVM{ Location: to.Ptr("westus"), }, &armcompute.VirtualMachineScaleSetVMsClientBeginUpdateOptions{IfMatch: nil, IfNoneMatch: nil, }) if err != nil { log.Fatalf("failed to finish the request: %v", err) } res, err := poller.PollUntilDone(ctx, nil) if err != nil { log.Fatalf("failed to pull the result: %v", err) } // You could use response here. We use blank identifier for just demo purposes. _ = res // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. // res.VirtualMachineScaleSetVM = armcompute.VirtualMachineScaleSetVM{ // ID: to.Ptr("/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/virtualMachineScaleSets/{vmss-name}/virtualMachines/0"), // Location: to.Ptr("westus"), // }
Output:
func (*VirtualMachineScaleSetVMsClient) Get ¶
func (client *VirtualMachineScaleSetVMsClient) Get(ctx context.Context, resourceGroupName string, vmScaleSetName string, instanceID string, options *VirtualMachineScaleSetVMsClientGetOptions) (VirtualMachineScaleSetVMsClientGetResponse, error)
Get - Gets a virtual machine from a VM scale set. If the operation fails it returns an *azcore.ResponseError type.
Generated from API version 2024-03-01
- resourceGroupName - The name of the resource group.
- vmScaleSetName - The name of the VM scale set.
- instanceID - The instance ID of the virtual machine.
- options - VirtualMachineScaleSetVMsClientGetOptions contains the optional parameters for the VirtualMachineScaleSetVMsClient.Get method.
Example (GetVmScaleSetVmWithUserData) ¶
Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/92de53a5f1e0e03c94b40475d2135d97148ed014/specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-03-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSetVM_Get_WithUserData.json
cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() clientFactory, err := armcompute.NewClientFactory("<subscription-id>", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } res, err := clientFactory.NewVirtualMachineScaleSetVMsClient().Get(ctx, "myResourceGroup", "{vmss-name}", "0", &armcompute.VirtualMachineScaleSetVMsClientGetOptions{Expand: nil}) if err != nil { log.Fatalf("failed to finish the request: %v", err) } // You could use response here. We use blank identifier for just demo purposes. _ = res // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. // res.VirtualMachineScaleSetVM = armcompute.VirtualMachineScaleSetVM{ // Name: to.Ptr("{vmss-vm-name}"), // Type: to.Ptr("Microsoft.Compute/virtualMachines"), // ID: to.Ptr("/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/virtualMachineScaleSets/{vmss-name}/virtualMachines/0"), // Location: to.Ptr("westus"), // Tags: map[string]*string{ // "myTag1": to.Ptr("tagValue1"), // }, // Etag: to.Ptr("\"1\""), // Properties: &armcompute.VirtualMachineScaleSetVMProperties{ // DiagnosticsProfile: &armcompute.DiagnosticsProfile{ // BootDiagnostics: &armcompute.BootDiagnostics{ // Enabled: to.Ptr(true), // }, // }, // HardwareProfile: &armcompute.HardwareProfile{ // }, // LatestModelApplied: to.Ptr(true), // ModelDefinitionApplied: to.Ptr("VirtualMachineScaleSet"), // NetworkProfile: &armcompute.NetworkProfile{ // NetworkInterfaces: []*armcompute.NetworkInterfaceReference{ // { // ID: to.Ptr("/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/virtualMachineScaleSets/{vmss-name}/virtualMachines/0/networkInterfaces/vmsstestnetconfig5415"), // }}, // }, // NetworkProfileConfiguration: &armcompute.VirtualMachineScaleSetVMNetworkProfileConfiguration{ // NetworkInterfaceConfigurations: []*armcompute.VirtualMachineScaleSetNetworkConfiguration{ // { // Name: to.Ptr("vmsstestnetconfig5415"), // Properties: &armcompute.VirtualMachineScaleSetNetworkConfigurationProperties{ // DNSSettings: &armcompute.VirtualMachineScaleSetNetworkConfigurationDNSSettings{ // DNSServers: []*string{ // }, // }, // EnableAcceleratedNetworking: to.Ptr(false), // EnableIPForwarding: to.Ptr(false), // IPConfigurations: []*armcompute.VirtualMachineScaleSetIPConfiguration{ // { // Name: to.Ptr("vmsstestnetconfig9693"), // Properties: &armcompute.VirtualMachineScaleSetIPConfigurationProperties{ // PrivateIPAddressVersion: to.Ptr(armcompute.IPVersionIPv4), // Subnet: &armcompute.APIEntityReference{ // ID: to.Ptr("/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/virtualNetworks/vn4071/subnets/sn5503"), // }, // }, // }}, // Primary: to.Ptr(true), // }, // }}, // }, // OSProfile: &armcompute.OSProfile{ // AdminUsername: to.Ptr("Foo12"), // AllowExtensionOperations: to.Ptr(true), // ComputerName: to.Ptr("test000000"), // RequireGuestProvisionSignal: to.Ptr(true), // Secrets: []*armcompute.VaultSecretGroup{ // }, // WindowsConfiguration: &armcompute.WindowsConfiguration{ // EnableAutomaticUpdates: to.Ptr(true), // ProvisionVMAgent: to.Ptr(true), // }, // }, // ProvisioningState: to.Ptr("Succeeded"), // StorageProfile: &armcompute.StorageProfile{ // DataDisks: []*armcompute.DataDisk{ // { // Name: to.Ptr("vmss3176_vmss3176_0_disk2_6c4f554bdafa49baa780eb2d128ff39d"), // Caching: to.Ptr(armcompute.CachingTypesNone), // CreateOption: to.Ptr(armcompute.DiskCreateOptionTypesEmpty), // DiskSizeGB: to.Ptr[int32](128), // Lun: to.Ptr[int32](1), // ManagedDisk: &armcompute.ManagedDiskParameters{ // ID: to.Ptr("/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/disks/vmss3176_vmss3176_0_disk2_6c4f554bdafa49baa780eb2d128ff39d"), // StorageAccountType: to.Ptr(armcompute.StorageAccountTypesStandardLRS), // }, // ToBeDetached: to.Ptr(false), // }}, // ImageReference: &armcompute.ImageReference{ // ExactVersion: to.Ptr("4.127.20180315"), // Offer: to.Ptr("WindowsServer"), // Publisher: to.Ptr("MicrosoftWindowsServer"), // SKU: to.Ptr("2012-R2-Datacenter"), // Version: to.Ptr("4.127.20180315"), // }, // OSDisk: &armcompute.OSDisk{ // Name: to.Ptr("vmss3176_vmss3176_0_OsDisk_1_6d72b805e50e4de6830303c5055077fc"), // Caching: to.Ptr(armcompute.CachingTypesNone), // CreateOption: to.Ptr(armcompute.DiskCreateOptionTypesFromImage), // DiskSizeGB: to.Ptr[int32](127), // ManagedDisk: &armcompute.ManagedDiskParameters{ // ID: to.Ptr("/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/disks/vmss3176_vmss3176_0_OsDisk_1_6d72b805e50e4de6830303c5055077fc"), // StorageAccountType: to.Ptr(armcompute.StorageAccountTypesStandardLRS), // }, // OSType: to.Ptr(armcompute.OperatingSystemTypesWindows), // }, // }, // UserData: to.Ptr("RXhhbXBsZSBVc2VyRGF0YQ=="), // VMID: to.Ptr("42af9fdf-b906-4ad7-9905-8316209ff619"), // }, // Resources: []*armcompute.VirtualMachineExtension{ // { // Name: to.Ptr("CustomScriptExtension-DSC"), // Type: to.Ptr("Microsoft.Compute/virtualMachines/extensions"), // ID: to.Ptr("/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/virtualMachines/myVM/extensions/CustomScriptExtension-DSC"), // Location: to.Ptr("westus"), // Tags: map[string]*string{ // "displayName": to.Ptr("CustomScriptExtension-DSC"), // }, // Properties: &armcompute.VirtualMachineExtensionProperties{ // Type: to.Ptr("CustomScriptExtension"), // AutoUpgradeMinorVersion: to.Ptr(true), // ProvisioningState: to.Ptr("Succeeded"), // Publisher: to.Ptr("Microsoft.Compute"), // Settings: map[string]any{ // }, // TypeHandlerVersion: to.Ptr("1.9"), // }, // }}, // }
Output:
Example (GetVmScaleSetVmWithVmSizeProperties) ¶
Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/92de53a5f1e0e03c94b40475d2135d97148ed014/specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-03-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSetVM_Get_WithVMSizeProperties.json
cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() clientFactory, err := armcompute.NewClientFactory("<subscription-id>", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } res, err := clientFactory.NewVirtualMachineScaleSetVMsClient().Get(ctx, "myResourceGroup", "{vmss-name}", "0", &armcompute.VirtualMachineScaleSetVMsClientGetOptions{Expand: nil}) if err != nil { log.Fatalf("failed to finish the request: %v", err) } // You could use response here. We use blank identifier for just demo purposes. _ = res // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. // res.VirtualMachineScaleSetVM = armcompute.VirtualMachineScaleSetVM{ // Name: to.Ptr("{vmss-vm-name}"), // Type: to.Ptr("Microsoft.Compute/virtualMachines"), // ID: to.Ptr("/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/virtualMachineScaleSets/{vmss-name}/virtualMachines/0"), // Location: to.Ptr("westus"), // Tags: map[string]*string{ // "myTag1": to.Ptr("tagValue1"), // }, // Etag: to.Ptr("\"1\""), // Properties: &armcompute.VirtualMachineScaleSetVMProperties{ // DiagnosticsProfile: &armcompute.DiagnosticsProfile{ // BootDiagnostics: &armcompute.BootDiagnostics{ // Enabled: to.Ptr(true), // }, // }, // HardwareProfile: &armcompute.HardwareProfile{ // VMSizeProperties: &armcompute.VMSizeProperties{ // VCPUsAvailable: to.Ptr[int32](1), // VCPUsPerCore: to.Ptr[int32](1), // }, // }, // LatestModelApplied: to.Ptr(true), // ModelDefinitionApplied: to.Ptr("VirtualMachineScaleSet"), // NetworkProfile: &armcompute.NetworkProfile{ // NetworkInterfaces: []*armcompute.NetworkInterfaceReference{ // { // ID: to.Ptr("/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/virtualMachineScaleSets/{vmss-name}/virtualMachines/0/networkInterfaces/vmsstestnetconfig5415"), // }}, // }, // NetworkProfileConfiguration: &armcompute.VirtualMachineScaleSetVMNetworkProfileConfiguration{ // NetworkInterfaceConfigurations: []*armcompute.VirtualMachineScaleSetNetworkConfiguration{ // { // Name: to.Ptr("vmsstestnetconfig5415"), // Properties: &armcompute.VirtualMachineScaleSetNetworkConfigurationProperties{ // DNSSettings: &armcompute.VirtualMachineScaleSetNetworkConfigurationDNSSettings{ // DNSServers: []*string{ // }, // }, // EnableAcceleratedNetworking: to.Ptr(false), // EnableIPForwarding: to.Ptr(false), // IPConfigurations: []*armcompute.VirtualMachineScaleSetIPConfiguration{ // { // Name: to.Ptr("vmsstestnetconfig9693"), // Properties: &armcompute.VirtualMachineScaleSetIPConfigurationProperties{ // PrivateIPAddressVersion: to.Ptr(armcompute.IPVersionIPv4), // Subnet: &armcompute.APIEntityReference{ // ID: to.Ptr("/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/virtualNetworks/vn4071/subnets/sn5503"), // }, // }, // }}, // Primary: to.Ptr(true), // }, // }}, // }, // OSProfile: &armcompute.OSProfile{ // AdminUsername: to.Ptr("Foo12"), // AllowExtensionOperations: to.Ptr(true), // ComputerName: to.Ptr("test000000"), // RequireGuestProvisionSignal: to.Ptr(true), // Secrets: []*armcompute.VaultSecretGroup{ // }, // WindowsConfiguration: &armcompute.WindowsConfiguration{ // EnableAutomaticUpdates: to.Ptr(true), // ProvisionVMAgent: to.Ptr(true), // }, // }, // ProvisioningState: to.Ptr("Succeeded"), // StorageProfile: &armcompute.StorageProfile{ // DataDisks: []*armcompute.DataDisk{ // { // Name: to.Ptr("vmss3176_vmss3176_0_disk2_6c4f554bdafa49baa780eb2d128ff39d"), // Caching: to.Ptr(armcompute.CachingTypesNone), // CreateOption: to.Ptr(armcompute.DiskCreateOptionTypesEmpty), // DiskSizeGB: to.Ptr[int32](128), // Lun: to.Ptr[int32](1), // ManagedDisk: &armcompute.ManagedDiskParameters{ // ID: to.Ptr("/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/disks/vmss3176_vmss3176_0_disk2_6c4f554bdafa49baa780eb2d128ff39d"), // StorageAccountType: to.Ptr(armcompute.StorageAccountTypesStandardLRS), // }, // ToBeDetached: to.Ptr(false), // }}, // ImageReference: &armcompute.ImageReference{ // ExactVersion: to.Ptr("4.127.20180315"), // Offer: to.Ptr("WindowsServer"), // Publisher: to.Ptr("MicrosoftWindowsServer"), // SKU: to.Ptr("2012-R2-Datacenter"), // Version: to.Ptr("4.127.20180315"), // }, // OSDisk: &armcompute.OSDisk{ // Name: to.Ptr("vmss3176_vmss3176_0_OsDisk_1_6d72b805e50e4de6830303c5055077fc"), // Caching: to.Ptr(armcompute.CachingTypesNone), // CreateOption: to.Ptr(armcompute.DiskCreateOptionTypesFromImage), // DiskSizeGB: to.Ptr[int32](127), // ManagedDisk: &armcompute.ManagedDiskParameters{ // ID: to.Ptr("/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/disks/vmss3176_vmss3176_0_OsDisk_1_6d72b805e50e4de6830303c5055077fc"), // StorageAccountType: to.Ptr(armcompute.StorageAccountTypesStandardLRS), // }, // OSType: to.Ptr(armcompute.OperatingSystemTypesWindows), // }, // }, // UserData: to.Ptr("RXhhbXBsZSBVc2VyRGF0YQ=="), // VMID: to.Ptr("42af9fdf-b906-4ad7-9905-8316209ff619"), // }, // Resources: []*armcompute.VirtualMachineExtension{ // { // Name: to.Ptr("CustomScriptExtension-DSC"), // Type: to.Ptr("Microsoft.Compute/virtualMachines/extensions"), // ID: to.Ptr("/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/virtualMachines/myVM/extensions/CustomScriptExtension-DSC"), // Location: to.Ptr("westus"), // Tags: map[string]*string{ // "displayName": to.Ptr("CustomScriptExtension-DSC"), // }, // Properties: &armcompute.VirtualMachineExtensionProperties{ // Type: to.Ptr("CustomScriptExtension"), // AutoUpgradeMinorVersion: to.Ptr(true), // ProvisioningState: to.Ptr("Succeeded"), // Publisher: to.Ptr("Microsoft.Compute"), // Settings: map[string]any{ // }, // TypeHandlerVersion: to.Ptr("1.9"), // }, // }}, // }
Output:
func (*VirtualMachineScaleSetVMsClient) GetInstanceView ¶
func (client *VirtualMachineScaleSetVMsClient) GetInstanceView(ctx context.Context, resourceGroupName string, vmScaleSetName string, instanceID string, options *VirtualMachineScaleSetVMsClientGetInstanceViewOptions) (VirtualMachineScaleSetVMsClientGetInstanceViewResponse, error)
GetInstanceView - Gets the status of a virtual machine from a VM scale set. If the operation fails it returns an *azcore.ResponseError type.
Generated from API version 2024-03-01
- resourceGroupName - The name of the resource group.
- vmScaleSetName - The name of the VM scale set.
- instanceID - The instance ID of the virtual machine.
- options - VirtualMachineScaleSetVMsClientGetInstanceViewOptions contains the optional parameters for the VirtualMachineScaleSetVMsClient.GetInstanceView method.
Example ¶
Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/92de53a5f1e0e03c94b40475d2135d97148ed014/specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-03-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSetVM_Get_InstanceViewAutoPlacedOnDedicatedHostGroup.json
cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() clientFactory, err := armcompute.NewClientFactory("<subscription-id>", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } res, err := clientFactory.NewVirtualMachineScaleSetVMsClient().GetInstanceView(ctx, "myResourceGroup", "myVirtualMachineScaleSet", "0", nil) if err != nil { log.Fatalf("failed to finish the request: %v", err) } // You could use response here. We use blank identifier for just demo purposes. _ = res // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. // res.VirtualMachineScaleSetVMInstanceView = armcompute.VirtualMachineScaleSetVMInstanceView{ // AssignedHost: to.Ptr("/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/hostGroups/myHostGroup/hosts/myHost"), // Disks: []*armcompute.DiskInstanceView{ // { // Name: to.Ptr("myOSDisk"), // Statuses: []*armcompute.InstanceViewStatus{ // { // Code: to.Ptr("ProvisioningState/succeeded"), // DisplayStatus: to.Ptr("Provisioning succeeded"), // Level: to.Ptr(armcompute.StatusLevelTypesInfo), // Time: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2024-03-01T04:58:58.088Z"); return t}()), // }}, // }}, // PlatformFaultDomain: to.Ptr[int32](0), // PlatformUpdateDomain: to.Ptr[int32](0), // Statuses: []*armcompute.InstanceViewStatus{ // { // Code: to.Ptr("ProvisioningState/succeeded"), // DisplayStatus: to.Ptr("Provisioning succeeded"), // Level: to.Ptr(armcompute.StatusLevelTypesInfo), // Time: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-06-05T04:59:58.185Z"); return t}()), // }, // { // Code: to.Ptr("PowerState/running"), // DisplayStatus: to.Ptr("VM running"), // Level: to.Ptr(armcompute.StatusLevelTypesInfo), // }}, // VMAgent: &armcompute.VirtualMachineAgentInstanceView{ // Statuses: []*armcompute.InstanceViewStatus{ // { // Code: to.Ptr("ProvisioningState/Unavailable"), // DisplayStatus: to.Ptr("Not Ready"), // Level: to.Ptr(armcompute.StatusLevelTypesWarning), // Message: to.Ptr("VM status blob is found but not yet populated."), // Time: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2024-03-01T05:00:32.000Z"); return t}()), // }}, // VMAgentVersion: to.Ptr("Unknown"), // }, // }
Output:
func (*VirtualMachineScaleSetVMsClient) NewListPager ¶
func (client *VirtualMachineScaleSetVMsClient) NewListPager(resourceGroupName string, virtualMachineScaleSetName string, options *VirtualMachineScaleSetVMsClientListOptions) *runtime.Pager[VirtualMachineScaleSetVMsClientListResponse]
NewListPager - Gets a list of all virtual machines in a VM scale sets.
Generated from API version 2024-03-01
- resourceGroupName - The name of the resource group.
- virtualMachineScaleSetName - The name of the VM scale set.
- options - VirtualMachineScaleSetVMsClientListOptions contains the optional parameters for the VirtualMachineScaleSetVMsClient.NewListPager method.
Example (VirtualMachineScaleSetVmListMaximumSetGen) ¶
Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/92de53a5f1e0e03c94b40475d2135d97148ed014/specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-03-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSetVM_List_MaximumSet_Gen.json
cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() clientFactory, err := armcompute.NewClientFactory("<subscription-id>", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } pager := clientFactory.NewVirtualMachineScaleSetVMsClient().NewListPager("rgcompute", "aaaaaaaaaaaaaaaaaaaaaa", &armcompute.VirtualMachineScaleSetVMsClientListOptions{Filter: to.Ptr("aaaaaaaaaaaaaa"), Select: to.Ptr("aaaaaaaaaaaaaaaaaaaaa"), Expand: to.Ptr("aaaaaaaaaaaaa"), }) for pager.More() { page, err := pager.NextPage(ctx) if err != nil { log.Fatalf("failed to advance page: %v", err) } for _, v := range page.Value { // You could use page here. We use blank identifier for just demo purposes. _ = v } // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. // page.VirtualMachineScaleSetVMListResult = armcompute.VirtualMachineScaleSetVMListResult{ // Value: []*armcompute.VirtualMachineScaleSetVM{ // { // Name: to.Ptr("{vmss-vm-name}"), // Type: to.Ptr("Microsoft.Compute/virtualMachines"), // ID: to.Ptr("/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/virtualMachineScaleSets/{vmss-name}/virtualMachines/0"), // Location: to.Ptr("westus"), // Tags: map[string]*string{ // }, // InstanceID: to.Ptr("aaaaaaaaaaaa"), // Plan: &armcompute.Plan{ // Name: to.Ptr("aaaaaaaaaa"), // Product: to.Ptr("aaaaaaaaaaaaaaaaaaaa"), // PromotionCode: to.Ptr("aaaaaaaaaaaaaaaaaaaa"), // Publisher: to.Ptr("aaaaaaaaaaaaaaaaaaaaaa"), // }, // Properties: &armcompute.VirtualMachineScaleSetVMProperties{ // AdditionalCapabilities: &armcompute.AdditionalCapabilities{ // HibernationEnabled: to.Ptr(true), // UltraSSDEnabled: to.Ptr(true), // }, // AvailabilitySet: &armcompute.SubResource{ // ID: to.Ptr("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/availabilitySets/{availabilitySetName}"), // }, // DiagnosticsProfile: &armcompute.DiagnosticsProfile{ // BootDiagnostics: &armcompute.BootDiagnostics{ // Enabled: to.Ptr(true), // StorageURI: to.Ptr("aaaaaaaaaaaaa"), // }, // }, // HardwareProfile: &armcompute.HardwareProfile{ // VMSize: to.Ptr(armcompute.VirtualMachineSizeTypesBasicA0), // VMSizeProperties: &armcompute.VMSizeProperties{ // VCPUsAvailable: to.Ptr[int32](9), // VCPUsPerCore: to.Ptr[int32](12), // }, // }, // InstanceView: &armcompute.VirtualMachineScaleSetVMInstanceView{ // AssignedHost: to.Ptr("aaaaaaa"), // BootDiagnostics: &armcompute.BootDiagnosticsInstanceView{ // ConsoleScreenshotBlobURI: to.Ptr("aaaaaaaaaaaaaaaaaaaaaaaaa"), // SerialConsoleLogBlobURI: to.Ptr("aaaaaaaa"), // Status: &armcompute.InstanceViewStatus{ // Code: to.Ptr("aaaaaaaaaaaaaaaaaaaaaaa"), // DisplayStatus: to.Ptr("aaaaaa"), // Level: to.Ptr(armcompute.StatusLevelTypesInfo), // Message: to.Ptr("a"), // Time: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-11-30T12:58:26.522Z"); return t}()), // }, // }, // Disks: []*armcompute.DiskInstanceView{ // { // Name: to.Ptr("aaaaaaaaaaa"), // EncryptionSettings: []*armcompute.DiskEncryptionSettings{ // { // DiskEncryptionKey: &armcompute.KeyVaultSecretReference{ // SecretURL: to.Ptr("aaaaaaaa"), // SourceVault: &armcompute.SubResource{ // ID: to.Ptr("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/availabilitySets/{availabilitySetName}"), // }, // }, // Enabled: to.Ptr(true), // KeyEncryptionKey: &armcompute.KeyVaultKeyReference{ // KeyURL: to.Ptr("aaaaaaaaaaaaaa"), // SourceVault: &armcompute.SubResource{ // ID: to.Ptr("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/availabilitySets/{availabilitySetName}"), // }, // }, // }}, // Statuses: []*armcompute.InstanceViewStatus{ // { // Code: to.Ptr("aaaaaaaaaaaaaaaaaaaaaaa"), // DisplayStatus: to.Ptr("aaaaaa"), // Level: to.Ptr(armcompute.StatusLevelTypesInfo), // Message: to.Ptr("a"), // Time: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-11-30T12:58:26.522Z"); return t}()), // }}, // }}, // MaintenanceRedeployStatus: &armcompute.MaintenanceRedeployStatus{ // IsCustomerInitiatedMaintenanceAllowed: to.Ptr(true), // LastOperationMessage: to.Ptr("aaaaaa"), // LastOperationResultCode: to.Ptr(armcompute.MaintenanceOperationResultCodeTypesNone), // MaintenanceWindowEndTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-11-30T12:58:26.531Z"); return t}()), // MaintenanceWindowStartTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-11-30T12:58:26.531Z"); return t}()), // PreMaintenanceWindowEndTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-11-30T12:58:26.531Z"); return t}()), // PreMaintenanceWindowStartTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-11-30T12:58:26.531Z"); return t}()), // }, // PlacementGroupID: to.Ptr("aaa"), // PlatformFaultDomain: to.Ptr[int32](14), // PlatformUpdateDomain: to.Ptr[int32](23), // RdpThumbPrint: to.Ptr("aaaaaaaaaaaaaaaaaaaaaaaaaaa"), // Statuses: []*armcompute.InstanceViewStatus{ // { // Code: to.Ptr("aaaaaaaaaaaaaaaaaaaaaaa"), // DisplayStatus: to.Ptr("aaaaaa"), // Level: to.Ptr(armcompute.StatusLevelTypesInfo), // Message: to.Ptr("a"), // Time: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-11-30T12:58:26.522Z"); return t}()), // }}, // VMAgent: &armcompute.VirtualMachineAgentInstanceView{ // ExtensionHandlers: []*armcompute.VirtualMachineExtensionHandlerInstanceView{ // { // Type: to.Ptr("aaaaaaaaaaaaa"), // Status: &armcompute.InstanceViewStatus{ // Code: to.Ptr("aaaaaaaaaaaaaaaaaaaaaaa"), // DisplayStatus: to.Ptr("aaaaaa"), // Level: to.Ptr(armcompute.StatusLevelTypesInfo), // Message: to.Ptr("a"), // Time: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-11-30T12:58:26.522Z"); return t}()), // }, // TypeHandlerVersion: to.Ptr("aaaaa"), // }}, // Statuses: []*armcompute.InstanceViewStatus{ // { // Code: to.Ptr("aaaaaaaaaaaaaaaaaaaaaaa"), // DisplayStatus: to.Ptr("aaaaaa"), // Level: to.Ptr(armcompute.StatusLevelTypesInfo), // Message: to.Ptr("a"), // Time: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-11-30T12:58:26.522Z"); return t}()), // }}, // VMAgentVersion: to.Ptr("aaaaaaaaaaaaaaaaaaaaaaa"), // }, // VMHealth: &armcompute.VirtualMachineHealthStatus{ // Status: &armcompute.InstanceViewStatus{ // Code: to.Ptr("aaaaaaaaaaaaaaaaaaaaaaa"), // DisplayStatus: to.Ptr("aaaaaa"), // Level: to.Ptr(armcompute.StatusLevelTypesInfo), // Message: to.Ptr("a"), // Time: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-11-30T12:58:26.522Z"); return t}()), // }, // }, // Extensions: []*armcompute.VirtualMachineExtensionInstanceView{ // { // Name: to.Ptr("aaaaaaaaaaaaaaaaa"), // Type: to.Ptr("aaaaaaaaa"), // Statuses: []*armcompute.InstanceViewStatus{ // { // Code: to.Ptr("aaaaaaaaaaaaaaaaaaaaaaa"), // DisplayStatus: to.Ptr("aaaaaa"), // Level: to.Ptr(armcompute.StatusLevelTypesInfo), // Message: to.Ptr("a"), // Time: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-11-30T12:58:26.522Z"); return t}()), // }}, // Substatuses: []*armcompute.InstanceViewStatus{ // { // Code: to.Ptr("aaaaaaaaaaaaaaaaaaaaaaa"), // DisplayStatus: to.Ptr("aaaaaa"), // Level: to.Ptr(armcompute.StatusLevelTypesInfo), // Message: to.Ptr("a"), // Time: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-11-30T12:58:26.522Z"); return t}()), // }}, // TypeHandlerVersion: to.Ptr("aaaaaaaaaaaaaaaaaaaaaaaaaa"), // }}, // }, // LatestModelApplied: to.Ptr(true), // LicenseType: to.Ptr("aaaaaaaaaa"), // ModelDefinitionApplied: to.Ptr("VirtualMachineScaleSet"), // NetworkProfile: &armcompute.NetworkProfile{ // NetworkAPIVersion: to.Ptr(armcompute.NetworkAPIVersionTwoThousandTwenty1101), // NetworkInterfaceConfigurations: []*armcompute.VirtualMachineNetworkInterfaceConfiguration{ // { // Name: to.Ptr("aaaaaaaaaaa"), // Properties: &armcompute.VirtualMachineNetworkInterfaceConfigurationProperties{ // DeleteOption: to.Ptr(armcompute.DeleteOptionsDelete), // DNSSettings: &armcompute.VirtualMachineNetworkInterfaceDNSSettingsConfiguration{ // DNSServers: []*string{ // to.Ptr("aaaaaa")}, // }, // DscpConfiguration: &armcompute.SubResource{ // ID: to.Ptr("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/availabilitySets/{availabilitySetName}"), // }, // EnableAcceleratedNetworking: to.Ptr(true), // EnableFpga: to.Ptr(true), // EnableIPForwarding: to.Ptr(true), // IPConfigurations: []*armcompute.VirtualMachineNetworkInterfaceIPConfiguration{ // { // Name: to.Ptr("aa"), // Properties: &armcompute.VirtualMachineNetworkInterfaceIPConfigurationProperties{ // ApplicationGatewayBackendAddressPools: []*armcompute.SubResource{ // { // ID: to.Ptr("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/availabilitySets/{availabilitySetName}"), // }}, // ApplicationSecurityGroups: []*armcompute.SubResource{ // { // ID: to.Ptr("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/availabilitySets/{availabilitySetName}"), // }}, // LoadBalancerBackendAddressPools: []*armcompute.SubResource{ // { // ID: to.Ptr("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/availabilitySets/{availabilitySetName}"), // }}, // Primary: to.Ptr(true), // PrivateIPAddressVersion: to.Ptr(armcompute.IPVersionsIPv4), // PublicIPAddressConfiguration: &armcompute.VirtualMachinePublicIPAddressConfiguration{ // Name: to.Ptr("aaaaaaaaaaaaaaaaaaaaaaaaaaaaa"), // Properties: &armcompute.VirtualMachinePublicIPAddressConfigurationProperties{ // DeleteOption: to.Ptr(armcompute.DeleteOptionsDelete), // DNSSettings: &armcompute.VirtualMachinePublicIPAddressDNSSettingsConfiguration{ // DomainNameLabel: to.Ptr("aaaaaaaaaaaaaaaaaaaaaaaaa"), // }, // IdleTimeoutInMinutes: to.Ptr[int32](2), // IPTags: []*armcompute.VirtualMachineIPTag{ // { // IPTagType: to.Ptr("aaaaaaaaaaaaaaaaaaaaaaaaa"), // Tag: to.Ptr("aaaaaaaaaaaaaaaaaaaa"), // }}, // PublicIPAddressVersion: to.Ptr(armcompute.IPVersionsIPv4), // PublicIPAllocationMethod: to.Ptr(armcompute.PublicIPAllocationMethodDynamic), // PublicIPPrefix: &armcompute.SubResource{ // ID: to.Ptr("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/availabilitySets/{availabilitySetName}"), // }, // }, // SKU: &armcompute.PublicIPAddressSKU{ // Name: to.Ptr(armcompute.PublicIPAddressSKUNameBasic), // Tier: to.Ptr(armcompute.PublicIPAddressSKUTierRegional), // }, // }, // Subnet: &armcompute.SubResource{ // ID: to.Ptr("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/availabilitySets/{availabilitySetName}"), // }, // }, // }}, // NetworkSecurityGroup: &armcompute.SubResource{ // ID: to.Ptr("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/availabilitySets/{availabilitySetName}"), // }, // Primary: to.Ptr(true), // }, // }}, // NetworkInterfaces: []*armcompute.NetworkInterfaceReference{ // { // ID: to.Ptr("/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/virtualMachineScaleSets/{vmss-name}/virtualMachines/0/networkInterfaces/vmsstestnetconfig5415"), // Properties: &armcompute.NetworkInterfaceReferenceProperties{ // DeleteOption: to.Ptr(armcompute.DeleteOptionsDelete), // Primary: to.Ptr(true), // }, // }}, // }, // NetworkProfileConfiguration: &armcompute.VirtualMachineScaleSetVMNetworkProfileConfiguration{ // NetworkInterfaceConfigurations: []*armcompute.VirtualMachineScaleSetNetworkConfiguration{ // { // Name: to.Ptr("vmsstestnetconfig5415"), // Properties: &armcompute.VirtualMachineScaleSetNetworkConfigurationProperties{ // DeleteOption: to.Ptr(armcompute.DeleteOptionsDelete), // DNSSettings: &armcompute.VirtualMachineScaleSetNetworkConfigurationDNSSettings{ // DNSServers: []*string{ // }, // }, // EnableAcceleratedNetworking: to.Ptr(true), // EnableFpga: to.Ptr(true), // EnableIPForwarding: to.Ptr(true), // IPConfigurations: []*armcompute.VirtualMachineScaleSetIPConfiguration{ // { // Name: to.Ptr("vmsstestnetconfig9693"), // Properties: &armcompute.VirtualMachineScaleSetIPConfigurationProperties{ // ApplicationGatewayBackendAddressPools: []*armcompute.SubResource{ // { // ID: to.Ptr("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/availabilitySets/{availabilitySetName}"), // }}, // ApplicationSecurityGroups: []*armcompute.SubResource{ // { // ID: to.Ptr("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/availabilitySets/{availabilitySetName}"), // }}, // LoadBalancerBackendAddressPools: []*armcompute.SubResource{ // { // ID: to.Ptr("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/availabilitySets/{availabilitySetName}"), // }}, // LoadBalancerInboundNatPools: []*armcompute.SubResource{ // { // ID: to.Ptr("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/availabilitySets/{availabilitySetName}"), // }}, // Primary: to.Ptr(true), // PrivateIPAddressVersion: to.Ptr(armcompute.IPVersionIPv4), // PublicIPAddressConfiguration: &armcompute.VirtualMachineScaleSetPublicIPAddressConfiguration{ // Name: to.Ptr("aaaaaaaaaaaaaaaaaa"), // Properties: &armcompute.VirtualMachineScaleSetPublicIPAddressConfigurationProperties{ // DeleteOption: to.Ptr(armcompute.DeleteOptionsDelete), // DNSSettings: &armcompute.VirtualMachineScaleSetPublicIPAddressConfigurationDNSSettings{ // DomainNameLabel: to.Ptr("aaaaaaaaaaaaaaaaaa"), // }, // IdleTimeoutInMinutes: to.Ptr[int32](18), // IPTags: []*armcompute.VirtualMachineScaleSetIPTag{ // { // IPTagType: to.Ptr("aaaaaaa"), // Tag: to.Ptr("aaaaaaaaaaaaaaaaaaaaaaaaaaa"), // }}, // PublicIPAddressVersion: to.Ptr(armcompute.IPVersionIPv4), // PublicIPPrefix: &armcompute.SubResource{ // ID: to.Ptr("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/availabilitySets/{availabilitySetName}"), // }, // }, // SKU: &armcompute.PublicIPAddressSKU{ // Name: to.Ptr(armcompute.PublicIPAddressSKUNameBasic), // Tier: to.Ptr(armcompute.PublicIPAddressSKUTierRegional), // }, // }, // Subnet: &armcompute.APIEntityReference{ // ID: to.Ptr("/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/virtualNetworks/vn4071/subnets/sn5503"), // }, // }, // }}, // NetworkSecurityGroup: &armcompute.SubResource{ // ID: to.Ptr("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/availabilitySets/{availabilitySetName}"), // }, // Primary: to.Ptr(true), // }, // }}, // }, // OSProfile: &armcompute.OSProfile{ // AdminUsername: to.Ptr("Foo12"), // AllowExtensionOperations: to.Ptr(true), // ComputerName: to.Ptr("test000000"), // CustomData: to.Ptr("aaaa"), // LinuxConfiguration: &armcompute.LinuxConfiguration{ // DisablePasswordAuthentication: to.Ptr(true), // PatchSettings: &armcompute.LinuxPatchSettings{ // AssessmentMode: to.Ptr(armcompute.LinuxPatchAssessmentModeImageDefault), // PatchMode: to.Ptr(armcompute.LinuxVMGuestPatchModeImageDefault), // }, // ProvisionVMAgent: to.Ptr(true), // SSH: &armcompute.SSHConfiguration{ // PublicKeys: []*armcompute.SSHPublicKey{ // { // Path: to.Ptr("aaa"), // KeyData: to.Ptr("aaaaaa"), // }}, // }, // }, // RequireGuestProvisionSignal: to.Ptr(true), // Secrets: []*armcompute.VaultSecretGroup{ // }, // WindowsConfiguration: &armcompute.WindowsConfiguration{ // AdditionalUnattendContent: []*armcompute.AdditionalUnattendContent{ // { // ComponentName: to.Ptr("Microsoft-Windows-Shell-Setup"), // Content: to.Ptr("aaaaaaaaaaaaaaaaaaaa"), // PassName: to.Ptr("OobeSystem"), // SettingName: to.Ptr(armcompute.SettingNamesAutoLogon), // }}, // EnableAutomaticUpdates: to.Ptr(true), // PatchSettings: &armcompute.PatchSettings{ // AssessmentMode: to.Ptr(armcompute.WindowsPatchAssessmentModeImageDefault), // EnableHotpatching: to.Ptr(true), // PatchMode: to.Ptr(armcompute.WindowsVMGuestPatchModeManual), // }, // ProvisionVMAgent: to.Ptr(true), // TimeZone: to.Ptr("aaaaaaaaaaaaaaaaaaaaaaaaaaa"), // WinRM: &armcompute.WinRMConfiguration{ // Listeners: []*armcompute.WinRMListener{ // { // CertificateURL: to.Ptr("aaaaaaaaaaaaaaaaaaaaaa"), // Protocol: to.Ptr(armcompute.ProtocolTypesHTTP), // }}, // }, // }, // }, // ProtectionPolicy: &armcompute.VirtualMachineScaleSetVMProtectionPolicy{ // ProtectFromScaleIn: to.Ptr(true), // ProtectFromScaleSetActions: to.Ptr(true), // }, // ProvisioningState: to.Ptr("Succeeded"), // SecurityProfile: &armcompute.SecurityProfile{ // EncryptionAtHost: to.Ptr(true), // SecurityType: to.Ptr(armcompute.SecurityTypesTrustedLaunch), // UefiSettings: &armcompute.UefiSettings{ // SecureBootEnabled: to.Ptr(true), // VTpmEnabled: to.Ptr(true), // }, // }, // StorageProfile: &armcompute.StorageProfile{ // DataDisks: []*armcompute.DataDisk{ // { // Name: to.Ptr("vmss3176_vmss3176_0_disk2_6c4f554bdafa49baa780eb2d128ff39d"), // Caching: to.Ptr(armcompute.CachingTypesNone), // CreateOption: to.Ptr(armcompute.DiskCreateOptionTypesEmpty), // DeleteOption: to.Ptr(armcompute.DiskDeleteOptionTypesDelete), // DetachOption: to.Ptr(armcompute.DiskDetachOptionTypesForceDetach), // DiskIOPSReadWrite: to.Ptr[int64](18), // DiskMBpsReadWrite: to.Ptr[int64](29), // DiskSizeGB: to.Ptr[int32](128), // Image: &armcompute.VirtualHardDisk{ // URI: to.Ptr("https://{storageAccountName}.blob.core.windows.net/{containerName}/{vhdName}.vhd"), // }, // Lun: to.Ptr[int32](1), // ManagedDisk: &armcompute.ManagedDiskParameters{ // ID: to.Ptr("/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/disks/vmss3176_vmss3176_0_disk2_6c4f554bdafa49baa780eb2d128ff39d"), // DiskEncryptionSet: &armcompute.DiskEncryptionSetParameters{ // ID: to.Ptr("aaaaaaaaaaaa"), // }, // StorageAccountType: to.Ptr(armcompute.StorageAccountTypesStandardLRS), // }, // ToBeDetached: to.Ptr(true), // Vhd: &armcompute.VirtualHardDisk{ // URI: to.Ptr("https://{storageAccountName}.blob.core.windows.net/{containerName}/{vhdName}.vhd"), // }, // WriteAcceleratorEnabled: to.Ptr(true), // }}, // ImageReference: &armcompute.ImageReference{ // ID: to.Ptr("a"), // ExactVersion: to.Ptr("4.127.20180315"), // Offer: to.Ptr("WindowsServer"), // Publisher: to.Ptr("MicrosoftWindowsServer"), // SharedGalleryImageID: to.Ptr("aaaaaaaaaaaaaaaaaaaa"), // SKU: to.Ptr("2012-R2-Datacenter"), // Version: to.Ptr("4.127.20180315"), // }, // OSDisk: &armcompute.OSDisk{ // Name: to.Ptr("vmss3176_vmss3176_0_OsDisk_1_6d72b805e50e4de6830303c5055077fc"), // Caching: to.Ptr(armcompute.CachingTypesNone), // CreateOption: to.Ptr(armcompute.DiskCreateOptionTypesFromImage), // DeleteOption: to.Ptr(armcompute.DiskDeleteOptionTypesDelete), // DiffDiskSettings: &armcompute.DiffDiskSettings{ // Option: to.Ptr(armcompute.DiffDiskOptionsLocal), // Placement: to.Ptr(armcompute.DiffDiskPlacementCacheDisk), // }, // DiskSizeGB: to.Ptr[int32](127), // EncryptionSettings: &armcompute.DiskEncryptionSettings{ // DiskEncryptionKey: &armcompute.KeyVaultSecretReference{ // SecretURL: to.Ptr("aaaaaaaa"), // SourceVault: &armcompute.SubResource{ // ID: to.Ptr("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/availabilitySets/{availabilitySetName}"), // }, // }, // Enabled: to.Ptr(true), // KeyEncryptionKey: &armcompute.KeyVaultKeyReference{ // KeyURL: to.Ptr("aaaaaaaaaaaaaa"), // SourceVault: &armcompute.SubResource{ // ID: to.Ptr("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/availabilitySets/{availabilitySetName}"), // }, // }, // }, // Image: &armcompute.VirtualHardDisk{ // URI: to.Ptr("https://{storageAccountName}.blob.core.windows.net/{containerName}/{vhdName}.vhd"), // }, // ManagedDisk: &armcompute.ManagedDiskParameters{ // ID: to.Ptr("/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/disks/vmss3176_vmss3176_0_OsDisk_1_6d72b805e50e4de6830303c5055077fc"), // DiskEncryptionSet: &armcompute.DiskEncryptionSetParameters{ // ID: to.Ptr("aaaaaaaaaaaa"), // }, // StorageAccountType: to.Ptr(armcompute.StorageAccountTypesStandardLRS), // }, // OSType: to.Ptr(armcompute.OperatingSystemTypesWindows), // Vhd: &armcompute.VirtualHardDisk{ // URI: to.Ptr("https://{storageAccountName}.blob.core.windows.net/{containerName}/{vhdName}.vhd"), // }, // WriteAcceleratorEnabled: to.Ptr(true), // }, // }, // TimeCreated: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-06-27T01:02:38.313Z"); return t}()), // UserData: to.Ptr("RXhhbXBsZSBVc2VyRGF0YQ=="), // VMID: to.Ptr("42af9fdf-b906-4ad7-9905-8316209ff619"), // }, // Resources: []*armcompute.VirtualMachineExtension{ // { // Name: to.Ptr("CustomScriptExtension-DSC"), // Type: to.Ptr("Microsoft.Compute/virtualMachines/extensions"), // ID: to.Ptr("/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/virtualMachines/myVM/extensions/CustomScriptExtension-DSC"), // Location: to.Ptr("westus"), // Tags: map[string]*string{ // }, // Properties: &armcompute.VirtualMachineExtensionProperties{ // Type: to.Ptr("CustomScriptExtension"), // AutoUpgradeMinorVersion: to.Ptr(true), // EnableAutomaticUpgrade: to.Ptr(true), // ForceUpdateTag: to.Ptr("aaaaaaa"), // InstanceView: &armcompute.VirtualMachineExtensionInstanceView{ // Name: to.Ptr("aaaaaaaaaaaaaaaaa"), // Type: to.Ptr("aaaaaaaaa"), // Statuses: []*armcompute.InstanceViewStatus{ // { // Code: to.Ptr("aaaaaaaaaaaaaaaaaaaaaaa"), // DisplayStatus: to.Ptr("aaaaaa"), // Level: to.Ptr(armcompute.StatusLevelTypesInfo), // Message: to.Ptr("a"), // Time: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-11-30T12:58:26.522Z"); return t}()), // }}, // Substatuses: []*armcompute.InstanceViewStatus{ // { // Code: to.Ptr("aaaaaaaaaaaaaaaaaaaaaaa"), // DisplayStatus: to.Ptr("aaaaaa"), // Level: to.Ptr(armcompute.StatusLevelTypesInfo), // Message: to.Ptr("a"), // Time: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-11-30T12:58:26.522Z"); return t}()), // }}, // TypeHandlerVersion: to.Ptr("aaaaaaaaaaaaaaaaaaaaaaaaaa"), // }, // ProtectedSettings: map[string]any{ // }, // ProvisioningState: to.Ptr("Succeeded"), // Publisher: to.Ptr("Microsoft.Compute"), // Settings: map[string]any{ // }, // SuppressFailures: to.Ptr(true), // TypeHandlerVersion: to.Ptr("1.9"), // }, // }}, // SKU: &armcompute.SKU{ // Name: to.Ptr("Classic"), // Capacity: to.Ptr[int64](29), // Tier: to.Ptr("aaaaaaaaaaaaaa"), // }, // Zones: []*string{ // to.Ptr("a")}, // }}, // } }
Output:
Example (VirtualMachineScaleSetVmListMinimumSetGen) ¶
Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/92de53a5f1e0e03c94b40475d2135d97148ed014/specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-03-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSetVM_List_MinimumSet_Gen.json
cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() clientFactory, err := armcompute.NewClientFactory("<subscription-id>", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } pager := clientFactory.NewVirtualMachineScaleSetVMsClient().NewListPager("rgcompute", "aaaaaaaaaaaaaaaaaaaaaaaaaaaa", &armcompute.VirtualMachineScaleSetVMsClientListOptions{Filter: nil, Select: nil, Expand: nil, }) for pager.More() { page, err := pager.NextPage(ctx) if err != nil { log.Fatalf("failed to advance page: %v", err) } for _, v := range page.Value { // You could use page here. We use blank identifier for just demo purposes. _ = v } // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. // page.VirtualMachineScaleSetVMListResult = armcompute.VirtualMachineScaleSetVMListResult{ // Value: []*armcompute.VirtualMachineScaleSetVM{ // { // ID: to.Ptr("/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/virtualMachineScaleSets/{vmss-name}/virtualMachines/0"), // Location: to.Ptr("westus"), // }}, // } }
Output:
func (*VirtualMachineScaleSetVMsClient) RetrieveBootDiagnosticsData ¶
func (client *VirtualMachineScaleSetVMsClient) RetrieveBootDiagnosticsData(ctx context.Context, resourceGroupName string, vmScaleSetName string, instanceID string, options *VirtualMachineScaleSetVMsClientRetrieveBootDiagnosticsDataOptions) (VirtualMachineScaleSetVMsClientRetrieveBootDiagnosticsDataResponse, error)
RetrieveBootDiagnosticsData - The operation to retrieve SAS URIs of boot diagnostic logs for a virtual machine in a VM scale set. If the operation fails it returns an *azcore.ResponseError type.
Generated from API version 2024-03-01
- resourceGroupName - The name of the resource group.
- vmScaleSetName - The name of the VM scale set.
- instanceID - The instance ID of the virtual machine.
- options - VirtualMachineScaleSetVMsClientRetrieveBootDiagnosticsDataOptions contains the optional parameters for the VirtualMachineScaleSetVMsClient.RetrieveBootDiagnosticsData method.
Example ¶
Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/92de53a5f1e0e03c94b40475d2135d97148ed014/specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-03-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSetVM_RetrieveBootDiagnosticsData.json
cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() clientFactory, err := armcompute.NewClientFactory("<subscription-id>", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } res, err := clientFactory.NewVirtualMachineScaleSetVMsClient().RetrieveBootDiagnosticsData(ctx, "ResourceGroup", "myvmScaleSet", "0", &armcompute.VirtualMachineScaleSetVMsClientRetrieveBootDiagnosticsDataOptions{SasURIExpirationTimeInMinutes: to.Ptr[int32](60)}) if err != nil { log.Fatalf("failed to finish the request: %v", err) } // You could use response here. We use blank identifier for just demo purposes. _ = res // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. // res.RetrieveBootDiagnosticsDataResult = armcompute.RetrieveBootDiagnosticsDataResult{ // ConsoleScreenshotBlobURI: to.Ptr("https://storageuri/myvmScaleSetinstance.screenshot.bmp?{saskey}"), // SerialConsoleLogBlobURI: to.Ptr("https://storageuri/myvmScaleSetinstance.serialconsole.log?{saskey}"), // }
Output:
func (*VirtualMachineScaleSetVMsClient) SimulateEviction ¶
func (client *VirtualMachineScaleSetVMsClient) SimulateEviction(ctx context.Context, resourceGroupName string, vmScaleSetName string, instanceID string, options *VirtualMachineScaleSetVMsClientSimulateEvictionOptions) (VirtualMachineScaleSetVMsClientSimulateEvictionResponse, error)
SimulateEviction - The operation to simulate the eviction of spot virtual machine in a VM scale set. If the operation fails it returns an *azcore.ResponseError type.
Generated from API version 2024-03-01
- resourceGroupName - The name of the resource group.
- vmScaleSetName - The name of the VM scale set.
- instanceID - The instance ID of the virtual machine.
- options - VirtualMachineScaleSetVMsClientSimulateEvictionOptions contains the optional parameters for the VirtualMachineScaleSetVMsClient.SimulateEviction method.
Example ¶
Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/92de53a5f1e0e03c94b40475d2135d97148ed014/specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-03-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSetVM_SimulateEviction.json
cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() clientFactory, err := armcompute.NewClientFactory("<subscription-id>", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } _, err = clientFactory.NewVirtualMachineScaleSetVMsClient().SimulateEviction(ctx, "ResourceGroup", "VmScaleSetName", "InstanceId", nil) if err != nil { log.Fatalf("failed to finish the request: %v", err) }
Output:
type VirtualMachineScaleSetVMsClientApproveRollingUpgradeResponse ¶ added in v5.4.0
type VirtualMachineScaleSetVMsClientApproveRollingUpgradeResponse struct { }
VirtualMachineScaleSetVMsClientApproveRollingUpgradeResponse contains the response from method VirtualMachineScaleSetVMsClient.BeginApproveRollingUpgrade.
type VirtualMachineScaleSetVMsClientAttachDetachDataDisksResponse ¶ added in v5.4.0
type VirtualMachineScaleSetVMsClientAttachDetachDataDisksResponse struct { // Specifies the storage settings for the virtual machine disks. StorageProfile }
VirtualMachineScaleSetVMsClientAttachDetachDataDisksResponse contains the response from method VirtualMachineScaleSetVMsClient.BeginAttachDetachDataDisks.
type VirtualMachineScaleSetVMsClientBeginApproveRollingUpgradeOptions ¶ added in v5.4.0
type VirtualMachineScaleSetVMsClientBeginApproveRollingUpgradeOptions struct { // Resumes the LRO from the provided token. ResumeToken string }
VirtualMachineScaleSetVMsClientBeginApproveRollingUpgradeOptions contains the optional parameters for the VirtualMachineScaleSetVMsClient.BeginApproveRollingUpgrade method.
type VirtualMachineScaleSetVMsClientBeginAttachDetachDataDisksOptions ¶ added in v5.4.0
type VirtualMachineScaleSetVMsClientBeginAttachDetachDataDisksOptions struct { // Resumes the LRO from the provided token. ResumeToken string }
VirtualMachineScaleSetVMsClientBeginAttachDetachDataDisksOptions contains the optional parameters for the VirtualMachineScaleSetVMsClient.BeginAttachDetachDataDisks method.
type VirtualMachineScaleSetVMsClientBeginDeallocateOptions ¶
type VirtualMachineScaleSetVMsClientBeginDeallocateOptions struct { // Resumes the LRO from the provided token. ResumeToken string }
VirtualMachineScaleSetVMsClientBeginDeallocateOptions contains the optional parameters for the VirtualMachineScaleSetVMsClient.BeginDeallocate method.
type VirtualMachineScaleSetVMsClientBeginDeleteOptions ¶
type VirtualMachineScaleSetVMsClientBeginDeleteOptions struct { // Optional parameter to force delete a virtual machine from a VM scale set. (Feature in Preview) ForceDeletion *bool // Resumes the LRO from the provided token. ResumeToken string }
VirtualMachineScaleSetVMsClientBeginDeleteOptions contains the optional parameters for the VirtualMachineScaleSetVMsClient.BeginDelete method.
type VirtualMachineScaleSetVMsClientBeginPerformMaintenanceOptions ¶
type VirtualMachineScaleSetVMsClientBeginPerformMaintenanceOptions struct { // Resumes the LRO from the provided token. ResumeToken string }
VirtualMachineScaleSetVMsClientBeginPerformMaintenanceOptions contains the optional parameters for the VirtualMachineScaleSetVMsClient.BeginPerformMaintenance method.
type VirtualMachineScaleSetVMsClientBeginPowerOffOptions ¶
type VirtualMachineScaleSetVMsClientBeginPowerOffOptions struct { // Resumes the LRO from the provided token. ResumeToken string // The parameter to request non-graceful VM shutdown. True value for this flag indicates non-graceful shutdown whereas false // indicates otherwise. Default value for this flag is false if not specified SkipShutdown *bool }
VirtualMachineScaleSetVMsClientBeginPowerOffOptions contains the optional parameters for the VirtualMachineScaleSetVMsClient.BeginPowerOff method.
type VirtualMachineScaleSetVMsClientBeginRedeployOptions ¶
type VirtualMachineScaleSetVMsClientBeginRedeployOptions struct { // Resumes the LRO from the provided token. ResumeToken string }
VirtualMachineScaleSetVMsClientBeginRedeployOptions contains the optional parameters for the VirtualMachineScaleSetVMsClient.BeginRedeploy method.
type VirtualMachineScaleSetVMsClientBeginReimageAllOptions ¶
type VirtualMachineScaleSetVMsClientBeginReimageAllOptions struct { // Resumes the LRO from the provided token. ResumeToken string }
VirtualMachineScaleSetVMsClientBeginReimageAllOptions contains the optional parameters for the VirtualMachineScaleSetVMsClient.BeginReimageAll method.
type VirtualMachineScaleSetVMsClientBeginReimageOptions ¶
type VirtualMachineScaleSetVMsClientBeginReimageOptions struct { // Resumes the LRO from the provided token. ResumeToken string // Parameters for the Reimaging Virtual machine in ScaleSet. VMScaleSetVMReimageInput *VirtualMachineScaleSetVMReimageParameters }
VirtualMachineScaleSetVMsClientBeginReimageOptions contains the optional parameters for the VirtualMachineScaleSetVMsClient.BeginReimage method.
type VirtualMachineScaleSetVMsClientBeginRestartOptions ¶
type VirtualMachineScaleSetVMsClientBeginRestartOptions struct { // Resumes the LRO from the provided token. ResumeToken string }
VirtualMachineScaleSetVMsClientBeginRestartOptions contains the optional parameters for the VirtualMachineScaleSetVMsClient.BeginRestart method.
type VirtualMachineScaleSetVMsClientBeginRunCommandOptions ¶
type VirtualMachineScaleSetVMsClientBeginRunCommandOptions struct { // Resumes the LRO from the provided token. ResumeToken string }
VirtualMachineScaleSetVMsClientBeginRunCommandOptions contains the optional parameters for the VirtualMachineScaleSetVMsClient.BeginRunCommand method.
type VirtualMachineScaleSetVMsClientBeginStartOptions ¶
type VirtualMachineScaleSetVMsClientBeginStartOptions struct { // Resumes the LRO from the provided token. ResumeToken string }
VirtualMachineScaleSetVMsClientBeginStartOptions contains the optional parameters for the VirtualMachineScaleSetVMsClient.BeginStart method.
type VirtualMachineScaleSetVMsClientBeginUpdateOptions ¶
type VirtualMachineScaleSetVMsClientBeginUpdateOptions struct { // The ETag of the transformation. Omit this value to always overwrite the current resource. Specify the last-seen ETag value // to prevent accidentally overwriting concurrent changes. IfMatch *string // Set to '*' to allow a new record set to be created, but to prevent updating an existing record set. Other values will result // in error from server as they are not supported. IfNoneMatch *string // Resumes the LRO from the provided token. ResumeToken string }
VirtualMachineScaleSetVMsClientBeginUpdateOptions contains the optional parameters for the VirtualMachineScaleSetVMsClient.BeginUpdate method.
type VirtualMachineScaleSetVMsClientDeallocateResponse ¶
type VirtualMachineScaleSetVMsClientDeallocateResponse struct { }
VirtualMachineScaleSetVMsClientDeallocateResponse contains the response from method VirtualMachineScaleSetVMsClient.BeginDeallocate.
type VirtualMachineScaleSetVMsClientDeleteResponse ¶
type VirtualMachineScaleSetVMsClientDeleteResponse struct { }
VirtualMachineScaleSetVMsClientDeleteResponse contains the response from method VirtualMachineScaleSetVMsClient.BeginDelete.
type VirtualMachineScaleSetVMsClientGetInstanceViewOptions ¶
type VirtualMachineScaleSetVMsClientGetInstanceViewOptions struct { }
VirtualMachineScaleSetVMsClientGetInstanceViewOptions contains the optional parameters for the VirtualMachineScaleSetVMsClient.GetInstanceView method.
type VirtualMachineScaleSetVMsClientGetInstanceViewResponse ¶
type VirtualMachineScaleSetVMsClientGetInstanceViewResponse struct { // The instance view of a virtual machine scale set VM. VirtualMachineScaleSetVMInstanceView }
VirtualMachineScaleSetVMsClientGetInstanceViewResponse contains the response from method VirtualMachineScaleSetVMsClient.GetInstanceView.
type VirtualMachineScaleSetVMsClientGetOptions ¶
type VirtualMachineScaleSetVMsClientGetOptions struct { // The expand expression to apply on the operation. 'InstanceView' will retrieve the instance view of the virtual machine. // 'UserData' will retrieve the UserData of the virtual machine. Expand *InstanceViewTypes }
VirtualMachineScaleSetVMsClientGetOptions contains the optional parameters for the VirtualMachineScaleSetVMsClient.Get method.
type VirtualMachineScaleSetVMsClientGetResponse ¶
type VirtualMachineScaleSetVMsClientGetResponse struct { // Describes a virtual machine scale set virtual machine. VirtualMachineScaleSetVM }
VirtualMachineScaleSetVMsClientGetResponse contains the response from method VirtualMachineScaleSetVMsClient.Get.
type VirtualMachineScaleSetVMsClientListOptions ¶
type VirtualMachineScaleSetVMsClientListOptions struct { // The expand expression to apply to the operation. Allowed values are 'instanceView'. Expand *string // The filter to apply to the operation. Allowed values are 'startswith(instanceView/statuses/code, 'PowerState') eq true', // 'properties/latestModelApplied eq true', 'properties/latestModelApplied eq // false'. Filter *string // The list parameters. Allowed values are 'instanceView', 'instanceView/statuses'. Select *string }
VirtualMachineScaleSetVMsClientListOptions contains the optional parameters for the VirtualMachineScaleSetVMsClient.NewListPager method.
type VirtualMachineScaleSetVMsClientListResponse ¶
type VirtualMachineScaleSetVMsClientListResponse struct { // The List Virtual Machine Scale Set VMs operation response. VirtualMachineScaleSetVMListResult }
VirtualMachineScaleSetVMsClientListResponse contains the response from method VirtualMachineScaleSetVMsClient.NewListPager.
type VirtualMachineScaleSetVMsClientPerformMaintenanceResponse ¶
type VirtualMachineScaleSetVMsClientPerformMaintenanceResponse struct { }
VirtualMachineScaleSetVMsClientPerformMaintenanceResponse contains the response from method VirtualMachineScaleSetVMsClient.BeginPerformMaintenance.
type VirtualMachineScaleSetVMsClientPowerOffResponse ¶
type VirtualMachineScaleSetVMsClientPowerOffResponse struct { }
VirtualMachineScaleSetVMsClientPowerOffResponse contains the response from method VirtualMachineScaleSetVMsClient.BeginPowerOff.
type VirtualMachineScaleSetVMsClientRedeployResponse ¶
type VirtualMachineScaleSetVMsClientRedeployResponse struct { }
VirtualMachineScaleSetVMsClientRedeployResponse contains the response from method VirtualMachineScaleSetVMsClient.BeginRedeploy.
type VirtualMachineScaleSetVMsClientReimageAllResponse ¶
type VirtualMachineScaleSetVMsClientReimageAllResponse struct { }
VirtualMachineScaleSetVMsClientReimageAllResponse contains the response from method VirtualMachineScaleSetVMsClient.BeginReimageAll.
type VirtualMachineScaleSetVMsClientReimageResponse ¶
type VirtualMachineScaleSetVMsClientReimageResponse struct { }
VirtualMachineScaleSetVMsClientReimageResponse contains the response from method VirtualMachineScaleSetVMsClient.BeginReimage.
type VirtualMachineScaleSetVMsClientRestartResponse ¶
type VirtualMachineScaleSetVMsClientRestartResponse struct { }
VirtualMachineScaleSetVMsClientRestartResponse contains the response from method VirtualMachineScaleSetVMsClient.BeginRestart.
type VirtualMachineScaleSetVMsClientRetrieveBootDiagnosticsDataOptions ¶
type VirtualMachineScaleSetVMsClientRetrieveBootDiagnosticsDataOptions struct { // Expiration duration in minutes for the SAS URIs with a value between 1 to 1440 minutes. Note: If not specified, SAS URIs // will be generated with a default expiration duration of 120 minutes. SasURIExpirationTimeInMinutes *int32 }
VirtualMachineScaleSetVMsClientRetrieveBootDiagnosticsDataOptions contains the optional parameters for the VirtualMachineScaleSetVMsClient.RetrieveBootDiagnosticsData method.
type VirtualMachineScaleSetVMsClientRetrieveBootDiagnosticsDataResponse ¶
type VirtualMachineScaleSetVMsClientRetrieveBootDiagnosticsDataResponse struct { // The SAS URIs of the console screenshot and serial log blobs. RetrieveBootDiagnosticsDataResult }
VirtualMachineScaleSetVMsClientRetrieveBootDiagnosticsDataResponse contains the response from method VirtualMachineScaleSetVMsClient.RetrieveBootDiagnosticsData.
type VirtualMachineScaleSetVMsClientRunCommandResponse ¶
type VirtualMachineScaleSetVMsClientRunCommandResponse struct {
RunCommandResult
}
VirtualMachineScaleSetVMsClientRunCommandResponse contains the response from method VirtualMachineScaleSetVMsClient.BeginRunCommand.
type VirtualMachineScaleSetVMsClientSimulateEvictionOptions ¶
type VirtualMachineScaleSetVMsClientSimulateEvictionOptions struct { }
VirtualMachineScaleSetVMsClientSimulateEvictionOptions contains the optional parameters for the VirtualMachineScaleSetVMsClient.SimulateEviction method.
type VirtualMachineScaleSetVMsClientSimulateEvictionResponse ¶
type VirtualMachineScaleSetVMsClientSimulateEvictionResponse struct { }
VirtualMachineScaleSetVMsClientSimulateEvictionResponse contains the response from method VirtualMachineScaleSetVMsClient.SimulateEviction.
type VirtualMachineScaleSetVMsClientStartResponse ¶
type VirtualMachineScaleSetVMsClientStartResponse struct { }
VirtualMachineScaleSetVMsClientStartResponse contains the response from method VirtualMachineScaleSetVMsClient.BeginStart.
type VirtualMachineScaleSetVMsClientUpdateResponse ¶
type VirtualMachineScaleSetVMsClientUpdateResponse struct { // Describes a virtual machine scale set virtual machine. VirtualMachineScaleSetVM }
VirtualMachineScaleSetVMsClientUpdateResponse contains the response from method VirtualMachineScaleSetVMsClient.BeginUpdate.
type VirtualMachineScaleSetsClient ¶
type VirtualMachineScaleSetsClient struct {
// contains filtered or unexported fields
}
VirtualMachineScaleSetsClient contains the methods for the VirtualMachineScaleSets group. Don't use this type directly, use NewVirtualMachineScaleSetsClient() instead.
func NewVirtualMachineScaleSetsClient ¶
func NewVirtualMachineScaleSetsClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*VirtualMachineScaleSetsClient, error)
NewVirtualMachineScaleSetsClient creates a new instance of VirtualMachineScaleSetsClient 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 (*VirtualMachineScaleSetsClient) BeginApproveRollingUpgrade ¶ added in v5.4.0
func (client *VirtualMachineScaleSetsClient) BeginApproveRollingUpgrade(ctx context.Context, resourceGroupName string, vmScaleSetName string, options *VirtualMachineScaleSetsClientBeginApproveRollingUpgradeOptions) (*runtime.Poller[VirtualMachineScaleSetsClientApproveRollingUpgradeResponse], error)
BeginApproveRollingUpgrade - Approve upgrade on deferred rolling upgrades for OS disks in the virtual machines in a VM scale set. If the operation fails it returns an *azcore.ResponseError type.
Generated from API version 2024-03-01
- resourceGroupName - The name of the resource group.
- vmScaleSetName - The name of the VM scale set.
- options - VirtualMachineScaleSetsClientBeginApproveRollingUpgradeOptions contains the optional parameters for the VirtualMachineScaleSetsClient.BeginApproveRollingUpgrade method.
Example ¶
Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/92de53a5f1e0e03c94b40475d2135d97148ed014/specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-03-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSet_ApproveRollingUpgrade.json
cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() clientFactory, err := armcompute.NewClientFactory("<subscription-id>", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } poller, err := clientFactory.NewVirtualMachineScaleSetsClient().BeginApproveRollingUpgrade(ctx, "rgcompute", "vmssToApproveRollingUpgradeOn", &armcompute.VirtualMachineScaleSetsClientBeginApproveRollingUpgradeOptions{VMInstanceIDs: &armcompute.VirtualMachineScaleSetVMInstanceIDs{ InstanceIDs: []*string{ to.Ptr("0"), to.Ptr("1"), to.Ptr("2")}, }, }) if err != nil { log.Fatalf("failed to finish the request: %v", err) } _, err = poller.PollUntilDone(ctx, nil) if err != nil { log.Fatalf("failed to pull the result: %v", err) }
Output:
func (*VirtualMachineScaleSetsClient) BeginCreateOrUpdate ¶
func (client *VirtualMachineScaleSetsClient) BeginCreateOrUpdate(ctx context.Context, resourceGroupName string, vmScaleSetName string, parameters VirtualMachineScaleSet, options *VirtualMachineScaleSetsClientBeginCreateOrUpdateOptions) (*runtime.Poller[VirtualMachineScaleSetsClientCreateOrUpdateResponse], error)
BeginCreateOrUpdate - Create or update a VM scale set. If the operation fails it returns an *azcore.ResponseError type.
Generated from API version 2024-03-01
- resourceGroupName - The name of the resource group.
- vmScaleSetName - The name of the VM scale set to create or update.
- parameters - The scale set object.
- options - VirtualMachineScaleSetsClientBeginCreateOrUpdateOptions contains the optional parameters for the VirtualMachineScaleSetsClient.BeginCreateOrUpdate method.
Example (CreateACustomImageScaleSetFromAnUnmanagedGeneralizedOsImage) ¶
Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/92de53a5f1e0e03c94b40475d2135d97148ed014/specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-03-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSet_Create_CustomImageFromAnUnmanagedGeneralizedOsImage.json
cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() clientFactory, err := armcompute.NewClientFactory("<subscription-id>", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } poller, err := clientFactory.NewVirtualMachineScaleSetsClient().BeginCreateOrUpdate(ctx, "myResourceGroup", "{vmss-name}", armcompute.VirtualMachineScaleSet{ Location: to.Ptr("westus"), Properties: &armcompute.VirtualMachineScaleSetProperties{ Overprovision: to.Ptr(true), UpgradePolicy: &armcompute.UpgradePolicy{ Mode: to.Ptr(armcompute.UpgradeModeManual), }, VirtualMachineProfile: &armcompute.VirtualMachineScaleSetVMProfile{ NetworkProfile: &armcompute.VirtualMachineScaleSetNetworkProfile{ NetworkInterfaceConfigurations: []*armcompute.VirtualMachineScaleSetNetworkConfiguration{ { Name: to.Ptr("{vmss-name}"), Properties: &armcompute.VirtualMachineScaleSetNetworkConfigurationProperties{ EnableIPForwarding: to.Ptr(true), IPConfigurations: []*armcompute.VirtualMachineScaleSetIPConfiguration{ { Name: to.Ptr("{vmss-name}"), Properties: &armcompute.VirtualMachineScaleSetIPConfigurationProperties{ Subnet: &armcompute.APIEntityReference{ ID: to.Ptr("/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/virtualNetworks/{existing-virtual-network-name}/subnets/{existing-subnet-name}"), }, }, }}, Primary: to.Ptr(true), }, }}, }, OSProfile: &armcompute.VirtualMachineScaleSetOSProfile{ AdminPassword: to.Ptr("{your-password}"), AdminUsername: to.Ptr("{your-username}"), ComputerNamePrefix: to.Ptr("{vmss-name}"), }, StorageProfile: &armcompute.VirtualMachineScaleSetStorageProfile{ OSDisk: &armcompute.VirtualMachineScaleSetOSDisk{ Name: to.Ptr("osDisk"), Caching: to.Ptr(armcompute.CachingTypesReadWrite), CreateOption: to.Ptr(armcompute.DiskCreateOptionTypesFromImage), Image: &armcompute.VirtualHardDisk{ URI: to.Ptr("http://{existing-storage-account-name}.blob.core.windows.net/{existing-container-name}/{existing-generalized-os-image-blob-name}.vhd"), }, }, }, }, }, SKU: &armcompute.SKU{ Name: to.Ptr("Standard_D1_v2"), Capacity: to.Ptr[int64](3), Tier: to.Ptr("Standard"), }, }, &armcompute.VirtualMachineScaleSetsClientBeginCreateOrUpdateOptions{IfMatch: nil, IfNoneMatch: nil, }) if err != nil { log.Fatalf("failed to finish the request: %v", err) } res, err := poller.PollUntilDone(ctx, nil) if err != nil { log.Fatalf("failed to pull the result: %v", err) } // You could use response here. We use blank identifier for just demo purposes. _ = res // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. // res.VirtualMachineScaleSet = armcompute.VirtualMachineScaleSet{ // Name: to.Ptr("{vmss-name}"), // Type: to.Ptr("Microsoft.Compute/virtualMachineScaleSets"), // ID: to.Ptr("/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/virtualMachineScaleSets/{vmss-name}"), // Location: to.Ptr("westus"), // Properties: &armcompute.VirtualMachineScaleSetProperties{ // Overprovision: to.Ptr(true), // ProvisioningState: to.Ptr("Succeeded"), // SinglePlacementGroup: to.Ptr(true), // UniqueID: to.Ptr("d6e9ab29-f8c9-4792-978c-ae2c07b98f17"), // UpgradePolicy: &armcompute.UpgradePolicy{ // Mode: to.Ptr(armcompute.UpgradeModeManual), // }, // VirtualMachineProfile: &armcompute.VirtualMachineScaleSetVMProfile{ // NetworkProfile: &armcompute.VirtualMachineScaleSetNetworkProfile{ // NetworkInterfaceConfigurations: []*armcompute.VirtualMachineScaleSetNetworkConfiguration{ // { // Name: to.Ptr("{vmss-name}"), // Properties: &armcompute.VirtualMachineScaleSetNetworkConfigurationProperties{ // DNSSettings: &armcompute.VirtualMachineScaleSetNetworkConfigurationDNSSettings{ // DNSServers: []*string{ // }, // }, // EnableAcceleratedNetworking: to.Ptr(false), // EnableIPForwarding: to.Ptr(true), // IPConfigurations: []*armcompute.VirtualMachineScaleSetIPConfiguration{ // { // Name: to.Ptr("{vmss-name}"), // Properties: &armcompute.VirtualMachineScaleSetIPConfigurationProperties{ // PrivateIPAddressVersion: to.Ptr(armcompute.IPVersionIPv4), // Subnet: &armcompute.APIEntityReference{ // ID: to.Ptr("/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/virtualNetworks/nsgExistingVnet/subnets/nsgExistingSubnet"), // }, // }, // }}, // Primary: to.Ptr(true), // }, // }}, // }, // OSProfile: &armcompute.VirtualMachineScaleSetOSProfile{ // AdminUsername: to.Ptr("{your-username}"), // ComputerNamePrefix: to.Ptr("{vmss-name}"), // Secrets: []*armcompute.VaultSecretGroup{ // }, // WindowsConfiguration: &armcompute.WindowsConfiguration{ // EnableAutomaticUpdates: to.Ptr(true), // ProvisionVMAgent: to.Ptr(true), // }, // }, // StorageProfile: &armcompute.VirtualMachineScaleSetStorageProfile{ // OSDisk: &armcompute.VirtualMachineScaleSetOSDisk{ // Name: to.Ptr("osDisk"), // Caching: to.Ptr(armcompute.CachingTypesReadWrite), // CreateOption: to.Ptr(armcompute.DiskCreateOptionTypesFromImage), // Image: &armcompute.VirtualHardDisk{ // URI: to.Ptr("https://{existing-storage-account-name}.blob.core.windows.net/system/Microsoft.Compute/Images/vhds/{existing-generalized-os-image-blob-name}.vhd"), // }, // OSType: to.Ptr(armcompute.OperatingSystemTypesWindows), // }, // }, // }, // }, // SKU: &armcompute.SKU{ // Name: to.Ptr("Standard_D1_v2"), // Capacity: to.Ptr[int64](3), // Tier: to.Ptr("Standard"), // }, // }
Output:
Example (CreateAPlatformImageScaleSetWithUnmanagedOsDisks) ¶
Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/92de53a5f1e0e03c94b40475d2135d97148ed014/specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-03-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSet_Create_PlatformImageWithUnmanagedOsDisks.json
cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() clientFactory, err := armcompute.NewClientFactory("<subscription-id>", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } poller, err := clientFactory.NewVirtualMachineScaleSetsClient().BeginCreateOrUpdate(ctx, "myResourceGroup", "{vmss-name}", armcompute.VirtualMachineScaleSet{ Location: to.Ptr("westus"), Properties: &armcompute.VirtualMachineScaleSetProperties{ Overprovision: to.Ptr(true), UpgradePolicy: &armcompute.UpgradePolicy{ Mode: to.Ptr(armcompute.UpgradeModeManual), }, VirtualMachineProfile: &armcompute.VirtualMachineScaleSetVMProfile{ NetworkProfile: &armcompute.VirtualMachineScaleSetNetworkProfile{ NetworkInterfaceConfigurations: []*armcompute.VirtualMachineScaleSetNetworkConfiguration{ { Name: to.Ptr("{vmss-name}"), Properties: &armcompute.VirtualMachineScaleSetNetworkConfigurationProperties{ EnableIPForwarding: to.Ptr(true), IPConfigurations: []*armcompute.VirtualMachineScaleSetIPConfiguration{ { Name: to.Ptr("{vmss-name}"), Properties: &armcompute.VirtualMachineScaleSetIPConfigurationProperties{ Subnet: &armcompute.APIEntityReference{ ID: to.Ptr("/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/virtualNetworks/{existing-virtual-network-name}/subnets/{existing-subnet-name}"), }, }, }}, Primary: to.Ptr(true), }, }}, }, OSProfile: &armcompute.VirtualMachineScaleSetOSProfile{ AdminPassword: to.Ptr("{your-password}"), AdminUsername: to.Ptr("{your-username}"), ComputerNamePrefix: to.Ptr("{vmss-name}"), }, StorageProfile: &armcompute.VirtualMachineScaleSetStorageProfile{ ImageReference: &armcompute.ImageReference{ Offer: to.Ptr("WindowsServer"), Publisher: to.Ptr("MicrosoftWindowsServer"), SKU: to.Ptr("2016-Datacenter"), Version: to.Ptr("latest"), }, OSDisk: &armcompute.VirtualMachineScaleSetOSDisk{ Name: to.Ptr("osDisk"), Caching: to.Ptr(armcompute.CachingTypesReadWrite), CreateOption: to.Ptr(armcompute.DiskCreateOptionTypesFromImage), VhdContainers: []*string{ to.Ptr("http://{existing-storage-account-name-0}.blob.core.windows.net/vhdContainer"), to.Ptr("http://{existing-storage-account-name-1}.blob.core.windows.net/vhdContainer"), to.Ptr("http://{existing-storage-account-name-2}.blob.core.windows.net/vhdContainer"), to.Ptr("http://{existing-storage-account-name-3}.blob.core.windows.net/vhdContainer"), to.Ptr("http://{existing-storage-account-name-4}.blob.core.windows.net/vhdContainer")}, }, }, }, }, SKU: &armcompute.SKU{ Name: to.Ptr("Standard_D1_v2"), Capacity: to.Ptr[int64](3), Tier: to.Ptr("Standard"), }, }, &armcompute.VirtualMachineScaleSetsClientBeginCreateOrUpdateOptions{IfMatch: nil, IfNoneMatch: nil, }) if err != nil { log.Fatalf("failed to finish the request: %v", err) } res, err := poller.PollUntilDone(ctx, nil) if err != nil { log.Fatalf("failed to pull the result: %v", err) } // You could use response here. We use blank identifier for just demo purposes. _ = res // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. // res.VirtualMachineScaleSet = armcompute.VirtualMachineScaleSet{ // Name: to.Ptr("{vmss-name}"), // Type: to.Ptr("Microsoft.Compute/virtualMachineScaleSets"), // ID: to.Ptr("/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/virtualMachineScaleSets/{vmss-name}"), // Location: to.Ptr("westus"), // Properties: &armcompute.VirtualMachineScaleSetProperties{ // Overprovision: to.Ptr(true), // ProvisioningState: to.Ptr("Succeeded"), // SinglePlacementGroup: to.Ptr(true), // UniqueID: to.Ptr("77b7df9a-32fe-45e3-8911-60ac9c9b9c64"), // UpgradePolicy: &armcompute.UpgradePolicy{ // Mode: to.Ptr(armcompute.UpgradeModeManual), // }, // VirtualMachineProfile: &armcompute.VirtualMachineScaleSetVMProfile{ // NetworkProfile: &armcompute.VirtualMachineScaleSetNetworkProfile{ // NetworkInterfaceConfigurations: []*armcompute.VirtualMachineScaleSetNetworkConfiguration{ // { // Name: to.Ptr("{vmss-name}"), // Properties: &armcompute.VirtualMachineScaleSetNetworkConfigurationProperties{ // DNSSettings: &armcompute.VirtualMachineScaleSetNetworkConfigurationDNSSettings{ // DNSServers: []*string{ // }, // }, // EnableAcceleratedNetworking: to.Ptr(false), // EnableIPForwarding: to.Ptr(true), // IPConfigurations: []*armcompute.VirtualMachineScaleSetIPConfiguration{ // { // Name: to.Ptr("{vmss-name}"), // Properties: &armcompute.VirtualMachineScaleSetIPConfigurationProperties{ // PrivateIPAddressVersion: to.Ptr(armcompute.IPVersionIPv4), // Subnet: &armcompute.APIEntityReference{ // ID: to.Ptr("/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/virtualNetworks/nsgExistingVnet/subnets/nsgExistingSubnet"), // }, // }, // }}, // Primary: to.Ptr(true), // }, // }}, // }, // OSProfile: &armcompute.VirtualMachineScaleSetOSProfile{ // AdminUsername: to.Ptr("{your-username}"), // ComputerNamePrefix: to.Ptr("{vmss-name}"), // Secrets: []*armcompute.VaultSecretGroup{ // }, // WindowsConfiguration: &armcompute.WindowsConfiguration{ // EnableAutomaticUpdates: to.Ptr(true), // ProvisionVMAgent: to.Ptr(true), // }, // }, // StorageProfile: &armcompute.VirtualMachineScaleSetStorageProfile{ // ImageReference: &armcompute.ImageReference{ // Offer: to.Ptr("WindowsServer"), // Publisher: to.Ptr("MicrosoftWindowsServer"), // SKU: to.Ptr("2016-Datacenter"), // Version: to.Ptr("latest"), // }, // OSDisk: &armcompute.VirtualMachineScaleSetOSDisk{ // Name: to.Ptr("osDisk"), // Caching: to.Ptr(armcompute.CachingTypesReadWrite), // CreateOption: to.Ptr(armcompute.DiskCreateOptionTypesFromImage), // VhdContainers: []*string{ // to.Ptr("http://{existing-storage-account-name}.blob.core.windows.net/vhds")}, // }, // }, // }, // }, // SKU: &armcompute.SKU{ // Name: to.Ptr("Standard_D1_v2"), // Capacity: to.Ptr[int64](3), // Tier: to.Ptr("Standard"), // }, // }
Output:
Example (CreateAScaleSetFromACustomImage) ¶
Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/92de53a5f1e0e03c94b40475d2135d97148ed014/specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-03-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSet_Create_FromACustomImage.json
cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() clientFactory, err := armcompute.NewClientFactory("<subscription-id>", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } poller, err := clientFactory.NewVirtualMachineScaleSetsClient().BeginCreateOrUpdate(ctx, "myResourceGroup", "{vmss-name}", armcompute.VirtualMachineScaleSet{ Location: to.Ptr("westus"), Properties: &armcompute.VirtualMachineScaleSetProperties{ Overprovision: to.Ptr(true), UpgradePolicy: &armcompute.UpgradePolicy{ Mode: to.Ptr(armcompute.UpgradeModeManual), }, VirtualMachineProfile: &armcompute.VirtualMachineScaleSetVMProfile{ NetworkProfile: &armcompute.VirtualMachineScaleSetNetworkProfile{ NetworkInterfaceConfigurations: []*armcompute.VirtualMachineScaleSetNetworkConfiguration{ { Name: to.Ptr("{vmss-name}"), Properties: &armcompute.VirtualMachineScaleSetNetworkConfigurationProperties{ EnableIPForwarding: to.Ptr(true), IPConfigurations: []*armcompute.VirtualMachineScaleSetIPConfiguration{ { Name: to.Ptr("{vmss-name}"), Properties: &armcompute.VirtualMachineScaleSetIPConfigurationProperties{ Subnet: &armcompute.APIEntityReference{ ID: to.Ptr("/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/virtualNetworks/{existing-virtual-network-name}/subnets/{existing-subnet-name}"), }, }, }}, Primary: to.Ptr(true), }, }}, }, OSProfile: &armcompute.VirtualMachineScaleSetOSProfile{ AdminPassword: to.Ptr("{your-password}"), AdminUsername: to.Ptr("{your-username}"), ComputerNamePrefix: to.Ptr("{vmss-name}"), }, StorageProfile: &armcompute.VirtualMachineScaleSetStorageProfile{ ImageReference: &armcompute.ImageReference{ ID: to.Ptr("/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/images/{existing-custom-image-name}"), }, OSDisk: &armcompute.VirtualMachineScaleSetOSDisk{ Caching: to.Ptr(armcompute.CachingTypesReadWrite), CreateOption: to.Ptr(armcompute.DiskCreateOptionTypesFromImage), ManagedDisk: &armcompute.VirtualMachineScaleSetManagedDiskParameters{ StorageAccountType: to.Ptr(armcompute.StorageAccountTypesStandardLRS), }, }, }, }, }, SKU: &armcompute.SKU{ Name: to.Ptr("Standard_D1_v2"), Capacity: to.Ptr[int64](3), Tier: to.Ptr("Standard"), }, }, &armcompute.VirtualMachineScaleSetsClientBeginCreateOrUpdateOptions{IfMatch: nil, IfNoneMatch: nil, }) if err != nil { log.Fatalf("failed to finish the request: %v", err) } res, err := poller.PollUntilDone(ctx, nil) if err != nil { log.Fatalf("failed to pull the result: %v", err) } // You could use response here. We use blank identifier for just demo purposes. _ = res // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. // res.VirtualMachineScaleSet = armcompute.VirtualMachineScaleSet{ // Name: to.Ptr("{vmss-name}"), // Type: to.Ptr("Microsoft.Compute/virtualMachineScaleSets"), // ID: to.Ptr("/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/virtualMachineScaleSets/{vmss-name}"), // Location: to.Ptr("westus"), // Properties: &armcompute.VirtualMachineScaleSetProperties{ // Overprovision: to.Ptr(true), // ProvisioningState: to.Ptr("Succeeded"), // SinglePlacementGroup: to.Ptr(true), // UniqueID: to.Ptr("afa2afa8-9e49-48fb-9d18-c86323b5d064"), // UpgradePolicy: &armcompute.UpgradePolicy{ // Mode: to.Ptr(armcompute.UpgradeModeManual), // }, // VirtualMachineProfile: &armcompute.VirtualMachineScaleSetVMProfile{ // NetworkProfile: &armcompute.VirtualMachineScaleSetNetworkProfile{ // NetworkInterfaceConfigurations: []*armcompute.VirtualMachineScaleSetNetworkConfiguration{ // { // Name: to.Ptr("{vmss-name}"), // Properties: &armcompute.VirtualMachineScaleSetNetworkConfigurationProperties{ // DNSSettings: &armcompute.VirtualMachineScaleSetNetworkConfigurationDNSSettings{ // DNSServers: []*string{ // }, // }, // EnableAcceleratedNetworking: to.Ptr(false), // EnableIPForwarding: to.Ptr(true), // IPConfigurations: []*armcompute.VirtualMachineScaleSetIPConfiguration{ // { // Name: to.Ptr("{vmss-name}"), // Properties: &armcompute.VirtualMachineScaleSetIPConfigurationProperties{ // PrivateIPAddressVersion: to.Ptr(armcompute.IPVersionIPv4), // Subnet: &armcompute.APIEntityReference{ // ID: to.Ptr("/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/virtualNetworks/nsgExistingVnet/subnets/nsgExistingSubnet"), // }, // }, // }}, // Primary: to.Ptr(true), // }, // }}, // }, // OSProfile: &armcompute.VirtualMachineScaleSetOSProfile{ // AdminUsername: to.Ptr("{your-username}"), // ComputerNamePrefix: to.Ptr("{vmss-name}"), // LinuxConfiguration: &armcompute.LinuxConfiguration{ // DisablePasswordAuthentication: to.Ptr(false), // }, // Secrets: []*armcompute.VaultSecretGroup{ // }, // }, // StorageProfile: &armcompute.VirtualMachineScaleSetStorageProfile{ // ImageReference: &armcompute.ImageReference{ // ID: to.Ptr("/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/images/nsgcustom"), // }, // OSDisk: &armcompute.VirtualMachineScaleSetOSDisk{ // Caching: to.Ptr(armcompute.CachingTypesReadWrite), // CreateOption: to.Ptr(armcompute.DiskCreateOptionTypesFromImage), // ManagedDisk: &armcompute.VirtualMachineScaleSetManagedDiskParameters{ // StorageAccountType: to.Ptr(armcompute.StorageAccountTypesStandardLRS), // }, // }, // }, // }, // }, // SKU: &armcompute.SKU{ // Name: to.Ptr("Standard_D1_v2"), // Capacity: to.Ptr[int64](3), // Tier: to.Ptr("Standard"), // }, // }
Output:
Example (CreateAScaleSetWhereNicConfigHasDisableTcpStateTrackingProperty) ¶
Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/92de53a5f1e0e03c94b40475d2135d97148ed014/specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-03-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSet_Create_FromWithDisableTcpStateTrackingNetworkInterface.json
cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() clientFactory, err := armcompute.NewClientFactory("<subscription-id>", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } poller, err := clientFactory.NewVirtualMachineScaleSetsClient().BeginCreateOrUpdate(ctx, "myResourceGroup", "{vmss-name}", armcompute.VirtualMachineScaleSet{ Location: to.Ptr("westus"), Properties: &armcompute.VirtualMachineScaleSetProperties{ Overprovision: to.Ptr(true), UpgradePolicy: &armcompute.UpgradePolicy{ Mode: to.Ptr(armcompute.UpgradeModeManual), }, VirtualMachineProfile: &armcompute.VirtualMachineScaleSetVMProfile{ NetworkProfile: &armcompute.VirtualMachineScaleSetNetworkProfile{ NetworkInterfaceConfigurations: []*armcompute.VirtualMachineScaleSetNetworkConfiguration{ { Name: to.Ptr("{nicConfig1-name}"), Properties: &armcompute.VirtualMachineScaleSetNetworkConfigurationProperties{ DisableTCPStateTracking: to.Ptr(true), EnableAcceleratedNetworking: to.Ptr(true), EnableIPForwarding: to.Ptr(true), IPConfigurations: []*armcompute.VirtualMachineScaleSetIPConfiguration{ { Name: to.Ptr("{vmss-name}"), Properties: &armcompute.VirtualMachineScaleSetIPConfigurationProperties{ Subnet: &armcompute.APIEntityReference{ ID: to.Ptr("/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/virtualNetworks/{existing-virtual-network-name}/subnets/{existing-subnet-name}"), }, }, }}, Primary: to.Ptr(true), }, }, { Name: to.Ptr("{nicConfig2-name}"), Properties: &armcompute.VirtualMachineScaleSetNetworkConfigurationProperties{ DisableTCPStateTracking: to.Ptr(false), EnableAcceleratedNetworking: to.Ptr(false), EnableIPForwarding: to.Ptr(false), IPConfigurations: []*armcompute.VirtualMachineScaleSetIPConfiguration{ { Name: to.Ptr("{nicConfig2-name}"), Properties: &armcompute.VirtualMachineScaleSetIPConfigurationProperties{ Primary: to.Ptr(true), PrivateIPAddressVersion: to.Ptr(armcompute.IPVersionIPv4), Subnet: &armcompute.APIEntityReference{ ID: to.Ptr("/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/virtualNetworks/{existing-virtual-network-name}/subnets/{existing-fpga-subnet-name2}"), }, }, }}, Primary: to.Ptr(false), }, }}, }, OSProfile: &armcompute.VirtualMachineScaleSetOSProfile{ AdminPassword: to.Ptr("{your-password}"), AdminUsername: to.Ptr("{your-username}"), ComputerNamePrefix: to.Ptr("{vmss-name}"), }, StorageProfile: &armcompute.VirtualMachineScaleSetStorageProfile{ ImageReference: &armcompute.ImageReference{ ID: to.Ptr("/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/images/{existing-custom-image-name}"), }, OSDisk: &armcompute.VirtualMachineScaleSetOSDisk{ Caching: to.Ptr(armcompute.CachingTypesReadWrite), CreateOption: to.Ptr(armcompute.DiskCreateOptionTypesFromImage), ManagedDisk: &armcompute.VirtualMachineScaleSetManagedDiskParameters{ StorageAccountType: to.Ptr(armcompute.StorageAccountTypesStandardLRS), }, }, }, }, }, SKU: &armcompute.SKU{ Name: to.Ptr("Standard_D1_v2"), Capacity: to.Ptr[int64](3), Tier: to.Ptr("Standard"), }, }, &armcompute.VirtualMachineScaleSetsClientBeginCreateOrUpdateOptions{IfMatch: nil, IfNoneMatch: nil, }) if err != nil { log.Fatalf("failed to finish the request: %v", err) } res, err := poller.PollUntilDone(ctx, nil) if err != nil { log.Fatalf("failed to pull the result: %v", err) } // You could use response here. We use blank identifier for just demo purposes. _ = res // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. // res.VirtualMachineScaleSet = armcompute.VirtualMachineScaleSet{ // Name: to.Ptr("{vmss-name}"), // Type: to.Ptr("Microsoft.Compute/virtualMachineScaleSets"), // ID: to.Ptr("/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/virtualMachineScaleSets/{vmss-name}"), // Location: to.Ptr("westus"), // Properties: &armcompute.VirtualMachineScaleSetProperties{ // Overprovision: to.Ptr(true), // ProvisioningState: to.Ptr("Succeeded"), // SinglePlacementGroup: to.Ptr(true), // UniqueID: to.Ptr("afa2afa8-9e49-48fb-9d18-c86323b5d064"), // UpgradePolicy: &armcompute.UpgradePolicy{ // Mode: to.Ptr(armcompute.UpgradeModeManual), // }, // VirtualMachineProfile: &armcompute.VirtualMachineScaleSetVMProfile{ // NetworkProfile: &armcompute.VirtualMachineScaleSetNetworkProfile{ // NetworkInterfaceConfigurations: []*armcompute.VirtualMachineScaleSetNetworkConfiguration{ // { // Name: to.Ptr("{nicConfig1-name}"), // Properties: &armcompute.VirtualMachineScaleSetNetworkConfigurationProperties{ // DisableTCPStateTracking: to.Ptr(true), // DNSSettings: &armcompute.VirtualMachineScaleSetNetworkConfigurationDNSSettings{ // DNSServers: []*string{ // }, // }, // EnableAcceleratedNetworking: to.Ptr(true), // EnableIPForwarding: to.Ptr(true), // IPConfigurations: []*armcompute.VirtualMachineScaleSetIPConfiguration{ // { // Name: to.Ptr("{nicConfig1-name}"), // Properties: &armcompute.VirtualMachineScaleSetIPConfigurationProperties{ // PrivateIPAddressVersion: to.Ptr(armcompute.IPVersionIPv4), // Subnet: &armcompute.APIEntityReference{ // ID: to.Ptr("/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/virtualNetworks/nsgExistingVnet/subnets/nsgExistingSubnet"), // }, // }, // }}, // Primary: to.Ptr(true), // }, // }, // { // Name: to.Ptr("{nicConfig2-name}"), // Properties: &armcompute.VirtualMachineScaleSetNetworkConfigurationProperties{ // DisableTCPStateTracking: to.Ptr(false), // DNSSettings: &armcompute.VirtualMachineScaleSetNetworkConfigurationDNSSettings{ // DNSServers: []*string{ // }, // }, // EnableAcceleratedNetworking: to.Ptr(false), // EnableFpga: to.Ptr(false), // IPConfigurations: []*armcompute.VirtualMachineScaleSetIPConfiguration{ // { // Name: to.Ptr("{nicConfig2-name}"), // Properties: &armcompute.VirtualMachineScaleSetIPConfigurationProperties{ // Primary: to.Ptr(true), // PrivateIPAddressVersion: to.Ptr(armcompute.IPVersionIPv4), // Subnet: &armcompute.APIEntityReference{ // ID: to.Ptr("/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/virtualNetworks/{existing-virtual-network-name}/subnets/{existing-fpga-subnet-name2}"), // }, // }, // }}, // Primary: to.Ptr(false), // }, // }}, // }, // OSProfile: &armcompute.VirtualMachineScaleSetOSProfile{ // AdminUsername: to.Ptr("{your-username}"), // ComputerNamePrefix: to.Ptr("{vmss-name}"), // LinuxConfiguration: &armcompute.LinuxConfiguration{ // DisablePasswordAuthentication: to.Ptr(false), // }, // Secrets: []*armcompute.VaultSecretGroup{ // }, // }, // StorageProfile: &armcompute.VirtualMachineScaleSetStorageProfile{ // ImageReference: &armcompute.ImageReference{ // ID: to.Ptr("/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/images/nsgcustom"), // }, // OSDisk: &armcompute.VirtualMachineScaleSetOSDisk{ // Caching: to.Ptr(armcompute.CachingTypesReadWrite), // CreateOption: to.Ptr(armcompute.DiskCreateOptionTypesFromImage), // ManagedDisk: &armcompute.VirtualMachineScaleSetManagedDiskParameters{ // StorageAccountType: to.Ptr(armcompute.StorageAccountTypesStandardLRS), // }, // }, // }, // }, // }, // SKU: &armcompute.SKU{ // Name: to.Ptr("Standard_D1_v2"), // Capacity: to.Ptr[int64](3), // Tier: to.Ptr("Standard"), // }, // }
Output:
Example (CreateAScaleSetWithAMarketplaceImagePlan) ¶
Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/92de53a5f1e0e03c94b40475d2135d97148ed014/specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-03-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSet_Create_WithAMarketplaceImagePlan.json
cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() clientFactory, err := armcompute.NewClientFactory("<subscription-id>", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } poller, err := clientFactory.NewVirtualMachineScaleSetsClient().BeginCreateOrUpdate(ctx, "myResourceGroup", "{vmss-name}", armcompute.VirtualMachineScaleSet{ Location: to.Ptr("westus"), Plan: &armcompute.Plan{ Name: to.Ptr("windows2016"), Product: to.Ptr("windows-data-science-vm"), Publisher: to.Ptr("microsoft-ads"), }, Properties: &armcompute.VirtualMachineScaleSetProperties{ Overprovision: to.Ptr(true), UpgradePolicy: &armcompute.UpgradePolicy{ Mode: to.Ptr(armcompute.UpgradeModeManual), }, VirtualMachineProfile: &armcompute.VirtualMachineScaleSetVMProfile{ NetworkProfile: &armcompute.VirtualMachineScaleSetNetworkProfile{ NetworkInterfaceConfigurations: []*armcompute.VirtualMachineScaleSetNetworkConfiguration{ { Name: to.Ptr("{vmss-name}"), Properties: &armcompute.VirtualMachineScaleSetNetworkConfigurationProperties{ EnableIPForwarding: to.Ptr(true), IPConfigurations: []*armcompute.VirtualMachineScaleSetIPConfiguration{ { Name: to.Ptr("{vmss-name}"), Properties: &armcompute.VirtualMachineScaleSetIPConfigurationProperties{ Subnet: &armcompute.APIEntityReference{ ID: to.Ptr("/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/virtualNetworks/{existing-virtual-network-name}/subnets/{existing-subnet-name}"), }, }, }}, Primary: to.Ptr(true), }, }}, }, OSProfile: &armcompute.VirtualMachineScaleSetOSProfile{ AdminPassword: to.Ptr("{your-password}"), AdminUsername: to.Ptr("{your-username}"), ComputerNamePrefix: to.Ptr("{vmss-name}"), }, StorageProfile: &armcompute.VirtualMachineScaleSetStorageProfile{ ImageReference: &armcompute.ImageReference{ Offer: to.Ptr("windows-data-science-vm"), Publisher: to.Ptr("microsoft-ads"), SKU: to.Ptr("windows2016"), Version: to.Ptr("latest"), }, OSDisk: &armcompute.VirtualMachineScaleSetOSDisk{ Caching: to.Ptr(armcompute.CachingTypesReadWrite), CreateOption: to.Ptr(armcompute.DiskCreateOptionTypesFromImage), ManagedDisk: &armcompute.VirtualMachineScaleSetManagedDiskParameters{ StorageAccountType: to.Ptr(armcompute.StorageAccountTypesStandardLRS), }, }, }, }, }, SKU: &armcompute.SKU{ Name: to.Ptr("Standard_D1_v2"), Capacity: to.Ptr[int64](3), Tier: to.Ptr("Standard"), }, }, &armcompute.VirtualMachineScaleSetsClientBeginCreateOrUpdateOptions{IfMatch: nil, IfNoneMatch: nil, }) if err != nil { log.Fatalf("failed to finish the request: %v", err) } res, err := poller.PollUntilDone(ctx, nil) if err != nil { log.Fatalf("failed to pull the result: %v", err) } // You could use response here. We use blank identifier for just demo purposes. _ = res // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. // res.VirtualMachineScaleSet = armcompute.VirtualMachineScaleSet{ // Name: to.Ptr("{vmss-name}"), // Type: to.Ptr("Microsoft.Compute/virtualMachineScaleSets"), // ID: to.Ptr("/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/virtualMachineScaleSets/{vmss-name}"), // Location: to.Ptr("westus"), // Plan: &armcompute.Plan{ // Name: to.Ptr("standard-data-science-vm"), // Product: to.Ptr("standard-data-science-vm"), // Publisher: to.Ptr("microsoft-ads"), // }, // Properties: &armcompute.VirtualMachineScaleSetProperties{ // Overprovision: to.Ptr(true), // ProvisioningState: to.Ptr("Succeeded"), // SinglePlacementGroup: to.Ptr(true), // UniqueID: to.Ptr("b9e23088-6ffc-46e0-9e02-b0a6eeef47db"), // UpgradePolicy: &armcompute.UpgradePolicy{ // Mode: to.Ptr(armcompute.UpgradeModeManual), // }, // VirtualMachineProfile: &armcompute.VirtualMachineScaleSetVMProfile{ // NetworkProfile: &armcompute.VirtualMachineScaleSetNetworkProfile{ // NetworkInterfaceConfigurations: []*armcompute.VirtualMachineScaleSetNetworkConfiguration{ // { // Name: to.Ptr("{vmss-name}"), // Properties: &armcompute.VirtualMachineScaleSetNetworkConfigurationProperties{ // DNSSettings: &armcompute.VirtualMachineScaleSetNetworkConfigurationDNSSettings{ // DNSServers: []*string{ // }, // }, // EnableAcceleratedNetworking: to.Ptr(false), // EnableIPForwarding: to.Ptr(true), // IPConfigurations: []*armcompute.VirtualMachineScaleSetIPConfiguration{ // { // Name: to.Ptr("{vmss-name}"), // Properties: &armcompute.VirtualMachineScaleSetIPConfigurationProperties{ // PrivateIPAddressVersion: to.Ptr(armcompute.IPVersionIPv4), // Subnet: &armcompute.APIEntityReference{ // ID: to.Ptr("/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/virtualNetworks/nsgExistingVnet/subnets/nsgExistingSubnet"), // }, // }, // }}, // Primary: to.Ptr(true), // }, // }}, // }, // OSProfile: &armcompute.VirtualMachineScaleSetOSProfile{ // AdminUsername: to.Ptr("{your-username}"), // ComputerNamePrefix: to.Ptr("{vmss-name}"), // Secrets: []*armcompute.VaultSecretGroup{ // }, // WindowsConfiguration: &armcompute.WindowsConfiguration{ // EnableAutomaticUpdates: to.Ptr(true), // ProvisionVMAgent: to.Ptr(true), // }, // }, // StorageProfile: &armcompute.VirtualMachineScaleSetStorageProfile{ // ImageReference: &armcompute.ImageReference{ // Offer: to.Ptr("standard-data-science-vm"), // Publisher: to.Ptr("microsoft-ads"), // SKU: to.Ptr("standard-data-science-vm"), // Version: to.Ptr("latest"), // }, // OSDisk: &armcompute.VirtualMachineScaleSetOSDisk{ // Caching: to.Ptr(armcompute.CachingTypesReadWrite), // CreateOption: to.Ptr(armcompute.DiskCreateOptionTypesFromImage), // ManagedDisk: &armcompute.VirtualMachineScaleSetManagedDiskParameters{ // StorageAccountType: to.Ptr(armcompute.StorageAccountTypesStandardLRS), // }, // }, // }, // }, // }, // SKU: &armcompute.SKU{ // Name: to.Ptr("Standard_D1_v2"), // Capacity: to.Ptr[int64](3), // Tier: to.Ptr("Standard"), // }, // }
Output:
Example (CreateAScaleSetWithAnAzureApplicationGateway) ¶
Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/92de53a5f1e0e03c94b40475d2135d97148ed014/specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-03-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSet_Create_WithAzureApplicationGateway.json
cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() clientFactory, err := armcompute.NewClientFactory("<subscription-id>", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } poller, err := clientFactory.NewVirtualMachineScaleSetsClient().BeginCreateOrUpdate(ctx, "myResourceGroup", "{vmss-name}", armcompute.VirtualMachineScaleSet{ Location: to.Ptr("westus"), Properties: &armcompute.VirtualMachineScaleSetProperties{ Overprovision: to.Ptr(true), UpgradePolicy: &armcompute.UpgradePolicy{ Mode: to.Ptr(armcompute.UpgradeModeManual), }, VirtualMachineProfile: &armcompute.VirtualMachineScaleSetVMProfile{ NetworkProfile: &armcompute.VirtualMachineScaleSetNetworkProfile{ NetworkInterfaceConfigurations: []*armcompute.VirtualMachineScaleSetNetworkConfiguration{ { Name: to.Ptr("{vmss-name}"), Properties: &armcompute.VirtualMachineScaleSetNetworkConfigurationProperties{ EnableIPForwarding: to.Ptr(true), IPConfigurations: []*armcompute.VirtualMachineScaleSetIPConfiguration{ { Name: to.Ptr("{vmss-name}"), Properties: &armcompute.VirtualMachineScaleSetIPConfigurationProperties{ ApplicationGatewayBackendAddressPools: []*armcompute.SubResource{ { ID: to.Ptr("/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/applicationGateways/{existing-application-gateway-name}/backendAddressPools/{existing-backend-address-pool-name}"), }}, Subnet: &armcompute.APIEntityReference{ ID: to.Ptr("/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/virtualNetworks/{existing-virtual-network-name}/subnets/{existing-subnet-name}"), }, }, }}, Primary: to.Ptr(true), }, }}, }, OSProfile: &armcompute.VirtualMachineScaleSetOSProfile{ AdminPassword: to.Ptr("{your-password}"), AdminUsername: to.Ptr("{your-username}"), ComputerNamePrefix: to.Ptr("{vmss-name}"), }, StorageProfile: &armcompute.VirtualMachineScaleSetStorageProfile{ ImageReference: &armcompute.ImageReference{ Offer: to.Ptr("WindowsServer"), Publisher: to.Ptr("MicrosoftWindowsServer"), SKU: to.Ptr("2016-Datacenter"), Version: to.Ptr("latest"), }, OSDisk: &armcompute.VirtualMachineScaleSetOSDisk{ Caching: to.Ptr(armcompute.CachingTypesReadWrite), CreateOption: to.Ptr(armcompute.DiskCreateOptionTypesFromImage), ManagedDisk: &armcompute.VirtualMachineScaleSetManagedDiskParameters{ StorageAccountType: to.Ptr(armcompute.StorageAccountTypesStandardLRS), }, }, }, }, }, SKU: &armcompute.SKU{ Name: to.Ptr("Standard_D1_v2"), Capacity: to.Ptr[int64](3), Tier: to.Ptr("Standard"), }, }, &armcompute.VirtualMachineScaleSetsClientBeginCreateOrUpdateOptions{IfMatch: nil, IfNoneMatch: nil, }) if err != nil { log.Fatalf("failed to finish the request: %v", err) } res, err := poller.PollUntilDone(ctx, nil) if err != nil { log.Fatalf("failed to pull the result: %v", err) } // You could use response here. We use blank identifier for just demo purposes. _ = res // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. // res.VirtualMachineScaleSet = armcompute.VirtualMachineScaleSet{ // Name: to.Ptr("{vmss-name}"), // Type: to.Ptr("Microsoft.Compute/virtualMachineScaleSets"), // ID: to.Ptr("/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/virtualMachineScaleSets/{vmss-name}"), // Location: to.Ptr("westus"), // Properties: &armcompute.VirtualMachineScaleSetProperties{ // Overprovision: to.Ptr(true), // ProvisioningState: to.Ptr("Succeeded"), // SinglePlacementGroup: to.Ptr(true), // UniqueID: to.Ptr("a0134477-b9d9-484b-b0e3-205c1c089ffa"), // UpgradePolicy: &armcompute.UpgradePolicy{ // Mode: to.Ptr(armcompute.UpgradeModeManual), // }, // VirtualMachineProfile: &armcompute.VirtualMachineScaleSetVMProfile{ // NetworkProfile: &armcompute.VirtualMachineScaleSetNetworkProfile{ // NetworkInterfaceConfigurations: []*armcompute.VirtualMachineScaleSetNetworkConfiguration{ // { // Name: to.Ptr("{vmss-name}"), // Properties: &armcompute.VirtualMachineScaleSetNetworkConfigurationProperties{ // DNSSettings: &armcompute.VirtualMachineScaleSetNetworkConfigurationDNSSettings{ // DNSServers: []*string{ // }, // }, // EnableAcceleratedNetworking: to.Ptr(false), // EnableIPForwarding: to.Ptr(true), // IPConfigurations: []*armcompute.VirtualMachineScaleSetIPConfiguration{ // { // Name: to.Ptr("{vmss-name}"), // Properties: &armcompute.VirtualMachineScaleSetIPConfigurationProperties{ // ApplicationGatewayBackendAddressPools: []*armcompute.SubResource{ // { // ID: to.Ptr("/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/applicationGateways/nsgExistingAppGw/backendAddressPools/appGatewayBackendPool"), // }}, // PrivateIPAddressVersion: to.Ptr(armcompute.IPVersionIPv4), // Subnet: &armcompute.APIEntityReference{ // ID: to.Ptr("/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/virtualNetworks/nsgExistingVnet/subnets/nsgExistingSubnet"), // }, // }, // }}, // Primary: to.Ptr(true), // }, // }}, // }, // OSProfile: &armcompute.VirtualMachineScaleSetOSProfile{ // AdminUsername: to.Ptr("{your-username}"), // ComputerNamePrefix: to.Ptr("{vmss-name}"), // Secrets: []*armcompute.VaultSecretGroup{ // }, // WindowsConfiguration: &armcompute.WindowsConfiguration{ // EnableAutomaticUpdates: to.Ptr(true), // ProvisionVMAgent: to.Ptr(true), // }, // }, // StorageProfile: &armcompute.VirtualMachineScaleSetStorageProfile{ // ImageReference: &armcompute.ImageReference{ // Offer: to.Ptr("WindowsServer"), // Publisher: to.Ptr("MicrosoftWindowsServer"), // SKU: to.Ptr("2016-Datacenter"), // Version: to.Ptr("latest"), // }, // OSDisk: &armcompute.VirtualMachineScaleSetOSDisk{ // Caching: to.Ptr(armcompute.CachingTypesReadWrite), // CreateOption: to.Ptr(armcompute.DiskCreateOptionTypesFromImage), // ManagedDisk: &armcompute.VirtualMachineScaleSetManagedDiskParameters{ // StorageAccountType: to.Ptr(armcompute.StorageAccountTypesStandardLRS), // }, // }, // }, // }, // }, // SKU: &armcompute.SKU{ // Name: to.Ptr("Standard_D1_v2"), // Capacity: to.Ptr[int64](3), // Tier: to.Ptr("Standard"), // }, // }
Output:
Example (CreateAScaleSetWithAnAzureLoadBalancer) ¶
Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/92de53a5f1e0e03c94b40475d2135d97148ed014/specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-03-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSet_Create_WithAzureLoadBalancer.json
cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() clientFactory, err := armcompute.NewClientFactory("<subscription-id>", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } poller, err := clientFactory.NewVirtualMachineScaleSetsClient().BeginCreateOrUpdate(ctx, "myResourceGroup", "{vmss-name}", armcompute.VirtualMachineScaleSet{ Location: to.Ptr("westus"), Properties: &armcompute.VirtualMachineScaleSetProperties{ Overprovision: to.Ptr(true), UpgradePolicy: &armcompute.UpgradePolicy{ Mode: to.Ptr(armcompute.UpgradeModeManual), }, VirtualMachineProfile: &armcompute.VirtualMachineScaleSetVMProfile{ NetworkProfile: &armcompute.VirtualMachineScaleSetNetworkProfile{ NetworkInterfaceConfigurations: []*armcompute.VirtualMachineScaleSetNetworkConfiguration{ { Name: to.Ptr("{vmss-name}"), Properties: &armcompute.VirtualMachineScaleSetNetworkConfigurationProperties{ EnableIPForwarding: to.Ptr(true), IPConfigurations: []*armcompute.VirtualMachineScaleSetIPConfiguration{ { Name: to.Ptr("{vmss-name}"), Properties: &armcompute.VirtualMachineScaleSetIPConfigurationProperties{ LoadBalancerBackendAddressPools: []*armcompute.SubResource{ { ID: to.Ptr("/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/loadBalancers/{existing-load-balancer-name}/backendAddressPools/{existing-backend-address-pool-name}"), }}, LoadBalancerInboundNatPools: []*armcompute.SubResource{ { ID: to.Ptr("/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/loadBalancers/{existing-load-balancer-name}/inboundNatPools/{existing-nat-pool-name}"), }}, PublicIPAddressConfiguration: &armcompute.VirtualMachineScaleSetPublicIPAddressConfiguration{ Name: to.Ptr("{vmss-name}"), Properties: &armcompute.VirtualMachineScaleSetPublicIPAddressConfigurationProperties{ PublicIPAddressVersion: to.Ptr(armcompute.IPVersionIPv4), }, }, Subnet: &armcompute.APIEntityReference{ ID: to.Ptr("/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/virtualNetworks/{existing-virtual-network-name}/subnets/{existing-subnet-name}"), }, }, }}, Primary: to.Ptr(true), }, }}, }, OSProfile: &armcompute.VirtualMachineScaleSetOSProfile{ AdminPassword: to.Ptr("{your-password}"), AdminUsername: to.Ptr("{your-username}"), ComputerNamePrefix: to.Ptr("{vmss-name}"), }, StorageProfile: &armcompute.VirtualMachineScaleSetStorageProfile{ ImageReference: &armcompute.ImageReference{ Offer: to.Ptr("WindowsServer"), Publisher: to.Ptr("MicrosoftWindowsServer"), SKU: to.Ptr("2016-Datacenter"), Version: to.Ptr("latest"), }, OSDisk: &armcompute.VirtualMachineScaleSetOSDisk{ Caching: to.Ptr(armcompute.CachingTypesReadWrite), CreateOption: to.Ptr(armcompute.DiskCreateOptionTypesFromImage), ManagedDisk: &armcompute.VirtualMachineScaleSetManagedDiskParameters{ StorageAccountType: to.Ptr(armcompute.StorageAccountTypesStandardLRS), }, }, }, }, }, SKU: &armcompute.SKU{ Name: to.Ptr("Standard_D1_v2"), Capacity: to.Ptr[int64](3), Tier: to.Ptr("Standard"), }, }, &armcompute.VirtualMachineScaleSetsClientBeginCreateOrUpdateOptions{IfMatch: nil, IfNoneMatch: nil, }) if err != nil { log.Fatalf("failed to finish the request: %v", err) } res, err := poller.PollUntilDone(ctx, nil) if err != nil { log.Fatalf("failed to pull the result: %v", err) } // You could use response here. We use blank identifier for just demo purposes. _ = res // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. // res.VirtualMachineScaleSet = armcompute.VirtualMachineScaleSet{ // Name: to.Ptr("{vmss-name}"), // Type: to.Ptr("Microsoft.Compute/virtualMachineScaleSets"), // ID: to.Ptr("/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/virtualMachineScaleSets/{vmss-name}"), // Location: to.Ptr("westus"), // Properties: &armcompute.VirtualMachineScaleSetProperties{ // Overprovision: to.Ptr(true), // ProvisioningState: to.Ptr("Succeeded"), // SinglePlacementGroup: to.Ptr(true), // UniqueID: to.Ptr("ec0b21ca-51ec-414b-9323-f236ffc21479"), // UpgradePolicy: &armcompute.UpgradePolicy{ // Mode: to.Ptr(armcompute.UpgradeModeManual), // }, // VirtualMachineProfile: &armcompute.VirtualMachineScaleSetVMProfile{ // NetworkProfile: &armcompute.VirtualMachineScaleSetNetworkProfile{ // NetworkInterfaceConfigurations: []*armcompute.VirtualMachineScaleSetNetworkConfiguration{ // { // Name: to.Ptr("{vmss-name}"), // Properties: &armcompute.VirtualMachineScaleSetNetworkConfigurationProperties{ // DNSSettings: &armcompute.VirtualMachineScaleSetNetworkConfigurationDNSSettings{ // DNSServers: []*string{ // }, // }, // EnableAcceleratedNetworking: to.Ptr(false), // EnableIPForwarding: to.Ptr(true), // IPConfigurations: []*armcompute.VirtualMachineScaleSetIPConfiguration{ // { // Name: to.Ptr("{vmss-name}"), // Properties: &armcompute.VirtualMachineScaleSetIPConfigurationProperties{ // LoadBalancerBackendAddressPools: []*armcompute.SubResource{ // { // ID: to.Ptr("/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/loadBalancers/myLb/backendAddressPools/lbBackendPool"), // }}, // LoadBalancerInboundNatPools: []*armcompute.SubResource{ // { // ID: to.Ptr("/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/loadBalancers/myLb/inboundNatPools/lbNatPool"), // }}, // PrivateIPAddressVersion: to.Ptr(armcompute.IPVersionIPv4), // Subnet: &armcompute.APIEntityReference{ // ID: to.Ptr("/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/virtualNetworks/nsgExistingVnet/subnets/nsgExistingSubnet"), // }, // }, // }}, // Primary: to.Ptr(true), // }, // }}, // }, // OSProfile: &armcompute.VirtualMachineScaleSetOSProfile{ // AdminUsername: to.Ptr("{your-username}"), // ComputerNamePrefix: to.Ptr("{vmss-name}"), // Secrets: []*armcompute.VaultSecretGroup{ // }, // WindowsConfiguration: &armcompute.WindowsConfiguration{ // EnableAutomaticUpdates: to.Ptr(true), // ProvisionVMAgent: to.Ptr(true), // }, // }, // StorageProfile: &armcompute.VirtualMachineScaleSetStorageProfile{ // ImageReference: &armcompute.ImageReference{ // Offer: to.Ptr("WindowsServer"), // Publisher: to.Ptr("MicrosoftWindowsServer"), // SKU: to.Ptr("2016-Datacenter"), // Version: to.Ptr("latest"), // }, // OSDisk: &armcompute.VirtualMachineScaleSetOSDisk{ // Caching: to.Ptr(armcompute.CachingTypesReadWrite), // CreateOption: to.Ptr(armcompute.DiskCreateOptionTypesFromImage), // ManagedDisk: &armcompute.VirtualMachineScaleSetManagedDiskParameters{ // StorageAccountType: to.Ptr(armcompute.StorageAccountTypesStandardLRS), // }, // }, // }, // }, // }, // SKU: &armcompute.SKU{ // Name: to.Ptr("Standard_D1_v2"), // Capacity: to.Ptr[int64](3), // Tier: to.Ptr("Standard"), // }, // }
Output:
Example (CreateAScaleSetWithApplicationProfile) ¶
Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/92de53a5f1e0e03c94b40475d2135d97148ed014/specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-03-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSet_Create_WithApplicationProfile.json
cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() clientFactory, err := armcompute.NewClientFactory("<subscription-id>", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } poller, err := clientFactory.NewVirtualMachineScaleSetsClient().BeginCreateOrUpdate(ctx, "myResourceGroup", "{vmss-name}", armcompute.VirtualMachineScaleSet{ Location: to.Ptr("westus"), Properties: &armcompute.VirtualMachineScaleSetProperties{ Overprovision: to.Ptr(true), UpgradePolicy: &armcompute.UpgradePolicy{ Mode: to.Ptr(armcompute.UpgradeModeManual), }, VirtualMachineProfile: &armcompute.VirtualMachineScaleSetVMProfile{ ApplicationProfile: &armcompute.ApplicationProfile{ GalleryApplications: []*armcompute.VMGalleryApplication{ { ConfigurationReference: to.Ptr("https://mystorageaccount.blob.core.windows.net/configurations/settings.config"), EnableAutomaticUpgrade: to.Ptr(false), Order: to.Ptr[int32](1), PackageReferenceID: to.Ptr("/subscriptions/32c17a9e-aa7b-4ba5-a45b-e324116b6fdb/resourceGroups/myresourceGroupName2/providers/Microsoft.Compute/galleries/myGallery1/applications/MyApplication1/versions/1.0"), Tags: to.Ptr("myTag1"), TreatFailureAsDeploymentFailure: to.Ptr(true), }, { PackageReferenceID: to.Ptr("/subscriptions/32c17a9e-aa7b-4ba5-a45b-e324116b6fdg/resourceGroups/myresourceGroupName3/providers/Microsoft.Compute/galleries/myGallery2/applications/MyApplication2/versions/1.1"), }}, }, NetworkProfile: &armcompute.VirtualMachineScaleSetNetworkProfile{ NetworkInterfaceConfigurations: []*armcompute.VirtualMachineScaleSetNetworkConfiguration{ { Name: to.Ptr("{vmss-name}"), Properties: &armcompute.VirtualMachineScaleSetNetworkConfigurationProperties{ EnableIPForwarding: to.Ptr(true), IPConfigurations: []*armcompute.VirtualMachineScaleSetIPConfiguration{ { Name: to.Ptr("{vmss-name}"), Properties: &armcompute.VirtualMachineScaleSetIPConfigurationProperties{ Subnet: &armcompute.APIEntityReference{ ID: to.Ptr("/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/virtualNetworks/{existing-virtual-network-name}/subnets/{existing-subnet-name}"), }, }, }}, Primary: to.Ptr(true), }, }}, }, OSProfile: &armcompute.VirtualMachineScaleSetOSProfile{ AdminPassword: to.Ptr("{your-password}"), AdminUsername: to.Ptr("{your-username}"), ComputerNamePrefix: to.Ptr("{vmss-name}"), }, StorageProfile: &armcompute.VirtualMachineScaleSetStorageProfile{ ImageReference: &armcompute.ImageReference{ Offer: to.Ptr("WindowsServer"), Publisher: to.Ptr("MicrosoftWindowsServer"), SKU: to.Ptr("2016-Datacenter"), Version: to.Ptr("latest"), }, OSDisk: &armcompute.VirtualMachineScaleSetOSDisk{ Caching: to.Ptr(armcompute.CachingTypesReadWrite), CreateOption: to.Ptr(armcompute.DiskCreateOptionTypesFromImage), ManagedDisk: &armcompute.VirtualMachineScaleSetManagedDiskParameters{ StorageAccountType: to.Ptr(armcompute.StorageAccountTypesStandardLRS), }, }, }, }, }, SKU: &armcompute.SKU{ Name: to.Ptr("Standard_D1_v2"), Capacity: to.Ptr[int64](3), Tier: to.Ptr("Standard"), }, }, &armcompute.VirtualMachineScaleSetsClientBeginCreateOrUpdateOptions{IfMatch: nil, IfNoneMatch: nil, }) if err != nil { log.Fatalf("failed to finish the request: %v", err) } res, err := poller.PollUntilDone(ctx, nil) if err != nil { log.Fatalf("failed to pull the result: %v", err) } // You could use response here. We use blank identifier for just demo purposes. _ = res // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. // res.VirtualMachineScaleSet = armcompute.VirtualMachineScaleSet{ // Name: to.Ptr("{vmss-name}"), // Type: to.Ptr("Microsoft.Compute/virtualMachineScaleSets"), // ID: to.Ptr("/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/virtualMachineScaleSets/{vmss-name}"), // Location: to.Ptr("westus"), // Properties: &armcompute.VirtualMachineScaleSetProperties{ // Overprovision: to.Ptr(true), // ProvisioningState: to.Ptr("Succeeded"), // SinglePlacementGroup: to.Ptr(true), // UniqueID: to.Ptr("ffb27c5c-39a5-4d4e-b307-b32598689813"), // UpgradePolicy: &armcompute.UpgradePolicy{ // Mode: to.Ptr(armcompute.UpgradeModeManual), // }, // VirtualMachineProfile: &armcompute.VirtualMachineScaleSetVMProfile{ // ApplicationProfile: &armcompute.ApplicationProfile{ // GalleryApplications: []*armcompute.VMGalleryApplication{ // { // ConfigurationReference: to.Ptr("https://mystorageaccount.blob.core.windows.net/configurations/settings.config"), // Order: to.Ptr[int32](1), // PackageReferenceID: to.Ptr("/subscriptions/32c17a9e-aa7b-4ba5-a45b-e324116b6fdb/resourceGroups/myresourceGroupName2/providers/Microsoft.Compute/galleries/myGallery1/applications/MyApplication1/versions/1.0"), // Tags: to.Ptr("myTag1"), // }, // { // PackageReferenceID: to.Ptr("/subscriptions/32c17a9e-aa7b-4ba5-a45b-e324116b6fdg/resourceGroups/myresourceGroupName3/providers/Microsoft.Compute/galleries/myGallery2/applications/MyApplication2/versions/1.1"), // }}, // }, // NetworkProfile: &armcompute.VirtualMachineScaleSetNetworkProfile{ // NetworkInterfaceConfigurations: []*armcompute.VirtualMachineScaleSetNetworkConfiguration{ // { // Name: to.Ptr("{vmss-name}"), // Properties: &armcompute.VirtualMachineScaleSetNetworkConfigurationProperties{ // DNSSettings: &armcompute.VirtualMachineScaleSetNetworkConfigurationDNSSettings{ // DNSServers: []*string{ // }, // }, // EnableAcceleratedNetworking: to.Ptr(false), // EnableIPForwarding: to.Ptr(true), // IPConfigurations: []*armcompute.VirtualMachineScaleSetIPConfiguration{ // { // Name: to.Ptr("{vmss-name}"), // Properties: &armcompute.VirtualMachineScaleSetIPConfigurationProperties{ // PrivateIPAddressVersion: to.Ptr(armcompute.IPVersionIPv4), // Subnet: &armcompute.APIEntityReference{ // ID: to.Ptr("/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/virtualNetworks/nsgExistingVnet/subnets/nsgExistingSubnet"), // }, // }, // }}, // Primary: to.Ptr(true), // }, // }}, // }, // OSProfile: &armcompute.VirtualMachineScaleSetOSProfile{ // AdminUsername: to.Ptr("{your-username}"), // ComputerNamePrefix: to.Ptr("{vmss-name}"), // Secrets: []*armcompute.VaultSecretGroup{ // }, // WindowsConfiguration: &armcompute.WindowsConfiguration{ // EnableAutomaticUpdates: to.Ptr(true), // ProvisionVMAgent: to.Ptr(true), // }, // }, // StorageProfile: &armcompute.VirtualMachineScaleSetStorageProfile{ // ImageReference: &armcompute.ImageReference{ // Offer: to.Ptr("WindowsServer"), // Publisher: to.Ptr("MicrosoftWindowsServer"), // SKU: to.Ptr("2016-Datacenter"), // Version: to.Ptr("latest"), // }, // OSDisk: &armcompute.VirtualMachineScaleSetOSDisk{ // Caching: to.Ptr(armcompute.CachingTypesReadWrite), // CreateOption: to.Ptr(armcompute.DiskCreateOptionTypesFromImage), // ManagedDisk: &armcompute.VirtualMachineScaleSetManagedDiskParameters{ // StorageAccountType: to.Ptr(armcompute.StorageAccountTypesStandardLRS), // }, // }, // }, // }, // }, // SKU: &armcompute.SKU{ // Name: to.Ptr("Standard_D1_v2"), // Capacity: to.Ptr[int64](3), // Tier: to.Ptr("Standard"), // }, // }
Output:
Example (CreateAScaleSetWithAutomaticRepairsEnabled) ¶
Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/92de53a5f1e0e03c94b40475d2135d97148ed014/specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-03-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSet_Create_WithAutomaticRepairs.json
cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() clientFactory, err := armcompute.NewClientFactory("<subscription-id>", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } poller, err := clientFactory.NewVirtualMachineScaleSetsClient().BeginCreateOrUpdate(ctx, "myResourceGroup", "{vmss-name}", armcompute.VirtualMachineScaleSet{ Location: to.Ptr("westus"), Properties: &armcompute.VirtualMachineScaleSetProperties{ AutomaticRepairsPolicy: &armcompute.AutomaticRepairsPolicy{ Enabled: to.Ptr(true), GracePeriod: to.Ptr("PT10M"), }, Overprovision: to.Ptr(true), ScheduledEventsPolicy: &armcompute.ScheduledEventsPolicy{ ScheduledEventsAdditionalPublishingTargets: &armcompute.ScheduledEventsAdditionalPublishingTargets{ EventGridAndResourceGraph: &armcompute.EventGridAndResourceGraph{ Enable: to.Ptr(true), }, }, UserInitiatedReboot: &armcompute.UserInitiatedReboot{ AutomaticallyApprove: to.Ptr(true), }, UserInitiatedRedeploy: &armcompute.UserInitiatedRedeploy{ AutomaticallyApprove: to.Ptr(true), }, }, UpgradePolicy: &armcompute.UpgradePolicy{ Mode: to.Ptr(armcompute.UpgradeModeManual), }, VirtualMachineProfile: &armcompute.VirtualMachineScaleSetVMProfile{ NetworkProfile: &armcompute.VirtualMachineScaleSetNetworkProfile{ NetworkInterfaceConfigurations: []*armcompute.VirtualMachineScaleSetNetworkConfiguration{ { Name: to.Ptr("{vmss-name}"), Properties: &armcompute.VirtualMachineScaleSetNetworkConfigurationProperties{ EnableIPForwarding: to.Ptr(true), IPConfigurations: []*armcompute.VirtualMachineScaleSetIPConfiguration{ { Name: to.Ptr("{vmss-name}"), Properties: &armcompute.VirtualMachineScaleSetIPConfigurationProperties{ Subnet: &armcompute.APIEntityReference{ ID: to.Ptr("/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/virtualNetworks/{existing-virtual-network-name}/subnets/{existing-subnet-name}"), }, }, }}, Primary: to.Ptr(true), }, }}, }, OSProfile: &armcompute.VirtualMachineScaleSetOSProfile{ AdminPassword: to.Ptr("{your-password}"), AdminUsername: to.Ptr("{your-username}"), ComputerNamePrefix: to.Ptr("{vmss-name}"), }, StorageProfile: &armcompute.VirtualMachineScaleSetStorageProfile{ ImageReference: &armcompute.ImageReference{ Offer: to.Ptr("WindowsServer"), Publisher: to.Ptr("MicrosoftWindowsServer"), SKU: to.Ptr("2016-Datacenter"), Version: to.Ptr("latest"), }, OSDisk: &armcompute.VirtualMachineScaleSetOSDisk{ Caching: to.Ptr(armcompute.CachingTypesReadWrite), CreateOption: to.Ptr(armcompute.DiskCreateOptionTypesFromImage), ManagedDisk: &armcompute.VirtualMachineScaleSetManagedDiskParameters{ StorageAccountType: to.Ptr(armcompute.StorageAccountTypesStandardLRS), }, }, }, }, }, SKU: &armcompute.SKU{ Name: to.Ptr("Standard_D1_v2"), Capacity: to.Ptr[int64](3), Tier: to.Ptr("Standard"), }, }, &armcompute.VirtualMachineScaleSetsClientBeginCreateOrUpdateOptions{IfMatch: nil, IfNoneMatch: nil, }) if err != nil { log.Fatalf("failed to finish the request: %v", err) } res, err := poller.PollUntilDone(ctx, nil) if err != nil { log.Fatalf("failed to pull the result: %v", err) } // You could use response here. We use blank identifier for just demo purposes. _ = res // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. // res.VirtualMachineScaleSet = armcompute.VirtualMachineScaleSet{ // Name: to.Ptr("{vmss-name}"), // Type: to.Ptr("Microsoft.Compute/virtualMachineScaleSets"), // ID: to.Ptr("/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/virtualMachineScaleSets/{vmss-name}"), // Location: to.Ptr("westus"), // Properties: &armcompute.VirtualMachineScaleSetProperties{ // AutomaticRepairsPolicy: &armcompute.AutomaticRepairsPolicy{ // Enabled: to.Ptr(true), // GracePeriod: to.Ptr("PT10M"), // }, // Overprovision: to.Ptr(true), // ProvisioningState: to.Ptr("Succeeded"), // ScheduledEventsPolicy: &armcompute.ScheduledEventsPolicy{ // ScheduledEventsAdditionalPublishingTargets: &armcompute.ScheduledEventsAdditionalPublishingTargets{ // EventGridAndResourceGraph: &armcompute.EventGridAndResourceGraph{ // Enable: to.Ptr(true), // }, // }, // UserInitiatedReboot: &armcompute.UserInitiatedReboot{ // AutomaticallyApprove: to.Ptr(true), // }, // UserInitiatedRedeploy: &armcompute.UserInitiatedRedeploy{ // AutomaticallyApprove: to.Ptr(true), // }, // }, // SinglePlacementGroup: to.Ptr(true), // UniqueID: to.Ptr("d053ec5a-8da6-495f-ab13-38216503c6d7"), // UpgradePolicy: &armcompute.UpgradePolicy{ // Mode: to.Ptr(armcompute.UpgradeModeManual), // }, // VirtualMachineProfile: &armcompute.VirtualMachineScaleSetVMProfile{ // NetworkProfile: &armcompute.VirtualMachineScaleSetNetworkProfile{ // NetworkInterfaceConfigurations: []*armcompute.VirtualMachineScaleSetNetworkConfiguration{ // { // Name: to.Ptr("{vmss-name}"), // Properties: &armcompute.VirtualMachineScaleSetNetworkConfigurationProperties{ // DNSSettings: &armcompute.VirtualMachineScaleSetNetworkConfigurationDNSSettings{ // DNSServers: []*string{ // }, // }, // EnableAcceleratedNetworking: to.Ptr(false), // EnableIPForwarding: to.Ptr(true), // IPConfigurations: []*armcompute.VirtualMachineScaleSetIPConfiguration{ // { // Name: to.Ptr("{vmss-name}"), // Properties: &armcompute.VirtualMachineScaleSetIPConfigurationProperties{ // PrivateIPAddressVersion: to.Ptr(armcompute.IPVersionIPv4), // Subnet: &armcompute.APIEntityReference{ // ID: to.Ptr("/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/virtualNetworks/nsgExistingVnet/subnets/nsgExistingSubnet"), // }, // }, // }}, // Primary: to.Ptr(true), // }, // }}, // }, // OSProfile: &armcompute.VirtualMachineScaleSetOSProfile{ // AdminUsername: to.Ptr("{your-username}"), // ComputerNamePrefix: to.Ptr("{vmss-name}"), // Secrets: []*armcompute.VaultSecretGroup{ // }, // WindowsConfiguration: &armcompute.WindowsConfiguration{ // EnableAutomaticUpdates: to.Ptr(true), // ProvisionVMAgent: to.Ptr(true), // }, // }, // StorageProfile: &armcompute.VirtualMachineScaleSetStorageProfile{ // ImageReference: &armcompute.ImageReference{ // Offer: to.Ptr("WindowsServer"), // Publisher: to.Ptr("MicrosoftWindowsServer"), // SKU: to.Ptr("2016-Datacenter"), // Version: to.Ptr("latest"), // }, // OSDisk: &armcompute.VirtualMachineScaleSetOSDisk{ // Caching: to.Ptr(armcompute.CachingTypesReadWrite), // CreateOption: to.Ptr(armcompute.DiskCreateOptionTypesFromImage), // ManagedDisk: &armcompute.VirtualMachineScaleSetManagedDiskParameters{ // StorageAccountType: to.Ptr(armcompute.StorageAccountTypesStandardLRS), // }, // }, // }, // }, // }, // SKU: &armcompute.SKU{ // Name: to.Ptr("Standard_D1_v2"), // Capacity: to.Ptr[int64](3), // Tier: to.Ptr("Standard"), // }, // }
Output:
Example (CreateAScaleSetWithBootDiagnostics) ¶
Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/92de53a5f1e0e03c94b40475d2135d97148ed014/specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-03-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSet_Create_WithBootDiagnostics.json
cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() clientFactory, err := armcompute.NewClientFactory("<subscription-id>", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } poller, err := clientFactory.NewVirtualMachineScaleSetsClient().BeginCreateOrUpdate(ctx, "myResourceGroup", "{vmss-name}", armcompute.VirtualMachineScaleSet{ Location: to.Ptr("westus"), Properties: &armcompute.VirtualMachineScaleSetProperties{ Overprovision: to.Ptr(true), UpgradePolicy: &armcompute.UpgradePolicy{ Mode: to.Ptr(armcompute.UpgradeModeManual), }, VirtualMachineProfile: &armcompute.VirtualMachineScaleSetVMProfile{ DiagnosticsProfile: &armcompute.DiagnosticsProfile{ BootDiagnostics: &armcompute.BootDiagnostics{ Enabled: to.Ptr(true), StorageURI: to.Ptr("http://{existing-storage-account-name}.blob.core.windows.net"), }, }, NetworkProfile: &armcompute.VirtualMachineScaleSetNetworkProfile{ NetworkInterfaceConfigurations: []*armcompute.VirtualMachineScaleSetNetworkConfiguration{ { Name: to.Ptr("{vmss-name}"), Properties: &armcompute.VirtualMachineScaleSetNetworkConfigurationProperties{ EnableIPForwarding: to.Ptr(true), IPConfigurations: []*armcompute.VirtualMachineScaleSetIPConfiguration{ { Name: to.Ptr("{vmss-name}"), Properties: &armcompute.VirtualMachineScaleSetIPConfigurationProperties{ Subnet: &armcompute.APIEntityReference{ ID: to.Ptr("/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/virtualNetworks/{existing-virtual-network-name}/subnets/{existing-subnet-name}"), }, }, }}, Primary: to.Ptr(true), }, }}, }, OSProfile: &armcompute.VirtualMachineScaleSetOSProfile{ AdminPassword: to.Ptr("{your-password}"), AdminUsername: to.Ptr("{your-username}"), ComputerNamePrefix: to.Ptr("{vmss-name}"), }, StorageProfile: &armcompute.VirtualMachineScaleSetStorageProfile{ ImageReference: &armcompute.ImageReference{ Offer: to.Ptr("WindowsServer"), Publisher: to.Ptr("MicrosoftWindowsServer"), SKU: to.Ptr("2016-Datacenter"), Version: to.Ptr("latest"), }, OSDisk: &armcompute.VirtualMachineScaleSetOSDisk{ Caching: to.Ptr(armcompute.CachingTypesReadWrite), CreateOption: to.Ptr(armcompute.DiskCreateOptionTypesFromImage), ManagedDisk: &armcompute.VirtualMachineScaleSetManagedDiskParameters{ StorageAccountType: to.Ptr(armcompute.StorageAccountTypesStandardLRS), }, }, }, }, }, SKU: &armcompute.SKU{ Name: to.Ptr("Standard_D1_v2"), Capacity: to.Ptr[int64](3), Tier: to.Ptr("Standard"), }, }, &armcompute.VirtualMachineScaleSetsClientBeginCreateOrUpdateOptions{IfMatch: nil, IfNoneMatch: nil, }) if err != nil { log.Fatalf("failed to finish the request: %v", err) } res, err := poller.PollUntilDone(ctx, nil) if err != nil { log.Fatalf("failed to pull the result: %v", err) } // You could use response here. We use blank identifier for just demo purposes. _ = res // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. // res.VirtualMachineScaleSet = armcompute.VirtualMachineScaleSet{ // Name: to.Ptr("{vmss-name}"), // Type: to.Ptr("Microsoft.Compute/virtualMachineScaleSets"), // ID: to.Ptr("/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/virtualMachineScaleSets/{vmss-name}"), // Location: to.Ptr("westus"), // Properties: &armcompute.VirtualMachineScaleSetProperties{ // Overprovision: to.Ptr(true), // ProvisioningState: to.Ptr("Succeeded"), // SinglePlacementGroup: to.Ptr(true), // UniqueID: to.Ptr("d053ec5a-8da6-495f-ab13-38216503c6d7"), // UpgradePolicy: &armcompute.UpgradePolicy{ // Mode: to.Ptr(armcompute.UpgradeModeManual), // }, // VirtualMachineProfile: &armcompute.VirtualMachineScaleSetVMProfile{ // DiagnosticsProfile: &armcompute.DiagnosticsProfile{ // BootDiagnostics: &armcompute.BootDiagnostics{ // Enabled: to.Ptr(true), // StorageURI: to.Ptr("http://nsgdiagnostic.blob.core.windows.net"), // }, // }, // NetworkProfile: &armcompute.VirtualMachineScaleSetNetworkProfile{ // NetworkInterfaceConfigurations: []*armcompute.VirtualMachineScaleSetNetworkConfiguration{ // { // Name: to.Ptr("{vmss-name}"), // Properties: &armcompute.VirtualMachineScaleSetNetworkConfigurationProperties{ // DNSSettings: &armcompute.VirtualMachineScaleSetNetworkConfigurationDNSSettings{ // DNSServers: []*string{ // }, // }, // EnableAcceleratedNetworking: to.Ptr(false), // EnableIPForwarding: to.Ptr(true), // IPConfigurations: []*armcompute.VirtualMachineScaleSetIPConfiguration{ // { // Name: to.Ptr("{vmss-name}"), // Properties: &armcompute.VirtualMachineScaleSetIPConfigurationProperties{ // PrivateIPAddressVersion: to.Ptr(armcompute.IPVersionIPv4), // Subnet: &armcompute.APIEntityReference{ // ID: to.Ptr("/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/virtualNetworks/nsgExistingVnet/subnets/nsgExistingSubnet"), // }, // }, // }}, // Primary: to.Ptr(true), // }, // }}, // }, // OSProfile: &armcompute.VirtualMachineScaleSetOSProfile{ // AdminUsername: to.Ptr("{your-username}"), // ComputerNamePrefix: to.Ptr("{vmss-name}"), // Secrets: []*armcompute.VaultSecretGroup{ // }, // WindowsConfiguration: &armcompute.WindowsConfiguration{ // EnableAutomaticUpdates: to.Ptr(true), // ProvisionVMAgent: to.Ptr(true), // }, // }, // StorageProfile: &armcompute.VirtualMachineScaleSetStorageProfile{ // ImageReference: &armcompute.ImageReference{ // Offer: to.Ptr("WindowsServer"), // Publisher: to.Ptr("MicrosoftWindowsServer"), // SKU: to.Ptr("2016-Datacenter"), // Version: to.Ptr("latest"), // }, // OSDisk: &armcompute.VirtualMachineScaleSetOSDisk{ // Caching: to.Ptr(armcompute.CachingTypesReadWrite), // CreateOption: to.Ptr(armcompute.DiskCreateOptionTypesFromImage), // ManagedDisk: &armcompute.VirtualMachineScaleSetManagedDiskParameters{ // StorageAccountType: to.Ptr(armcompute.StorageAccountTypesStandardLRS), // }, // }, // }, // }, // }, // SKU: &armcompute.SKU{ // Name: to.Ptr("Standard_D1_v2"), // Capacity: to.Ptr[int64](3), // Tier: to.Ptr("Standard"), // }, // }
Output:
Example (CreateAScaleSetWithDiskControllerType) ¶
Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/92de53a5f1e0e03c94b40475d2135d97148ed014/specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-03-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSet_Create_WithDiskControllerType.json
cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() clientFactory, err := armcompute.NewClientFactory("<subscription-id>", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } poller, err := clientFactory.NewVirtualMachineScaleSetsClient().BeginCreateOrUpdate(ctx, "myResourceGroup", "{vmss-name}", armcompute.VirtualMachineScaleSet{ Location: to.Ptr("westus"), Properties: &armcompute.VirtualMachineScaleSetProperties{ Overprovision: to.Ptr(true), ScheduledEventsPolicy: &armcompute.ScheduledEventsPolicy{ ScheduledEventsAdditionalPublishingTargets: &armcompute.ScheduledEventsAdditionalPublishingTargets{ EventGridAndResourceGraph: &armcompute.EventGridAndResourceGraph{ Enable: to.Ptr(true), }, }, UserInitiatedReboot: &armcompute.UserInitiatedReboot{ AutomaticallyApprove: to.Ptr(true), }, UserInitiatedRedeploy: &armcompute.UserInitiatedRedeploy{ AutomaticallyApprove: to.Ptr(true), }, }, UpgradePolicy: &armcompute.UpgradePolicy{ Mode: to.Ptr(armcompute.UpgradeModeManual), }, VirtualMachineProfile: &armcompute.VirtualMachineScaleSetVMProfile{ HardwareProfile: &armcompute.VirtualMachineScaleSetHardwareProfile{ VMSizeProperties: &armcompute.VMSizeProperties{ VCPUsAvailable: to.Ptr[int32](1), VCPUsPerCore: to.Ptr[int32](1), }, }, NetworkProfile: &armcompute.VirtualMachineScaleSetNetworkProfile{ NetworkInterfaceConfigurations: []*armcompute.VirtualMachineScaleSetNetworkConfiguration{ { Name: to.Ptr("{vmss-name}"), Properties: &armcompute.VirtualMachineScaleSetNetworkConfigurationProperties{ EnableIPForwarding: to.Ptr(true), IPConfigurations: []*armcompute.VirtualMachineScaleSetIPConfiguration{ { Name: to.Ptr("{vmss-name}"), Properties: &armcompute.VirtualMachineScaleSetIPConfigurationProperties{ Subnet: &armcompute.APIEntityReference{ ID: to.Ptr("/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/virtualNetworks/{existing-virtual-network-name}/subnets/{existing-subnet-name}"), }, }, }}, Primary: to.Ptr(true), }, }}, }, OSProfile: &armcompute.VirtualMachineScaleSetOSProfile{ AdminPassword: to.Ptr("{your-password}"), AdminUsername: to.Ptr("{your-username}"), ComputerNamePrefix: to.Ptr("{vmss-name}"), }, StorageProfile: &armcompute.VirtualMachineScaleSetStorageProfile{ DiskControllerType: to.Ptr("NVMe"), ImageReference: &armcompute.ImageReference{ Offer: to.Ptr("WindowsServer"), Publisher: to.Ptr("MicrosoftWindowsServer"), SKU: to.Ptr("2016-Datacenter"), Version: to.Ptr("latest"), }, OSDisk: &armcompute.VirtualMachineScaleSetOSDisk{ Caching: to.Ptr(armcompute.CachingTypesReadWrite), CreateOption: to.Ptr(armcompute.DiskCreateOptionTypesFromImage), ManagedDisk: &armcompute.VirtualMachineScaleSetManagedDiskParameters{ StorageAccountType: to.Ptr(armcompute.StorageAccountTypesStandardLRS), }, }, }, UserData: to.Ptr("RXhhbXBsZSBVc2VyRGF0YQ=="), }, }, SKU: &armcompute.SKU{ Name: to.Ptr("Standard_D1_v2"), Capacity: to.Ptr[int64](3), Tier: to.Ptr("Standard"), }, }, &armcompute.VirtualMachineScaleSetsClientBeginCreateOrUpdateOptions{IfMatch: nil, IfNoneMatch: nil, }) if err != nil { log.Fatalf("failed to finish the request: %v", err) } res, err := poller.PollUntilDone(ctx, nil) if err != nil { log.Fatalf("failed to pull the result: %v", err) } // You could use response here. We use blank identifier for just demo purposes. _ = res // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. // res.VirtualMachineScaleSet = armcompute.VirtualMachineScaleSet{ // Name: to.Ptr("{vmss-name}"), // Type: to.Ptr("Microsoft.Compute/virtualMachineScaleSets"), // ID: to.Ptr("/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/virtualMachineScaleSets/{vmss-name}"), // Location: to.Ptr("westus"), // Properties: &armcompute.VirtualMachineScaleSetProperties{ // Overprovision: to.Ptr(true), // ProvisioningState: to.Ptr("Succeeded"), // ScheduledEventsPolicy: &armcompute.ScheduledEventsPolicy{ // ScheduledEventsAdditionalPublishingTargets: &armcompute.ScheduledEventsAdditionalPublishingTargets{ // EventGridAndResourceGraph: &armcompute.EventGridAndResourceGraph{ // Enable: to.Ptr(true), // }, // }, // UserInitiatedReboot: &armcompute.UserInitiatedReboot{ // AutomaticallyApprove: to.Ptr(true), // }, // UserInitiatedRedeploy: &armcompute.UserInitiatedRedeploy{ // AutomaticallyApprove: to.Ptr(true), // }, // }, // SinglePlacementGroup: to.Ptr(true), // UniqueID: to.Ptr("d053ec5a-8da6-495f-ab13-38216503c6d7"), // UpgradePolicy: &armcompute.UpgradePolicy{ // Mode: to.Ptr(armcompute.UpgradeModeManual), // }, // VirtualMachineProfile: &armcompute.VirtualMachineScaleSetVMProfile{ // DiagnosticsProfile: &armcompute.DiagnosticsProfile{ // BootDiagnostics: &armcompute.BootDiagnostics{ // Enabled: to.Ptr(true), // StorageURI: to.Ptr("http://nsgdiagnostic.blob.core.windows.net"), // }, // }, // HardwareProfile: &armcompute.VirtualMachineScaleSetHardwareProfile{ // VMSizeProperties: &armcompute.VMSizeProperties{ // VCPUsAvailable: to.Ptr[int32](1), // VCPUsPerCore: to.Ptr[int32](1), // }, // }, // NetworkProfile: &armcompute.VirtualMachineScaleSetNetworkProfile{ // NetworkInterfaceConfigurations: []*armcompute.VirtualMachineScaleSetNetworkConfiguration{ // { // Name: to.Ptr("{vmss-name}"), // Properties: &armcompute.VirtualMachineScaleSetNetworkConfigurationProperties{ // DNSSettings: &armcompute.VirtualMachineScaleSetNetworkConfigurationDNSSettings{ // DNSServers: []*string{ // }, // }, // EnableAcceleratedNetworking: to.Ptr(false), // EnableIPForwarding: to.Ptr(true), // IPConfigurations: []*armcompute.VirtualMachineScaleSetIPConfiguration{ // { // Name: to.Ptr("{vmss-name}"), // Properties: &armcompute.VirtualMachineScaleSetIPConfigurationProperties{ // PrivateIPAddressVersion: to.Ptr(armcompute.IPVersionIPv4), // Subnet: &armcompute.APIEntityReference{ // ID: to.Ptr("/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/virtualNetworks/nsgExistingVnet/subnets/nsgExistingSubnet"), // }, // }, // }}, // Primary: to.Ptr(true), // }, // }}, // }, // OSProfile: &armcompute.VirtualMachineScaleSetOSProfile{ // AdminUsername: to.Ptr("{your-username}"), // ComputerNamePrefix: to.Ptr("{vmss-name}"), // Secrets: []*armcompute.VaultSecretGroup{ // }, // WindowsConfiguration: &armcompute.WindowsConfiguration{ // EnableAutomaticUpdates: to.Ptr(true), // ProvisionVMAgent: to.Ptr(true), // }, // }, // StorageProfile: &armcompute.VirtualMachineScaleSetStorageProfile{ // DiskControllerType: to.Ptr("NVMe"), // ImageReference: &armcompute.ImageReference{ // Offer: to.Ptr("WindowsServer"), // Publisher: to.Ptr("MicrosoftWindowsServer"), // SKU: to.Ptr("2016-Datacenter"), // Version: to.Ptr("latest"), // }, // OSDisk: &armcompute.VirtualMachineScaleSetOSDisk{ // Caching: to.Ptr(armcompute.CachingTypesReadWrite), // CreateOption: to.Ptr(armcompute.DiskCreateOptionTypesFromImage), // ManagedDisk: &armcompute.VirtualMachineScaleSetManagedDiskParameters{ // StorageAccountType: to.Ptr(armcompute.StorageAccountTypesStandardLRS), // }, // }, // }, // }, // }, // SKU: &armcompute.SKU{ // Name: to.Ptr("Standard_D1_v2"), // Capacity: to.Ptr[int64](3), // Tier: to.Ptr("Standard"), // }, // }
Output:
Example (CreateAScaleSetWithDiskEncryptionSetResourceInOsDiskAndDataDisk) ¶
Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/92de53a5f1e0e03c94b40475d2135d97148ed014/specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-03-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSet_Create_WithDiskEncryptionSetResource.json
cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() clientFactory, err := armcompute.NewClientFactory("<subscription-id>", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } poller, err := clientFactory.NewVirtualMachineScaleSetsClient().BeginCreateOrUpdate(ctx, "myResourceGroup", "{vmss-name}", armcompute.VirtualMachineScaleSet{ Location: to.Ptr("westus"), Properties: &armcompute.VirtualMachineScaleSetProperties{ Overprovision: to.Ptr(true), UpgradePolicy: &armcompute.UpgradePolicy{ Mode: to.Ptr(armcompute.UpgradeModeManual), }, VirtualMachineProfile: &armcompute.VirtualMachineScaleSetVMProfile{ NetworkProfile: &armcompute.VirtualMachineScaleSetNetworkProfile{ NetworkInterfaceConfigurations: []*armcompute.VirtualMachineScaleSetNetworkConfiguration{ { Name: to.Ptr("{vmss-name}"), Properties: &armcompute.VirtualMachineScaleSetNetworkConfigurationProperties{ EnableIPForwarding: to.Ptr(true), IPConfigurations: []*armcompute.VirtualMachineScaleSetIPConfiguration{ { Name: to.Ptr("{vmss-name}"), Properties: &armcompute.VirtualMachineScaleSetIPConfigurationProperties{ Subnet: &armcompute.APIEntityReference{ ID: to.Ptr("/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/virtualNetworks/{existing-virtual-network-name}/subnets/{existing-subnet-name}"), }, }, }}, Primary: to.Ptr(true), }, }}, }, OSProfile: &armcompute.VirtualMachineScaleSetOSProfile{ AdminPassword: to.Ptr("{your-password}"), AdminUsername: to.Ptr("{your-username}"), ComputerNamePrefix: to.Ptr("{vmss-name}"), }, StorageProfile: &armcompute.VirtualMachineScaleSetStorageProfile{ DataDisks: []*armcompute.VirtualMachineScaleSetDataDisk{ { Caching: to.Ptr(armcompute.CachingTypesReadWrite), CreateOption: to.Ptr(armcompute.DiskCreateOptionTypesEmpty), DiskSizeGB: to.Ptr[int32](1023), Lun: to.Ptr[int32](0), ManagedDisk: &armcompute.VirtualMachineScaleSetManagedDiskParameters{ DiskEncryptionSet: &armcompute.DiskEncryptionSetParameters{ ID: to.Ptr("/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/diskEncryptionSets/{existing-diskEncryptionSet-name}"), }, StorageAccountType: to.Ptr(armcompute.StorageAccountTypesStandardLRS), }, }}, ImageReference: &armcompute.ImageReference{ ID: to.Ptr("/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/images/{existing-custom-image-name}"), }, OSDisk: &armcompute.VirtualMachineScaleSetOSDisk{ Caching: to.Ptr(armcompute.CachingTypesReadWrite), CreateOption: to.Ptr(armcompute.DiskCreateOptionTypesFromImage), ManagedDisk: &armcompute.VirtualMachineScaleSetManagedDiskParameters{ DiskEncryptionSet: &armcompute.DiskEncryptionSetParameters{ ID: to.Ptr("/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/diskEncryptionSets/{existing-diskEncryptionSet-name}"), }, StorageAccountType: to.Ptr(armcompute.StorageAccountTypesStandardLRS), }, }, }, }, }, SKU: &armcompute.SKU{ Name: to.Ptr("Standard_DS1_v2"), Capacity: to.Ptr[int64](3), Tier: to.Ptr("Standard"), }, }, &armcompute.VirtualMachineScaleSetsClientBeginCreateOrUpdateOptions{IfMatch: nil, IfNoneMatch: nil, }) if err != nil { log.Fatalf("failed to finish the request: %v", err) } res, err := poller.PollUntilDone(ctx, nil) if err != nil { log.Fatalf("failed to pull the result: %v", err) } // You could use response here. We use blank identifier for just demo purposes. _ = res // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. // res.VirtualMachineScaleSet = armcompute.VirtualMachineScaleSet{ // Name: to.Ptr("{vmss-name}"), // Type: to.Ptr("Microsoft.Compute/virtualMachineScaleSets"), // ID: to.Ptr("/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/virtualMachineScaleSets/{vmss-name}"), // Location: to.Ptr("westus"), // Properties: &armcompute.VirtualMachineScaleSetProperties{ // Overprovision: to.Ptr(true), // ProvisioningState: to.Ptr("Succeeded"), // SinglePlacementGroup: to.Ptr(true), // UniqueID: to.Ptr("afa2afa8-9e49-48fb-9d18-c86323b5d064"), // UpgradePolicy: &armcompute.UpgradePolicy{ // Mode: to.Ptr(armcompute.UpgradeModeManual), // }, // VirtualMachineProfile: &armcompute.VirtualMachineScaleSetVMProfile{ // NetworkProfile: &armcompute.VirtualMachineScaleSetNetworkProfile{ // NetworkInterfaceConfigurations: []*armcompute.VirtualMachineScaleSetNetworkConfiguration{ // { // Name: to.Ptr("{vmss-name}"), // Properties: &armcompute.VirtualMachineScaleSetNetworkConfigurationProperties{ // DNSSettings: &armcompute.VirtualMachineScaleSetNetworkConfigurationDNSSettings{ // DNSServers: []*string{ // }, // }, // EnableAcceleratedNetworking: to.Ptr(false), // EnableIPForwarding: to.Ptr(true), // IPConfigurations: []*armcompute.VirtualMachineScaleSetIPConfiguration{ // { // Name: to.Ptr("{vmss-name}"), // Properties: &armcompute.VirtualMachineScaleSetIPConfigurationProperties{ // PrivateIPAddressVersion: to.Ptr(armcompute.IPVersionIPv4), // Subnet: &armcompute.APIEntityReference{ // ID: to.Ptr("/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/virtualNetworks/nsgExistingVnet/subnets/nsgExistingSubnet"), // }, // }, // }}, // Primary: to.Ptr(true), // }, // }}, // }, // OSProfile: &armcompute.VirtualMachineScaleSetOSProfile{ // AdminUsername: to.Ptr("{your-username}"), // ComputerNamePrefix: to.Ptr("{vmss-name}"), // LinuxConfiguration: &armcompute.LinuxConfiguration{ // DisablePasswordAuthentication: to.Ptr(false), // }, // Secrets: []*armcompute.VaultSecretGroup{ // }, // }, // StorageProfile: &armcompute.VirtualMachineScaleSetStorageProfile{ // DataDisks: []*armcompute.VirtualMachineScaleSetDataDisk{ // { // Caching: to.Ptr(armcompute.CachingTypesReadWrite), // CreateOption: to.Ptr(armcompute.DiskCreateOptionTypesEmpty), // DiskSizeGB: to.Ptr[int32](1023), // Lun: to.Ptr[int32](0), // ManagedDisk: &armcompute.VirtualMachineScaleSetManagedDiskParameters{ // DiskEncryptionSet: &armcompute.DiskEncryptionSetParameters{ // ID: to.Ptr("/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/diskEncryptionSets/{existing-diskEncryptionSet-name}"), // }, // StorageAccountType: to.Ptr(armcompute.StorageAccountTypesStandardLRS), // }, // }}, // ImageReference: &armcompute.ImageReference{ // ID: to.Ptr("/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/images/nsgcustom"), // }, // OSDisk: &armcompute.VirtualMachineScaleSetOSDisk{ // Caching: to.Ptr(armcompute.CachingTypesReadWrite), // CreateOption: to.Ptr(armcompute.DiskCreateOptionTypesFromImage), // ManagedDisk: &armcompute.VirtualMachineScaleSetManagedDiskParameters{ // DiskEncryptionSet: &armcompute.DiskEncryptionSetParameters{ // ID: to.Ptr("/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/diskEncryptionSets/{existing-diskEncryptionSet-name}"), // }, // StorageAccountType: to.Ptr(armcompute.StorageAccountTypesStandardLRS), // }, // }, // }, // }, // }, // SKU: &armcompute.SKU{ // Name: to.Ptr("Standard_D1_v2"), // Capacity: to.Ptr[int64](3), // Tier: to.Ptr("Standard"), // }, // }
Output:
Example (CreateAScaleSetWithEmptyDataDisksOnEachVm) ¶
Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/92de53a5f1e0e03c94b40475d2135d97148ed014/specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-03-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSet_Create_WithEmptyDataDisksOnEachVm.json
cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() clientFactory, err := armcompute.NewClientFactory("<subscription-id>", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } poller, err := clientFactory.NewVirtualMachineScaleSetsClient().BeginCreateOrUpdate(ctx, "myResourceGroup", "{vmss-name}", armcompute.VirtualMachineScaleSet{ Location: to.Ptr("westus"), Properties: &armcompute.VirtualMachineScaleSetProperties{ Overprovision: to.Ptr(true), UpgradePolicy: &armcompute.UpgradePolicy{ Mode: to.Ptr(armcompute.UpgradeModeManual), }, VirtualMachineProfile: &armcompute.VirtualMachineScaleSetVMProfile{ NetworkProfile: &armcompute.VirtualMachineScaleSetNetworkProfile{ NetworkInterfaceConfigurations: []*armcompute.VirtualMachineScaleSetNetworkConfiguration{ { Name: to.Ptr("{vmss-name}"), Properties: &armcompute.VirtualMachineScaleSetNetworkConfigurationProperties{ EnableIPForwarding: to.Ptr(true), IPConfigurations: []*armcompute.VirtualMachineScaleSetIPConfiguration{ { Name: to.Ptr("{vmss-name}"), Properties: &armcompute.VirtualMachineScaleSetIPConfigurationProperties{ Subnet: &armcompute.APIEntityReference{ ID: to.Ptr("/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/virtualNetworks/{existing-virtual-network-name}/subnets/{existing-subnet-name}"), }, }, }}, Primary: to.Ptr(true), }, }}, }, OSProfile: &armcompute.VirtualMachineScaleSetOSProfile{ AdminPassword: to.Ptr("{your-password}"), AdminUsername: to.Ptr("{your-username}"), ComputerNamePrefix: to.Ptr("{vmss-name}"), }, StorageProfile: &armcompute.VirtualMachineScaleSetStorageProfile{ DataDisks: []*armcompute.VirtualMachineScaleSetDataDisk{ { CreateOption: to.Ptr(armcompute.DiskCreateOptionTypesEmpty), DiskSizeGB: to.Ptr[int32](1023), Lun: to.Ptr[int32](0), }, { CreateOption: to.Ptr(armcompute.DiskCreateOptionTypesEmpty), DiskSizeGB: to.Ptr[int32](1023), Lun: to.Ptr[int32](1), }}, ImageReference: &armcompute.ImageReference{ Offer: to.Ptr("WindowsServer"), Publisher: to.Ptr("MicrosoftWindowsServer"), SKU: to.Ptr("2016-Datacenter"), Version: to.Ptr("latest"), }, OSDisk: &armcompute.VirtualMachineScaleSetOSDisk{ Caching: to.Ptr(armcompute.CachingTypesReadWrite), CreateOption: to.Ptr(armcompute.DiskCreateOptionTypesFromImage), DiskSizeGB: to.Ptr[int32](512), ManagedDisk: &armcompute.VirtualMachineScaleSetManagedDiskParameters{ StorageAccountType: to.Ptr(armcompute.StorageAccountTypesStandardLRS), }, }, }, }, }, SKU: &armcompute.SKU{ Name: to.Ptr("Standard_D2_v2"), Capacity: to.Ptr[int64](3), Tier: to.Ptr("Standard"), }, }, &armcompute.VirtualMachineScaleSetsClientBeginCreateOrUpdateOptions{IfMatch: nil, IfNoneMatch: nil, }) if err != nil { log.Fatalf("failed to finish the request: %v", err) } res, err := poller.PollUntilDone(ctx, nil) if err != nil { log.Fatalf("failed to pull the result: %v", err) } // You could use response here. We use blank identifier for just demo purposes. _ = res // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. // res.VirtualMachineScaleSet = armcompute.VirtualMachineScaleSet{ // Name: to.Ptr("{vmss-name}"), // Type: to.Ptr("Microsoft.Compute/virtualMachineScaleSets"), // ID: to.Ptr("/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/virtualMachineScaleSets/{vmss-name}"), // Location: to.Ptr("westus"), // Properties: &armcompute.VirtualMachineScaleSetProperties{ // Overprovision: to.Ptr(true), // ProvisioningState: to.Ptr("Succeeded"), // SinglePlacementGroup: to.Ptr(true), // UniqueID: to.Ptr("8042c376-4690-4c47-9fa2-fbdad70e32fa"), // UpgradePolicy: &armcompute.UpgradePolicy{ // Mode: to.Ptr(armcompute.UpgradeModeManual), // }, // VirtualMachineProfile: &armcompute.VirtualMachineScaleSetVMProfile{ // NetworkProfile: &armcompute.VirtualMachineScaleSetNetworkProfile{ // NetworkInterfaceConfigurations: []*armcompute.VirtualMachineScaleSetNetworkConfiguration{ // { // Name: to.Ptr("{vmss-name}"), // Properties: &armcompute.VirtualMachineScaleSetNetworkConfigurationProperties{ // DNSSettings: &armcompute.VirtualMachineScaleSetNetworkConfigurationDNSSettings{ // DNSServers: []*string{ // }, // }, // EnableAcceleratedNetworking: to.Ptr(false), // EnableIPForwarding: to.Ptr(true), // IPConfigurations: []*armcompute.VirtualMachineScaleSetIPConfiguration{ // { // Name: to.Ptr("{vmss-name}"), // Properties: &armcompute.VirtualMachineScaleSetIPConfigurationProperties{ // PrivateIPAddressVersion: to.Ptr(armcompute.IPVersionIPv4), // Subnet: &armcompute.APIEntityReference{ // ID: to.Ptr("/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/virtualNetworks/nsgExistingVnet/subnets/nsgExistingSubnet"), // }, // }, // }}, // Primary: to.Ptr(true), // }, // }}, // }, // OSProfile: &armcompute.VirtualMachineScaleSetOSProfile{ // AdminUsername: to.Ptr("{your-username}"), // ComputerNamePrefix: to.Ptr("{vmss-name}"), // Secrets: []*armcompute.VaultSecretGroup{ // }, // WindowsConfiguration: &armcompute.WindowsConfiguration{ // EnableAutomaticUpdates: to.Ptr(true), // ProvisionVMAgent: to.Ptr(true), // }, // }, // StorageProfile: &armcompute.VirtualMachineScaleSetStorageProfile{ // DataDisks: []*armcompute.VirtualMachineScaleSetDataDisk{ // { // Caching: to.Ptr(armcompute.CachingTypesNone), // CreateOption: to.Ptr(armcompute.DiskCreateOptionTypesEmpty), // DiskSizeGB: to.Ptr[int32](1023), // Lun: to.Ptr[int32](0), // ManagedDisk: &armcompute.VirtualMachineScaleSetManagedDiskParameters{ // StorageAccountType: to.Ptr(armcompute.StorageAccountTypesStandardLRS), // }, // }, // { // Caching: to.Ptr(armcompute.CachingTypesNone), // CreateOption: to.Ptr(armcompute.DiskCreateOptionTypesEmpty), // DiskSizeGB: to.Ptr[int32](1023), // Lun: to.Ptr[int32](1), // ManagedDisk: &armcompute.VirtualMachineScaleSetManagedDiskParameters{ // StorageAccountType: to.Ptr(armcompute.StorageAccountTypesStandardLRS), // }, // }}, // ImageReference: &armcompute.ImageReference{ // Offer: to.Ptr("WindowsServer"), // Publisher: to.Ptr("MicrosoftWindowsServer"), // SKU: to.Ptr("2016-Datacenter"), // Version: to.Ptr("latest"), // }, // OSDisk: &armcompute.VirtualMachineScaleSetOSDisk{ // Caching: to.Ptr(armcompute.CachingTypesReadWrite), // CreateOption: to.Ptr(armcompute.DiskCreateOptionTypesFromImage), // DiskSizeGB: to.Ptr[int32](512), // ManagedDisk: &armcompute.VirtualMachineScaleSetManagedDiskParameters{ // StorageAccountType: to.Ptr(armcompute.StorageAccountTypesStandardLRS), // }, // }, // }, // }, // }, // SKU: &armcompute.SKU{ // Name: to.Ptr("Standard_D2_v2"), // Capacity: to.Ptr[int64](3), // Tier: to.Ptr("Standard"), // }, // }
Output:
Example (CreateAScaleSetWithEphemeralOsDiskProvisioningInNvmeDiskUsingPlacementProperty) ¶
Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/92de53a5f1e0e03c94b40475d2135d97148ed014/specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-03-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSet_CreateA_WithDiffOsDiskUsingDiffDiskPlacementAsNvmeDisk.json
cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() clientFactory, err := armcompute.NewClientFactory("<subscription-id>", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } poller, err := clientFactory.NewVirtualMachineScaleSetsClient().BeginCreateOrUpdate(ctx, "myResourceGroup", "{vmss-name}", armcompute.VirtualMachineScaleSet{ Location: to.Ptr("westus"), Plan: &armcompute.Plan{ Name: to.Ptr("windows2016"), Product: to.Ptr("windows-data-science-vm"), Publisher: to.Ptr("microsoft-ads"), }, Properties: &armcompute.VirtualMachineScaleSetProperties{ Overprovision: to.Ptr(true), UpgradePolicy: &armcompute.UpgradePolicy{ Mode: to.Ptr(armcompute.UpgradeModeManual), }, VirtualMachineProfile: &armcompute.VirtualMachineScaleSetVMProfile{ NetworkProfile: &armcompute.VirtualMachineScaleSetNetworkProfile{ NetworkInterfaceConfigurations: []*armcompute.VirtualMachineScaleSetNetworkConfiguration{ { Name: to.Ptr("{vmss-name}"), Properties: &armcompute.VirtualMachineScaleSetNetworkConfigurationProperties{ EnableIPForwarding: to.Ptr(true), IPConfigurations: []*armcompute.VirtualMachineScaleSetIPConfiguration{ { Name: to.Ptr("{vmss-name}"), Properties: &armcompute.VirtualMachineScaleSetIPConfigurationProperties{ Subnet: &armcompute.APIEntityReference{ ID: to.Ptr("/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/virtualNetworks/{existing-virtual-network-name}/subnets/{existing-subnet-name}"), }, }, }}, Primary: to.Ptr(true), }, }}, }, OSProfile: &armcompute.VirtualMachineScaleSetOSProfile{ AdminPassword: to.Ptr("{your-password}"), AdminUsername: to.Ptr("{your-username}"), ComputerNamePrefix: to.Ptr("{vmss-name}"), }, StorageProfile: &armcompute.VirtualMachineScaleSetStorageProfile{ ImageReference: &armcompute.ImageReference{ Offer: to.Ptr("windows-data-science-vm"), Publisher: to.Ptr("microsoft-ads"), SKU: to.Ptr("windows2016"), Version: to.Ptr("latest"), }, OSDisk: &armcompute.VirtualMachineScaleSetOSDisk{ Caching: to.Ptr(armcompute.CachingTypesReadOnly), CreateOption: to.Ptr(armcompute.DiskCreateOptionTypesFromImage), DiffDiskSettings: &armcompute.DiffDiskSettings{ Option: to.Ptr(armcompute.DiffDiskOptionsLocal), Placement: to.Ptr(armcompute.DiffDiskPlacementNvmeDisk), }, ManagedDisk: &armcompute.VirtualMachineScaleSetManagedDiskParameters{ StorageAccountType: to.Ptr(armcompute.StorageAccountTypesStandardLRS), }, }, }, }, }, SKU: &armcompute.SKU{ Name: to.Ptr("Standard_DS1_v2"), Capacity: to.Ptr[int64](3), Tier: to.Ptr("Standard"), }, }, &armcompute.VirtualMachineScaleSetsClientBeginCreateOrUpdateOptions{IfMatch: nil, IfNoneMatch: nil, }) if err != nil { log.Fatalf("failed to finish the request: %v", err) } res, err := poller.PollUntilDone(ctx, nil) if err != nil { log.Fatalf("failed to pull the result: %v", err) } // You could use response here. We use blank identifier for just demo purposes. _ = res // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. // res.VirtualMachineScaleSet = armcompute.VirtualMachineScaleSet{ // Name: to.Ptr("{vmss-name}"), // Type: to.Ptr("Microsoft.Compute/virtualMachineScaleSets"), // ID: to.Ptr("/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/virtualMachineScaleSets/{vmss-name}"), // Location: to.Ptr("westus"), // Plan: &armcompute.Plan{ // Name: to.Ptr("standard-data-science-vm"), // Product: to.Ptr("standard-data-science-vm"), // Publisher: to.Ptr("microsoft-ads"), // }, // Properties: &armcompute.VirtualMachineScaleSetProperties{ // Overprovision: to.Ptr(true), // ProvisioningState: to.Ptr("Succeeded"), // SinglePlacementGroup: to.Ptr(true), // UniqueID: to.Ptr("b9e23088-6ffc-46e0-9e02-b0a6eeef47db"), // UpgradePolicy: &armcompute.UpgradePolicy{ // Mode: to.Ptr(armcompute.UpgradeModeManual), // }, // VirtualMachineProfile: &armcompute.VirtualMachineScaleSetVMProfile{ // NetworkProfile: &armcompute.VirtualMachineScaleSetNetworkProfile{ // NetworkInterfaceConfigurations: []*armcompute.VirtualMachineScaleSetNetworkConfiguration{ // { // Name: to.Ptr("{vmss-name}"), // Properties: &armcompute.VirtualMachineScaleSetNetworkConfigurationProperties{ // DNSSettings: &armcompute.VirtualMachineScaleSetNetworkConfigurationDNSSettings{ // DNSServers: []*string{ // }, // }, // EnableAcceleratedNetworking: to.Ptr(false), // EnableIPForwarding: to.Ptr(true), // IPConfigurations: []*armcompute.VirtualMachineScaleSetIPConfiguration{ // { // Name: to.Ptr("{vmss-name}"), // Properties: &armcompute.VirtualMachineScaleSetIPConfigurationProperties{ // PrivateIPAddressVersion: to.Ptr(armcompute.IPVersionIPv4), // Subnet: &armcompute.APIEntityReference{ // ID: to.Ptr("/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/virtualNetworks/nsgExistingVnet/subnets/nsgExistingSubnet"), // }, // }, // }}, // Primary: to.Ptr(true), // }, // }}, // }, // OSProfile: &armcompute.VirtualMachineScaleSetOSProfile{ // AdminUsername: to.Ptr("{your-username}"), // ComputerNamePrefix: to.Ptr("{vmss-name}"), // Secrets: []*armcompute.VaultSecretGroup{ // }, // WindowsConfiguration: &armcompute.WindowsConfiguration{ // EnableAutomaticUpdates: to.Ptr(true), // ProvisionVMAgent: to.Ptr(true), // }, // }, // StorageProfile: &armcompute.VirtualMachineScaleSetStorageProfile{ // ImageReference: &armcompute.ImageReference{ // Offer: to.Ptr("standard-data-science-vm"), // Publisher: to.Ptr("microsoft-ads"), // SKU: to.Ptr("standard-data-science-vm"), // Version: to.Ptr("latest"), // }, // OSDisk: &armcompute.VirtualMachineScaleSetOSDisk{ // Caching: to.Ptr(armcompute.CachingTypesReadOnly), // CreateOption: to.Ptr(armcompute.DiskCreateOptionTypesFromImage), // DiffDiskSettings: &armcompute.DiffDiskSettings{ // Option: to.Ptr(armcompute.DiffDiskOptionsLocal), // Placement: to.Ptr(armcompute.DiffDiskPlacementNvmeDisk), // }, // ManagedDisk: &armcompute.VirtualMachineScaleSetManagedDiskParameters{ // StorageAccountType: to.Ptr(armcompute.StorageAccountTypesStandardLRS), // }, // }, // }, // }, // }, // SKU: &armcompute.SKU{ // Name: to.Ptr("Standard_DS1_v2"), // Capacity: to.Ptr[int64](3), // Tier: to.Ptr("Standard"), // }, // }
Output:
Example (CreateAScaleSetWithEphemeralOsDisks) ¶
Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/92de53a5f1e0e03c94b40475d2135d97148ed014/specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-03-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSet_Create_WithDiffOsDisk.json
cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() clientFactory, err := armcompute.NewClientFactory("<subscription-id>", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } poller, err := clientFactory.NewVirtualMachineScaleSetsClient().BeginCreateOrUpdate(ctx, "myResourceGroup", "{vmss-name}", armcompute.VirtualMachineScaleSet{ Location: to.Ptr("westus"), Plan: &armcompute.Plan{ Name: to.Ptr("windows2016"), Product: to.Ptr("windows-data-science-vm"), Publisher: to.Ptr("microsoft-ads"), }, Properties: &armcompute.VirtualMachineScaleSetProperties{ Overprovision: to.Ptr(true), UpgradePolicy: &armcompute.UpgradePolicy{ Mode: to.Ptr(armcompute.UpgradeModeManual), }, VirtualMachineProfile: &armcompute.VirtualMachineScaleSetVMProfile{ NetworkProfile: &armcompute.VirtualMachineScaleSetNetworkProfile{ NetworkInterfaceConfigurations: []*armcompute.VirtualMachineScaleSetNetworkConfiguration{ { Name: to.Ptr("{vmss-name}"), Properties: &armcompute.VirtualMachineScaleSetNetworkConfigurationProperties{ EnableIPForwarding: to.Ptr(true), IPConfigurations: []*armcompute.VirtualMachineScaleSetIPConfiguration{ { Name: to.Ptr("{vmss-name}"), Properties: &armcompute.VirtualMachineScaleSetIPConfigurationProperties{ Subnet: &armcompute.APIEntityReference{ ID: to.Ptr("/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/virtualNetworks/{existing-virtual-network-name}/subnets/{existing-subnet-name}"), }, }, }}, Primary: to.Ptr(true), }, }}, }, OSProfile: &armcompute.VirtualMachineScaleSetOSProfile{ AdminPassword: to.Ptr("{your-password}"), AdminUsername: to.Ptr("{your-username}"), ComputerNamePrefix: to.Ptr("{vmss-name}"), }, StorageProfile: &armcompute.VirtualMachineScaleSetStorageProfile{ ImageReference: &armcompute.ImageReference{ Offer: to.Ptr("windows-data-science-vm"), Publisher: to.Ptr("microsoft-ads"), SKU: to.Ptr("windows2016"), Version: to.Ptr("latest"), }, OSDisk: &armcompute.VirtualMachineScaleSetOSDisk{ Caching: to.Ptr(armcompute.CachingTypesReadOnly), CreateOption: to.Ptr(armcompute.DiskCreateOptionTypesFromImage), DiffDiskSettings: &armcompute.DiffDiskSettings{ Option: to.Ptr(armcompute.DiffDiskOptionsLocal), }, ManagedDisk: &armcompute.VirtualMachineScaleSetManagedDiskParameters{ StorageAccountType: to.Ptr(armcompute.StorageAccountTypesStandardLRS), }, }, }, }, }, SKU: &armcompute.SKU{ Name: to.Ptr("Standard_DS1_v2"), Capacity: to.Ptr[int64](3), Tier: to.Ptr("Standard"), }, }, &armcompute.VirtualMachineScaleSetsClientBeginCreateOrUpdateOptions{IfMatch: nil, IfNoneMatch: nil, }) if err != nil { log.Fatalf("failed to finish the request: %v", err) } res, err := poller.PollUntilDone(ctx, nil) if err != nil { log.Fatalf("failed to pull the result: %v", err) } // You could use response here. We use blank identifier for just demo purposes. _ = res // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. // res.VirtualMachineScaleSet = armcompute.VirtualMachineScaleSet{ // Name: to.Ptr("{vmss-name}"), // Type: to.Ptr("Microsoft.Compute/virtualMachineScaleSets"), // ID: to.Ptr("/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/virtualMachineScaleSets/{vmss-name}"), // Location: to.Ptr("westus"), // Plan: &armcompute.Plan{ // Name: to.Ptr("standard-data-science-vm"), // Product: to.Ptr("standard-data-science-vm"), // Publisher: to.Ptr("microsoft-ads"), // }, // Properties: &armcompute.VirtualMachineScaleSetProperties{ // Overprovision: to.Ptr(true), // ProvisioningState: to.Ptr("Succeeded"), // SinglePlacementGroup: to.Ptr(true), // UniqueID: to.Ptr("b9e23088-6ffc-46e0-9e02-b0a6eeef47db"), // UpgradePolicy: &armcompute.UpgradePolicy{ // Mode: to.Ptr(armcompute.UpgradeModeManual), // }, // VirtualMachineProfile: &armcompute.VirtualMachineScaleSetVMProfile{ // NetworkProfile: &armcompute.VirtualMachineScaleSetNetworkProfile{ // NetworkInterfaceConfigurations: []*armcompute.VirtualMachineScaleSetNetworkConfiguration{ // { // Name: to.Ptr("{vmss-name}"), // Properties: &armcompute.VirtualMachineScaleSetNetworkConfigurationProperties{ // DNSSettings: &armcompute.VirtualMachineScaleSetNetworkConfigurationDNSSettings{ // DNSServers: []*string{ // }, // }, // EnableAcceleratedNetworking: to.Ptr(false), // EnableIPForwarding: to.Ptr(true), // IPConfigurations: []*armcompute.VirtualMachineScaleSetIPConfiguration{ // { // Name: to.Ptr("{vmss-name}"), // Properties: &armcompute.VirtualMachineScaleSetIPConfigurationProperties{ // PrivateIPAddressVersion: to.Ptr(armcompute.IPVersionIPv4), // Subnet: &armcompute.APIEntityReference{ // ID: to.Ptr("/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/virtualNetworks/nsgExistingVnet/subnets/nsgExistingSubnet"), // }, // }, // }}, // Primary: to.Ptr(true), // }, // }}, // }, // OSProfile: &armcompute.VirtualMachineScaleSetOSProfile{ // AdminUsername: to.Ptr("{your-username}"), // ComputerNamePrefix: to.Ptr("{vmss-name}"), // Secrets: []*armcompute.VaultSecretGroup{ // }, // WindowsConfiguration: &armcompute.WindowsConfiguration{ // EnableAutomaticUpdates: to.Ptr(true), // ProvisionVMAgent: to.Ptr(true), // }, // }, // StorageProfile: &armcompute.VirtualMachineScaleSetStorageProfile{ // ImageReference: &armcompute.ImageReference{ // Offer: to.Ptr("standard-data-science-vm"), // Publisher: to.Ptr("microsoft-ads"), // SKU: to.Ptr("standard-data-science-vm"), // Version: to.Ptr("latest"), // }, // OSDisk: &armcompute.VirtualMachineScaleSetOSDisk{ // Caching: to.Ptr(armcompute.CachingTypesReadOnly), // CreateOption: to.Ptr(armcompute.DiskCreateOptionTypesFromImage), // DiffDiskSettings: &armcompute.DiffDiskSettings{ // Option: to.Ptr(armcompute.DiffDiskOptionsLocal), // }, // ManagedDisk: &armcompute.VirtualMachineScaleSetManagedDiskParameters{ // StorageAccountType: to.Ptr(armcompute.StorageAccountTypesStandardLRS), // }, // }, // }, // }, // }, // SKU: &armcompute.SKU{ // Name: to.Ptr("Standard_DS1_v2"), // Capacity: to.Ptr[int64](3), // Tier: to.Ptr("Standard"), // }, // }
Output:
Example (CreateAScaleSetWithEphemeralOsDisksUsingPlacementProperty) ¶
Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/92de53a5f1e0e03c94b40475d2135d97148ed014/specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-03-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSet_CreateA_WithDiffOsDiskUsingDiffDiskPlacement.json
cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() clientFactory, err := armcompute.NewClientFactory("<subscription-id>", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } poller, err := clientFactory.NewVirtualMachineScaleSetsClient().BeginCreateOrUpdate(ctx, "myResourceGroup", "{vmss-name}", armcompute.VirtualMachineScaleSet{ Location: to.Ptr("westus"), Plan: &armcompute.Plan{ Name: to.Ptr("windows2016"), Product: to.Ptr("windows-data-science-vm"), Publisher: to.Ptr("microsoft-ads"), }, Properties: &armcompute.VirtualMachineScaleSetProperties{ Overprovision: to.Ptr(true), UpgradePolicy: &armcompute.UpgradePolicy{ Mode: to.Ptr(armcompute.UpgradeModeManual), }, VirtualMachineProfile: &armcompute.VirtualMachineScaleSetVMProfile{ NetworkProfile: &armcompute.VirtualMachineScaleSetNetworkProfile{ NetworkInterfaceConfigurations: []*armcompute.VirtualMachineScaleSetNetworkConfiguration{ { Name: to.Ptr("{vmss-name}"), Properties: &armcompute.VirtualMachineScaleSetNetworkConfigurationProperties{ EnableIPForwarding: to.Ptr(true), IPConfigurations: []*armcompute.VirtualMachineScaleSetIPConfiguration{ { Name: to.Ptr("{vmss-name}"), Properties: &armcompute.VirtualMachineScaleSetIPConfigurationProperties{ Subnet: &armcompute.APIEntityReference{ ID: to.Ptr("/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/virtualNetworks/{existing-virtual-network-name}/subnets/{existing-subnet-name}"), }, }, }}, Primary: to.Ptr(true), }, }}, }, OSProfile: &armcompute.VirtualMachineScaleSetOSProfile{ AdminPassword: to.Ptr("{your-password}"), AdminUsername: to.Ptr("{your-username}"), ComputerNamePrefix: to.Ptr("{vmss-name}"), }, StorageProfile: &armcompute.VirtualMachineScaleSetStorageProfile{ ImageReference: &armcompute.ImageReference{ Offer: to.Ptr("windows-data-science-vm"), Publisher: to.Ptr("microsoft-ads"), SKU: to.Ptr("windows2016"), Version: to.Ptr("latest"), }, OSDisk: &armcompute.VirtualMachineScaleSetOSDisk{ Caching: to.Ptr(armcompute.CachingTypesReadOnly), CreateOption: to.Ptr(armcompute.DiskCreateOptionTypesFromImage), DiffDiskSettings: &armcompute.DiffDiskSettings{ Option: to.Ptr(armcompute.DiffDiskOptionsLocal), Placement: to.Ptr(armcompute.DiffDiskPlacementResourceDisk), }, ManagedDisk: &armcompute.VirtualMachineScaleSetManagedDiskParameters{ StorageAccountType: to.Ptr(armcompute.StorageAccountTypesStandardLRS), }, }, }, }, }, SKU: &armcompute.SKU{ Name: to.Ptr("Standard_DS1_v2"), Capacity: to.Ptr[int64](3), Tier: to.Ptr("Standard"), }, }, &armcompute.VirtualMachineScaleSetsClientBeginCreateOrUpdateOptions{IfMatch: nil, IfNoneMatch: nil, }) if err != nil { log.Fatalf("failed to finish the request: %v", err) } res, err := poller.PollUntilDone(ctx, nil) if err != nil { log.Fatalf("failed to pull the result: %v", err) } // You could use response here. We use blank identifier for just demo purposes. _ = res // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. // res.VirtualMachineScaleSet = armcompute.VirtualMachineScaleSet{ // Name: to.Ptr("{vmss-name}"), // Type: to.Ptr("Microsoft.Compute/virtualMachineScaleSets"), // ID: to.Ptr("/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/virtualMachineScaleSets/{vmss-name}"), // Location: to.Ptr("westus"), // Plan: &armcompute.Plan{ // Name: to.Ptr("standard-data-science-vm"), // Product: to.Ptr("standard-data-science-vm"), // Publisher: to.Ptr("microsoft-ads"), // }, // Properties: &armcompute.VirtualMachineScaleSetProperties{ // Overprovision: to.Ptr(true), // ProvisioningState: to.Ptr("Succeeded"), // SinglePlacementGroup: to.Ptr(true), // UniqueID: to.Ptr("b9e23088-6ffc-46e0-9e02-b0a6eeef47db"), // UpgradePolicy: &armcompute.UpgradePolicy{ // Mode: to.Ptr(armcompute.UpgradeModeManual), // }, // VirtualMachineProfile: &armcompute.VirtualMachineScaleSetVMProfile{ // NetworkProfile: &armcompute.VirtualMachineScaleSetNetworkProfile{ // NetworkInterfaceConfigurations: []*armcompute.VirtualMachineScaleSetNetworkConfiguration{ // { // Name: to.Ptr("{vmss-name}"), // Properties: &armcompute.VirtualMachineScaleSetNetworkConfigurationProperties{ // DNSSettings: &armcompute.VirtualMachineScaleSetNetworkConfigurationDNSSettings{ // DNSServers: []*string{ // }, // }, // EnableAcceleratedNetworking: to.Ptr(false), // EnableIPForwarding: to.Ptr(true), // IPConfigurations: []*armcompute.VirtualMachineScaleSetIPConfiguration{ // { // Name: to.Ptr("{vmss-name}"), // Properties: &armcompute.VirtualMachineScaleSetIPConfigurationProperties{ // PrivateIPAddressVersion: to.Ptr(armcompute.IPVersionIPv4), // Subnet: &armcompute.APIEntityReference{ // ID: to.Ptr("/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/virtualNetworks/nsgExistingVnet/subnets/nsgExistingSubnet"), // }, // }, // }}, // Primary: to.Ptr(true), // }, // }}, // }, // OSProfile: &armcompute.VirtualMachineScaleSetOSProfile{ // AdminUsername: to.Ptr("{your-username}"), // ComputerNamePrefix: to.Ptr("{vmss-name}"), // Secrets: []*armcompute.VaultSecretGroup{ // }, // WindowsConfiguration: &armcompute.WindowsConfiguration{ // EnableAutomaticUpdates: to.Ptr(true), // ProvisionVMAgent: to.Ptr(true), // }, // }, // StorageProfile: &armcompute.VirtualMachineScaleSetStorageProfile{ // ImageReference: &armcompute.ImageReference{ // Offer: to.Ptr("standard-data-science-vm"), // Publisher: to.Ptr("microsoft-ads"), // SKU: to.Ptr("standard-data-science-vm"), // Version: to.Ptr("latest"), // }, // OSDisk: &armcompute.VirtualMachineScaleSetOSDisk{ // Caching: to.Ptr(armcompute.CachingTypesReadOnly), // CreateOption: to.Ptr(armcompute.DiskCreateOptionTypesFromImage), // DiffDiskSettings: &armcompute.DiffDiskSettings{ // Option: to.Ptr(armcompute.DiffDiskOptionsLocal), // Placement: to.Ptr(armcompute.DiffDiskPlacementResourceDisk), // }, // ManagedDisk: &armcompute.VirtualMachineScaleSetManagedDiskParameters{ // StorageAccountType: to.Ptr(armcompute.StorageAccountTypesStandardLRS), // }, // }, // }, // }, // }, // SKU: &armcompute.SKU{ // Name: to.Ptr("Standard_DS1_v2"), // Capacity: to.Ptr[int64](3), // Tier: to.Ptr("Standard"), // }, // }
Output:
Example (CreateAScaleSetWithExtensionTimeBudget) ¶
Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/92de53a5f1e0e03c94b40475d2135d97148ed014/specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-03-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSet_Create_WithExtensionsTimeBudget.json
cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() clientFactory, err := armcompute.NewClientFactory("<subscription-id>", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } poller, err := clientFactory.NewVirtualMachineScaleSetsClient().BeginCreateOrUpdate(ctx, "myResourceGroup", "{vmss-name}", armcompute.VirtualMachineScaleSet{ Location: to.Ptr("westus"), Properties: &armcompute.VirtualMachineScaleSetProperties{ Overprovision: to.Ptr(true), UpgradePolicy: &armcompute.UpgradePolicy{ Mode: to.Ptr(armcompute.UpgradeModeManual), }, VirtualMachineProfile: &armcompute.VirtualMachineScaleSetVMProfile{ DiagnosticsProfile: &armcompute.DiagnosticsProfile{ BootDiagnostics: &armcompute.BootDiagnostics{ Enabled: to.Ptr(true), StorageURI: to.Ptr("http://{existing-storage-account-name}.blob.core.windows.net"), }, }, ExtensionProfile: &armcompute.VirtualMachineScaleSetExtensionProfile{ ExtensionsTimeBudget: to.Ptr("PT1H20M"), Extensions: []*armcompute.VirtualMachineScaleSetExtension{ { Name: to.Ptr("{extension-name}"), Properties: &armcompute.VirtualMachineScaleSetExtensionProperties{ Type: to.Ptr("{extension-Type}"), AutoUpgradeMinorVersion: to.Ptr(false), Publisher: to.Ptr("{extension-Publisher}"), Settings: map[string]any{}, TypeHandlerVersion: to.Ptr("{handler-version}"), }, }}, }, NetworkProfile: &armcompute.VirtualMachineScaleSetNetworkProfile{ NetworkInterfaceConfigurations: []*armcompute.VirtualMachineScaleSetNetworkConfiguration{ { Name: to.Ptr("{vmss-name}"), Properties: &armcompute.VirtualMachineScaleSetNetworkConfigurationProperties{ EnableIPForwarding: to.Ptr(true), IPConfigurations: []*armcompute.VirtualMachineScaleSetIPConfiguration{ { Name: to.Ptr("{vmss-name}"), Properties: &armcompute.VirtualMachineScaleSetIPConfigurationProperties{ Subnet: &armcompute.APIEntityReference{ ID: to.Ptr("/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/virtualNetworks/{existing-virtual-network-name}/subnets/{existing-subnet-name}"), }, }, }}, Primary: to.Ptr(true), }, }}, }, OSProfile: &armcompute.VirtualMachineScaleSetOSProfile{ AdminPassword: to.Ptr("{your-password}"), AdminUsername: to.Ptr("{your-username}"), ComputerNamePrefix: to.Ptr("{vmss-name}"), }, StorageProfile: &armcompute.VirtualMachineScaleSetStorageProfile{ ImageReference: &armcompute.ImageReference{ Offer: to.Ptr("WindowsServer"), Publisher: to.Ptr("MicrosoftWindowsServer"), SKU: to.Ptr("2016-Datacenter"), Version: to.Ptr("latest"), }, OSDisk: &armcompute.VirtualMachineScaleSetOSDisk{ Caching: to.Ptr(armcompute.CachingTypesReadWrite), CreateOption: to.Ptr(armcompute.DiskCreateOptionTypesFromImage), ManagedDisk: &armcompute.VirtualMachineScaleSetManagedDiskParameters{ StorageAccountType: to.Ptr(armcompute.StorageAccountTypesStandardLRS), }, }, }, }, }, SKU: &armcompute.SKU{ Name: to.Ptr("Standard_D1_v2"), Capacity: to.Ptr[int64](3), Tier: to.Ptr("Standard"), }, }, &armcompute.VirtualMachineScaleSetsClientBeginCreateOrUpdateOptions{IfMatch: nil, IfNoneMatch: nil, }) if err != nil { log.Fatalf("failed to finish the request: %v", err) } res, err := poller.PollUntilDone(ctx, nil) if err != nil { log.Fatalf("failed to pull the result: %v", err) } // You could use response here. We use blank identifier for just demo purposes. _ = res // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. // res.VirtualMachineScaleSet = armcompute.VirtualMachineScaleSet{ // Name: to.Ptr("{vmss-name}"), // Type: to.Ptr("Microsoft.Compute/virtualMachineScaleSets"), // ID: to.Ptr("/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/virtualMachineScaleSets/{vmss-name}"), // Location: to.Ptr("westus"), // Properties: &armcompute.VirtualMachineScaleSetProperties{ // Overprovision: to.Ptr(true), // ProvisioningState: to.Ptr("Succeeded"), // SinglePlacementGroup: to.Ptr(true), // UniqueID: to.Ptr("d053ec5a-8da6-495f-ab13-38216503c6d7"), // UpgradePolicy: &armcompute.UpgradePolicy{ // Mode: to.Ptr(armcompute.UpgradeModeManual), // }, // VirtualMachineProfile: &armcompute.VirtualMachineScaleSetVMProfile{ // DiagnosticsProfile: &armcompute.DiagnosticsProfile{ // BootDiagnostics: &armcompute.BootDiagnostics{ // Enabled: to.Ptr(true), // StorageURI: to.Ptr("http://nsgdiagnostic.blob.core.windows.net"), // }, // }, // ExtensionProfile: &armcompute.VirtualMachineScaleSetExtensionProfile{ // ExtensionsTimeBudget: to.Ptr("PT1H20M"), // Extensions: []*armcompute.VirtualMachineScaleSetExtension{ // { // Name: to.Ptr("{extension-name}"), // Properties: &armcompute.VirtualMachineScaleSetExtensionProperties{ // Type: to.Ptr("{extension-Type}"), // AutoUpgradeMinorVersion: to.Ptr(false), // Publisher: to.Ptr("{extension-Publisher}"), // Settings: map[string]any{ // }, // TypeHandlerVersion: to.Ptr("{handler-version}"), // }, // }}, // }, // NetworkProfile: &armcompute.VirtualMachineScaleSetNetworkProfile{ // NetworkInterfaceConfigurations: []*armcompute.VirtualMachineScaleSetNetworkConfiguration{ // { // Name: to.Ptr("{vmss-name}"), // Properties: &armcompute.VirtualMachineScaleSetNetworkConfigurationProperties{ // DNSSettings: &armcompute.VirtualMachineScaleSetNetworkConfigurationDNSSettings{ // DNSServers: []*string{ // }, // }, // EnableAcceleratedNetworking: to.Ptr(false), // EnableIPForwarding: to.Ptr(true), // IPConfigurations: []*armcompute.VirtualMachineScaleSetIPConfiguration{ // { // Name: to.Ptr("{vmss-name}"), // Properties: &armcompute.VirtualMachineScaleSetIPConfigurationProperties{ // PrivateIPAddressVersion: to.Ptr(armcompute.IPVersionIPv4), // Subnet: &armcompute.APIEntityReference{ // ID: to.Ptr("/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/virtualNetworks/nsgExistingVnet/subnets/nsgExistingSubnet"), // }, // }, // }}, // Primary: to.Ptr(true), // }, // }}, // }, // OSProfile: &armcompute.VirtualMachineScaleSetOSProfile{ // AdminUsername: to.Ptr("{your-username}"), // ComputerNamePrefix: to.Ptr("{vmss-name}"), // Secrets: []*armcompute.VaultSecretGroup{ // }, // WindowsConfiguration: &armcompute.WindowsConfiguration{ // EnableAutomaticUpdates: to.Ptr(true), // ProvisionVMAgent: to.Ptr(true), // }, // }, // StorageProfile: &armcompute.VirtualMachineScaleSetStorageProfile{ // ImageReference: &armcompute.ImageReference{ // Offer: to.Ptr("WindowsServer"), // Publisher: to.Ptr("MicrosoftWindowsServer"), // SKU: to.Ptr("2016-Datacenter"), // Version: to.Ptr("latest"), // }, // OSDisk: &armcompute.VirtualMachineScaleSetOSDisk{ // Caching: to.Ptr(armcompute.CachingTypesReadWrite), // CreateOption: to.Ptr(armcompute.DiskCreateOptionTypesFromImage), // ManagedDisk: &armcompute.VirtualMachineScaleSetManagedDiskParameters{ // StorageAccountType: to.Ptr(armcompute.StorageAccountTypesStandardLRS), // }, // }, // }, // }, // }, // SKU: &armcompute.SKU{ // Name: to.Ptr("Standard_D1_v2"), // Capacity: to.Ptr[int64](3), // Tier: to.Ptr("Standard"), // }, // }
Output:
Example (CreateAScaleSetWithFpgaNetworkInterfaces) ¶
Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/92de53a5f1e0e03c94b40475d2135d97148ed014/specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-03-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSet_Create_FromWithFpgaNetworkInterface.json
cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() clientFactory, err := armcompute.NewClientFactory("<subscription-id>", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } poller, err := clientFactory.NewVirtualMachineScaleSetsClient().BeginCreateOrUpdate(ctx, "myResourceGroup", "{vmss-name}", armcompute.VirtualMachineScaleSet{ Location: to.Ptr("westus"), Properties: &armcompute.VirtualMachineScaleSetProperties{ Overprovision: to.Ptr(true), UpgradePolicy: &armcompute.UpgradePolicy{ Mode: to.Ptr(armcompute.UpgradeModeManual), }, VirtualMachineProfile: &armcompute.VirtualMachineScaleSetVMProfile{ NetworkProfile: &armcompute.VirtualMachineScaleSetNetworkProfile{ NetworkInterfaceConfigurations: []*armcompute.VirtualMachineScaleSetNetworkConfiguration{ { Name: to.Ptr("{vmss-name}"), Properties: &armcompute.VirtualMachineScaleSetNetworkConfigurationProperties{ EnableIPForwarding: to.Ptr(true), IPConfigurations: []*armcompute.VirtualMachineScaleSetIPConfiguration{ { Name: to.Ptr("{vmss-name}"), Properties: &armcompute.VirtualMachineScaleSetIPConfigurationProperties{ Subnet: &armcompute.APIEntityReference{ ID: to.Ptr("/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/virtualNetworks/{existing-virtual-network-name}/subnets/{existing-subnet-name}"), }, }, }}, Primary: to.Ptr(true), }, }, { Name: to.Ptr("{fpgaNic-Name}"), Properties: &armcompute.VirtualMachineScaleSetNetworkConfigurationProperties{ EnableAcceleratedNetworking: to.Ptr(false), EnableFpga: to.Ptr(true), EnableIPForwarding: to.Ptr(false), IPConfigurations: []*armcompute.VirtualMachineScaleSetIPConfiguration{ { Name: to.Ptr("{fpgaNic-Name}"), Properties: &armcompute.VirtualMachineScaleSetIPConfigurationProperties{ Primary: to.Ptr(true), PrivateIPAddressVersion: to.Ptr(armcompute.IPVersionIPv4), Subnet: &armcompute.APIEntityReference{ ID: to.Ptr("/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/virtualNetworks/{existing-virtual-network-name}/subnets/{existing-fpga-subnet-name}"), }, }, }}, Primary: to.Ptr(false), }, }}, }, OSProfile: &armcompute.VirtualMachineScaleSetOSProfile{ AdminPassword: to.Ptr("{your-password}"), AdminUsername: to.Ptr("{your-username}"), ComputerNamePrefix: to.Ptr("{vmss-name}"), }, StorageProfile: &armcompute.VirtualMachineScaleSetStorageProfile{ ImageReference: &armcompute.ImageReference{ ID: to.Ptr("/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/images/{existing-custom-image-name}"), }, OSDisk: &armcompute.VirtualMachineScaleSetOSDisk{ Caching: to.Ptr(armcompute.CachingTypesReadWrite), CreateOption: to.Ptr(armcompute.DiskCreateOptionTypesFromImage), ManagedDisk: &armcompute.VirtualMachineScaleSetManagedDiskParameters{ StorageAccountType: to.Ptr(armcompute.StorageAccountTypesStandardLRS), }, }, }, }, }, SKU: &armcompute.SKU{ Name: to.Ptr("Standard_D1_v2"), Capacity: to.Ptr[int64](3), Tier: to.Ptr("Standard"), }, }, &armcompute.VirtualMachineScaleSetsClientBeginCreateOrUpdateOptions{IfMatch: nil, IfNoneMatch: nil, }) if err != nil { log.Fatalf("failed to finish the request: %v", err) } res, err := poller.PollUntilDone(ctx, nil) if err != nil { log.Fatalf("failed to pull the result: %v", err) } // You could use response here. We use blank identifier for just demo purposes. _ = res // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. // res.VirtualMachineScaleSet = armcompute.VirtualMachineScaleSet{ // Name: to.Ptr("{vmss-name}"), // Type: to.Ptr("Microsoft.Compute/virtualMachineScaleSets"), // ID: to.Ptr("/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/virtualMachineScaleSets/{vmss-name}"), // Location: to.Ptr("westus"), // Properties: &armcompute.VirtualMachineScaleSetProperties{ // Overprovision: to.Ptr(true), // ProvisioningState: to.Ptr("Succeeded"), // SinglePlacementGroup: to.Ptr(true), // UniqueID: to.Ptr("afa2afa8-9e49-48fb-9d18-c86323b5d064"), // UpgradePolicy: &armcompute.UpgradePolicy{ // Mode: to.Ptr(armcompute.UpgradeModeManual), // }, // VirtualMachineProfile: &armcompute.VirtualMachineScaleSetVMProfile{ // NetworkProfile: &armcompute.VirtualMachineScaleSetNetworkProfile{ // NetworkInterfaceConfigurations: []*armcompute.VirtualMachineScaleSetNetworkConfiguration{ // { // Name: to.Ptr("{vmss-name}"), // Properties: &armcompute.VirtualMachineScaleSetNetworkConfigurationProperties{ // DNSSettings: &armcompute.VirtualMachineScaleSetNetworkConfigurationDNSSettings{ // DNSServers: []*string{ // }, // }, // EnableAcceleratedNetworking: to.Ptr(false), // EnableIPForwarding: to.Ptr(true), // IPConfigurations: []*armcompute.VirtualMachineScaleSetIPConfiguration{ // { // Name: to.Ptr("{vmss-name}"), // Properties: &armcompute.VirtualMachineScaleSetIPConfigurationProperties{ // PrivateIPAddressVersion: to.Ptr(armcompute.IPVersionIPv4), // Subnet: &armcompute.APIEntityReference{ // ID: to.Ptr("/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/virtualNetworks/nsgExistingVnet/subnets/nsgExistingSubnet"), // }, // }, // }}, // Primary: to.Ptr(true), // }, // }, // { // Name: to.Ptr("{fpgaNic-Name}"), // Properties: &armcompute.VirtualMachineScaleSetNetworkConfigurationProperties{ // DNSSettings: &armcompute.VirtualMachineScaleSetNetworkConfigurationDNSSettings{ // DNSServers: []*string{ // }, // }, // EnableAcceleratedNetworking: to.Ptr(false), // EnableFpga: to.Ptr(true), // IPConfigurations: []*armcompute.VirtualMachineScaleSetIPConfiguration{ // { // Name: to.Ptr("{fpgaNic-Name}"), // Properties: &armcompute.VirtualMachineScaleSetIPConfigurationProperties{ // Primary: to.Ptr(true), // PrivateIPAddressVersion: to.Ptr(armcompute.IPVersionIPv4), // Subnet: &armcompute.APIEntityReference{ // ID: to.Ptr("/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/virtualNetworks/{existing-virtual-network-name}/subnets/{existing-fpga-subnet-name}"), // }, // }, // }}, // Primary: to.Ptr(false), // }, // }}, // }, // OSProfile: &armcompute.VirtualMachineScaleSetOSProfile{ // AdminUsername: to.Ptr("{your-username}"), // ComputerNamePrefix: to.Ptr("{vmss-name}"), // LinuxConfiguration: &armcompute.LinuxConfiguration{ // DisablePasswordAuthentication: to.Ptr(false), // }, // Secrets: []*armcompute.VaultSecretGroup{ // }, // }, // StorageProfile: &armcompute.VirtualMachineScaleSetStorageProfile{ // ImageReference: &armcompute.ImageReference{ // ID: to.Ptr("/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/images/nsgcustom"), // }, // OSDisk: &armcompute.VirtualMachineScaleSetOSDisk{ // Caching: to.Ptr(armcompute.CachingTypesReadWrite), // CreateOption: to.Ptr(armcompute.DiskCreateOptionTypesFromImage), // ManagedDisk: &armcompute.VirtualMachineScaleSetManagedDiskParameters{ // StorageAccountType: to.Ptr(armcompute.StorageAccountTypesStandardLRS), // }, // }, // }, // }, // }, // SKU: &armcompute.SKU{ // Name: to.Ptr("Standard_D1_v2"), // Capacity: to.Ptr[int64](3), // Tier: to.Ptr("Standard"), // }, // }
Output:
Example (CreateAScaleSetWithHostEncryptionUsingEncryptionAtHostProperty) ¶
Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/92de53a5f1e0e03c94b40475d2135d97148ed014/specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-03-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSet_Create_WithEncryptionAtHost.json
cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() clientFactory, err := armcompute.NewClientFactory("<subscription-id>", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } poller, err := clientFactory.NewVirtualMachineScaleSetsClient().BeginCreateOrUpdate(ctx, "myResourceGroup", "{vmss-name}", armcompute.VirtualMachineScaleSet{ Location: to.Ptr("westus"), Plan: &armcompute.Plan{ Name: to.Ptr("windows2016"), Product: to.Ptr("windows-data-science-vm"), Publisher: to.Ptr("microsoft-ads"), }, Properties: &armcompute.VirtualMachineScaleSetProperties{ Overprovision: to.Ptr(true), UpgradePolicy: &armcompute.UpgradePolicy{ Mode: to.Ptr(armcompute.UpgradeModeManual), }, VirtualMachineProfile: &armcompute.VirtualMachineScaleSetVMProfile{ NetworkProfile: &armcompute.VirtualMachineScaleSetNetworkProfile{ NetworkInterfaceConfigurations: []*armcompute.VirtualMachineScaleSetNetworkConfiguration{ { Name: to.Ptr("{vmss-name}"), Properties: &armcompute.VirtualMachineScaleSetNetworkConfigurationProperties{ EnableIPForwarding: to.Ptr(true), IPConfigurations: []*armcompute.VirtualMachineScaleSetIPConfiguration{ { Name: to.Ptr("{vmss-name}"), Properties: &armcompute.VirtualMachineScaleSetIPConfigurationProperties{ Subnet: &armcompute.APIEntityReference{ ID: to.Ptr("/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/virtualNetworks/{existing-virtual-network-name}/subnets/{existing-subnet-name}"), }, }, }}, Primary: to.Ptr(true), }, }}, }, OSProfile: &armcompute.VirtualMachineScaleSetOSProfile{ AdminPassword: to.Ptr("{your-password}"), AdminUsername: to.Ptr("{your-username}"), ComputerNamePrefix: to.Ptr("{vmss-name}"), }, SecurityProfile: &armcompute.SecurityProfile{ EncryptionAtHost: to.Ptr(true), }, StorageProfile: &armcompute.VirtualMachineScaleSetStorageProfile{ ImageReference: &armcompute.ImageReference{ Offer: to.Ptr("windows-data-science-vm"), Publisher: to.Ptr("microsoft-ads"), SKU: to.Ptr("windows2016"), Version: to.Ptr("latest"), }, OSDisk: &armcompute.VirtualMachineScaleSetOSDisk{ Caching: to.Ptr(armcompute.CachingTypesReadOnly), CreateOption: to.Ptr(armcompute.DiskCreateOptionTypesFromImage), ManagedDisk: &armcompute.VirtualMachineScaleSetManagedDiskParameters{ StorageAccountType: to.Ptr(armcompute.StorageAccountTypesStandardLRS), }, }, }, }, }, SKU: &armcompute.SKU{ Name: to.Ptr("Standard_DS1_v2"), Capacity: to.Ptr[int64](3), Tier: to.Ptr("Standard"), }, }, &armcompute.VirtualMachineScaleSetsClientBeginCreateOrUpdateOptions{IfMatch: nil, IfNoneMatch: nil, }) if err != nil { log.Fatalf("failed to finish the request: %v", err) } res, err := poller.PollUntilDone(ctx, nil) if err != nil { log.Fatalf("failed to pull the result: %v", err) } // You could use response here. We use blank identifier for just demo purposes. _ = res // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. // res.VirtualMachineScaleSet = armcompute.VirtualMachineScaleSet{ // Name: to.Ptr("{vmss-name}"), // Type: to.Ptr("Microsoft.Compute/virtualMachineScaleSets"), // ID: to.Ptr("/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/virtualMachineScaleSets/{vmss-name}"), // Location: to.Ptr("westus"), // Plan: &armcompute.Plan{ // Name: to.Ptr("standard-data-science-vm"), // Product: to.Ptr("standard-data-science-vm"), // Publisher: to.Ptr("microsoft-ads"), // }, // Properties: &armcompute.VirtualMachineScaleSetProperties{ // Overprovision: to.Ptr(true), // ProvisioningState: to.Ptr("Succeeded"), // SinglePlacementGroup: to.Ptr(true), // UniqueID: to.Ptr("b9e23088-6ffc-46e0-9e02-b0a6eeef47db"), // UpgradePolicy: &armcompute.UpgradePolicy{ // Mode: to.Ptr(armcompute.UpgradeModeManual), // }, // VirtualMachineProfile: &armcompute.VirtualMachineScaleSetVMProfile{ // NetworkProfile: &armcompute.VirtualMachineScaleSetNetworkProfile{ // NetworkInterfaceConfigurations: []*armcompute.VirtualMachineScaleSetNetworkConfiguration{ // { // Name: to.Ptr("{vmss-name}"), // Properties: &armcompute.VirtualMachineScaleSetNetworkConfigurationProperties{ // DNSSettings: &armcompute.VirtualMachineScaleSetNetworkConfigurationDNSSettings{ // DNSServers: []*string{ // }, // }, // EnableAcceleratedNetworking: to.Ptr(false), // EnableIPForwarding: to.Ptr(true), // IPConfigurations: []*armcompute.VirtualMachineScaleSetIPConfiguration{ // { // Name: to.Ptr("{vmss-name}"), // Properties: &armcompute.VirtualMachineScaleSetIPConfigurationProperties{ // PrivateIPAddressVersion: to.Ptr(armcompute.IPVersionIPv4), // Subnet: &armcompute.APIEntityReference{ // ID: to.Ptr("/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/virtualNetworks/nsgExistingVnet/subnets/nsgExistingSubnet"), // }, // }, // }}, // Primary: to.Ptr(true), // }, // }}, // }, // OSProfile: &armcompute.VirtualMachineScaleSetOSProfile{ // AdminUsername: to.Ptr("{your-username}"), // ComputerNamePrefix: to.Ptr("{vmss-name}"), // Secrets: []*armcompute.VaultSecretGroup{ // }, // WindowsConfiguration: &armcompute.WindowsConfiguration{ // EnableAutomaticUpdates: to.Ptr(true), // ProvisionVMAgent: to.Ptr(true), // }, // }, // SecurityProfile: &armcompute.SecurityProfile{ // EncryptionAtHost: to.Ptr(true), // }, // StorageProfile: &armcompute.VirtualMachineScaleSetStorageProfile{ // ImageReference: &armcompute.ImageReference{ // Offer: to.Ptr("standard-data-science-vm"), // Publisher: to.Ptr("microsoft-ads"), // SKU: to.Ptr("standard-data-science-vm"), // Version: to.Ptr("latest"), // }, // OSDisk: &armcompute.VirtualMachineScaleSetOSDisk{ // Caching: to.Ptr(armcompute.CachingTypesReadOnly), // CreateOption: to.Ptr(armcompute.DiskCreateOptionTypesFromImage), // ManagedDisk: &armcompute.VirtualMachineScaleSetManagedDiskParameters{ // StorageAccountType: to.Ptr(armcompute.StorageAccountTypesStandardLRS), // }, // }, // }, // }, // }, // SKU: &armcompute.SKU{ // Name: to.Ptr("Standard_DS1_v2"), // Capacity: to.Ptr[int64](3), // Tier: to.Ptr("Standard"), // }, // }
Output:
Example (CreateAScaleSetWithManagedBootDiagnostics) ¶
Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/92de53a5f1e0e03c94b40475d2135d97148ed014/specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-03-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSet_Create_WithManagedBootDiagnostics.json
cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() clientFactory, err := armcompute.NewClientFactory("<subscription-id>", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } poller, err := clientFactory.NewVirtualMachineScaleSetsClient().BeginCreateOrUpdate(ctx, "myResourceGroup", "{vmss-name}", armcompute.VirtualMachineScaleSet{ Location: to.Ptr("westus"), Properties: &armcompute.VirtualMachineScaleSetProperties{ Overprovision: to.Ptr(true), UpgradePolicy: &armcompute.UpgradePolicy{ Mode: to.Ptr(armcompute.UpgradeModeManual), }, VirtualMachineProfile: &armcompute.VirtualMachineScaleSetVMProfile{ DiagnosticsProfile: &armcompute.DiagnosticsProfile{ BootDiagnostics: &armcompute.BootDiagnostics{ Enabled: to.Ptr(true), }, }, NetworkProfile: &armcompute.VirtualMachineScaleSetNetworkProfile{ NetworkInterfaceConfigurations: []*armcompute.VirtualMachineScaleSetNetworkConfiguration{ { Name: to.Ptr("{vmss-name}"), Properties: &armcompute.VirtualMachineScaleSetNetworkConfigurationProperties{ EnableIPForwarding: to.Ptr(true), IPConfigurations: []*armcompute.VirtualMachineScaleSetIPConfiguration{ { Name: to.Ptr("{vmss-name}"), Properties: &armcompute.VirtualMachineScaleSetIPConfigurationProperties{ Subnet: &armcompute.APIEntityReference{ ID: to.Ptr("/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/virtualNetworks/{existing-virtual-network-name}/subnets/{existing-subnet-name}"), }, }, }}, Primary: to.Ptr(true), }, }}, }, OSProfile: &armcompute.VirtualMachineScaleSetOSProfile{ AdminPassword: to.Ptr("{your-password}"), AdminUsername: to.Ptr("{your-username}"), ComputerNamePrefix: to.Ptr("{vmss-name}"), }, StorageProfile: &armcompute.VirtualMachineScaleSetStorageProfile{ ImageReference: &armcompute.ImageReference{ Offer: to.Ptr("WindowsServer"), Publisher: to.Ptr("MicrosoftWindowsServer"), SKU: to.Ptr("2016-Datacenter"), Version: to.Ptr("latest"), }, OSDisk: &armcompute.VirtualMachineScaleSetOSDisk{ Caching: to.Ptr(armcompute.CachingTypesReadWrite), CreateOption: to.Ptr(armcompute.DiskCreateOptionTypesFromImage), ManagedDisk: &armcompute.VirtualMachineScaleSetManagedDiskParameters{ StorageAccountType: to.Ptr(armcompute.StorageAccountTypesStandardLRS), }, }, }, }, }, SKU: &armcompute.SKU{ Name: to.Ptr("Standard_D1_v2"), Capacity: to.Ptr[int64](3), Tier: to.Ptr("Standard"), }, }, &armcompute.VirtualMachineScaleSetsClientBeginCreateOrUpdateOptions{IfMatch: nil, IfNoneMatch: nil, }) if err != nil { log.Fatalf("failed to finish the request: %v", err) } res, err := poller.PollUntilDone(ctx, nil) if err != nil { log.Fatalf("failed to pull the result: %v", err) } // You could use response here. We use blank identifier for just demo purposes. _ = res // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. // res.VirtualMachineScaleSet = armcompute.VirtualMachineScaleSet{ // Name: to.Ptr("{vmss-name}"), // Type: to.Ptr("Microsoft.Compute/virtualMachineScaleSets"), // ID: to.Ptr("/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/virtualMachineScaleSets/{vmss-name}"), // Location: to.Ptr("westus"), // Properties: &armcompute.VirtualMachineScaleSetProperties{ // Overprovision: to.Ptr(true), // ProvisioningState: to.Ptr("Succeeded"), // SinglePlacementGroup: to.Ptr(true), // UniqueID: to.Ptr("d053ec5a-8da6-495f-ab13-38216503c6d7"), // UpgradePolicy: &armcompute.UpgradePolicy{ // Mode: to.Ptr(armcompute.UpgradeModeManual), // }, // VirtualMachineProfile: &armcompute.VirtualMachineScaleSetVMProfile{ // DiagnosticsProfile: &armcompute.DiagnosticsProfile{ // BootDiagnostics: &armcompute.BootDiagnostics{ // Enabled: to.Ptr(true), // }, // }, // NetworkProfile: &armcompute.VirtualMachineScaleSetNetworkProfile{ // NetworkInterfaceConfigurations: []*armcompute.VirtualMachineScaleSetNetworkConfiguration{ // { // Name: to.Ptr("{vmss-name}"), // Properties: &armcompute.VirtualMachineScaleSetNetworkConfigurationProperties{ // DNSSettings: &armcompute.VirtualMachineScaleSetNetworkConfigurationDNSSettings{ // DNSServers: []*string{ // }, // }, // EnableAcceleratedNetworking: to.Ptr(false), // EnableIPForwarding: to.Ptr(true), // IPConfigurations: []*armcompute.VirtualMachineScaleSetIPConfiguration{ // { // Name: to.Ptr("{vmss-name}"), // Properties: &armcompute.VirtualMachineScaleSetIPConfigurationProperties{ // PrivateIPAddressVersion: to.Ptr(armcompute.IPVersionIPv4), // Subnet: &armcompute.APIEntityReference{ // ID: to.Ptr("/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/virtualNetworks/nsgExistingVnet/subnets/nsgExistingSubnet"), // }, // }, // }}, // Primary: to.Ptr(true), // }, // }}, // }, // OSProfile: &armcompute.VirtualMachineScaleSetOSProfile{ // AdminUsername: to.Ptr("{your-username}"), // ComputerNamePrefix: to.Ptr("{vmss-name}"), // Secrets: []*armcompute.VaultSecretGroup{ // }, // WindowsConfiguration: &armcompute.WindowsConfiguration{ // EnableAutomaticUpdates: to.Ptr(true), // ProvisionVMAgent: to.Ptr(true), // }, // }, // StorageProfile: &armcompute.VirtualMachineScaleSetStorageProfile{ // ImageReference: &armcompute.ImageReference{ // Offer: to.Ptr("WindowsServer"), // Publisher: to.Ptr("MicrosoftWindowsServer"), // SKU: to.Ptr("2016-Datacenter"), // Version: to.Ptr("latest"), // }, // OSDisk: &armcompute.VirtualMachineScaleSetOSDisk{ // Caching: to.Ptr(armcompute.CachingTypesReadWrite), // CreateOption: to.Ptr(armcompute.DiskCreateOptionTypesFromImage), // ManagedDisk: &armcompute.VirtualMachineScaleSetManagedDiskParameters{ // StorageAccountType: to.Ptr(armcompute.StorageAccountTypesStandardLRS), // }, // }, // }, // }, // }, // SKU: &armcompute.SKU{ // Name: to.Ptr("Standard_D1_v2"), // Capacity: to.Ptr[int64](3), // Tier: to.Ptr("Standard"), // }, // }
Output:
Example (CreateAScaleSetWithNetworkInterfacesWithPublicIpAddressDnsSettings) ¶
Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/92de53a5f1e0e03c94b40475d2135d97148ed014/specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-03-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSet_Create_FromWithNetworkInterfaceWithDnsSettings.json
cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() clientFactory, err := armcompute.NewClientFactory("<subscription-id>", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } poller, err := clientFactory.NewVirtualMachineScaleSetsClient().BeginCreateOrUpdate(ctx, "myResourceGroup", "{vmss-name}", armcompute.VirtualMachineScaleSet{ Location: to.Ptr("westus"), Properties: &armcompute.VirtualMachineScaleSetProperties{ Overprovision: to.Ptr(true), UpgradePolicy: &armcompute.UpgradePolicy{ Mode: to.Ptr(armcompute.UpgradeModeManual), }, VirtualMachineProfile: &armcompute.VirtualMachineScaleSetVMProfile{ NetworkProfile: &armcompute.VirtualMachineScaleSetNetworkProfile{ NetworkInterfaceConfigurations: []*armcompute.VirtualMachineScaleSetNetworkConfiguration{ { Name: to.Ptr("{nicConfig1-name}"), Properties: &armcompute.VirtualMachineScaleSetNetworkConfigurationProperties{ AuxiliaryMode: to.Ptr(armcompute.NetworkInterfaceAuxiliaryModeAcceleratedConnections), AuxiliarySKU: to.Ptr(armcompute.NetworkInterfaceAuxiliarySKUA1), DisableTCPStateTracking: to.Ptr(true), EnableAcceleratedNetworking: to.Ptr(true), EnableIPForwarding: to.Ptr(true), IPConfigurations: []*armcompute.VirtualMachineScaleSetIPConfiguration{ { Name: to.Ptr("{vmss-name}"), Properties: &armcompute.VirtualMachineScaleSetIPConfigurationProperties{ Subnet: &armcompute.APIEntityReference{ ID: to.Ptr("/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/virtualNetworks/{existing-virtual-network-name}/subnets/{existing-subnet-name}"), }, }, }}, Primary: to.Ptr(true), }, }, { Name: to.Ptr("{nicConfig2-name}"), Properties: &armcompute.VirtualMachineScaleSetNetworkConfigurationProperties{ DisableTCPStateTracking: to.Ptr(false), EnableAcceleratedNetworking: to.Ptr(false), EnableIPForwarding: to.Ptr(false), IPConfigurations: []*armcompute.VirtualMachineScaleSetIPConfiguration{ { Name: to.Ptr("{nicConfig2-name}"), Properties: &armcompute.VirtualMachineScaleSetIPConfigurationProperties{ Primary: to.Ptr(true), PrivateIPAddressVersion: to.Ptr(armcompute.IPVersionIPv4), PublicIPAddressConfiguration: &armcompute.VirtualMachineScaleSetPublicIPAddressConfiguration{ Name: to.Ptr("publicip"), Properties: &armcompute.VirtualMachineScaleSetPublicIPAddressConfigurationProperties{ DNSSettings: &armcompute.VirtualMachineScaleSetPublicIPAddressConfigurationDNSSettings{ DomainNameLabel: to.Ptr("vmsstestlabel01"), DomainNameLabelScope: to.Ptr(armcompute.DomainNameLabelScopeTypesNoReuse), }, IdleTimeoutInMinutes: to.Ptr[int32](10), }, }, Subnet: &armcompute.APIEntityReference{ ID: to.Ptr("/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/virtualNetworks/{existing-virtual-network-name}/subnets/{existing-fpga-subnet-name2}"), }, }, }}, Primary: to.Ptr(false), }, }}, }, OSProfile: &armcompute.VirtualMachineScaleSetOSProfile{ AdminPassword: to.Ptr("{your-password}"), AdminUsername: to.Ptr("{your-username}"), ComputerNamePrefix: to.Ptr("{vmss-name}"), }, StorageProfile: &armcompute.VirtualMachineScaleSetStorageProfile{ ImageReference: &armcompute.ImageReference{ ID: to.Ptr("/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/images/{existing-custom-image-name}"), }, OSDisk: &armcompute.VirtualMachineScaleSetOSDisk{ Caching: to.Ptr(armcompute.CachingTypesReadWrite), CreateOption: to.Ptr(armcompute.DiskCreateOptionTypesFromImage), ManagedDisk: &armcompute.VirtualMachineScaleSetManagedDiskParameters{ StorageAccountType: to.Ptr(armcompute.StorageAccountTypesStandardLRS), }, }, }, }, }, SKU: &armcompute.SKU{ Name: to.Ptr("Standard_D1_v2"), Capacity: to.Ptr[int64](3), Tier: to.Ptr("Standard"), }, }, &armcompute.VirtualMachineScaleSetsClientBeginCreateOrUpdateOptions{IfMatch: nil, IfNoneMatch: nil, }) if err != nil { log.Fatalf("failed to finish the request: %v", err) } res, err := poller.PollUntilDone(ctx, nil) if err != nil { log.Fatalf("failed to pull the result: %v", err) } // You could use response here. We use blank identifier for just demo purposes. _ = res // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. // res.VirtualMachineScaleSet = armcompute.VirtualMachineScaleSet{ // Name: to.Ptr("{vmss-name}"), // Type: to.Ptr("Microsoft.Compute/virtualMachineScaleSets"), // ID: to.Ptr("/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/virtualMachineScaleSets/{vmss-name}"), // Location: to.Ptr("westus"), // Properties: &armcompute.VirtualMachineScaleSetProperties{ // Overprovision: to.Ptr(true), // ProvisioningState: to.Ptr("Succeeded"), // SinglePlacementGroup: to.Ptr(true), // UniqueID: to.Ptr("afa2afa8-9e49-48fb-9d18-c86323b5d064"), // UpgradePolicy: &armcompute.UpgradePolicy{ // Mode: to.Ptr(armcompute.UpgradeModeManual), // }, // VirtualMachineProfile: &armcompute.VirtualMachineScaleSetVMProfile{ // NetworkProfile: &armcompute.VirtualMachineScaleSetNetworkProfile{ // NetworkInterfaceConfigurations: []*armcompute.VirtualMachineScaleSetNetworkConfiguration{ // { // Name: to.Ptr("{nicConfig1-name}"), // Properties: &armcompute.VirtualMachineScaleSetNetworkConfigurationProperties{ // AuxiliaryMode: to.Ptr(armcompute.NetworkInterfaceAuxiliaryModeAcceleratedConnections), // AuxiliarySKU: to.Ptr(armcompute.NetworkInterfaceAuxiliarySKUA1), // DisableTCPStateTracking: to.Ptr(true), // DNSSettings: &armcompute.VirtualMachineScaleSetNetworkConfigurationDNSSettings{ // DNSServers: []*string{ // }, // }, // EnableAcceleratedNetworking: to.Ptr(true), // EnableIPForwarding: to.Ptr(true), // IPConfigurations: []*armcompute.VirtualMachineScaleSetIPConfiguration{ // { // Name: to.Ptr("{nicConfig1-name}"), // Properties: &armcompute.VirtualMachineScaleSetIPConfigurationProperties{ // PrivateIPAddressVersion: to.Ptr(armcompute.IPVersionIPv4), // PublicIPAddressConfiguration: &armcompute.VirtualMachineScaleSetPublicIPAddressConfiguration{ // Name: to.Ptr("publicip"), // Properties: &armcompute.VirtualMachineScaleSetPublicIPAddressConfigurationProperties{ // DNSSettings: &armcompute.VirtualMachineScaleSetPublicIPAddressConfigurationDNSSettings{ // DomainNameLabel: to.Ptr("vmsstestlabel01"), // DomainNameLabelScope: to.Ptr(armcompute.DomainNameLabelScopeTypesTenantReuse), // }, // IdleTimeoutInMinutes: to.Ptr[int32](10), // }, // }, // Subnet: &armcompute.APIEntityReference{ // ID: to.Ptr("/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/virtualNetworks/nsgExistingVnet/subnets/nsgExistingSubnet"), // }, // }, // }}, // Primary: to.Ptr(true), // }, // }, // { // Name: to.Ptr("{nicConfig2-name}"), // Properties: &armcompute.VirtualMachineScaleSetNetworkConfigurationProperties{ // DisableTCPStateTracking: to.Ptr(false), // DNSSettings: &armcompute.VirtualMachineScaleSetNetworkConfigurationDNSSettings{ // DNSServers: []*string{ // }, // }, // EnableAcceleratedNetworking: to.Ptr(false), // EnableFpga: to.Ptr(false), // IPConfigurations: []*armcompute.VirtualMachineScaleSetIPConfiguration{ // { // Name: to.Ptr("{nicConfig2-name}"), // Properties: &armcompute.VirtualMachineScaleSetIPConfigurationProperties{ // Primary: to.Ptr(true), // PrivateIPAddressVersion: to.Ptr(armcompute.IPVersionIPv4), // Subnet: &armcompute.APIEntityReference{ // ID: to.Ptr("/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/virtualNetworks/{existing-virtual-network-name}/subnets/{existing-fpga-subnet-name2}"), // }, // }, // }}, // Primary: to.Ptr(false), // }, // }}, // }, // OSProfile: &armcompute.VirtualMachineScaleSetOSProfile{ // AdminUsername: to.Ptr("{your-username}"), // ComputerNamePrefix: to.Ptr("{vmss-name}"), // LinuxConfiguration: &armcompute.LinuxConfiguration{ // DisablePasswordAuthentication: to.Ptr(false), // }, // Secrets: []*armcompute.VaultSecretGroup{ // }, // }, // StorageProfile: &armcompute.VirtualMachineScaleSetStorageProfile{ // ImageReference: &armcompute.ImageReference{ // ID: to.Ptr("/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/images/nsgcustom"), // }, // OSDisk: &armcompute.VirtualMachineScaleSetOSDisk{ // Caching: to.Ptr(armcompute.CachingTypesReadWrite), // CreateOption: to.Ptr(armcompute.DiskCreateOptionTypesFromImage), // ManagedDisk: &armcompute.VirtualMachineScaleSetManagedDiskParameters{ // StorageAccountType: to.Ptr(armcompute.StorageAccountTypesStandardLRS), // }, // }, // }, // }, // }, // SKU: &armcompute.SKU{ // Name: to.Ptr("Standard_D1_v2"), // Capacity: to.Ptr[int64](3), // Tier: to.Ptr("Standard"), // }, // }
Output:
Example (CreateAScaleSetWithOsImageScheduledEventsEnabled) ¶
Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/92de53a5f1e0e03c94b40475d2135d97148ed014/specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-03-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSet_Create_WithOSImageScheduledEventEnabled.json
cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() clientFactory, err := armcompute.NewClientFactory("<subscription-id>", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } poller, err := clientFactory.NewVirtualMachineScaleSetsClient().BeginCreateOrUpdate(ctx, "myResourceGroup", "{vmss-name}", armcompute.VirtualMachineScaleSet{ Location: to.Ptr("westus"), Properties: &armcompute.VirtualMachineScaleSetProperties{ Overprovision: to.Ptr(true), UpgradePolicy: &armcompute.UpgradePolicy{ Mode: to.Ptr(armcompute.UpgradeModeManual), }, VirtualMachineProfile: &armcompute.VirtualMachineScaleSetVMProfile{ NetworkProfile: &armcompute.VirtualMachineScaleSetNetworkProfile{ NetworkInterfaceConfigurations: []*armcompute.VirtualMachineScaleSetNetworkConfiguration{ { Name: to.Ptr("{vmss-name}"), Properties: &armcompute.VirtualMachineScaleSetNetworkConfigurationProperties{ EnableIPForwarding: to.Ptr(true), IPConfigurations: []*armcompute.VirtualMachineScaleSetIPConfiguration{ { Name: to.Ptr("{vmss-name}"), Properties: &armcompute.VirtualMachineScaleSetIPConfigurationProperties{ Subnet: &armcompute.APIEntityReference{ ID: to.Ptr("/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/virtualNetworks/{existing-virtual-network-name}/subnets/{existing-subnet-name}"), }, }, }}, Primary: to.Ptr(true), }, }}, }, OSProfile: &armcompute.VirtualMachineScaleSetOSProfile{ AdminPassword: to.Ptr("{your-password}"), AdminUsername: to.Ptr("{your-username}"), ComputerNamePrefix: to.Ptr("{vmss-name}"), }, ScheduledEventsProfile: &armcompute.ScheduledEventsProfile{ OSImageNotificationProfile: &armcompute.OSImageNotificationProfile{ Enable: to.Ptr(true), NotBeforeTimeout: to.Ptr("PT15M"), }, }, StorageProfile: &armcompute.VirtualMachineScaleSetStorageProfile{ ImageReference: &armcompute.ImageReference{ Offer: to.Ptr("WindowsServer"), Publisher: to.Ptr("MicrosoftWindowsServer"), SKU: to.Ptr("2016-Datacenter"), Version: to.Ptr("latest"), }, OSDisk: &armcompute.VirtualMachineScaleSetOSDisk{ Caching: to.Ptr(armcompute.CachingTypesReadWrite), CreateOption: to.Ptr(armcompute.DiskCreateOptionTypesFromImage), ManagedDisk: &armcompute.VirtualMachineScaleSetManagedDiskParameters{ StorageAccountType: to.Ptr(armcompute.StorageAccountTypesStandardLRS), }, }, }, }, }, SKU: &armcompute.SKU{ Name: to.Ptr("Standard_D1_v2"), Capacity: to.Ptr[int64](3), Tier: to.Ptr("Standard"), }, }, &armcompute.VirtualMachineScaleSetsClientBeginCreateOrUpdateOptions{IfMatch: nil, IfNoneMatch: nil, }) if err != nil { log.Fatalf("failed to finish the request: %v", err) } res, err := poller.PollUntilDone(ctx, nil) if err != nil { log.Fatalf("failed to pull the result: %v", err) } // You could use response here. We use blank identifier for just demo purposes. _ = res // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. // res.VirtualMachineScaleSet = armcompute.VirtualMachineScaleSet{ // Name: to.Ptr("{vmss-name}"), // Type: to.Ptr("Microsoft.Compute/virtualMachineScaleSets"), // ID: to.Ptr("/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/virtualMachineScaleSets/{vmss-name}"), // Location: to.Ptr("westus"), // Properties: &armcompute.VirtualMachineScaleSetProperties{ // Overprovision: to.Ptr(true), // ProvisioningState: to.Ptr("Succeeded"), // SinglePlacementGroup: to.Ptr(true), // UniqueID: to.Ptr("d053ec5a-8da6-495f-ab13-38216503c6d7"), // UpgradePolicy: &armcompute.UpgradePolicy{ // Mode: to.Ptr(armcompute.UpgradeModeManual), // }, // VirtualMachineProfile: &armcompute.VirtualMachineScaleSetVMProfile{ // NetworkProfile: &armcompute.VirtualMachineScaleSetNetworkProfile{ // NetworkInterfaceConfigurations: []*armcompute.VirtualMachineScaleSetNetworkConfiguration{ // { // Name: to.Ptr("{vmss-name}"), // Properties: &armcompute.VirtualMachineScaleSetNetworkConfigurationProperties{ // DNSSettings: &armcompute.VirtualMachineScaleSetNetworkConfigurationDNSSettings{ // DNSServers: []*string{ // }, // }, // EnableAcceleratedNetworking: to.Ptr(false), // EnableIPForwarding: to.Ptr(true), // IPConfigurations: []*armcompute.VirtualMachineScaleSetIPConfiguration{ // { // Name: to.Ptr("{vmss-name}"), // Properties: &armcompute.VirtualMachineScaleSetIPConfigurationProperties{ // PrivateIPAddressVersion: to.Ptr(armcompute.IPVersionIPv4), // Subnet: &armcompute.APIEntityReference{ // ID: to.Ptr("/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/virtualNetworks/nsgExistingVnet/subnets/nsgExistingSubnet"), // }, // }, // }}, // Primary: to.Ptr(true), // }, // }}, // }, // OSProfile: &armcompute.VirtualMachineScaleSetOSProfile{ // AdminUsername: to.Ptr("{your-username}"), // ComputerNamePrefix: to.Ptr("{vmss-name}"), // Secrets: []*armcompute.VaultSecretGroup{ // }, // WindowsConfiguration: &armcompute.WindowsConfiguration{ // EnableAutomaticUpdates: to.Ptr(true), // ProvisionVMAgent: to.Ptr(true), // }, // }, // ScheduledEventsProfile: &armcompute.ScheduledEventsProfile{ // OSImageNotificationProfile: &armcompute.OSImageNotificationProfile{ // Enable: to.Ptr(true), // NotBeforeTimeout: to.Ptr("PT15M"), // }, // }, // StorageProfile: &armcompute.VirtualMachineScaleSetStorageProfile{ // ImageReference: &armcompute.ImageReference{ // Offer: to.Ptr("WindowsServer"), // Publisher: to.Ptr("MicrosoftWindowsServer"), // SKU: to.Ptr("2016-Datacenter"), // Version: to.Ptr("latest"), // }, // OSDisk: &armcompute.VirtualMachineScaleSetOSDisk{ // Caching: to.Ptr(armcompute.CachingTypesReadWrite), // CreateOption: to.Ptr(armcompute.DiskCreateOptionTypesFromImage), // ManagedDisk: &armcompute.VirtualMachineScaleSetManagedDiskParameters{ // StorageAccountType: to.Ptr(armcompute.StorageAccountTypesStandardLRS), // }, // }, // }, // }, // }, // SKU: &armcompute.SKU{ // Name: to.Ptr("Standard_D1_v2"), // Capacity: to.Ptr[int64](3), // Tier: to.Ptr("Standard"), // }, // }
Output:
Example (CreateAScaleSetWithPasswordAuthentication) ¶
Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/92de53a5f1e0e03c94b40475d2135d97148ed014/specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-03-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSet_Create_WithPasswordAuthentication.json
cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() clientFactory, err := armcompute.NewClientFactory("<subscription-id>", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } poller, err := clientFactory.NewVirtualMachineScaleSetsClient().BeginCreateOrUpdate(ctx, "myResourceGroup", "{vmss-name}", armcompute.VirtualMachineScaleSet{ Location: to.Ptr("westus"), Properties: &armcompute.VirtualMachineScaleSetProperties{ Overprovision: to.Ptr(true), UpgradePolicy: &armcompute.UpgradePolicy{ Mode: to.Ptr(armcompute.UpgradeModeManual), }, VirtualMachineProfile: &armcompute.VirtualMachineScaleSetVMProfile{ NetworkProfile: &armcompute.VirtualMachineScaleSetNetworkProfile{ NetworkInterfaceConfigurations: []*armcompute.VirtualMachineScaleSetNetworkConfiguration{ { Name: to.Ptr("{vmss-name}"), Properties: &armcompute.VirtualMachineScaleSetNetworkConfigurationProperties{ EnableIPForwarding: to.Ptr(true), IPConfigurations: []*armcompute.VirtualMachineScaleSetIPConfiguration{ { Name: to.Ptr("{vmss-name}"), Properties: &armcompute.VirtualMachineScaleSetIPConfigurationProperties{ Subnet: &armcompute.APIEntityReference{ ID: to.Ptr("/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/virtualNetworks/{existing-virtual-network-name}/subnets/{existing-subnet-name}"), }, }, }}, Primary: to.Ptr(true), }, }}, }, OSProfile: &armcompute.VirtualMachineScaleSetOSProfile{ AdminPassword: to.Ptr("{your-password}"), AdminUsername: to.Ptr("{your-username}"), ComputerNamePrefix: to.Ptr("{vmss-name}"), }, StorageProfile: &armcompute.VirtualMachineScaleSetStorageProfile{ ImageReference: &armcompute.ImageReference{ Offer: to.Ptr("WindowsServer"), Publisher: to.Ptr("MicrosoftWindowsServer"), SKU: to.Ptr("2016-Datacenter"), Version: to.Ptr("latest"), }, OSDisk: &armcompute.VirtualMachineScaleSetOSDisk{ Caching: to.Ptr(armcompute.CachingTypesReadWrite), CreateOption: to.Ptr(armcompute.DiskCreateOptionTypesFromImage), ManagedDisk: &armcompute.VirtualMachineScaleSetManagedDiskParameters{ StorageAccountType: to.Ptr(armcompute.StorageAccountTypesStandardLRS), }, }, }, }, }, SKU: &armcompute.SKU{ Name: to.Ptr("Standard_D1_v2"), Capacity: to.Ptr[int64](3), Tier: to.Ptr("Standard"), }, }, &armcompute.VirtualMachineScaleSetsClientBeginCreateOrUpdateOptions{IfMatch: nil, IfNoneMatch: nil, }) if err != nil { log.Fatalf("failed to finish the request: %v", err) } res, err := poller.PollUntilDone(ctx, nil) if err != nil { log.Fatalf("failed to pull the result: %v", err) } // You could use response here. We use blank identifier for just demo purposes. _ = res // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. // res.VirtualMachineScaleSet = armcompute.VirtualMachineScaleSet{ // Name: to.Ptr("{vmss-name}"), // Type: to.Ptr("Microsoft.Compute/virtualMachineScaleSets"), // ID: to.Ptr("/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/virtualMachineScaleSets/{vmss-name}"), // Location: to.Ptr("westus"), // Properties: &armcompute.VirtualMachineScaleSetProperties{ // Overprovision: to.Ptr(true), // ProvisioningState: to.Ptr("Succeeded"), // SinglePlacementGroup: to.Ptr(true), // UniqueID: to.Ptr("ffb27c5c-39a5-4d4e-b307-b32598689813"), // UpgradePolicy: &armcompute.UpgradePolicy{ // Mode: to.Ptr(armcompute.UpgradeModeManual), // }, // VirtualMachineProfile: &armcompute.VirtualMachineScaleSetVMProfile{ // NetworkProfile: &armcompute.VirtualMachineScaleSetNetworkProfile{ // NetworkInterfaceConfigurations: []*armcompute.VirtualMachineScaleSetNetworkConfiguration{ // { // Name: to.Ptr("{vmss-name}"), // Properties: &armcompute.VirtualMachineScaleSetNetworkConfigurationProperties{ // DNSSettings: &armcompute.VirtualMachineScaleSetNetworkConfigurationDNSSettings{ // DNSServers: []*string{ // }, // }, // EnableAcceleratedNetworking: to.Ptr(false), // EnableIPForwarding: to.Ptr(true), // IPConfigurations: []*armcompute.VirtualMachineScaleSetIPConfiguration{ // { // Name: to.Ptr("{vmss-name}"), // Properties: &armcompute.VirtualMachineScaleSetIPConfigurationProperties{ // PrivateIPAddressVersion: to.Ptr(armcompute.IPVersionIPv4), // Subnet: &armcompute.APIEntityReference{ // ID: to.Ptr("/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/virtualNetworks/nsgExistingVnet/subnets/nsgExistingSubnet"), // }, // }, // }}, // Primary: to.Ptr(true), // }, // }}, // }, // OSProfile: &armcompute.VirtualMachineScaleSetOSProfile{ // AdminUsername: to.Ptr("{your-username}"), // ComputerNamePrefix: to.Ptr("{vmss-name}"), // Secrets: []*armcompute.VaultSecretGroup{ // }, // WindowsConfiguration: &armcompute.WindowsConfiguration{ // EnableAutomaticUpdates: to.Ptr(true), // ProvisionVMAgent: to.Ptr(true), // }, // }, // StorageProfile: &armcompute.VirtualMachineScaleSetStorageProfile{ // ImageReference: &armcompute.ImageReference{ // Offer: to.Ptr("WindowsServer"), // Publisher: to.Ptr("MicrosoftWindowsServer"), // SKU: to.Ptr("2016-Datacenter"), // Version: to.Ptr("latest"), // }, // OSDisk: &armcompute.VirtualMachineScaleSetOSDisk{ // Caching: to.Ptr(armcompute.CachingTypesReadWrite), // CreateOption: to.Ptr(armcompute.DiskCreateOptionTypesFromImage), // ManagedDisk: &armcompute.VirtualMachineScaleSetManagedDiskParameters{ // StorageAccountType: to.Ptr(armcompute.StorageAccountTypesStandardLRS), // }, // }, // }, // }, // }, // SKU: &armcompute.SKU{ // Name: to.Ptr("Standard_D1_v2"), // Capacity: to.Ptr[int64](3), // Tier: to.Ptr("Standard"), // }, // }
Output:
Example (CreateAScaleSetWithPremiumStorage) ¶
Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/92de53a5f1e0e03c94b40475d2135d97148ed014/specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-03-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSet_Create_WithPremiumStorage.json
cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() clientFactory, err := armcompute.NewClientFactory("<subscription-id>", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } poller, err := clientFactory.NewVirtualMachineScaleSetsClient().BeginCreateOrUpdate(ctx, "myResourceGroup", "{vmss-name}", armcompute.VirtualMachineScaleSet{ Location: to.Ptr("westus"), Properties: &armcompute.VirtualMachineScaleSetProperties{ Overprovision: to.Ptr(true), UpgradePolicy: &armcompute.UpgradePolicy{ Mode: to.Ptr(armcompute.UpgradeModeManual), }, VirtualMachineProfile: &armcompute.VirtualMachineScaleSetVMProfile{ NetworkProfile: &armcompute.VirtualMachineScaleSetNetworkProfile{ NetworkInterfaceConfigurations: []*armcompute.VirtualMachineScaleSetNetworkConfiguration{ { Name: to.Ptr("{vmss-name}"), Properties: &armcompute.VirtualMachineScaleSetNetworkConfigurationProperties{ EnableIPForwarding: to.Ptr(true), IPConfigurations: []*armcompute.VirtualMachineScaleSetIPConfiguration{ { Name: to.Ptr("{vmss-name}"), Properties: &armcompute.VirtualMachineScaleSetIPConfigurationProperties{ Subnet: &armcompute.APIEntityReference{ ID: to.Ptr("/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/virtualNetworks/{existing-virtual-network-name}/subnets/{existing-subnet-name}"), }, }, }}, Primary: to.Ptr(true), }, }}, }, OSProfile: &armcompute.VirtualMachineScaleSetOSProfile{ AdminPassword: to.Ptr("{your-password}"), AdminUsername: to.Ptr("{your-username}"), ComputerNamePrefix: to.Ptr("{vmss-name}"), }, StorageProfile: &armcompute.VirtualMachineScaleSetStorageProfile{ ImageReference: &armcompute.ImageReference{ Offer: to.Ptr("WindowsServer"), Publisher: to.Ptr("MicrosoftWindowsServer"), SKU: to.Ptr("2016-Datacenter"), Version: to.Ptr("latest"), }, OSDisk: &armcompute.VirtualMachineScaleSetOSDisk{ Caching: to.Ptr(armcompute.CachingTypesReadWrite), CreateOption: to.Ptr(armcompute.DiskCreateOptionTypesFromImage), ManagedDisk: &armcompute.VirtualMachineScaleSetManagedDiskParameters{ StorageAccountType: to.Ptr(armcompute.StorageAccountTypesPremiumLRS), }, }, }, }, }, SKU: &armcompute.SKU{ Name: to.Ptr("Standard_D1_v2"), Capacity: to.Ptr[int64](3), Tier: to.Ptr("Standard"), }, }, &armcompute.VirtualMachineScaleSetsClientBeginCreateOrUpdateOptions{IfMatch: nil, IfNoneMatch: nil, }) if err != nil { log.Fatalf("failed to finish the request: %v", err) } res, err := poller.PollUntilDone(ctx, nil) if err != nil { log.Fatalf("failed to pull the result: %v", err) } // You could use response here. We use blank identifier for just demo purposes. _ = res // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. // res.VirtualMachineScaleSet = armcompute.VirtualMachineScaleSet{ // Name: to.Ptr("{vmss-name}"), // Type: to.Ptr("Microsoft.Compute/virtualMachineScaleSets"), // ID: to.Ptr("/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/virtualMachineScaleSets/{vmss-name}"), // Location: to.Ptr("westus"), // Properties: &armcompute.VirtualMachineScaleSetProperties{ // Overprovision: to.Ptr(true), // ProvisioningState: to.Ptr("Succeeded"), // SinglePlacementGroup: to.Ptr(true), // UniqueID: to.Ptr("19fd38a2-f50a-42c6-9dc7-3f9cf3791225"), // UpgradePolicy: &armcompute.UpgradePolicy{ // Mode: to.Ptr(armcompute.UpgradeModeManual), // }, // VirtualMachineProfile: &armcompute.VirtualMachineScaleSetVMProfile{ // NetworkProfile: &armcompute.VirtualMachineScaleSetNetworkProfile{ // NetworkInterfaceConfigurations: []*armcompute.VirtualMachineScaleSetNetworkConfiguration{ // { // Name: to.Ptr("{vmss-name}"), // Properties: &armcompute.VirtualMachineScaleSetNetworkConfigurationProperties{ // DNSSettings: &armcompute.VirtualMachineScaleSetNetworkConfigurationDNSSettings{ // DNSServers: []*string{ // }, // }, // EnableAcceleratedNetworking: to.Ptr(false), // EnableIPForwarding: to.Ptr(true), // IPConfigurations: []*armcompute.VirtualMachineScaleSetIPConfiguration{ // { // Name: to.Ptr("{vmss-name}"), // Properties: &armcompute.VirtualMachineScaleSetIPConfigurationProperties{ // PrivateIPAddressVersion: to.Ptr(armcompute.IPVersionIPv4), // Subnet: &armcompute.APIEntityReference{ // ID: to.Ptr("/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/virtualNetworks/nsgExistingVnet/subnets/nsgExistingSubnet"), // }, // }, // }}, // Primary: to.Ptr(true), // }, // }}, // }, // OSProfile: &armcompute.VirtualMachineScaleSetOSProfile{ // AdminUsername: to.Ptr("{your-username}"), // ComputerNamePrefix: to.Ptr("{vmss-name}"), // Secrets: []*armcompute.VaultSecretGroup{ // }, // WindowsConfiguration: &armcompute.WindowsConfiguration{ // EnableAutomaticUpdates: to.Ptr(true), // ProvisionVMAgent: to.Ptr(true), // }, // }, // StorageProfile: &armcompute.VirtualMachineScaleSetStorageProfile{ // ImageReference: &armcompute.ImageReference{ // Offer: to.Ptr("WindowsServer"), // Publisher: to.Ptr("MicrosoftWindowsServer"), // SKU: to.Ptr("2016-Datacenter"), // Version: to.Ptr("latest"), // }, // OSDisk: &armcompute.VirtualMachineScaleSetOSDisk{ // Caching: to.Ptr(armcompute.CachingTypesReadWrite), // CreateOption: to.Ptr(armcompute.DiskCreateOptionTypesFromImage), // ManagedDisk: &armcompute.VirtualMachineScaleSetManagedDiskParameters{ // StorageAccountType: to.Ptr(armcompute.StorageAccountTypesPremiumLRS), // }, // }, // }, // }, // }, // SKU: &armcompute.SKU{ // Name: to.Ptr("Standard_DS1_v2"), // Capacity: to.Ptr[int64](3), // Tier: to.Ptr("Standard"), // }, // }
Output:
Example (CreateAScaleSetWithPriorityMixPolicy) ¶
Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/92de53a5f1e0e03c94b40475d2135d97148ed014/specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-03-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSet_Create_WithPriorityMixPolicy.json
cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() clientFactory, err := armcompute.NewClientFactory("<subscription-id>", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } poller, err := clientFactory.NewVirtualMachineScaleSetsClient().BeginCreateOrUpdate(ctx, "myResourceGroup", "{vmss-name}", armcompute.VirtualMachineScaleSet{ Location: to.Ptr("westus"), Properties: &armcompute.VirtualMachineScaleSetProperties{ OrchestrationMode: to.Ptr(armcompute.OrchestrationModeFlexible), PriorityMixPolicy: &armcompute.PriorityMixPolicy{ BaseRegularPriorityCount: to.Ptr[int32](4), RegularPriorityPercentageAboveBase: to.Ptr[int32](50), }, SinglePlacementGroup: to.Ptr(false), VirtualMachineProfile: &armcompute.VirtualMachineScaleSetVMProfile{ BillingProfile: &armcompute.BillingProfile{ MaxPrice: to.Ptr[float64](-1), }, EvictionPolicy: to.Ptr(armcompute.VirtualMachineEvictionPolicyTypesDeallocate), NetworkProfile: &armcompute.VirtualMachineScaleSetNetworkProfile{ NetworkInterfaceConfigurations: []*armcompute.VirtualMachineScaleSetNetworkConfiguration{ { Name: to.Ptr("{vmss-name}"), Properties: &armcompute.VirtualMachineScaleSetNetworkConfigurationProperties{ EnableIPForwarding: to.Ptr(true), IPConfigurations: []*armcompute.VirtualMachineScaleSetIPConfiguration{ { Name: to.Ptr("{vmss-name}"), Properties: &armcompute.VirtualMachineScaleSetIPConfigurationProperties{ Subnet: &armcompute.APIEntityReference{ ID: to.Ptr("/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/virtualNetworks/{existing-virtual-network-name}/subnets/{existing-subnet-name}"), }, }, }}, Primary: to.Ptr(true), }, }}, }, OSProfile: &armcompute.VirtualMachineScaleSetOSProfile{ AdminPassword: to.Ptr("{your-password}"), AdminUsername: to.Ptr("{your-username}"), ComputerNamePrefix: to.Ptr("{vmss-name}"), }, Priority: to.Ptr(armcompute.VirtualMachinePriorityTypesSpot), StorageProfile: &armcompute.VirtualMachineScaleSetStorageProfile{ ImageReference: &armcompute.ImageReference{ Offer: to.Ptr("WindowsServer"), Publisher: to.Ptr("MicrosoftWindowsServer"), SKU: to.Ptr("2016-Datacenter"), Version: to.Ptr("latest"), }, OSDisk: &armcompute.VirtualMachineScaleSetOSDisk{ Caching: to.Ptr(armcompute.CachingTypesReadWrite), CreateOption: to.Ptr(armcompute.DiskCreateOptionTypesFromImage), ManagedDisk: &armcompute.VirtualMachineScaleSetManagedDiskParameters{ StorageAccountType: to.Ptr(armcompute.StorageAccountTypesStandardLRS), }, }, }, }, }, SKU: &armcompute.SKU{ Name: to.Ptr("Standard_A8m_v2"), Capacity: to.Ptr[int64](10), Tier: to.Ptr("Standard"), }, }, &armcompute.VirtualMachineScaleSetsClientBeginCreateOrUpdateOptions{IfMatch: nil, IfNoneMatch: nil, }) if err != nil { log.Fatalf("failed to finish the request: %v", err) } res, err := poller.PollUntilDone(ctx, nil) if err != nil { log.Fatalf("failed to pull the result: %v", err) } // You could use response here. We use blank identifier for just demo purposes. _ = res // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. // res.VirtualMachineScaleSet = armcompute.VirtualMachineScaleSet{ // Name: to.Ptr("{vmss-name}"), // Type: to.Ptr("Microsoft.Compute/virtualMachineScaleSets"), // ID: to.Ptr("/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/virtualMachineScaleSets/{vmss-name}"), // Location: to.Ptr("westus"), // Properties: &armcompute.VirtualMachineScaleSetProperties{ // OrchestrationMode: to.Ptr(armcompute.OrchestrationModeFlexible), // PriorityMixPolicy: &armcompute.PriorityMixPolicy{ // BaseRegularPriorityCount: to.Ptr[int32](4), // RegularPriorityPercentageAboveBase: to.Ptr[int32](50), // }, // ProvisioningState: to.Ptr("Succeeded"), // SinglePlacementGroup: to.Ptr(false), // UniqueID: to.Ptr("d053ec5a-8da6-495f-ab13-38216503c6d7"), // VirtualMachineProfile: &armcompute.VirtualMachineScaleSetVMProfile{ // BillingProfile: &armcompute.BillingProfile{ // MaxPrice: to.Ptr[float64](-1), // }, // EvictionPolicy: to.Ptr(armcompute.VirtualMachineEvictionPolicyTypesDeallocate), // NetworkProfile: &armcompute.VirtualMachineScaleSetNetworkProfile{ // NetworkInterfaceConfigurations: []*armcompute.VirtualMachineScaleSetNetworkConfiguration{ // { // Name: to.Ptr("{vmss-name}"), // Properties: &armcompute.VirtualMachineScaleSetNetworkConfigurationProperties{ // DNSSettings: &armcompute.VirtualMachineScaleSetNetworkConfigurationDNSSettings{ // DNSServers: []*string{ // }, // }, // EnableAcceleratedNetworking: to.Ptr(false), // EnableIPForwarding: to.Ptr(true), // IPConfigurations: []*armcompute.VirtualMachineScaleSetIPConfiguration{ // { // Name: to.Ptr("{vmss-name}"), // Properties: &armcompute.VirtualMachineScaleSetIPConfigurationProperties{ // PrivateIPAddressVersion: to.Ptr(armcompute.IPVersionIPv4), // Subnet: &armcompute.APIEntityReference{ // ID: to.Ptr("/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/virtualNetworks/nsgExistingVnet/subnets/nsgExistingSubnet"), // }, // }, // }}, // Primary: to.Ptr(true), // }, // }}, // }, // OSProfile: &armcompute.VirtualMachineScaleSetOSProfile{ // AdminUsername: to.Ptr("{your-username}"), // ComputerNamePrefix: to.Ptr("{vmss-name}"), // Secrets: []*armcompute.VaultSecretGroup{ // }, // WindowsConfiguration: &armcompute.WindowsConfiguration{ // EnableAutomaticUpdates: to.Ptr(true), // ProvisionVMAgent: to.Ptr(true), // }, // }, // Priority: to.Ptr(armcompute.VirtualMachinePriorityTypesSpot), // StorageProfile: &armcompute.VirtualMachineScaleSetStorageProfile{ // ImageReference: &armcompute.ImageReference{ // Offer: to.Ptr("WindowsServer"), // Publisher: to.Ptr("MicrosoftWindowsServer"), // SKU: to.Ptr("2016-Datacenter"), // Version: to.Ptr("latest"), // }, // OSDisk: &armcompute.VirtualMachineScaleSetOSDisk{ // Caching: to.Ptr(armcompute.CachingTypesReadWrite), // CreateOption: to.Ptr(armcompute.DiskCreateOptionTypesFromImage), // ManagedDisk: &armcompute.VirtualMachineScaleSetManagedDiskParameters{ // StorageAccountType: to.Ptr(armcompute.StorageAccountTypesStandardLRS), // }, // }, // }, // }, // }, // SKU: &armcompute.SKU{ // Name: to.Ptr("Standard_A8m_v2"), // Capacity: to.Ptr[int64](10), // Tier: to.Ptr("Standard"), // }, // }
Output:
Example (CreateAScaleSetWithProxyAgentSettingsOfEnabledAndMode) ¶
Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/92de53a5f1e0e03c94b40475d2135d97148ed014/specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-03-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSet_Create_WithProxyAgentSettings.json
cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() clientFactory, err := armcompute.NewClientFactory("<subscription-id>", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } poller, err := clientFactory.NewVirtualMachineScaleSetsClient().BeginCreateOrUpdate(ctx, "myResourceGroup", "{vmss-name}", armcompute.VirtualMachineScaleSet{ Location: to.Ptr("westus"), Properties: &armcompute.VirtualMachineScaleSetProperties{ Overprovision: to.Ptr(true), UpgradePolicy: &armcompute.UpgradePolicy{ Mode: to.Ptr(armcompute.UpgradeModeManual), }, VirtualMachineProfile: &armcompute.VirtualMachineScaleSetVMProfile{ NetworkProfile: &armcompute.VirtualMachineScaleSetNetworkProfile{ NetworkInterfaceConfigurations: []*armcompute.VirtualMachineScaleSetNetworkConfiguration{ { Name: to.Ptr("{vmss-name}"), Properties: &armcompute.VirtualMachineScaleSetNetworkConfigurationProperties{ EnableIPForwarding: to.Ptr(true), IPConfigurations: []*armcompute.VirtualMachineScaleSetIPConfiguration{ { Name: to.Ptr("{vmss-name}"), Properties: &armcompute.VirtualMachineScaleSetIPConfigurationProperties{ Subnet: &armcompute.APIEntityReference{ ID: to.Ptr("/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/virtualNetworks/{existing-virtual-network-name}/subnets/{existing-subnet-name}"), }, }, }}, Primary: to.Ptr(true), }, }}, }, OSProfile: &armcompute.VirtualMachineScaleSetOSProfile{ AdminPassword: to.Ptr("{your-password}"), AdminUsername: to.Ptr("{your-username}"), ComputerNamePrefix: to.Ptr("{vmss-name}"), }, SecurityProfile: &armcompute.SecurityProfile{ ProxyAgentSettings: &armcompute.ProxyAgentSettings{ Enabled: to.Ptr(true), Mode: to.Ptr(armcompute.ModeEnforce), }, }, StorageProfile: &armcompute.VirtualMachineScaleSetStorageProfile{ ImageReference: &armcompute.ImageReference{ Offer: to.Ptr("WindowsServer"), Publisher: to.Ptr("MicrosoftWindowsServer"), SKU: to.Ptr("2019-Datacenter"), Version: to.Ptr("latest"), }, OSDisk: &armcompute.VirtualMachineScaleSetOSDisk{ Caching: to.Ptr(armcompute.CachingTypesReadOnly), CreateOption: to.Ptr(armcompute.DiskCreateOptionTypesFromImage), ManagedDisk: &armcompute.VirtualMachineScaleSetManagedDiskParameters{ StorageAccountType: to.Ptr(armcompute.StorageAccountTypesStandardSSDLRS), }, }, }, }, }, SKU: &armcompute.SKU{ Name: to.Ptr("Standard_D2s_v3"), Capacity: to.Ptr[int64](3), Tier: to.Ptr("Standard"), }, }, &armcompute.VirtualMachineScaleSetsClientBeginCreateOrUpdateOptions{IfMatch: nil, IfNoneMatch: nil, }) if err != nil { log.Fatalf("failed to finish the request: %v", err) } res, err := poller.PollUntilDone(ctx, nil) if err != nil { log.Fatalf("failed to pull the result: %v", err) } // You could use response here. We use blank identifier for just demo purposes. _ = res // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. // res.VirtualMachineScaleSet = armcompute.VirtualMachineScaleSet{ // Name: to.Ptr("{vmss-name}"), // Type: to.Ptr("Microsoft.Compute/virtualMachineScaleSets"), // ID: to.Ptr("/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/virtualMachineScaleSets/{vmss-name}"), // Location: to.Ptr("westus"), // Properties: &armcompute.VirtualMachineScaleSetProperties{ // Overprovision: to.Ptr(true), // ProvisioningState: to.Ptr("Succeeded"), // SinglePlacementGroup: to.Ptr(true), // UniqueID: to.Ptr("b9e23088-6ffc-46e0-9e02-b0a6eeef47db"), // UpgradePolicy: &armcompute.UpgradePolicy{ // Mode: to.Ptr(armcompute.UpgradeModeManual), // }, // VirtualMachineProfile: &armcompute.VirtualMachineScaleSetVMProfile{ // NetworkProfile: &armcompute.VirtualMachineScaleSetNetworkProfile{ // NetworkInterfaceConfigurations: []*armcompute.VirtualMachineScaleSetNetworkConfiguration{ // { // Name: to.Ptr("{vmss-name}"), // Properties: &armcompute.VirtualMachineScaleSetNetworkConfigurationProperties{ // DNSSettings: &armcompute.VirtualMachineScaleSetNetworkConfigurationDNSSettings{ // DNSServers: []*string{ // }, // }, // EnableAcceleratedNetworking: to.Ptr(false), // EnableIPForwarding: to.Ptr(true), // IPConfigurations: []*armcompute.VirtualMachineScaleSetIPConfiguration{ // { // Name: to.Ptr("{vmss-name}"), // Properties: &armcompute.VirtualMachineScaleSetIPConfigurationProperties{ // PrivateIPAddressVersion: to.Ptr(armcompute.IPVersionIPv4), // Subnet: &armcompute.APIEntityReference{ // ID: to.Ptr("/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/virtualNetworks/nsgExistingVnet/subnets/nsgExistingSubnet"), // }, // }, // }}, // Primary: to.Ptr(true), // }, // }}, // }, // OSProfile: &armcompute.VirtualMachineScaleSetOSProfile{ // AdminUsername: to.Ptr("{your-username}"), // ComputerNamePrefix: to.Ptr("{vmss-name}"), // Secrets: []*armcompute.VaultSecretGroup{ // }, // WindowsConfiguration: &armcompute.WindowsConfiguration{ // EnableAutomaticUpdates: to.Ptr(true), // ProvisionVMAgent: to.Ptr(true), // }, // }, // SecurityProfile: &armcompute.SecurityProfile{ // ProxyAgentSettings: &armcompute.ProxyAgentSettings{ // Enabled: to.Ptr(true), // Mode: to.Ptr(armcompute.ModeEnforce), // }, // }, // StorageProfile: &armcompute.VirtualMachineScaleSetStorageProfile{ // ImageReference: &armcompute.ImageReference{ // Offer: to.Ptr("WindowsServer"), // Publisher: to.Ptr("MicrosoftWindowsServer"), // SKU: to.Ptr("2019-Datacenter"), // Version: to.Ptr("latest"), // }, // OSDisk: &armcompute.VirtualMachineScaleSetOSDisk{ // Caching: to.Ptr(armcompute.CachingTypesReadOnly), // CreateOption: to.Ptr(armcompute.DiskCreateOptionTypesFromImage), // ManagedDisk: &armcompute.VirtualMachineScaleSetManagedDiskParameters{ // StorageAccountType: to.Ptr(armcompute.StorageAccountTypesStandardSSDLRS), // }, // }, // }, // }, // }, // SKU: &armcompute.SKU{ // Name: to.Ptr("Standard_D2s_v3"), // Capacity: to.Ptr[int64](3), // Tier: to.Ptr("Standard"), // }, // }
Output:
Example (CreateAScaleSetWithResilientVmCreationEnabled) ¶
Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/92de53a5f1e0e03c94b40475d2135d97148ed014/specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-03-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSet_Create_WithResilientVMCreationPolicy.json
cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() clientFactory, err := armcompute.NewClientFactory("<subscription-id>", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } poller, err := clientFactory.NewVirtualMachineScaleSetsClient().BeginCreateOrUpdate(ctx, "myResourceGroup", "{vmss-name}", armcompute.VirtualMachineScaleSet{ Location: to.Ptr("westus"), Properties: &armcompute.VirtualMachineScaleSetProperties{ Overprovision: to.Ptr(false), ResiliencyPolicy: &armcompute.ResiliencyPolicy{ ResilientVMCreationPolicy: &armcompute.ResilientVMCreationPolicy{ Enabled: to.Ptr(true), }, }, UpgradePolicy: &armcompute.UpgradePolicy{ Mode: to.Ptr(armcompute.UpgradeModeManual), }, VirtualMachineProfile: &armcompute.VirtualMachineScaleSetVMProfile{ NetworkProfile: &armcompute.VirtualMachineScaleSetNetworkProfile{ NetworkInterfaceConfigurations: []*armcompute.VirtualMachineScaleSetNetworkConfiguration{ { Name: to.Ptr("{vmss-name}"), Properties: &armcompute.VirtualMachineScaleSetNetworkConfigurationProperties{ EnableIPForwarding: to.Ptr(true), IPConfigurations: []*armcompute.VirtualMachineScaleSetIPConfiguration{ { Name: to.Ptr("{vmss-name}"), Properties: &armcompute.VirtualMachineScaleSetIPConfigurationProperties{ Subnet: &armcompute.APIEntityReference{ ID: to.Ptr("/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/virtualNetworks/{existing-virtual-network-name}/subnets/{existing-subnet-name}"), }, }, }}, Primary: to.Ptr(true), }, }}, }, OSProfile: &armcompute.VirtualMachineScaleSetOSProfile{ AdminPassword: to.Ptr("{your-password}"), AdminUsername: to.Ptr("{your-username}"), ComputerNamePrefix: to.Ptr("{vmss-name}"), }, StorageProfile: &armcompute.VirtualMachineScaleSetStorageProfile{ ImageReference: &armcompute.ImageReference{ Offer: to.Ptr("WindowsServer"), Publisher: to.Ptr("MicrosoftWindowsServer"), SKU: to.Ptr("2016-Datacenter"), Version: to.Ptr("latest"), }, OSDisk: &armcompute.VirtualMachineScaleSetOSDisk{ Caching: to.Ptr(armcompute.CachingTypesReadWrite), CreateOption: to.Ptr(armcompute.DiskCreateOptionTypesFromImage), ManagedDisk: &armcompute.VirtualMachineScaleSetManagedDiskParameters{ StorageAccountType: to.Ptr(armcompute.StorageAccountTypesStandardLRS), }, }, }, }, }, SKU: &armcompute.SKU{ Name: to.Ptr("Standard_D1_v2"), Capacity: to.Ptr[int64](3), Tier: to.Ptr("Standard"), }, }, &armcompute.VirtualMachineScaleSetsClientBeginCreateOrUpdateOptions{IfMatch: nil, IfNoneMatch: nil, }) if err != nil { log.Fatalf("failed to finish the request: %v", err) } res, err := poller.PollUntilDone(ctx, nil) if err != nil { log.Fatalf("failed to pull the result: %v", err) } // You could use response here. We use blank identifier for just demo purposes. _ = res // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. // res.VirtualMachineScaleSet = armcompute.VirtualMachineScaleSet{ // Name: to.Ptr("{vmss-name}"), // Type: to.Ptr("Microsoft.Compute/virtualMachineScaleSets"), // ID: to.Ptr("/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/virtualMachineScaleSets/{vmss-name}"), // Location: to.Ptr("westus"), // Properties: &armcompute.VirtualMachineScaleSetProperties{ // Overprovision: to.Ptr(false), // ProvisioningState: to.Ptr("Succeeded"), // ResiliencyPolicy: &armcompute.ResiliencyPolicy{ // ResilientVMCreationPolicy: &armcompute.ResilientVMCreationPolicy{ // Enabled: to.Ptr(true), // }, // }, // SinglePlacementGroup: to.Ptr(true), // UniqueID: to.Ptr("d053ec5a-8da6-495f-ab13-38216503c6d7"), // UpgradePolicy: &armcompute.UpgradePolicy{ // Mode: to.Ptr(armcompute.UpgradeModeManual), // }, // VirtualMachineProfile: &armcompute.VirtualMachineScaleSetVMProfile{ // NetworkProfile: &armcompute.VirtualMachineScaleSetNetworkProfile{ // NetworkInterfaceConfigurations: []*armcompute.VirtualMachineScaleSetNetworkConfiguration{ // { // Name: to.Ptr("{vmss-name}"), // Properties: &armcompute.VirtualMachineScaleSetNetworkConfigurationProperties{ // DNSSettings: &armcompute.VirtualMachineScaleSetNetworkConfigurationDNSSettings{ // DNSServers: []*string{ // }, // }, // EnableAcceleratedNetworking: to.Ptr(false), // EnableIPForwarding: to.Ptr(true), // IPConfigurations: []*armcompute.VirtualMachineScaleSetIPConfiguration{ // { // Name: to.Ptr("{vmss-name}"), // Properties: &armcompute.VirtualMachineScaleSetIPConfigurationProperties{ // PrivateIPAddressVersion: to.Ptr(armcompute.IPVersionIPv4), // Subnet: &armcompute.APIEntityReference{ // ID: to.Ptr("/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/virtualNetworks/nsgExistingVnet/subnets/nsgExistingSubnet"), // }, // }, // }}, // Primary: to.Ptr(true), // }, // }}, // }, // OSProfile: &armcompute.VirtualMachineScaleSetOSProfile{ // AdminUsername: to.Ptr("{your-username}"), // ComputerNamePrefix: to.Ptr("{vmss-name}"), // Secrets: []*armcompute.VaultSecretGroup{ // }, // WindowsConfiguration: &armcompute.WindowsConfiguration{ // EnableAutomaticUpdates: to.Ptr(true), // ProvisionVMAgent: to.Ptr(true), // }, // }, // StorageProfile: &armcompute.VirtualMachineScaleSetStorageProfile{ // ImageReference: &armcompute.ImageReference{ // Offer: to.Ptr("WindowsServer"), // Publisher: to.Ptr("MicrosoftWindowsServer"), // SKU: to.Ptr("2016-Datacenter"), // Version: to.Ptr("latest"), // }, // OSDisk: &armcompute.VirtualMachineScaleSetOSDisk{ // Caching: to.Ptr(armcompute.CachingTypesReadWrite), // CreateOption: to.Ptr(armcompute.DiskCreateOptionTypesFromImage), // ManagedDisk: &armcompute.VirtualMachineScaleSetManagedDiskParameters{ // StorageAccountType: to.Ptr(armcompute.StorageAccountTypesStandardLRS), // }, // }, // }, // }, // }, // SKU: &armcompute.SKU{ // Name: to.Ptr("Standard_D1_v2"), // Capacity: to.Ptr[int64](3), // Tier: to.Ptr("Standard"), // }, // }
Output:
Example (CreateAScaleSetWithResilientVmDeletionEnabled) ¶
Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/92de53a5f1e0e03c94b40475d2135d97148ed014/specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-03-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSet_Create_WithResilientVMDeletionPolicy.json
cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() clientFactory, err := armcompute.NewClientFactory("<subscription-id>", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } poller, err := clientFactory.NewVirtualMachineScaleSetsClient().BeginCreateOrUpdate(ctx, "myResourceGroup", "{vmss-name}", armcompute.VirtualMachineScaleSet{ Location: to.Ptr("westus"), Properties: &armcompute.VirtualMachineScaleSetProperties{ Overprovision: to.Ptr(false), ResiliencyPolicy: &armcompute.ResiliencyPolicy{ ResilientVMDeletionPolicy: &armcompute.ResilientVMDeletionPolicy{ Enabled: to.Ptr(true), }, }, UpgradePolicy: &armcompute.UpgradePolicy{ Mode: to.Ptr(armcompute.UpgradeModeManual), }, VirtualMachineProfile: &armcompute.VirtualMachineScaleSetVMProfile{ NetworkProfile: &armcompute.VirtualMachineScaleSetNetworkProfile{ NetworkInterfaceConfigurations: []*armcompute.VirtualMachineScaleSetNetworkConfiguration{ { Name: to.Ptr("{vmss-name}"), Properties: &armcompute.VirtualMachineScaleSetNetworkConfigurationProperties{ EnableIPForwarding: to.Ptr(true), IPConfigurations: []*armcompute.VirtualMachineScaleSetIPConfiguration{ { Name: to.Ptr("{vmss-name}"), Properties: &armcompute.VirtualMachineScaleSetIPConfigurationProperties{ Subnet: &armcompute.APIEntityReference{ ID: to.Ptr("/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/virtualNetworks/{existing-virtual-network-name}/subnets/{existing-subnet-name}"), }, }, }}, Primary: to.Ptr(true), }, }}, }, OSProfile: &armcompute.VirtualMachineScaleSetOSProfile{ AdminPassword: to.Ptr("{your-password}"), AdminUsername: to.Ptr("{your-username}"), ComputerNamePrefix: to.Ptr("{vmss-name}"), }, StorageProfile: &armcompute.VirtualMachineScaleSetStorageProfile{ ImageReference: &armcompute.ImageReference{ Offer: to.Ptr("WindowsServer"), Publisher: to.Ptr("MicrosoftWindowsServer"), SKU: to.Ptr("2016-Datacenter"), Version: to.Ptr("latest"), }, OSDisk: &armcompute.VirtualMachineScaleSetOSDisk{ Caching: to.Ptr(armcompute.CachingTypesReadWrite), CreateOption: to.Ptr(armcompute.DiskCreateOptionTypesFromImage), ManagedDisk: &armcompute.VirtualMachineScaleSetManagedDiskParameters{ StorageAccountType: to.Ptr(armcompute.StorageAccountTypesStandardLRS), }, }, }, }, }, SKU: &armcompute.SKU{ Name: to.Ptr("Standard_D1_v2"), Capacity: to.Ptr[int64](3), Tier: to.Ptr("Standard"), }, }, &armcompute.VirtualMachineScaleSetsClientBeginCreateOrUpdateOptions{IfMatch: nil, IfNoneMatch: nil, }) if err != nil { log.Fatalf("failed to finish the request: %v", err) } res, err := poller.PollUntilDone(ctx, nil) if err != nil { log.Fatalf("failed to pull the result: %v", err) } // You could use response here. We use blank identifier for just demo purposes. _ = res // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. // res.VirtualMachineScaleSet = armcompute.VirtualMachineScaleSet{ // Name: to.Ptr("{vmss-name}"), // Type: to.Ptr("Microsoft.Compute/virtualMachineScaleSets"), // ID: to.Ptr("/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/virtualMachineScaleSets/{vmss-name}"), // Location: to.Ptr("westus"), // Properties: &armcompute.VirtualMachineScaleSetProperties{ // Overprovision: to.Ptr(false), // ProvisioningState: to.Ptr("Succeeded"), // ResiliencyPolicy: &armcompute.ResiliencyPolicy{ // ResilientVMDeletionPolicy: &armcompute.ResilientVMDeletionPolicy{ // Enabled: to.Ptr(true), // }, // }, // SinglePlacementGroup: to.Ptr(true), // UniqueID: to.Ptr("d053ec5a-8da6-495f-ab13-38216503c6d7"), // UpgradePolicy: &armcompute.UpgradePolicy{ // Mode: to.Ptr(armcompute.UpgradeModeManual), // }, // VirtualMachineProfile: &armcompute.VirtualMachineScaleSetVMProfile{ // NetworkProfile: &armcompute.VirtualMachineScaleSetNetworkProfile{ // NetworkInterfaceConfigurations: []*armcompute.VirtualMachineScaleSetNetworkConfiguration{ // { // Name: to.Ptr("{vmss-name}"), // Properties: &armcompute.VirtualMachineScaleSetNetworkConfigurationProperties{ // DNSSettings: &armcompute.VirtualMachineScaleSetNetworkConfigurationDNSSettings{ // DNSServers: []*string{ // }, // }, // EnableAcceleratedNetworking: to.Ptr(false), // EnableIPForwarding: to.Ptr(true), // IPConfigurations: []*armcompute.VirtualMachineScaleSetIPConfiguration{ // { // Name: to.Ptr("{vmss-name}"), // Properties: &armcompute.VirtualMachineScaleSetIPConfigurationProperties{ // PrivateIPAddressVersion: to.Ptr(armcompute.IPVersionIPv4), // Subnet: &armcompute.APIEntityReference{ // ID: to.Ptr("/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/virtualNetworks/nsgExistingVnet/subnets/nsgExistingSubnet"), // }, // }, // }}, // Primary: to.Ptr(true), // }, // }}, // }, // OSProfile: &armcompute.VirtualMachineScaleSetOSProfile{ // AdminUsername: to.Ptr("{your-username}"), // ComputerNamePrefix: to.Ptr("{vmss-name}"), // Secrets: []*armcompute.VaultSecretGroup{ // }, // WindowsConfiguration: &armcompute.WindowsConfiguration{ // EnableAutomaticUpdates: to.Ptr(true), // ProvisionVMAgent: to.Ptr(true), // }, // }, // StorageProfile: &armcompute.VirtualMachineScaleSetStorageProfile{ // ImageReference: &armcompute.ImageReference{ // Offer: to.Ptr("WindowsServer"), // Publisher: to.Ptr("MicrosoftWindowsServer"), // SKU: to.Ptr("2016-Datacenter"), // Version: to.Ptr("latest"), // }, // OSDisk: &armcompute.VirtualMachineScaleSetOSDisk{ // Caching: to.Ptr(armcompute.CachingTypesReadWrite), // CreateOption: to.Ptr(armcompute.DiskCreateOptionTypesFromImage), // ManagedDisk: &armcompute.VirtualMachineScaleSetManagedDiskParameters{ // StorageAccountType: to.Ptr(armcompute.StorageAccountTypesStandardLRS), // }, // }, // }, // }, // }, // SKU: &armcompute.SKU{ // Name: to.Ptr("Standard_D1_v2"), // Capacity: to.Ptr[int64](3), // Tier: to.Ptr("Standard"), // }, // }
Output:
Example (CreateAScaleSetWithScaleInPolicy) ¶
Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/92de53a5f1e0e03c94b40475d2135d97148ed014/specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-03-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSet_Create_WithScaleInPolicy.json
cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() clientFactory, err := armcompute.NewClientFactory("<subscription-id>", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } poller, err := clientFactory.NewVirtualMachineScaleSetsClient().BeginCreateOrUpdate(ctx, "myResourceGroup", "{vmss-name}", armcompute.VirtualMachineScaleSet{ Location: to.Ptr("westus"), Properties: &armcompute.VirtualMachineScaleSetProperties{ Overprovision: to.Ptr(true), ScaleInPolicy: &armcompute.ScaleInPolicy{ ForceDeletion: to.Ptr(true), Rules: []*armcompute.VirtualMachineScaleSetScaleInRules{ to.Ptr(armcompute.VirtualMachineScaleSetScaleInRulesOldestVM)}, }, UpgradePolicy: &armcompute.UpgradePolicy{ Mode: to.Ptr(armcompute.UpgradeModeManual), }, VirtualMachineProfile: &armcompute.VirtualMachineScaleSetVMProfile{ NetworkProfile: &armcompute.VirtualMachineScaleSetNetworkProfile{ NetworkInterfaceConfigurations: []*armcompute.VirtualMachineScaleSetNetworkConfiguration{ { Name: to.Ptr("{vmss-name}"), Properties: &armcompute.VirtualMachineScaleSetNetworkConfigurationProperties{ EnableIPForwarding: to.Ptr(true), IPConfigurations: []*armcompute.VirtualMachineScaleSetIPConfiguration{ { Name: to.Ptr("{vmss-name}"), Properties: &armcompute.VirtualMachineScaleSetIPConfigurationProperties{ Subnet: &armcompute.APIEntityReference{ ID: to.Ptr("/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/virtualNetworks/{existing-virtual-network-name}/subnets/{existing-subnet-name}"), }, }, }}, Primary: to.Ptr(true), }, }}, }, OSProfile: &armcompute.VirtualMachineScaleSetOSProfile{ AdminPassword: to.Ptr("{your-password}"), AdminUsername: to.Ptr("{your-username}"), ComputerNamePrefix: to.Ptr("{vmss-name}"), }, StorageProfile: &armcompute.VirtualMachineScaleSetStorageProfile{ ImageReference: &armcompute.ImageReference{ Offer: to.Ptr("WindowsServer"), Publisher: to.Ptr("MicrosoftWindowsServer"), SKU: to.Ptr("2016-Datacenter"), Version: to.Ptr("latest"), }, OSDisk: &armcompute.VirtualMachineScaleSetOSDisk{ Caching: to.Ptr(armcompute.CachingTypesReadWrite), CreateOption: to.Ptr(armcompute.DiskCreateOptionTypesFromImage), ManagedDisk: &armcompute.VirtualMachineScaleSetManagedDiskParameters{ StorageAccountType: to.Ptr(armcompute.StorageAccountTypesStandardLRS), }, }, }, }, }, SKU: &armcompute.SKU{ Name: to.Ptr("Standard_D1_v2"), Capacity: to.Ptr[int64](3), Tier: to.Ptr("Standard"), }, }, &armcompute.VirtualMachineScaleSetsClientBeginCreateOrUpdateOptions{IfMatch: nil, IfNoneMatch: nil, }) if err != nil { log.Fatalf("failed to finish the request: %v", err) } res, err := poller.PollUntilDone(ctx, nil) if err != nil { log.Fatalf("failed to pull the result: %v", err) } // You could use response here. We use blank identifier for just demo purposes. _ = res // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. // res.VirtualMachineScaleSet = armcompute.VirtualMachineScaleSet{ // Name: to.Ptr("{vmss-name}"), // Type: to.Ptr("Microsoft.Compute/virtualMachineScaleSets"), // ID: to.Ptr("/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/virtualMachineScaleSets/{vmss-name}"), // Location: to.Ptr("westus"), // Properties: &armcompute.VirtualMachineScaleSetProperties{ // Overprovision: to.Ptr(true), // ProvisioningState: to.Ptr("Succeeded"), // ScaleInPolicy: &armcompute.ScaleInPolicy{ // ForceDeletion: to.Ptr(true), // Rules: []*armcompute.VirtualMachineScaleSetScaleInRules{ // to.Ptr(armcompute.VirtualMachineScaleSetScaleInRulesOldestVM)}, // }, // SinglePlacementGroup: to.Ptr(true), // UniqueID: to.Ptr("d053ec5a-8da6-495f-ab13-38216503c6d7"), // UpgradePolicy: &armcompute.UpgradePolicy{ // Mode: to.Ptr(armcompute.UpgradeModeManual), // }, // VirtualMachineProfile: &armcompute.VirtualMachineScaleSetVMProfile{ // NetworkProfile: &armcompute.VirtualMachineScaleSetNetworkProfile{ // NetworkInterfaceConfigurations: []*armcompute.VirtualMachineScaleSetNetworkConfiguration{ // { // Name: to.Ptr("{vmss-name}"), // Properties: &armcompute.VirtualMachineScaleSetNetworkConfigurationProperties{ // DNSSettings: &armcompute.VirtualMachineScaleSetNetworkConfigurationDNSSettings{ // DNSServers: []*string{ // }, // }, // EnableAcceleratedNetworking: to.Ptr(false), // EnableIPForwarding: to.Ptr(true), // IPConfigurations: []*armcompute.VirtualMachineScaleSetIPConfiguration{ // { // Name: to.Ptr("{vmss-name}"), // Properties: &armcompute.VirtualMachineScaleSetIPConfigurationProperties{ // PrivateIPAddressVersion: to.Ptr(armcompute.IPVersionIPv4), // Subnet: &armcompute.APIEntityReference{ // ID: to.Ptr("/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/virtualNetworks/nsgExistingVnet/subnets/nsgExistingSubnet"), // }, // }, // }}, // Primary: to.Ptr(true), // }, // }}, // }, // OSProfile: &armcompute.VirtualMachineScaleSetOSProfile{ // AdminUsername: to.Ptr("{your-username}"), // ComputerNamePrefix: to.Ptr("{vmss-name}"), // Secrets: []*armcompute.VaultSecretGroup{ // }, // WindowsConfiguration: &armcompute.WindowsConfiguration{ // EnableAutomaticUpdates: to.Ptr(true), // ProvisionVMAgent: to.Ptr(true), // }, // }, // StorageProfile: &armcompute.VirtualMachineScaleSetStorageProfile{ // ImageReference: &armcompute.ImageReference{ // Offer: to.Ptr("WindowsServer"), // Publisher: to.Ptr("MicrosoftWindowsServer"), // SKU: to.Ptr("2016-Datacenter"), // Version: to.Ptr("latest"), // }, // OSDisk: &armcompute.VirtualMachineScaleSetOSDisk{ // Caching: to.Ptr(armcompute.CachingTypesReadWrite), // CreateOption: to.Ptr(armcompute.DiskCreateOptionTypesFromImage), // ManagedDisk: &armcompute.VirtualMachineScaleSetManagedDiskParameters{ // StorageAccountType: to.Ptr(armcompute.StorageAccountTypesStandardLRS), // }, // }, // }, // }, // }, // SKU: &armcompute.SKU{ // Name: to.Ptr("Standard_D1_v2"), // Capacity: to.Ptr[int64](3), // Tier: to.Ptr("Standard"), // }, // }
Output:
Example (CreateAScaleSetWithSecurityPostureReference) ¶
Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/92de53a5f1e0e03c94b40475d2135d97148ed014/specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-03-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSet_Create_WithSecurityPostureReference.json
cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() clientFactory, err := armcompute.NewClientFactory("<subscription-id>", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } poller, err := clientFactory.NewVirtualMachineScaleSetsClient().BeginCreateOrUpdate(ctx, "myResourceGroup", "{vmss-name}", armcompute.VirtualMachineScaleSet{ Location: to.Ptr("eastus2euap"), Properties: &armcompute.VirtualMachineScaleSetProperties{ Overprovision: to.Ptr(true), UpgradePolicy: &armcompute.UpgradePolicy{ AutomaticOSUpgradePolicy: &armcompute.AutomaticOSUpgradePolicy{ EnableAutomaticOSUpgrade: to.Ptr(true), }, Mode: to.Ptr(armcompute.UpgradeModeAutomatic), }, VirtualMachineProfile: &armcompute.VirtualMachineScaleSetVMProfile{ NetworkProfile: &armcompute.VirtualMachineScaleSetNetworkProfile{ NetworkInterfaceConfigurations: []*armcompute.VirtualMachineScaleSetNetworkConfiguration{ { Name: to.Ptr("{vmss-name}"), Properties: &armcompute.VirtualMachineScaleSetNetworkConfigurationProperties{ EnableIPForwarding: to.Ptr(true), IPConfigurations: []*armcompute.VirtualMachineScaleSetIPConfiguration{ { Name: to.Ptr("{vmss-name}"), Properties: &armcompute.VirtualMachineScaleSetIPConfigurationProperties{ Subnet: &armcompute.APIEntityReference{ ID: to.Ptr("/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/virtualNetworks/{existing-virtual-network-name}/subnets/{existing-subnet-name}"), }, }, }}, Primary: to.Ptr(true), }, }}, }, OSProfile: &armcompute.VirtualMachineScaleSetOSProfile{ AdminPassword: to.Ptr("{your-password}"), AdminUsername: to.Ptr("{your-username}"), ComputerNamePrefix: to.Ptr("{vmss-name}"), }, SecurityPostureReference: &armcompute.SecurityPostureReference{ ID: to.Ptr("/CommunityGalleries/{communityGalleryName}/securityPostures/{securityPostureName}/versions/{major.minor.patch}|{major.*}|latest"), }, StorageProfile: &armcompute.VirtualMachineScaleSetStorageProfile{ ImageReference: &armcompute.ImageReference{ Offer: to.Ptr("WindowsServer"), Publisher: to.Ptr("MicrosoftWindowsServer"), SKU: to.Ptr("2022-Datacenter"), Version: to.Ptr("latest"), }, OSDisk: &armcompute.VirtualMachineScaleSetOSDisk{ Name: to.Ptr("osDisk"), Caching: to.Ptr(armcompute.CachingTypesReadWrite), CreateOption: to.Ptr(armcompute.DiskCreateOptionTypesFromImage), }, }, }, }, SKU: &armcompute.SKU{ Name: to.Ptr("Standard_A1"), Capacity: to.Ptr[int64](3), Tier: to.Ptr("Standard"), }, }, &armcompute.VirtualMachineScaleSetsClientBeginCreateOrUpdateOptions{IfMatch: nil, IfNoneMatch: nil, }) if err != nil { log.Fatalf("failed to finish the request: %v", err) } res, err := poller.PollUntilDone(ctx, nil) if err != nil { log.Fatalf("failed to pull the result: %v", err) } // You could use response here. We use blank identifier for just demo purposes. _ = res // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. // res.VirtualMachineScaleSet = armcompute.VirtualMachineScaleSet{ // Name: to.Ptr("{vmss-name}"), // Type: to.Ptr("Microsoft.Compute/virtualMachineScaleSets"), // ID: to.Ptr("/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/virtualMachineScaleSets/{vmss-name}"), // Location: to.Ptr("eastus2euap"), // Properties: &armcompute.VirtualMachineScaleSetProperties{ // Overprovision: to.Ptr(true), // ProvisioningState: to.Ptr("Succeeded"), // SinglePlacementGroup: to.Ptr(true), // UniqueID: to.Ptr("d12ccb3d-ab15-4794-9836-c4196392e9f2"), // UpgradePolicy: &armcompute.UpgradePolicy{ // AutomaticOSUpgradePolicy: &armcompute.AutomaticOSUpgradePolicy{ // EnableAutomaticOSUpgrade: to.Ptr(true), // }, // Mode: to.Ptr(armcompute.UpgradeModeAutomatic), // }, // VirtualMachineProfile: &armcompute.VirtualMachineScaleSetVMProfile{ // NetworkProfile: &armcompute.VirtualMachineScaleSetNetworkProfile{ // NetworkInterfaceConfigurations: []*armcompute.VirtualMachineScaleSetNetworkConfiguration{ // { // Name: to.Ptr("{vmss-name}"), // Properties: &armcompute.VirtualMachineScaleSetNetworkConfigurationProperties{ // DNSSettings: &armcompute.VirtualMachineScaleSetNetworkConfigurationDNSSettings{ // DNSServers: []*string{ // }, // }, // EnableAcceleratedNetworking: to.Ptr(false), // EnableIPForwarding: to.Ptr(true), // IPConfigurations: []*armcompute.VirtualMachineScaleSetIPConfiguration{ // { // Name: to.Ptr("{vmss-name}"), // Properties: &armcompute.VirtualMachineScaleSetIPConfigurationProperties{ // PrivateIPAddressVersion: to.Ptr(armcompute.IPVersionIPv4), // Subnet: &armcompute.APIEntityReference{ // ID: to.Ptr("/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/virtualNetworks/nsgExistingVnet/subnets/nsgExistingSubnet"), // }, // }, // }}, // Primary: to.Ptr(true), // }, // }}, // }, // OSProfile: &armcompute.VirtualMachineScaleSetOSProfile{ // AdminUsername: to.Ptr("{your-username}"), // ComputerNamePrefix: to.Ptr("{vmss-name}"), // Secrets: []*armcompute.VaultSecretGroup{ // }, // WindowsConfiguration: &armcompute.WindowsConfiguration{ // EnableAutomaticUpdates: to.Ptr(true), // ProvisionVMAgent: to.Ptr(true), // }, // }, // SecurityPostureReference: &armcompute.SecurityPostureReference{ // ID: to.Ptr("/CommunityGalleries/{communityGalleryName}/securityPostures/{securityPostureName}/versions/{major.minor.patch}|{major.*}|latest"), // }, // StorageProfile: &armcompute.VirtualMachineScaleSetStorageProfile{ // ImageReference: &armcompute.ImageReference{ // Offer: to.Ptr("WindowsServer"), // Publisher: to.Ptr("MicrosoftWindowsServer"), // SKU: to.Ptr("2022-Datacenter"), // Version: to.Ptr("latest"), // }, // OSDisk: &armcompute.VirtualMachineScaleSetOSDisk{ // Name: to.Ptr("osDisk"), // Caching: to.Ptr(armcompute.CachingTypesReadWrite), // CreateOption: to.Ptr(armcompute.DiskCreateOptionTypesFromImage), // }, // }, // }, // }, // SKU: &armcompute.SKU{ // Name: to.Ptr("Standard_A1"), // Capacity: to.Ptr[int64](3), // Tier: to.Ptr("Standard"), // }, // }
Output:
Example (CreateAScaleSetWithSecurityTypeAsConfidentialVm) ¶
Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/92de53a5f1e0e03c94b40475d2135d97148ed014/specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-03-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSet_Create_WithSecurityTypeConfidentialVM.json
cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() clientFactory, err := armcompute.NewClientFactory("<subscription-id>", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } poller, err := clientFactory.NewVirtualMachineScaleSetsClient().BeginCreateOrUpdate(ctx, "myResourceGroup", "{vmss-name}", armcompute.VirtualMachineScaleSet{ Location: to.Ptr("westus"), Properties: &armcompute.VirtualMachineScaleSetProperties{ Overprovision: to.Ptr(true), UpgradePolicy: &armcompute.UpgradePolicy{ Mode: to.Ptr(armcompute.UpgradeModeManual), }, VirtualMachineProfile: &armcompute.VirtualMachineScaleSetVMProfile{ NetworkProfile: &armcompute.VirtualMachineScaleSetNetworkProfile{ NetworkInterfaceConfigurations: []*armcompute.VirtualMachineScaleSetNetworkConfiguration{ { Name: to.Ptr("{vmss-name}"), Properties: &armcompute.VirtualMachineScaleSetNetworkConfigurationProperties{ EnableIPForwarding: to.Ptr(true), IPConfigurations: []*armcompute.VirtualMachineScaleSetIPConfiguration{ { Name: to.Ptr("{vmss-name}"), Properties: &armcompute.VirtualMachineScaleSetIPConfigurationProperties{ Subnet: &armcompute.APIEntityReference{ ID: to.Ptr("/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/virtualNetworks/{existing-virtual-network-name}/subnets/{existing-subnet-name}"), }, }, }}, Primary: to.Ptr(true), }, }}, }, OSProfile: &armcompute.VirtualMachineScaleSetOSProfile{ AdminPassword: to.Ptr("{your-password}"), AdminUsername: to.Ptr("{your-username}"), ComputerNamePrefix: to.Ptr("{vmss-name}"), }, SecurityProfile: &armcompute.SecurityProfile{ SecurityType: to.Ptr(armcompute.SecurityTypesConfidentialVM), UefiSettings: &armcompute.UefiSettings{ SecureBootEnabled: to.Ptr(true), VTpmEnabled: to.Ptr(true), }, }, StorageProfile: &armcompute.VirtualMachineScaleSetStorageProfile{ ImageReference: &armcompute.ImageReference{ Offer: to.Ptr("2019-datacenter-cvm"), Publisher: to.Ptr("MicrosoftWindowsServer"), SKU: to.Ptr("windows-cvm"), Version: to.Ptr("17763.2183.2109130127"), }, OSDisk: &armcompute.VirtualMachineScaleSetOSDisk{ Caching: to.Ptr(armcompute.CachingTypesReadOnly), CreateOption: to.Ptr(armcompute.DiskCreateOptionTypesFromImage), ManagedDisk: &armcompute.VirtualMachineScaleSetManagedDiskParameters{ SecurityProfile: &armcompute.VMDiskSecurityProfile{ SecurityEncryptionType: to.Ptr(armcompute.SecurityEncryptionTypesVMGuestStateOnly), }, StorageAccountType: to.Ptr(armcompute.StorageAccountTypesStandardSSDLRS), }, }, }, }, }, SKU: &armcompute.SKU{ Name: to.Ptr("Standard_DC2as_v5"), Capacity: to.Ptr[int64](3), Tier: to.Ptr("Standard"), }, }, &armcompute.VirtualMachineScaleSetsClientBeginCreateOrUpdateOptions{IfMatch: nil, IfNoneMatch: nil, }) if err != nil { log.Fatalf("failed to finish the request: %v", err) } res, err := poller.PollUntilDone(ctx, nil) if err != nil { log.Fatalf("failed to pull the result: %v", err) } // You could use response here. We use blank identifier for just demo purposes. _ = res // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. // res.VirtualMachineScaleSet = armcompute.VirtualMachineScaleSet{ // Name: to.Ptr("{vmss-name}"), // Type: to.Ptr("Microsoft.Compute/virtualMachineScaleSets"), // ID: to.Ptr("/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/virtualMachineScaleSets/{vmss-name}"), // Location: to.Ptr("westus"), // Properties: &armcompute.VirtualMachineScaleSetProperties{ // Overprovision: to.Ptr(true), // ProvisioningState: to.Ptr("Succeeded"), // SinglePlacementGroup: to.Ptr(true), // UniqueID: to.Ptr("b9e23088-6ffc-46e0-9e02-b0a6eeef47db"), // UpgradePolicy: &armcompute.UpgradePolicy{ // Mode: to.Ptr(armcompute.UpgradeModeManual), // }, // VirtualMachineProfile: &armcompute.VirtualMachineScaleSetVMProfile{ // NetworkProfile: &armcompute.VirtualMachineScaleSetNetworkProfile{ // NetworkInterfaceConfigurations: []*armcompute.VirtualMachineScaleSetNetworkConfiguration{ // { // Name: to.Ptr("{vmss-name}"), // Properties: &armcompute.VirtualMachineScaleSetNetworkConfigurationProperties{ // DNSSettings: &armcompute.VirtualMachineScaleSetNetworkConfigurationDNSSettings{ // DNSServers: []*string{ // }, // }, // EnableAcceleratedNetworking: to.Ptr(false), // EnableIPForwarding: to.Ptr(true), // IPConfigurations: []*armcompute.VirtualMachineScaleSetIPConfiguration{ // { // Name: to.Ptr("{vmss-name}"), // Properties: &armcompute.VirtualMachineScaleSetIPConfigurationProperties{ // PrivateIPAddressVersion: to.Ptr(armcompute.IPVersionIPv4), // Subnet: &armcompute.APIEntityReference{ // ID: to.Ptr("/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/virtualNetworks/nsgExistingVnet/subnets/nsgExistingSubnet"), // }, // }, // }}, // Primary: to.Ptr(true), // }, // }}, // }, // OSProfile: &armcompute.VirtualMachineScaleSetOSProfile{ // AdminUsername: to.Ptr("{your-username}"), // ComputerNamePrefix: to.Ptr("{vmss-name}"), // Secrets: []*armcompute.VaultSecretGroup{ // }, // WindowsConfiguration: &armcompute.WindowsConfiguration{ // EnableAutomaticUpdates: to.Ptr(true), // ProvisionVMAgent: to.Ptr(true), // }, // }, // SecurityProfile: &armcompute.SecurityProfile{ // SecurityType: to.Ptr(armcompute.SecurityTypesConfidentialVM), // UefiSettings: &armcompute.UefiSettings{ // SecureBootEnabled: to.Ptr(true), // VTpmEnabled: to.Ptr(true), // }, // }, // StorageProfile: &armcompute.VirtualMachineScaleSetStorageProfile{ // ImageReference: &armcompute.ImageReference{ // Offer: to.Ptr("2019-datacenter-cvm"), // Publisher: to.Ptr("MicrosoftWindowsServer"), // SKU: to.Ptr("windows-cvm"), // Version: to.Ptr("17763.2183.2109130127"), // }, // OSDisk: &armcompute.VirtualMachineScaleSetOSDisk{ // Caching: to.Ptr(armcompute.CachingTypesReadOnly), // CreateOption: to.Ptr(armcompute.DiskCreateOptionTypesFromImage), // ManagedDisk: &armcompute.VirtualMachineScaleSetManagedDiskParameters{ // SecurityProfile: &armcompute.VMDiskSecurityProfile{ // SecurityEncryptionType: to.Ptr(armcompute.SecurityEncryptionTypesVMGuestStateOnly), // }, // StorageAccountType: to.Ptr(armcompute.StorageAccountTypesStandardSSDLRS), // }, // }, // }, // }, // }, // SKU: &armcompute.SKU{ // Name: to.Ptr("Standard_DC2as_v5"), // Capacity: to.Ptr[int64](3), // Tier: to.Ptr("Standard"), // }, // }
Output:
Example (CreateAScaleSetWithSecurityTypeAsConfidentialVmAndNonPersistedTpmSecurityEncryptionType) ¶
Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/92de53a5f1e0e03c94b40475d2135d97148ed014/specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-03-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSet_Create_WithSecurityTypeConfidentialVMWithNonPersistedTPM.json
cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() clientFactory, err := armcompute.NewClientFactory("<subscription-id>", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } poller, err := clientFactory.NewVirtualMachineScaleSetsClient().BeginCreateOrUpdate(ctx, "myResourceGroup", "{vmss-name}", armcompute.VirtualMachineScaleSet{ Location: to.Ptr("westus"), Properties: &armcompute.VirtualMachineScaleSetProperties{ Overprovision: to.Ptr(true), UpgradePolicy: &armcompute.UpgradePolicy{ Mode: to.Ptr(armcompute.UpgradeModeManual), }, VirtualMachineProfile: &armcompute.VirtualMachineScaleSetVMProfile{ NetworkProfile: &armcompute.VirtualMachineScaleSetNetworkProfile{ NetworkInterfaceConfigurations: []*armcompute.VirtualMachineScaleSetNetworkConfiguration{ { Name: to.Ptr("{vmss-name}"), Properties: &armcompute.VirtualMachineScaleSetNetworkConfigurationProperties{ EnableIPForwarding: to.Ptr(true), IPConfigurations: []*armcompute.VirtualMachineScaleSetIPConfiguration{ { Name: to.Ptr("{vmss-name}"), Properties: &armcompute.VirtualMachineScaleSetIPConfigurationProperties{ Subnet: &armcompute.APIEntityReference{ ID: to.Ptr("/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/virtualNetworks/{existing-virtual-network-name}/subnets/{existing-subnet-name}"), }, }, }}, Primary: to.Ptr(true), }, }}, }, OSProfile: &armcompute.VirtualMachineScaleSetOSProfile{ AdminPassword: to.Ptr("{your-password}"), AdminUsername: to.Ptr("{your-username}"), ComputerNamePrefix: to.Ptr("{vmss-name}"), }, SecurityProfile: &armcompute.SecurityProfile{ SecurityType: to.Ptr(armcompute.SecurityTypesConfidentialVM), UefiSettings: &armcompute.UefiSettings{ SecureBootEnabled: to.Ptr(false), VTpmEnabled: to.Ptr(true), }, }, StorageProfile: &armcompute.VirtualMachineScaleSetStorageProfile{ ImageReference: &armcompute.ImageReference{ Offer: to.Ptr("2022-datacenter-cvm"), Publisher: to.Ptr("UbuntuServer"), SKU: to.Ptr("linux-cvm"), Version: to.Ptr("17763.2183.2109130127"), }, OSDisk: &armcompute.VirtualMachineScaleSetOSDisk{ Caching: to.Ptr(armcompute.CachingTypesReadOnly), CreateOption: to.Ptr(armcompute.DiskCreateOptionTypesFromImage), ManagedDisk: &armcompute.VirtualMachineScaleSetManagedDiskParameters{ SecurityProfile: &armcompute.VMDiskSecurityProfile{ SecurityEncryptionType: to.Ptr(armcompute.SecurityEncryptionTypesNonPersistedTPM), }, StorageAccountType: to.Ptr(armcompute.StorageAccountTypesStandardSSDLRS), }, }, }, }, }, SKU: &armcompute.SKU{ Name: to.Ptr("Standard_DC2es_v5"), Capacity: to.Ptr[int64](3), Tier: to.Ptr("Standard"), }, }, &armcompute.VirtualMachineScaleSetsClientBeginCreateOrUpdateOptions{IfMatch: nil, IfNoneMatch: nil, }) if err != nil { log.Fatalf("failed to finish the request: %v", err) } res, err := poller.PollUntilDone(ctx, nil) if err != nil { log.Fatalf("failed to pull the result: %v", err) } // You could use response here. We use blank identifier for just demo purposes. _ = res // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. // res.VirtualMachineScaleSet = armcompute.VirtualMachineScaleSet{ // Name: to.Ptr("{vmss-name}"), // Type: to.Ptr("Microsoft.Compute/virtualMachineScaleSets"), // ID: to.Ptr("/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/virtualMachineScaleSets/{vmss-name}"), // Location: to.Ptr("westus"), // Properties: &armcompute.VirtualMachineScaleSetProperties{ // Overprovision: to.Ptr(true), // ProvisioningState: to.Ptr("Succeeded"), // SinglePlacementGroup: to.Ptr(true), // UniqueID: to.Ptr("b9e23088-6ffc-46e0-9e02-b0a6eeef47db"), // UpgradePolicy: &armcompute.UpgradePolicy{ // Mode: to.Ptr(armcompute.UpgradeModeManual), // }, // VirtualMachineProfile: &armcompute.VirtualMachineScaleSetVMProfile{ // NetworkProfile: &armcompute.VirtualMachineScaleSetNetworkProfile{ // NetworkInterfaceConfigurations: []*armcompute.VirtualMachineScaleSetNetworkConfiguration{ // { // Name: to.Ptr("{vmss-name}"), // Properties: &armcompute.VirtualMachineScaleSetNetworkConfigurationProperties{ // DNSSettings: &armcompute.VirtualMachineScaleSetNetworkConfigurationDNSSettings{ // DNSServers: []*string{ // }, // }, // EnableAcceleratedNetworking: to.Ptr(false), // EnableIPForwarding: to.Ptr(true), // IPConfigurations: []*armcompute.VirtualMachineScaleSetIPConfiguration{ // { // Name: to.Ptr("{vmss-name}"), // Properties: &armcompute.VirtualMachineScaleSetIPConfigurationProperties{ // PrivateIPAddressVersion: to.Ptr(armcompute.IPVersionIPv4), // Subnet: &armcompute.APIEntityReference{ // ID: to.Ptr("/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/virtualNetworks/nsgExistingVnet/subnets/nsgExistingSubnet"), // }, // }, // }}, // Primary: to.Ptr(true), // }, // }}, // }, // OSProfile: &armcompute.VirtualMachineScaleSetOSProfile{ // AdminUsername: to.Ptr("{your-username}"), // ComputerNamePrefix: to.Ptr("{vmss-name}"), // Secrets: []*armcompute.VaultSecretGroup{ // }, // WindowsConfiguration: &armcompute.WindowsConfiguration{ // EnableAutomaticUpdates: to.Ptr(true), // ProvisionVMAgent: to.Ptr(true), // }, // }, // SecurityProfile: &armcompute.SecurityProfile{ // SecurityType: to.Ptr(armcompute.SecurityTypesConfidentialVM), // UefiSettings: &armcompute.UefiSettings{ // SecureBootEnabled: to.Ptr(false), // VTpmEnabled: to.Ptr(true), // }, // }, // StorageProfile: &armcompute.VirtualMachineScaleSetStorageProfile{ // ImageReference: &armcompute.ImageReference{ // Offer: to.Ptr("2022-datacenter-cvm"), // Publisher: to.Ptr("UbuntuServer"), // SKU: to.Ptr("linux-cvm"), // Version: to.Ptr("17763.2183.2109130127"), // }, // OSDisk: &armcompute.VirtualMachineScaleSetOSDisk{ // Caching: to.Ptr(armcompute.CachingTypesReadOnly), // CreateOption: to.Ptr(armcompute.DiskCreateOptionTypesFromImage), // ManagedDisk: &armcompute.VirtualMachineScaleSetManagedDiskParameters{ // SecurityProfile: &armcompute.VMDiskSecurityProfile{ // SecurityEncryptionType: to.Ptr(armcompute.SecurityEncryptionTypesNonPersistedTPM), // }, // StorageAccountType: to.Ptr(armcompute.StorageAccountTypesStandardSSDLRS), // }, // }, // }, // }, // }, // SKU: &armcompute.SKU{ // Name: to.Ptr("Standard_DC2es_v5"), // Capacity: to.Ptr[int64](3), // Tier: to.Ptr("Standard"), // }, // }
Output:
Example (CreateAScaleSetWithServiceArtifactReference) ¶
Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/92de53a5f1e0e03c94b40475d2135d97148ed014/specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-03-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSet_Create_WithServiceArtifactReference.json
cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() clientFactory, err := armcompute.NewClientFactory("<subscription-id>", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } poller, err := clientFactory.NewVirtualMachineScaleSetsClient().BeginCreateOrUpdate(ctx, "myResourceGroup", "{vmss-name}", armcompute.VirtualMachineScaleSet{ Location: to.Ptr("eastus2euap"), Properties: &armcompute.VirtualMachineScaleSetProperties{ Overprovision: to.Ptr(true), UpgradePolicy: &armcompute.UpgradePolicy{ AutomaticOSUpgradePolicy: &armcompute.AutomaticOSUpgradePolicy{ EnableAutomaticOSUpgrade: to.Ptr(true), }, Mode: to.Ptr(armcompute.UpgradeModeAutomatic), }, VirtualMachineProfile: &armcompute.VirtualMachineScaleSetVMProfile{ NetworkProfile: &armcompute.VirtualMachineScaleSetNetworkProfile{ NetworkInterfaceConfigurations: []*armcompute.VirtualMachineScaleSetNetworkConfiguration{ { Name: to.Ptr("{vmss-name}"), Properties: &armcompute.VirtualMachineScaleSetNetworkConfigurationProperties{ EnableIPForwarding: to.Ptr(true), IPConfigurations: []*armcompute.VirtualMachineScaleSetIPConfiguration{ { Name: to.Ptr("{vmss-name}"), Properties: &armcompute.VirtualMachineScaleSetIPConfigurationProperties{ Subnet: &armcompute.APIEntityReference{ ID: to.Ptr("/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/virtualNetworks/{existing-virtual-network-name}/subnets/{existing-subnet-name}"), }, }, }}, Primary: to.Ptr(true), }, }}, }, OSProfile: &armcompute.VirtualMachineScaleSetOSProfile{ AdminPassword: to.Ptr("{your-password}"), AdminUsername: to.Ptr("{your-username}"), ComputerNamePrefix: to.Ptr("{vmss-name}"), }, ServiceArtifactReference: &armcompute.ServiceArtifactReference{ ID: to.Ptr("/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/galleries/myGalleryName/serviceArtifacts/serviceArtifactName/vmArtifactsProfiles/vmArtifactsProfilesName"), }, StorageProfile: &armcompute.VirtualMachineScaleSetStorageProfile{ ImageReference: &armcompute.ImageReference{ Offer: to.Ptr("WindowsServer"), Publisher: to.Ptr("MicrosoftWindowsServer"), SKU: to.Ptr("2022-Datacenter"), Version: to.Ptr("latest"), }, OSDisk: &armcompute.VirtualMachineScaleSetOSDisk{ Name: to.Ptr("osDisk"), Caching: to.Ptr(armcompute.CachingTypesReadWrite), CreateOption: to.Ptr(armcompute.DiskCreateOptionTypesFromImage), }, }, }, }, SKU: &armcompute.SKU{ Name: to.Ptr("Standard_A1"), Capacity: to.Ptr[int64](3), Tier: to.Ptr("Standard"), }, }, &armcompute.VirtualMachineScaleSetsClientBeginCreateOrUpdateOptions{IfMatch: nil, IfNoneMatch: nil, }) if err != nil { log.Fatalf("failed to finish the request: %v", err) } res, err := poller.PollUntilDone(ctx, nil) if err != nil { log.Fatalf("failed to pull the result: %v", err) } // You could use response here. We use blank identifier for just demo purposes. _ = res // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. // res.VirtualMachineScaleSet = armcompute.VirtualMachineScaleSet{ // Name: to.Ptr("{vmss-name}"), // Type: to.Ptr("Microsoft.Compute/virtualMachineScaleSets"), // ID: to.Ptr("/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/virtualMachineScaleSets/{vmss-name}"), // Location: to.Ptr("eastus2euap"), // Properties: &armcompute.VirtualMachineScaleSetProperties{ // Overprovision: to.Ptr(true), // ProvisioningState: to.Ptr("Succeeded"), // SinglePlacementGroup: to.Ptr(true), // UniqueID: to.Ptr("77b7df9a-32fe-45e3-8911-60ac9c9b9c64"), // UpgradePolicy: &armcompute.UpgradePolicy{ // AutomaticOSUpgradePolicy: &armcompute.AutomaticOSUpgradePolicy{ // EnableAutomaticOSUpgrade: to.Ptr(true), // }, // Mode: to.Ptr(armcompute.UpgradeModeAutomatic), // }, // VirtualMachineProfile: &armcompute.VirtualMachineScaleSetVMProfile{ // NetworkProfile: &armcompute.VirtualMachineScaleSetNetworkProfile{ // NetworkInterfaceConfigurations: []*armcompute.VirtualMachineScaleSetNetworkConfiguration{ // { // Name: to.Ptr("{vmss-name}"), // Properties: &armcompute.VirtualMachineScaleSetNetworkConfigurationProperties{ // DNSSettings: &armcompute.VirtualMachineScaleSetNetworkConfigurationDNSSettings{ // DNSServers: []*string{ // }, // }, // EnableAcceleratedNetworking: to.Ptr(false), // EnableIPForwarding: to.Ptr(true), // IPConfigurations: []*armcompute.VirtualMachineScaleSetIPConfiguration{ // { // Name: to.Ptr("{vmss-name}"), // Properties: &armcompute.VirtualMachineScaleSetIPConfigurationProperties{ // PrivateIPAddressVersion: to.Ptr(armcompute.IPVersionIPv4), // Subnet: &armcompute.APIEntityReference{ // ID: to.Ptr("/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/virtualNetworks/nsgExistingVnet/subnets/nsgExistingSubnet"), // }, // }, // }}, // Primary: to.Ptr(true), // }, // }}, // }, // OSProfile: &armcompute.VirtualMachineScaleSetOSProfile{ // AdminUsername: to.Ptr("{your-username}"), // ComputerNamePrefix: to.Ptr("{vmss-name}"), // Secrets: []*armcompute.VaultSecretGroup{ // }, // WindowsConfiguration: &armcompute.WindowsConfiguration{ // EnableAutomaticUpdates: to.Ptr(true), // ProvisionVMAgent: to.Ptr(true), // }, // }, // ServiceArtifactReference: &armcompute.ServiceArtifactReference{ // ID: to.Ptr("/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/galleries/myGalleryName/serviceArtifacts/serviceArtifactName/vmArtifactsProfiles/vmArtifactsProfilesName"), // }, // StorageProfile: &armcompute.VirtualMachineScaleSetStorageProfile{ // ImageReference: &armcompute.ImageReference{ // Offer: to.Ptr("WindowsServer"), // Publisher: to.Ptr("MicrosoftWindowsServer"), // SKU: to.Ptr("2022-Datacenter"), // Version: to.Ptr("latest"), // }, // OSDisk: &armcompute.VirtualMachineScaleSetOSDisk{ // Name: to.Ptr("osDisk"), // Caching: to.Ptr(armcompute.CachingTypesReadWrite), // CreateOption: to.Ptr(armcompute.DiskCreateOptionTypesFromImage), // }, // }, // }, // }, // SKU: &armcompute.SKU{ // Name: to.Ptr("Standard_A1"), // Capacity: to.Ptr[int64](3), // Tier: to.Ptr("Standard"), // }, // }
Output:
Example (CreateAScaleSetWithSpotRestorePolicy) ¶
Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/92de53a5f1e0e03c94b40475d2135d97148ed014/specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-03-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSet_Create_WithSpotRestorePolicy.json
cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() clientFactory, err := armcompute.NewClientFactory("<subscription-id>", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } poller, err := clientFactory.NewVirtualMachineScaleSetsClient().BeginCreateOrUpdate(ctx, "myResourceGroup", "{vmss-name}", armcompute.VirtualMachineScaleSet{ Location: to.Ptr("westus"), Properties: &armcompute.VirtualMachineScaleSetProperties{ Overprovision: to.Ptr(true), SpotRestorePolicy: &armcompute.SpotRestorePolicy{ Enabled: to.Ptr(true), RestoreTimeout: to.Ptr("PT1H"), }, UpgradePolicy: &armcompute.UpgradePolicy{ Mode: to.Ptr(armcompute.UpgradeModeManual), }, VirtualMachineProfile: &armcompute.VirtualMachineScaleSetVMProfile{ BillingProfile: &armcompute.BillingProfile{ MaxPrice: to.Ptr[float64](-1), }, EvictionPolicy: to.Ptr(armcompute.VirtualMachineEvictionPolicyTypesDeallocate), NetworkProfile: &armcompute.VirtualMachineScaleSetNetworkProfile{ NetworkInterfaceConfigurations: []*armcompute.VirtualMachineScaleSetNetworkConfiguration{ { Name: to.Ptr("{vmss-name}"), Properties: &armcompute.VirtualMachineScaleSetNetworkConfigurationProperties{ EnableIPForwarding: to.Ptr(true), IPConfigurations: []*armcompute.VirtualMachineScaleSetIPConfiguration{ { Name: to.Ptr("{vmss-name}"), Properties: &armcompute.VirtualMachineScaleSetIPConfigurationProperties{ Subnet: &armcompute.APIEntityReference{ ID: to.Ptr("/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/virtualNetworks/{existing-virtual-network-name}/subnets/{existing-subnet-name}"), }, }, }}, Primary: to.Ptr(true), }, }}, }, OSProfile: &armcompute.VirtualMachineScaleSetOSProfile{ AdminPassword: to.Ptr("{your-password}"), AdminUsername: to.Ptr("{your-username}"), ComputerNamePrefix: to.Ptr("{vmss-name}"), }, Priority: to.Ptr(armcompute.VirtualMachinePriorityTypesSpot), StorageProfile: &armcompute.VirtualMachineScaleSetStorageProfile{ ImageReference: &armcompute.ImageReference{ Offer: to.Ptr("WindowsServer"), Publisher: to.Ptr("MicrosoftWindowsServer"), SKU: to.Ptr("2016-Datacenter"), Version: to.Ptr("latest"), }, OSDisk: &armcompute.VirtualMachineScaleSetOSDisk{ Caching: to.Ptr(armcompute.CachingTypesReadWrite), CreateOption: to.Ptr(armcompute.DiskCreateOptionTypesFromImage), ManagedDisk: &armcompute.VirtualMachineScaleSetManagedDiskParameters{ StorageAccountType: to.Ptr(armcompute.StorageAccountTypesStandardLRS), }, }, }, }, }, SKU: &armcompute.SKU{ Name: to.Ptr("Standard_A8m_v2"), Capacity: to.Ptr[int64](2), Tier: to.Ptr("Standard"), }, }, &armcompute.VirtualMachineScaleSetsClientBeginCreateOrUpdateOptions{IfMatch: nil, IfNoneMatch: nil, }) if err != nil { log.Fatalf("failed to finish the request: %v", err) } res, err := poller.PollUntilDone(ctx, nil) if err != nil { log.Fatalf("failed to pull the result: %v", err) } // You could use response here. We use blank identifier for just demo purposes. _ = res // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. // res.VirtualMachineScaleSet = armcompute.VirtualMachineScaleSet{ // Name: to.Ptr("{vmss-name}"), // Type: to.Ptr("Microsoft.Compute/virtualMachineScaleSets"), // ID: to.Ptr("/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/virtualMachineScaleSets/{vmss-name}"), // Location: to.Ptr("westus"), // Properties: &armcompute.VirtualMachineScaleSetProperties{ // Overprovision: to.Ptr(true), // ProvisioningState: to.Ptr("Succeeded"), // SinglePlacementGroup: to.Ptr(true), // SpotRestorePolicy: &armcompute.SpotRestorePolicy{ // Enabled: to.Ptr(true), // RestoreTimeout: to.Ptr("PT1H"), // }, // UniqueID: to.Ptr("d053ec5a-8da6-495f-ab13-38216503c6d7"), // UpgradePolicy: &armcompute.UpgradePolicy{ // Mode: to.Ptr(armcompute.UpgradeModeManual), // }, // VirtualMachineProfile: &armcompute.VirtualMachineScaleSetVMProfile{ // BillingProfile: &armcompute.BillingProfile{ // MaxPrice: to.Ptr[float64](-1), // }, // EvictionPolicy: to.Ptr(armcompute.VirtualMachineEvictionPolicyTypesDeallocate), // NetworkProfile: &armcompute.VirtualMachineScaleSetNetworkProfile{ // NetworkInterfaceConfigurations: []*armcompute.VirtualMachineScaleSetNetworkConfiguration{ // { // Name: to.Ptr("{vmss-name}"), // Properties: &armcompute.VirtualMachineScaleSetNetworkConfigurationProperties{ // DNSSettings: &armcompute.VirtualMachineScaleSetNetworkConfigurationDNSSettings{ // DNSServers: []*string{ // }, // }, // EnableAcceleratedNetworking: to.Ptr(false), // EnableIPForwarding: to.Ptr(true), // IPConfigurations: []*armcompute.VirtualMachineScaleSetIPConfiguration{ // { // Name: to.Ptr("{vmss-name}"), // Properties: &armcompute.VirtualMachineScaleSetIPConfigurationProperties{ // PrivateIPAddressVersion: to.Ptr(armcompute.IPVersionIPv4), // Subnet: &armcompute.APIEntityReference{ // ID: to.Ptr("/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/virtualNetworks/nsgExistingVnet/subnets/nsgExistingSubnet"), // }, // }, // }}, // Primary: to.Ptr(true), // }, // }}, // }, // OSProfile: &armcompute.VirtualMachineScaleSetOSProfile{ // AdminUsername: to.Ptr("{your-username}"), // ComputerNamePrefix: to.Ptr("{vmss-name}"), // Secrets: []*armcompute.VaultSecretGroup{ // }, // WindowsConfiguration: &armcompute.WindowsConfiguration{ // EnableAutomaticUpdates: to.Ptr(true), // ProvisionVMAgent: to.Ptr(true), // }, // }, // Priority: to.Ptr(armcompute.VirtualMachinePriorityTypesSpot), // StorageProfile: &armcompute.VirtualMachineScaleSetStorageProfile{ // ImageReference: &armcompute.ImageReference{ // Offer: to.Ptr("WindowsServer"), // Publisher: to.Ptr("MicrosoftWindowsServer"), // SKU: to.Ptr("2016-Datacenter"), // Version: to.Ptr("latest"), // }, // OSDisk: &armcompute.VirtualMachineScaleSetOSDisk{ // Caching: to.Ptr(armcompute.CachingTypesReadWrite), // CreateOption: to.Ptr(armcompute.DiskCreateOptionTypesFromImage), // ManagedDisk: &armcompute.VirtualMachineScaleSetManagedDiskParameters{ // StorageAccountType: to.Ptr(armcompute.StorageAccountTypesStandardLRS), // }, // }, // }, // }, // }, // SKU: &armcompute.SKU{ // Name: to.Ptr("Standard_A8m_v2"), // Capacity: to.Ptr[int64](2), // Tier: to.Ptr("Standard"), // }, // }
Output:
Example (CreateAScaleSetWithSshAuthentication) ¶
Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/92de53a5f1e0e03c94b40475d2135d97148ed014/specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-03-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSet_Create_WithSshAuthentication.json
cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() clientFactory, err := armcompute.NewClientFactory("<subscription-id>", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } poller, err := clientFactory.NewVirtualMachineScaleSetsClient().BeginCreateOrUpdate(ctx, "myResourceGroup", "{vmss-name}", armcompute.VirtualMachineScaleSet{ Location: to.Ptr("westus"), Properties: &armcompute.VirtualMachineScaleSetProperties{ Overprovision: to.Ptr(true), UpgradePolicy: &armcompute.UpgradePolicy{ Mode: to.Ptr(armcompute.UpgradeModeManual), }, VirtualMachineProfile: &armcompute.VirtualMachineScaleSetVMProfile{ NetworkProfile: &armcompute.VirtualMachineScaleSetNetworkProfile{ NetworkInterfaceConfigurations: []*armcompute.VirtualMachineScaleSetNetworkConfiguration{ { Name: to.Ptr("{vmss-name}"), Properties: &armcompute.VirtualMachineScaleSetNetworkConfigurationProperties{ EnableIPForwarding: to.Ptr(true), IPConfigurations: []*armcompute.VirtualMachineScaleSetIPConfiguration{ { Name: to.Ptr("{vmss-name}"), Properties: &armcompute.VirtualMachineScaleSetIPConfigurationProperties{ Subnet: &armcompute.APIEntityReference{ ID: to.Ptr("/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/virtualNetworks/{existing-virtual-network-name}/subnets/{existing-subnet-name}"), }, }, }}, Primary: to.Ptr(true), }, }}, }, OSProfile: &armcompute.VirtualMachineScaleSetOSProfile{ AdminUsername: to.Ptr("{your-username}"), ComputerNamePrefix: to.Ptr("{vmss-name}"), LinuxConfiguration: &armcompute.LinuxConfiguration{ DisablePasswordAuthentication: to.Ptr(true), SSH: &armcompute.SSHConfiguration{ PublicKeys: []*armcompute.SSHPublicKey{ { Path: to.Ptr("/home/{your-username}/.ssh/authorized_keys"), KeyData: to.Ptr("ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQCeClRAk2ipUs/l5voIsDC5q9RI+YSRd1Bvd/O+axgY4WiBzG+4FwJWZm/mLLe5DoOdHQwmU2FrKXZSW4w2sYE70KeWnrFViCOX5MTVvJgPE8ClugNl8RWth/tU849DvM9sT7vFgfVSHcAS2yDRyDlueii+8nF2ym8XWAPltFVCyLHRsyBp5YPqK8JFYIa1eybKsY3hEAxRCA+/7bq8et+Gj3coOsuRmrehav7rE6N12Pb80I6ofa6SM5XNYq4Xk0iYNx7R3kdz0Jj9XgZYWjAHjJmT0gTRoOnt6upOuxK7xI/ykWrllgpXrCPu3Ymz+c+ujaqcxDopnAl2lmf69/J1"), }}, }, }, }, StorageProfile: &armcompute.VirtualMachineScaleSetStorageProfile{ ImageReference: &armcompute.ImageReference{ Offer: to.Ptr("WindowsServer"), Publisher: to.Ptr("MicrosoftWindowsServer"), SKU: to.Ptr("2016-Datacenter"), Version: to.Ptr("latest"), }, OSDisk: &armcompute.VirtualMachineScaleSetOSDisk{ Caching: to.Ptr(armcompute.CachingTypesReadWrite), CreateOption: to.Ptr(armcompute.DiskCreateOptionTypesFromImage), ManagedDisk: &armcompute.VirtualMachineScaleSetManagedDiskParameters{ StorageAccountType: to.Ptr(armcompute.StorageAccountTypesStandardLRS), }, }, }, }, }, SKU: &armcompute.SKU{ Name: to.Ptr("Standard_D1_v2"), Capacity: to.Ptr[int64](3), Tier: to.Ptr("Standard"), }, }, &armcompute.VirtualMachineScaleSetsClientBeginCreateOrUpdateOptions{IfMatch: nil, IfNoneMatch: nil, }) if err != nil { log.Fatalf("failed to finish the request: %v", err) } res, err := poller.PollUntilDone(ctx, nil) if err != nil { log.Fatalf("failed to pull the result: %v", err) } // You could use response here. We use blank identifier for just demo purposes. _ = res // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. // res.VirtualMachineScaleSet = armcompute.VirtualMachineScaleSet{ // Name: to.Ptr("{vmss-name}"), // Type: to.Ptr("Microsoft.Compute/virtualMachineScaleSets"), // ID: to.Ptr("/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/virtualMachineScaleSets/{vmss-name}"), // Location: to.Ptr("westus"), // Properties: &armcompute.VirtualMachineScaleSetProperties{ // Overprovision: to.Ptr(true), // ProvisioningState: to.Ptr("Succeeded"), // SinglePlacementGroup: to.Ptr(true), // UniqueID: to.Ptr("fb73af19-0090-467c-9ced-b00bceab1c45"), // UpgradePolicy: &armcompute.UpgradePolicy{ // Mode: to.Ptr(armcompute.UpgradeModeManual), // }, // VirtualMachineProfile: &armcompute.VirtualMachineScaleSetVMProfile{ // NetworkProfile: &armcompute.VirtualMachineScaleSetNetworkProfile{ // NetworkInterfaceConfigurations: []*armcompute.VirtualMachineScaleSetNetworkConfiguration{ // { // Name: to.Ptr("{vmss-name}"), // Properties: &armcompute.VirtualMachineScaleSetNetworkConfigurationProperties{ // DNSSettings: &armcompute.VirtualMachineScaleSetNetworkConfigurationDNSSettings{ // DNSServers: []*string{ // }, // }, // EnableAcceleratedNetworking: to.Ptr(false), // EnableIPForwarding: to.Ptr(true), // IPConfigurations: []*armcompute.VirtualMachineScaleSetIPConfiguration{ // { // Name: to.Ptr("{vmss-name}"), // Properties: &armcompute.VirtualMachineScaleSetIPConfigurationProperties{ // PrivateIPAddressVersion: to.Ptr(armcompute.IPVersionIPv4), // Subnet: &armcompute.APIEntityReference{ // ID: to.Ptr("/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/virtualNetworks/nsgExistingVnet/subnets/nsgExistingSubnet"), // }, // }, // }}, // Primary: to.Ptr(true), // }, // }}, // }, // OSProfile: &armcompute.VirtualMachineScaleSetOSProfile{ // AdminUsername: to.Ptr("{your-username}"), // ComputerNamePrefix: to.Ptr("{vmss-name}"), // LinuxConfiguration: &armcompute.LinuxConfiguration{ // DisablePasswordAuthentication: to.Ptr(true), // SSH: &armcompute.SSHConfiguration{ // PublicKeys: []*armcompute.SSHPublicKey{ // { // Path: to.Ptr("/home/{your-username}/.ssh/authorized_keys"), // KeyData: to.Ptr("ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQCeClRAk2ipUs/l5voIsDC5q9RI+YSRd1Bvd/O+axgY4WiBzG+4FwJWZm/mLLe5DoOdHQwmU2FrKXZSW4w2sYE70KeWnrFViCOX5MTVvJgPE8ClugNl8RWth/tU849DvM9sT7vFgfVSHcAS2yDRyDlueii+8nF2ym8XWAPltFVCyLHRsyBp5YPqK8JFYIa1eybKsY3hEAxRCA+/7bq8et+Gj3coOsuRmrehav7rE6N12Pb80I6ofa6SM5XNYq4Xk0iYNx7R3kdz0Jj9XgZYWjAHjJmT0gTRoOnt6upOuxK7xI/ykWrllgpXrCPu3Ymz+c+ujaqcxDopnAl2lmf69/J1"), // }}, // }, // }, // Secrets: []*armcompute.VaultSecretGroup{ // }, // }, // StorageProfile: &armcompute.VirtualMachineScaleSetStorageProfile{ // ImageReference: &armcompute.ImageReference{ // Offer: to.Ptr("UbuntuServer"), // Publisher: to.Ptr("Canonical"), // SKU: to.Ptr("16.04-LTS"), // Version: to.Ptr("latest"), // }, // OSDisk: &armcompute.VirtualMachineScaleSetOSDisk{ // Caching: to.Ptr(armcompute.CachingTypesReadWrite), // CreateOption: to.Ptr(armcompute.DiskCreateOptionTypesFromImage), // ManagedDisk: &armcompute.VirtualMachineScaleSetManagedDiskParameters{ // StorageAccountType: to.Ptr(armcompute.StorageAccountTypesStandardLRS), // }, // }, // }, // }, // }, // SKU: &armcompute.SKU{ // Name: to.Ptr("Standard_D1_v2"), // Capacity: to.Ptr[int64](3), // Tier: to.Ptr("Standard"), // }, // }
Output:
Example (CreateAScaleSetWithTerminateScheduledEventsEnabled) ¶
Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/92de53a5f1e0e03c94b40475d2135d97148ed014/specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-03-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSet_Create_WithTerminateScheduledEventEnabled.json
cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() clientFactory, err := armcompute.NewClientFactory("<subscription-id>", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } poller, err := clientFactory.NewVirtualMachineScaleSetsClient().BeginCreateOrUpdate(ctx, "myResourceGroup", "{vmss-name}", armcompute.VirtualMachineScaleSet{ Location: to.Ptr("westus"), Properties: &armcompute.VirtualMachineScaleSetProperties{ Overprovision: to.Ptr(true), UpgradePolicy: &armcompute.UpgradePolicy{ Mode: to.Ptr(armcompute.UpgradeModeManual), }, VirtualMachineProfile: &armcompute.VirtualMachineScaleSetVMProfile{ NetworkProfile: &armcompute.VirtualMachineScaleSetNetworkProfile{ NetworkInterfaceConfigurations: []*armcompute.VirtualMachineScaleSetNetworkConfiguration{ { Name: to.Ptr("{vmss-name}"), Properties: &armcompute.VirtualMachineScaleSetNetworkConfigurationProperties{ EnableIPForwarding: to.Ptr(true), IPConfigurations: []*armcompute.VirtualMachineScaleSetIPConfiguration{ { Name: to.Ptr("{vmss-name}"), Properties: &armcompute.VirtualMachineScaleSetIPConfigurationProperties{ Subnet: &armcompute.APIEntityReference{ ID: to.Ptr("/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/virtualNetworks/{existing-virtual-network-name}/subnets/{existing-subnet-name}"), }, }, }}, Primary: to.Ptr(true), }, }}, }, OSProfile: &armcompute.VirtualMachineScaleSetOSProfile{ AdminPassword: to.Ptr("{your-password}"), AdminUsername: to.Ptr("{your-username}"), ComputerNamePrefix: to.Ptr("{vmss-name}"), }, ScheduledEventsProfile: &armcompute.ScheduledEventsProfile{ TerminateNotificationProfile: &armcompute.TerminateNotificationProfile{ Enable: to.Ptr(true), NotBeforeTimeout: to.Ptr("PT5M"), }, }, StorageProfile: &armcompute.VirtualMachineScaleSetStorageProfile{ ImageReference: &armcompute.ImageReference{ Offer: to.Ptr("WindowsServer"), Publisher: to.Ptr("MicrosoftWindowsServer"), SKU: to.Ptr("2016-Datacenter"), Version: to.Ptr("latest"), }, OSDisk: &armcompute.VirtualMachineScaleSetOSDisk{ Caching: to.Ptr(armcompute.CachingTypesReadWrite), CreateOption: to.Ptr(armcompute.DiskCreateOptionTypesFromImage), ManagedDisk: &armcompute.VirtualMachineScaleSetManagedDiskParameters{ StorageAccountType: to.Ptr(armcompute.StorageAccountTypesStandardLRS), }, }, }, }, }, SKU: &armcompute.SKU{ Name: to.Ptr("Standard_D1_v2"), Capacity: to.Ptr[int64](3), Tier: to.Ptr("Standard"), }, }, &armcompute.VirtualMachineScaleSetsClientBeginCreateOrUpdateOptions{IfMatch: nil, IfNoneMatch: nil, }) if err != nil { log.Fatalf("failed to finish the request: %v", err) } res, err := poller.PollUntilDone(ctx, nil) if err != nil { log.Fatalf("failed to pull the result: %v", err) } // You could use response here. We use blank identifier for just demo purposes. _ = res // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. // res.VirtualMachineScaleSet = armcompute.VirtualMachineScaleSet{ // Name: to.Ptr("{vmss-name}"), // Type: to.Ptr("Microsoft.Compute/virtualMachineScaleSets"), // ID: to.Ptr("/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/virtualMachineScaleSets/{vmss-name}"), // Location: to.Ptr("westus"), // Properties: &armcompute.VirtualMachineScaleSetProperties{ // Overprovision: to.Ptr(true), // ProvisioningState: to.Ptr("Succeeded"), // SinglePlacementGroup: to.Ptr(true), // UniqueID: to.Ptr("d053ec5a-8da6-495f-ab13-38216503c6d7"), // UpgradePolicy: &armcompute.UpgradePolicy{ // Mode: to.Ptr(armcompute.UpgradeModeManual), // }, // VirtualMachineProfile: &armcompute.VirtualMachineScaleSetVMProfile{ // NetworkProfile: &armcompute.VirtualMachineScaleSetNetworkProfile{ // NetworkInterfaceConfigurations: []*armcompute.VirtualMachineScaleSetNetworkConfiguration{ // { // Name: to.Ptr("{vmss-name}"), // Properties: &armcompute.VirtualMachineScaleSetNetworkConfigurationProperties{ // DNSSettings: &armcompute.VirtualMachineScaleSetNetworkConfigurationDNSSettings{ // DNSServers: []*string{ // }, // }, // EnableAcceleratedNetworking: to.Ptr(false), // EnableIPForwarding: to.Ptr(true), // IPConfigurations: []*armcompute.VirtualMachineScaleSetIPConfiguration{ // { // Name: to.Ptr("{vmss-name}"), // Properties: &armcompute.VirtualMachineScaleSetIPConfigurationProperties{ // PrivateIPAddressVersion: to.Ptr(armcompute.IPVersionIPv4), // Subnet: &armcompute.APIEntityReference{ // ID: to.Ptr("/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/virtualNetworks/nsgExistingVnet/subnets/nsgExistingSubnet"), // }, // }, // }}, // Primary: to.Ptr(true), // }, // }}, // }, // OSProfile: &armcompute.VirtualMachineScaleSetOSProfile{ // AdminUsername: to.Ptr("{your-username}"), // ComputerNamePrefix: to.Ptr("{vmss-name}"), // Secrets: []*armcompute.VaultSecretGroup{ // }, // WindowsConfiguration: &armcompute.WindowsConfiguration{ // EnableAutomaticUpdates: to.Ptr(true), // ProvisionVMAgent: to.Ptr(true), // }, // }, // ScheduledEventsProfile: &armcompute.ScheduledEventsProfile{ // TerminateNotificationProfile: &armcompute.TerminateNotificationProfile{ // Enable: to.Ptr(true), // NotBeforeTimeout: to.Ptr("PT5M"), // }, // }, // StorageProfile: &armcompute.VirtualMachineScaleSetStorageProfile{ // ImageReference: &armcompute.ImageReference{ // Offer: to.Ptr("WindowsServer"), // Publisher: to.Ptr("MicrosoftWindowsServer"), // SKU: to.Ptr("2016-Datacenter"), // Version: to.Ptr("latest"), // }, // OSDisk: &armcompute.VirtualMachineScaleSetOSDisk{ // Caching: to.Ptr(armcompute.CachingTypesReadWrite), // CreateOption: to.Ptr(armcompute.DiskCreateOptionTypesFromImage), // ManagedDisk: &armcompute.VirtualMachineScaleSetManagedDiskParameters{ // StorageAccountType: to.Ptr(armcompute.StorageAccountTypesStandardLRS), // }, // }, // }, // }, // }, // SKU: &armcompute.SKU{ // Name: to.Ptr("Standard_D1_v2"), // Capacity: to.Ptr[int64](3), // Tier: to.Ptr("Standard"), // }, // }
Output:
Example (CreateAScaleSetWithUefiSettingsOfSecureBootAndVTpm) ¶
Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/92de53a5f1e0e03c94b40475d2135d97148ed014/specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-03-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSet_Create_WithUefiSettings.json
cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() clientFactory, err := armcompute.NewClientFactory("<subscription-id>", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } poller, err := clientFactory.NewVirtualMachineScaleSetsClient().BeginCreateOrUpdate(ctx, "myResourceGroup", "{vmss-name}", armcompute.VirtualMachineScaleSet{ Location: to.Ptr("westus"), Properties: &armcompute.VirtualMachineScaleSetProperties{ Overprovision: to.Ptr(true), UpgradePolicy: &armcompute.UpgradePolicy{ Mode: to.Ptr(armcompute.UpgradeModeManual), }, VirtualMachineProfile: &armcompute.VirtualMachineScaleSetVMProfile{ NetworkProfile: &armcompute.VirtualMachineScaleSetNetworkProfile{ NetworkInterfaceConfigurations: []*armcompute.VirtualMachineScaleSetNetworkConfiguration{ { Name: to.Ptr("{vmss-name}"), Properties: &armcompute.VirtualMachineScaleSetNetworkConfigurationProperties{ EnableIPForwarding: to.Ptr(true), IPConfigurations: []*armcompute.VirtualMachineScaleSetIPConfiguration{ { Name: to.Ptr("{vmss-name}"), Properties: &armcompute.VirtualMachineScaleSetIPConfigurationProperties{ Subnet: &armcompute.APIEntityReference{ ID: to.Ptr("/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/virtualNetworks/{existing-virtual-network-name}/subnets/{existing-subnet-name}"), }, }, }}, Primary: to.Ptr(true), }, }}, }, OSProfile: &armcompute.VirtualMachineScaleSetOSProfile{ AdminPassword: to.Ptr("{your-password}"), AdminUsername: to.Ptr("{your-username}"), ComputerNamePrefix: to.Ptr("{vmss-name}"), }, SecurityProfile: &armcompute.SecurityProfile{ SecurityType: to.Ptr(armcompute.SecurityTypesTrustedLaunch), UefiSettings: &armcompute.UefiSettings{ SecureBootEnabled: to.Ptr(true), VTpmEnabled: to.Ptr(true), }, }, StorageProfile: &armcompute.VirtualMachineScaleSetStorageProfile{ ImageReference: &armcompute.ImageReference{ Offer: to.Ptr("windowsserver-gen2preview-preview"), Publisher: to.Ptr("MicrosoftWindowsServer"), SKU: to.Ptr("windows10-tvm"), Version: to.Ptr("18363.592.2001092016"), }, OSDisk: &armcompute.VirtualMachineScaleSetOSDisk{ Caching: to.Ptr(armcompute.CachingTypesReadOnly), CreateOption: to.Ptr(armcompute.DiskCreateOptionTypesFromImage), ManagedDisk: &armcompute.VirtualMachineScaleSetManagedDiskParameters{ StorageAccountType: to.Ptr(armcompute.StorageAccountTypesStandardSSDLRS), }, }, }, }, }, SKU: &armcompute.SKU{ Name: to.Ptr("Standard_D2s_v3"), Capacity: to.Ptr[int64](3), Tier: to.Ptr("Standard"), }, }, &armcompute.VirtualMachineScaleSetsClientBeginCreateOrUpdateOptions{IfMatch: nil, IfNoneMatch: nil, }) if err != nil { log.Fatalf("failed to finish the request: %v", err) } res, err := poller.PollUntilDone(ctx, nil) if err != nil { log.Fatalf("failed to pull the result: %v", err) } // You could use response here. We use blank identifier for just demo purposes. _ = res // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. // res.VirtualMachineScaleSet = armcompute.VirtualMachineScaleSet{ // Name: to.Ptr("{vmss-name}"), // Type: to.Ptr("Microsoft.Compute/virtualMachineScaleSets"), // ID: to.Ptr("/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/virtualMachineScaleSets/{vmss-name}"), // Location: to.Ptr("westus"), // Properties: &armcompute.VirtualMachineScaleSetProperties{ // Overprovision: to.Ptr(true), // ProvisioningState: to.Ptr("Succeeded"), // SinglePlacementGroup: to.Ptr(true), // UniqueID: to.Ptr("b9e23088-6ffc-46e0-9e02-b0a6eeef47db"), // UpgradePolicy: &armcompute.UpgradePolicy{ // Mode: to.Ptr(armcompute.UpgradeModeManual), // }, // VirtualMachineProfile: &armcompute.VirtualMachineScaleSetVMProfile{ // NetworkProfile: &armcompute.VirtualMachineScaleSetNetworkProfile{ // NetworkInterfaceConfigurations: []*armcompute.VirtualMachineScaleSetNetworkConfiguration{ // { // Name: to.Ptr("{vmss-name}"), // Properties: &armcompute.VirtualMachineScaleSetNetworkConfigurationProperties{ // DNSSettings: &armcompute.VirtualMachineScaleSetNetworkConfigurationDNSSettings{ // DNSServers: []*string{ // }, // }, // EnableAcceleratedNetworking: to.Ptr(false), // EnableIPForwarding: to.Ptr(true), // IPConfigurations: []*armcompute.VirtualMachineScaleSetIPConfiguration{ // { // Name: to.Ptr("{vmss-name}"), // Properties: &armcompute.VirtualMachineScaleSetIPConfigurationProperties{ // PrivateIPAddressVersion: to.Ptr(armcompute.IPVersionIPv4), // Subnet: &armcompute.APIEntityReference{ // ID: to.Ptr("/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/virtualNetworks/nsgExistingVnet/subnets/nsgExistingSubnet"), // }, // }, // }}, // Primary: to.Ptr(true), // }, // }}, // }, // OSProfile: &armcompute.VirtualMachineScaleSetOSProfile{ // AdminUsername: to.Ptr("{your-username}"), // ComputerNamePrefix: to.Ptr("{vmss-name}"), // Secrets: []*armcompute.VaultSecretGroup{ // }, // WindowsConfiguration: &armcompute.WindowsConfiguration{ // EnableAutomaticUpdates: to.Ptr(true), // ProvisionVMAgent: to.Ptr(true), // }, // }, // SecurityProfile: &armcompute.SecurityProfile{ // SecurityType: to.Ptr(armcompute.SecurityTypesTrustedLaunch), // UefiSettings: &armcompute.UefiSettings{ // SecureBootEnabled: to.Ptr(true), // VTpmEnabled: to.Ptr(true), // }, // }, // StorageProfile: &armcompute.VirtualMachineScaleSetStorageProfile{ // ImageReference: &armcompute.ImageReference{ // Offer: to.Ptr("windowsserver-gen2preview-preview"), // Publisher: to.Ptr("MicrosoftWindowsServer"), // SKU: to.Ptr("windows10-tvm"), // Version: to.Ptr("18363.592.2001092016"), // }, // OSDisk: &armcompute.VirtualMachineScaleSetOSDisk{ // Caching: to.Ptr(armcompute.CachingTypesReadOnly), // CreateOption: to.Ptr(armcompute.DiskCreateOptionTypesFromImage), // ManagedDisk: &armcompute.VirtualMachineScaleSetManagedDiskParameters{ // StorageAccountType: to.Ptr(armcompute.StorageAccountTypesStandardSSDLRS), // }, // }, // }, // }, // }, // SKU: &armcompute.SKU{ // Name: to.Ptr("Standard_D2s_v3"), // Capacity: to.Ptr[int64](3), // Tier: to.Ptr("Standard"), // }, // }
Output:
Example (CreateAScaleSetWithUserData) ¶
Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/92de53a5f1e0e03c94b40475d2135d97148ed014/specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-03-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSet_Create_WithUserData.json
cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() clientFactory, err := armcompute.NewClientFactory("<subscription-id>", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } poller, err := clientFactory.NewVirtualMachineScaleSetsClient().BeginCreateOrUpdate(ctx, "myResourceGroup", "{vmss-name}", armcompute.VirtualMachineScaleSet{ Location: to.Ptr("westus"), Properties: &armcompute.VirtualMachineScaleSetProperties{ Overprovision: to.Ptr(true), UpgradePolicy: &armcompute.UpgradePolicy{ Mode: to.Ptr(armcompute.UpgradeModeManual), }, VirtualMachineProfile: &armcompute.VirtualMachineScaleSetVMProfile{ NetworkProfile: &armcompute.VirtualMachineScaleSetNetworkProfile{ NetworkInterfaceConfigurations: []*armcompute.VirtualMachineScaleSetNetworkConfiguration{ { Name: to.Ptr("{vmss-name}"), Properties: &armcompute.VirtualMachineScaleSetNetworkConfigurationProperties{ EnableIPForwarding: to.Ptr(true), IPConfigurations: []*armcompute.VirtualMachineScaleSetIPConfiguration{ { Name: to.Ptr("{vmss-name}"), Properties: &armcompute.VirtualMachineScaleSetIPConfigurationProperties{ Subnet: &armcompute.APIEntityReference{ ID: to.Ptr("/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/virtualNetworks/{existing-virtual-network-name}/subnets/{existing-subnet-name}"), }, }, }}, Primary: to.Ptr(true), }, }}, }, OSProfile: &armcompute.VirtualMachineScaleSetOSProfile{ AdminPassword: to.Ptr("{your-password}"), AdminUsername: to.Ptr("{your-username}"), ComputerNamePrefix: to.Ptr("{vmss-name}"), }, StorageProfile: &armcompute.VirtualMachineScaleSetStorageProfile{ ImageReference: &armcompute.ImageReference{ Offer: to.Ptr("WindowsServer"), Publisher: to.Ptr("MicrosoftWindowsServer"), SKU: to.Ptr("2016-Datacenter"), Version: to.Ptr("latest"), }, OSDisk: &armcompute.VirtualMachineScaleSetOSDisk{ Caching: to.Ptr(armcompute.CachingTypesReadWrite), CreateOption: to.Ptr(armcompute.DiskCreateOptionTypesFromImage), ManagedDisk: &armcompute.VirtualMachineScaleSetManagedDiskParameters{ StorageAccountType: to.Ptr(armcompute.StorageAccountTypesStandardLRS), }, }, }, UserData: to.Ptr("RXhhbXBsZSBVc2VyRGF0YQ=="), }, }, SKU: &armcompute.SKU{ Name: to.Ptr("Standard_D1_v2"), Capacity: to.Ptr[int64](3), Tier: to.Ptr("Standard"), }, }, &armcompute.VirtualMachineScaleSetsClientBeginCreateOrUpdateOptions{IfMatch: nil, IfNoneMatch: nil, }) if err != nil { log.Fatalf("failed to finish the request: %v", err) } res, err := poller.PollUntilDone(ctx, nil) if err != nil { log.Fatalf("failed to pull the result: %v", err) } // You could use response here. We use blank identifier for just demo purposes. _ = res // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. // res.VirtualMachineScaleSet = armcompute.VirtualMachineScaleSet{ // Name: to.Ptr("{vmss-name}"), // Type: to.Ptr("Microsoft.Compute/virtualMachineScaleSets"), // ID: to.Ptr("/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/virtualMachineScaleSets/{vmss-name}"), // Location: to.Ptr("westus"), // Properties: &armcompute.VirtualMachineScaleSetProperties{ // Overprovision: to.Ptr(true), // ProvisioningState: to.Ptr("Succeeded"), // SinglePlacementGroup: to.Ptr(true), // UniqueID: to.Ptr("d053ec5a-8da6-495f-ab13-38216503c6d7"), // UpgradePolicy: &armcompute.UpgradePolicy{ // Mode: to.Ptr(armcompute.UpgradeModeManual), // }, // VirtualMachineProfile: &armcompute.VirtualMachineScaleSetVMProfile{ // DiagnosticsProfile: &armcompute.DiagnosticsProfile{ // BootDiagnostics: &armcompute.BootDiagnostics{ // Enabled: to.Ptr(true), // StorageURI: to.Ptr("http://nsgdiagnostic.blob.core.windows.net"), // }, // }, // NetworkProfile: &armcompute.VirtualMachineScaleSetNetworkProfile{ // NetworkInterfaceConfigurations: []*armcompute.VirtualMachineScaleSetNetworkConfiguration{ // { // Name: to.Ptr("{vmss-name}"), // Properties: &armcompute.VirtualMachineScaleSetNetworkConfigurationProperties{ // DNSSettings: &armcompute.VirtualMachineScaleSetNetworkConfigurationDNSSettings{ // DNSServers: []*string{ // }, // }, // EnableAcceleratedNetworking: to.Ptr(false), // EnableIPForwarding: to.Ptr(true), // IPConfigurations: []*armcompute.VirtualMachineScaleSetIPConfiguration{ // { // Name: to.Ptr("{vmss-name}"), // Properties: &armcompute.VirtualMachineScaleSetIPConfigurationProperties{ // PrivateIPAddressVersion: to.Ptr(armcompute.IPVersionIPv4), // Subnet: &armcompute.APIEntityReference{ // ID: to.Ptr("/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/virtualNetworks/nsgExistingVnet/subnets/nsgExistingSubnet"), // }, // }, // }}, // Primary: to.Ptr(true), // }, // }}, // }, // OSProfile: &armcompute.VirtualMachineScaleSetOSProfile{ // AdminUsername: to.Ptr("{your-username}"), // ComputerNamePrefix: to.Ptr("{vmss-name}"), // Secrets: []*armcompute.VaultSecretGroup{ // }, // WindowsConfiguration: &armcompute.WindowsConfiguration{ // EnableAutomaticUpdates: to.Ptr(true), // ProvisionVMAgent: to.Ptr(true), // }, // }, // StorageProfile: &armcompute.VirtualMachineScaleSetStorageProfile{ // ImageReference: &armcompute.ImageReference{ // Offer: to.Ptr("WindowsServer"), // Publisher: to.Ptr("MicrosoftWindowsServer"), // SKU: to.Ptr("2016-Datacenter"), // Version: to.Ptr("latest"), // }, // OSDisk: &armcompute.VirtualMachineScaleSetOSDisk{ // Caching: to.Ptr(armcompute.CachingTypesReadWrite), // CreateOption: to.Ptr(armcompute.DiskCreateOptionTypesFromImage), // ManagedDisk: &armcompute.VirtualMachineScaleSetManagedDiskParameters{ // StorageAccountType: to.Ptr(armcompute.StorageAccountTypesStandardLRS), // }, // }, // }, // }, // }, // SKU: &armcompute.SKU{ // Name: to.Ptr("Standard_D1_v2"), // Capacity: to.Ptr[int64](3), // Tier: to.Ptr("Standard"), // }, // }
Output:
Example (CreateAScaleSetWithVirtualMachinesInDifferentZones) ¶
Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/92de53a5f1e0e03c94b40475d2135d97148ed014/specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-03-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSet_Create_WithVMsInDifferentZones.json
cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() clientFactory, err := armcompute.NewClientFactory("<subscription-id>", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } poller, err := clientFactory.NewVirtualMachineScaleSetsClient().BeginCreateOrUpdate(ctx, "myResourceGroup", "{vmss-name}", armcompute.VirtualMachineScaleSet{ Location: to.Ptr("centralus"), Properties: &armcompute.VirtualMachineScaleSetProperties{ Overprovision: to.Ptr(true), UpgradePolicy: &armcompute.UpgradePolicy{ Mode: to.Ptr(armcompute.UpgradeModeAutomatic), }, VirtualMachineProfile: &armcompute.VirtualMachineScaleSetVMProfile{ NetworkProfile: &armcompute.VirtualMachineScaleSetNetworkProfile{ NetworkInterfaceConfigurations: []*armcompute.VirtualMachineScaleSetNetworkConfiguration{ { Name: to.Ptr("{vmss-name}"), Properties: &armcompute.VirtualMachineScaleSetNetworkConfigurationProperties{ EnableIPForwarding: to.Ptr(true), IPConfigurations: []*armcompute.VirtualMachineScaleSetIPConfiguration{ { Name: to.Ptr("{vmss-name}"), Properties: &armcompute.VirtualMachineScaleSetIPConfigurationProperties{ Subnet: &armcompute.APIEntityReference{ ID: to.Ptr("/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/virtualNetworks/{existing-virtual-network-name}/subnets/{existing-subnet-name}"), }, }, }}, Primary: to.Ptr(true), }, }}, }, OSProfile: &armcompute.VirtualMachineScaleSetOSProfile{ AdminPassword: to.Ptr("{your-password}"), AdminUsername: to.Ptr("{your-username}"), ComputerNamePrefix: to.Ptr("{vmss-name}"), }, StorageProfile: &armcompute.VirtualMachineScaleSetStorageProfile{ DataDisks: []*armcompute.VirtualMachineScaleSetDataDisk{ { CreateOption: to.Ptr(armcompute.DiskCreateOptionTypesEmpty), DiskSizeGB: to.Ptr[int32](1023), Lun: to.Ptr[int32](0), }, { CreateOption: to.Ptr(armcompute.DiskCreateOptionTypesEmpty), DiskSizeGB: to.Ptr[int32](1023), Lun: to.Ptr[int32](1), }}, ImageReference: &armcompute.ImageReference{ Offer: to.Ptr("WindowsServer"), Publisher: to.Ptr("MicrosoftWindowsServer"), SKU: to.Ptr("2016-Datacenter"), Version: to.Ptr("latest"), }, OSDisk: &armcompute.VirtualMachineScaleSetOSDisk{ Caching: to.Ptr(armcompute.CachingTypesReadWrite), CreateOption: to.Ptr(armcompute.DiskCreateOptionTypesFromImage), DiskSizeGB: to.Ptr[int32](512), ManagedDisk: &armcompute.VirtualMachineScaleSetManagedDiskParameters{ StorageAccountType: to.Ptr(armcompute.StorageAccountTypesStandardLRS), }, }, }, }, }, SKU: &armcompute.SKU{ Name: to.Ptr("Standard_A1_v2"), Capacity: to.Ptr[int64](2), Tier: to.Ptr("Standard"), }, Zones: []*string{ to.Ptr("1"), to.Ptr("3")}, }, &armcompute.VirtualMachineScaleSetsClientBeginCreateOrUpdateOptions{IfMatch: nil, IfNoneMatch: nil, }) if err != nil { log.Fatalf("failed to finish the request: %v", err) } res, err := poller.PollUntilDone(ctx, nil) if err != nil { log.Fatalf("failed to pull the result: %v", err) } // You could use response here. We use blank identifier for just demo purposes. _ = res // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. // res.VirtualMachineScaleSet = armcompute.VirtualMachineScaleSet{ // Name: to.Ptr("{vmss-name}"), // Type: to.Ptr("Microsoft.Compute/virtualMachineScaleSets"), // ID: to.Ptr("/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/virtualMachineScaleSets/{vmss-name}"), // Location: to.Ptr("centralus"), // Properties: &armcompute.VirtualMachineScaleSetProperties{ // Overprovision: to.Ptr(true), // ProvisioningState: to.Ptr("Succeeded"), // SinglePlacementGroup: to.Ptr(false), // UniqueID: to.Ptr("8042c376-4690-4c47-9fa2-fbdad70e32fa"), // UpgradePolicy: &armcompute.UpgradePolicy{ // Mode: to.Ptr(armcompute.UpgradeModeAutomatic), // }, // VirtualMachineProfile: &armcompute.VirtualMachineScaleSetVMProfile{ // NetworkProfile: &armcompute.VirtualMachineScaleSetNetworkProfile{ // NetworkInterfaceConfigurations: []*armcompute.VirtualMachineScaleSetNetworkConfiguration{ // { // Name: to.Ptr("{vmss-name}"), // Properties: &armcompute.VirtualMachineScaleSetNetworkConfigurationProperties{ // DNSSettings: &armcompute.VirtualMachineScaleSetNetworkConfigurationDNSSettings{ // DNSServers: []*string{ // }, // }, // EnableAcceleratedNetworking: to.Ptr(false), // EnableIPForwarding: to.Ptr(true), // IPConfigurations: []*armcompute.VirtualMachineScaleSetIPConfiguration{ // { // Name: to.Ptr("{vmss-name}"), // Properties: &armcompute.VirtualMachineScaleSetIPConfigurationProperties{ // PrivateIPAddressVersion: to.Ptr(armcompute.IPVersionIPv4), // Subnet: &armcompute.APIEntityReference{ // ID: to.Ptr("/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/virtualNetworks/nsgExistingVnet/subnets/nsgExistingSubnet"), // }, // }, // }}, // Primary: to.Ptr(true), // }, // }}, // }, // OSProfile: &armcompute.VirtualMachineScaleSetOSProfile{ // AdminUsername: to.Ptr("{your-username}"), // ComputerNamePrefix: to.Ptr("{vmss-name}"), // Secrets: []*armcompute.VaultSecretGroup{ // }, // WindowsConfiguration: &armcompute.WindowsConfiguration{ // EnableAutomaticUpdates: to.Ptr(true), // ProvisionVMAgent: to.Ptr(true), // }, // }, // StorageProfile: &armcompute.VirtualMachineScaleSetStorageProfile{ // DataDisks: []*armcompute.VirtualMachineScaleSetDataDisk{ // { // Caching: to.Ptr(armcompute.CachingTypesNone), // CreateOption: to.Ptr(armcompute.DiskCreateOptionTypesEmpty), // DiskSizeGB: to.Ptr[int32](1023), // Lun: to.Ptr[int32](0), // ManagedDisk: &armcompute.VirtualMachineScaleSetManagedDiskParameters{ // StorageAccountType: to.Ptr(armcompute.StorageAccountTypesStandardLRS), // }, // }, // { // Caching: to.Ptr(armcompute.CachingTypesNone), // CreateOption: to.Ptr(armcompute.DiskCreateOptionTypesEmpty), // DiskSizeGB: to.Ptr[int32](1023), // Lun: to.Ptr[int32](1), // ManagedDisk: &armcompute.VirtualMachineScaleSetManagedDiskParameters{ // StorageAccountType: to.Ptr(armcompute.StorageAccountTypesStandardLRS), // }, // }}, // ImageReference: &armcompute.ImageReference{ // Offer: to.Ptr("WindowsServer"), // Publisher: to.Ptr("MicrosoftWindowsServer"), // SKU: to.Ptr("2016-Datacenter"), // Version: to.Ptr("latest"), // }, // OSDisk: &armcompute.VirtualMachineScaleSetOSDisk{ // Caching: to.Ptr(armcompute.CachingTypesReadWrite), // CreateOption: to.Ptr(armcompute.DiskCreateOptionTypesFromImage), // DiskSizeGB: to.Ptr[int32](512), // ManagedDisk: &armcompute.VirtualMachineScaleSetManagedDiskParameters{ // StorageAccountType: to.Ptr(armcompute.StorageAccountTypesStandardLRS), // }, // }, // }, // }, // ZoneBalance: to.Ptr(false), // }, // SKU: &armcompute.SKU{ // Name: to.Ptr("Standard_A1_v2"), // Capacity: to.Ptr[int64](2), // Tier: to.Ptr("Standard"), // }, // Zones: []*string{ // to.Ptr("1"), // to.Ptr("3")}, // }
Output:
Example (CreateAScaleSetWithVmSizeProperties) ¶
Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/92de53a5f1e0e03c94b40475d2135d97148ed014/specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-03-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSet_Create_WithVMSizeProperties.json
cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() clientFactory, err := armcompute.NewClientFactory("<subscription-id>", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } poller, err := clientFactory.NewVirtualMachineScaleSetsClient().BeginCreateOrUpdate(ctx, "myResourceGroup", "{vmss-name}", armcompute.VirtualMachineScaleSet{ Location: to.Ptr("westus"), Properties: &armcompute.VirtualMachineScaleSetProperties{ Overprovision: to.Ptr(true), UpgradePolicy: &armcompute.UpgradePolicy{ Mode: to.Ptr(armcompute.UpgradeModeManual), }, VirtualMachineProfile: &armcompute.VirtualMachineScaleSetVMProfile{ HardwareProfile: &armcompute.VirtualMachineScaleSetHardwareProfile{ VMSizeProperties: &armcompute.VMSizeProperties{ VCPUsAvailable: to.Ptr[int32](1), VCPUsPerCore: to.Ptr[int32](1), }, }, NetworkProfile: &armcompute.VirtualMachineScaleSetNetworkProfile{ NetworkInterfaceConfigurations: []*armcompute.VirtualMachineScaleSetNetworkConfiguration{ { Name: to.Ptr("{vmss-name}"), Properties: &armcompute.VirtualMachineScaleSetNetworkConfigurationProperties{ EnableIPForwarding: to.Ptr(true), IPConfigurations: []*armcompute.VirtualMachineScaleSetIPConfiguration{ { Name: to.Ptr("{vmss-name}"), Properties: &armcompute.VirtualMachineScaleSetIPConfigurationProperties{ Subnet: &armcompute.APIEntityReference{ ID: to.Ptr("/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/virtualNetworks/{existing-virtual-network-name}/subnets/{existing-subnet-name}"), }, }, }}, Primary: to.Ptr(true), }, }}, }, OSProfile: &armcompute.VirtualMachineScaleSetOSProfile{ AdminPassword: to.Ptr("{your-password}"), AdminUsername: to.Ptr("{your-username}"), ComputerNamePrefix: to.Ptr("{vmss-name}"), }, StorageProfile: &armcompute.VirtualMachineScaleSetStorageProfile{ ImageReference: &armcompute.ImageReference{ Offer: to.Ptr("WindowsServer"), Publisher: to.Ptr("MicrosoftWindowsServer"), SKU: to.Ptr("2016-Datacenter"), Version: to.Ptr("latest"), }, OSDisk: &armcompute.VirtualMachineScaleSetOSDisk{ Caching: to.Ptr(armcompute.CachingTypesReadWrite), CreateOption: to.Ptr(armcompute.DiskCreateOptionTypesFromImage), ManagedDisk: &armcompute.VirtualMachineScaleSetManagedDiskParameters{ StorageAccountType: to.Ptr(armcompute.StorageAccountTypesStandardLRS), }, }, }, UserData: to.Ptr("RXhhbXBsZSBVc2VyRGF0YQ=="), }, }, SKU: &armcompute.SKU{ Name: to.Ptr("Standard_D1_v2"), Capacity: to.Ptr[int64](3), Tier: to.Ptr("Standard"), }, }, &armcompute.VirtualMachineScaleSetsClientBeginCreateOrUpdateOptions{IfMatch: nil, IfNoneMatch: nil, }) if err != nil { log.Fatalf("failed to finish the request: %v", err) } res, err := poller.PollUntilDone(ctx, nil) if err != nil { log.Fatalf("failed to pull the result: %v", err) } // You could use response here. We use blank identifier for just demo purposes. _ = res // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. // res.VirtualMachineScaleSet = armcompute.VirtualMachineScaleSet{ // Name: to.Ptr("{vmss-name}"), // Type: to.Ptr("Microsoft.Compute/virtualMachineScaleSets"), // ID: to.Ptr("/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/virtualMachineScaleSets/{vmss-name}"), // Location: to.Ptr("westus"), // Properties: &armcompute.VirtualMachineScaleSetProperties{ // Overprovision: to.Ptr(true), // ProvisioningState: to.Ptr("Succeeded"), // SinglePlacementGroup: to.Ptr(true), // UniqueID: to.Ptr("d053ec5a-8da6-495f-ab13-38216503c6d7"), // UpgradePolicy: &armcompute.UpgradePolicy{ // Mode: to.Ptr(armcompute.UpgradeModeManual), // }, // VirtualMachineProfile: &armcompute.VirtualMachineScaleSetVMProfile{ // DiagnosticsProfile: &armcompute.DiagnosticsProfile{ // BootDiagnostics: &armcompute.BootDiagnostics{ // Enabled: to.Ptr(true), // StorageURI: to.Ptr("http://nsgdiagnostic.blob.core.windows.net"), // }, // }, // HardwareProfile: &armcompute.VirtualMachineScaleSetHardwareProfile{ // VMSizeProperties: &armcompute.VMSizeProperties{ // VCPUsAvailable: to.Ptr[int32](1), // VCPUsPerCore: to.Ptr[int32](1), // }, // }, // NetworkProfile: &armcompute.VirtualMachineScaleSetNetworkProfile{ // NetworkInterfaceConfigurations: []*armcompute.VirtualMachineScaleSetNetworkConfiguration{ // { // Name: to.Ptr("{vmss-name}"), // Properties: &armcompute.VirtualMachineScaleSetNetworkConfigurationProperties{ // DNSSettings: &armcompute.VirtualMachineScaleSetNetworkConfigurationDNSSettings{ // DNSServers: []*string{ // }, // }, // EnableAcceleratedNetworking: to.Ptr(false), // EnableIPForwarding: to.Ptr(true), // IPConfigurations: []*armcompute.VirtualMachineScaleSetIPConfiguration{ // { // Name: to.Ptr("{vmss-name}"), // Properties: &armcompute.VirtualMachineScaleSetIPConfigurationProperties{ // PrivateIPAddressVersion: to.Ptr(armcompute.IPVersionIPv4), // Subnet: &armcompute.APIEntityReference{ // ID: to.Ptr("/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/virtualNetworks/nsgExistingVnet/subnets/nsgExistingSubnet"), // }, // }, // }}, // Primary: to.Ptr(true), // }, // }}, // }, // OSProfile: &armcompute.VirtualMachineScaleSetOSProfile{ // AdminUsername: to.Ptr("{your-username}"), // ComputerNamePrefix: to.Ptr("{vmss-name}"), // Secrets: []*armcompute.VaultSecretGroup{ // }, // WindowsConfiguration: &armcompute.WindowsConfiguration{ // EnableAutomaticUpdates: to.Ptr(true), // ProvisionVMAgent: to.Ptr(true), // }, // }, // StorageProfile: &armcompute.VirtualMachineScaleSetStorageProfile{ // ImageReference: &armcompute.ImageReference{ // Offer: to.Ptr("WindowsServer"), // Publisher: to.Ptr("MicrosoftWindowsServer"), // SKU: to.Ptr("2016-Datacenter"), // Version: to.Ptr("latest"), // }, // OSDisk: &armcompute.VirtualMachineScaleSetOSDisk{ // Caching: to.Ptr(armcompute.CachingTypesReadWrite), // CreateOption: to.Ptr(armcompute.DiskCreateOptionTypesFromImage), // ManagedDisk: &armcompute.VirtualMachineScaleSetManagedDiskParameters{ // StorageAccountType: to.Ptr(armcompute.StorageAccountTypesStandardLRS), // }, // }, // }, // }, // }, // SKU: &armcompute.SKU{ // Name: to.Ptr("Standard_D1_v2"), // Capacity: to.Ptr[int64](3), // Tier: to.Ptr("Standard"), // }, // }
Output:
Example (CreateAVmssWithAnExtensionThatHasSuppressFailuresEnabled) ¶
Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/92de53a5f1e0e03c94b40475d2135d97148ed014/specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-03-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSet_Create_WithExtensionsSuppressFailuresEnabled.json
cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() clientFactory, err := armcompute.NewClientFactory("<subscription-id>", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } poller, err := clientFactory.NewVirtualMachineScaleSetsClient().BeginCreateOrUpdate(ctx, "myResourceGroup", "{vmss-name}", armcompute.VirtualMachineScaleSet{ Location: to.Ptr("westus"), Properties: &armcompute.VirtualMachineScaleSetProperties{ Overprovision: to.Ptr(true), UpgradePolicy: &armcompute.UpgradePolicy{ Mode: to.Ptr(armcompute.UpgradeModeManual), }, VirtualMachineProfile: &armcompute.VirtualMachineScaleSetVMProfile{ DiagnosticsProfile: &armcompute.DiagnosticsProfile{ BootDiagnostics: &armcompute.BootDiagnostics{ Enabled: to.Ptr(true), StorageURI: to.Ptr("http://{existing-storage-account-name}.blob.core.windows.net"), }, }, ExtensionProfile: &armcompute.VirtualMachineScaleSetExtensionProfile{ Extensions: []*armcompute.VirtualMachineScaleSetExtension{ { Name: to.Ptr("{extension-name}"), Properties: &armcompute.VirtualMachineScaleSetExtensionProperties{ Type: to.Ptr("{extension-Type}"), AutoUpgradeMinorVersion: to.Ptr(false), Publisher: to.Ptr("{extension-Publisher}"), Settings: map[string]any{}, SuppressFailures: to.Ptr(true), TypeHandlerVersion: to.Ptr("{handler-version}"), }, }}, }, NetworkProfile: &armcompute.VirtualMachineScaleSetNetworkProfile{ NetworkInterfaceConfigurations: []*armcompute.VirtualMachineScaleSetNetworkConfiguration{ { Name: to.Ptr("{vmss-name}"), Properties: &armcompute.VirtualMachineScaleSetNetworkConfigurationProperties{ EnableIPForwarding: to.Ptr(true), IPConfigurations: []*armcompute.VirtualMachineScaleSetIPConfiguration{ { Name: to.Ptr("{vmss-name}"), Properties: &armcompute.VirtualMachineScaleSetIPConfigurationProperties{ Subnet: &armcompute.APIEntityReference{ ID: to.Ptr("/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/virtualNetworks/{existing-virtual-network-name}/subnets/{existing-subnet-name}"), }, }, }}, Primary: to.Ptr(true), }, }}, }, OSProfile: &armcompute.VirtualMachineScaleSetOSProfile{ AdminPassword: to.Ptr("{your-password}"), AdminUsername: to.Ptr("{your-username}"), ComputerNamePrefix: to.Ptr("{vmss-name}"), }, StorageProfile: &armcompute.VirtualMachineScaleSetStorageProfile{ ImageReference: &armcompute.ImageReference{ Offer: to.Ptr("WindowsServer"), Publisher: to.Ptr("MicrosoftWindowsServer"), SKU: to.Ptr("2016-Datacenter"), Version: to.Ptr("latest"), }, OSDisk: &armcompute.VirtualMachineScaleSetOSDisk{ Caching: to.Ptr(armcompute.CachingTypesReadWrite), CreateOption: to.Ptr(armcompute.DiskCreateOptionTypesFromImage), ManagedDisk: &armcompute.VirtualMachineScaleSetManagedDiskParameters{ StorageAccountType: to.Ptr(armcompute.StorageAccountTypesStandardLRS), }, }, }, }, }, SKU: &armcompute.SKU{ Name: to.Ptr("Standard_D1_v2"), Capacity: to.Ptr[int64](3), Tier: to.Ptr("Standard"), }, }, &armcompute.VirtualMachineScaleSetsClientBeginCreateOrUpdateOptions{IfMatch: nil, IfNoneMatch: nil, }) if err != nil { log.Fatalf("failed to finish the request: %v", err) } res, err := poller.PollUntilDone(ctx, nil) if err != nil { log.Fatalf("failed to pull the result: %v", err) } // You could use response here. We use blank identifier for just demo purposes. _ = res // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. // res.VirtualMachineScaleSet = armcompute.VirtualMachineScaleSet{ // Name: to.Ptr("{vmss-name}"), // Type: to.Ptr("Microsoft.Compute/virtualMachineScaleSets"), // ID: to.Ptr("/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/virtualMachineScaleSets/{vmss-name}"), // Location: to.Ptr("westus"), // Properties: &armcompute.VirtualMachineScaleSetProperties{ // Overprovision: to.Ptr(true), // ProvisioningState: to.Ptr("Succeeded"), // SinglePlacementGroup: to.Ptr(true), // UniqueID: to.Ptr("d053ec5a-8da6-495f-ab13-38216503c6d7"), // UpgradePolicy: &armcompute.UpgradePolicy{ // Mode: to.Ptr(armcompute.UpgradeModeManual), // }, // VirtualMachineProfile: &armcompute.VirtualMachineScaleSetVMProfile{ // DiagnosticsProfile: &armcompute.DiagnosticsProfile{ // BootDiagnostics: &armcompute.BootDiagnostics{ // Enabled: to.Ptr(true), // StorageURI: to.Ptr("http://nsgdiagnostic.blob.core.windows.net"), // }, // }, // ExtensionProfile: &armcompute.VirtualMachineScaleSetExtensionProfile{ // Extensions: []*armcompute.VirtualMachineScaleSetExtension{ // { // Name: to.Ptr("{extension-name}"), // Properties: &armcompute.VirtualMachineScaleSetExtensionProperties{ // Type: to.Ptr("{extension-Type}"), // AutoUpgradeMinorVersion: to.Ptr(false), // Publisher: to.Ptr("{extension-Publisher}"), // Settings: map[string]any{ // }, // SuppressFailures: to.Ptr(true), // TypeHandlerVersion: to.Ptr("{handler-version}"), // }, // }}, // }, // NetworkProfile: &armcompute.VirtualMachineScaleSetNetworkProfile{ // NetworkInterfaceConfigurations: []*armcompute.VirtualMachineScaleSetNetworkConfiguration{ // { // Name: to.Ptr("{vmss-name}"), // Properties: &armcompute.VirtualMachineScaleSetNetworkConfigurationProperties{ // DNSSettings: &armcompute.VirtualMachineScaleSetNetworkConfigurationDNSSettings{ // DNSServers: []*string{ // }, // }, // EnableAcceleratedNetworking: to.Ptr(false), // EnableIPForwarding: to.Ptr(true), // IPConfigurations: []*armcompute.VirtualMachineScaleSetIPConfiguration{ // { // Name: to.Ptr("{vmss-name}"), // Properties: &armcompute.VirtualMachineScaleSetIPConfigurationProperties{ // PrivateIPAddressVersion: to.Ptr(armcompute.IPVersionIPv4), // Subnet: &armcompute.APIEntityReference{ // ID: to.Ptr("/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/virtualNetworks/nsgExistingVnet/subnets/nsgExistingSubnet"), // }, // }, // }}, // Primary: to.Ptr(true), // }, // }}, // }, // OSProfile: &armcompute.VirtualMachineScaleSetOSProfile{ // AdminUsername: to.Ptr("{your-username}"), // ComputerNamePrefix: to.Ptr("{vmss-name}"), // Secrets: []*armcompute.VaultSecretGroup{ // }, // WindowsConfiguration: &armcompute.WindowsConfiguration{ // EnableAutomaticUpdates: to.Ptr(true), // ProvisionVMAgent: to.Ptr(true), // }, // }, // StorageProfile: &armcompute.VirtualMachineScaleSetStorageProfile{ // ImageReference: &armcompute.ImageReference{ // Offer: to.Ptr("WindowsServer"), // Publisher: to.Ptr("MicrosoftWindowsServer"), // SKU: to.Ptr("2016-Datacenter"), // Version: to.Ptr("latest"), // }, // OSDisk: &armcompute.VirtualMachineScaleSetOSDisk{ // Caching: to.Ptr(armcompute.CachingTypesReadWrite), // CreateOption: to.Ptr(armcompute.DiskCreateOptionTypesFromImage), // ManagedDisk: &armcompute.VirtualMachineScaleSetManagedDiskParameters{ // StorageAccountType: to.Ptr(armcompute.StorageAccountTypesStandardLRS), // }, // }, // }, // }, // }, // SKU: &armcompute.SKU{ // Name: to.Ptr("Standard_D1_v2"), // Capacity: to.Ptr[int64](3), // Tier: to.Ptr("Standard"), // }, // }
Output:
Example (CreateAVmssWithAnExtensionWithProtectedSettingsFromKeyVault) ¶
Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/92de53a5f1e0e03c94b40475d2135d97148ed014/specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-03-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSet_Create_WithProtectedSettingsFromKeyVault.json
cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() clientFactory, err := armcompute.NewClientFactory("<subscription-id>", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } poller, err := clientFactory.NewVirtualMachineScaleSetsClient().BeginCreateOrUpdate(ctx, "myResourceGroup", "{vmss-name}", armcompute.VirtualMachineScaleSet{ Location: to.Ptr("westus"), Properties: &armcompute.VirtualMachineScaleSetProperties{ Overprovision: to.Ptr(true), UpgradePolicy: &armcompute.UpgradePolicy{ Mode: to.Ptr(armcompute.UpgradeModeManual), }, VirtualMachineProfile: &armcompute.VirtualMachineScaleSetVMProfile{ DiagnosticsProfile: &armcompute.DiagnosticsProfile{ BootDiagnostics: &armcompute.BootDiagnostics{ Enabled: to.Ptr(true), StorageURI: to.Ptr("http://{existing-storage-account-name}.blob.core.windows.net"), }, }, ExtensionProfile: &armcompute.VirtualMachineScaleSetExtensionProfile{ Extensions: []*armcompute.VirtualMachineScaleSetExtension{ { Name: to.Ptr("{extension-name}"), Properties: &armcompute.VirtualMachineScaleSetExtensionProperties{ Type: to.Ptr("{extension-Type}"), AutoUpgradeMinorVersion: to.Ptr(false), ProtectedSettingsFromKeyVault: &armcompute.KeyVaultSecretReference{ SecretURL: to.Ptr("https://kvName.vault.azure.net/secrets/secretName/79b88b3a6f5440ffb2e73e44a0db712e"), SourceVault: &armcompute.SubResource{ ID: to.Ptr("/subscriptions/a53f7094-a16c-47af-abe4-b05c05d0d79a/resourceGroups/myResourceGroup/providers/Microsoft.KeyVault/vaults/kvName"), }, }, Publisher: to.Ptr("{extension-Publisher}"), Settings: map[string]any{}, TypeHandlerVersion: to.Ptr("{handler-version}"), }, }}, }, NetworkProfile: &armcompute.VirtualMachineScaleSetNetworkProfile{ NetworkInterfaceConfigurations: []*armcompute.VirtualMachineScaleSetNetworkConfiguration{ { Name: to.Ptr("{vmss-name}"), Properties: &armcompute.VirtualMachineScaleSetNetworkConfigurationProperties{ EnableIPForwarding: to.Ptr(true), IPConfigurations: []*armcompute.VirtualMachineScaleSetIPConfiguration{ { Name: to.Ptr("{vmss-name}"), Properties: &armcompute.VirtualMachineScaleSetIPConfigurationProperties{ Subnet: &armcompute.APIEntityReference{ ID: to.Ptr("/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/virtualNetworks/{existing-virtual-network-name}/subnets/{existing-subnet-name}"), }, }, }}, Primary: to.Ptr(true), }, }}, }, OSProfile: &armcompute.VirtualMachineScaleSetOSProfile{ AdminPassword: to.Ptr("{your-password}"), AdminUsername: to.Ptr("{your-username}"), ComputerNamePrefix: to.Ptr("{vmss-name}"), }, StorageProfile: &armcompute.VirtualMachineScaleSetStorageProfile{ ImageReference: &armcompute.ImageReference{ Offer: to.Ptr("WindowsServer"), Publisher: to.Ptr("MicrosoftWindowsServer"), SKU: to.Ptr("2016-Datacenter"), Version: to.Ptr("latest"), }, OSDisk: &armcompute.VirtualMachineScaleSetOSDisk{ Caching: to.Ptr(armcompute.CachingTypesReadWrite), CreateOption: to.Ptr(armcompute.DiskCreateOptionTypesFromImage), ManagedDisk: &armcompute.VirtualMachineScaleSetManagedDiskParameters{ StorageAccountType: to.Ptr(armcompute.StorageAccountTypesStandardLRS), }, }, }, }, }, SKU: &armcompute.SKU{ Name: to.Ptr("Standard_D1_v2"), Capacity: to.Ptr[int64](3), Tier: to.Ptr("Standard"), }, }, &armcompute.VirtualMachineScaleSetsClientBeginCreateOrUpdateOptions{IfMatch: nil, IfNoneMatch: nil, }) if err != nil { log.Fatalf("failed to finish the request: %v", err) } res, err := poller.PollUntilDone(ctx, nil) if err != nil { log.Fatalf("failed to pull the result: %v", err) } // You could use response here. We use blank identifier for just demo purposes. _ = res // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. // res.VirtualMachineScaleSet = armcompute.VirtualMachineScaleSet{ // Name: to.Ptr("{vmss-name}"), // Type: to.Ptr("Microsoft.Compute/virtualMachineScaleSets"), // ID: to.Ptr("/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/virtualMachineScaleSets/{vmss-name}"), // Location: to.Ptr("westus"), // Properties: &armcompute.VirtualMachineScaleSetProperties{ // Overprovision: to.Ptr(true), // ProvisioningState: to.Ptr("Succeeded"), // SinglePlacementGroup: to.Ptr(true), // UniqueID: to.Ptr("d053ec5a-8da6-495f-ab13-38216503c6d7"), // UpgradePolicy: &armcompute.UpgradePolicy{ // Mode: to.Ptr(armcompute.UpgradeModeManual), // }, // VirtualMachineProfile: &armcompute.VirtualMachineScaleSetVMProfile{ // DiagnosticsProfile: &armcompute.DiagnosticsProfile{ // BootDiagnostics: &armcompute.BootDiagnostics{ // Enabled: to.Ptr(true), // StorageURI: to.Ptr("http://nsgdiagnostic.blob.core.windows.net"), // }, // }, // ExtensionProfile: &armcompute.VirtualMachineScaleSetExtensionProfile{ // Extensions: []*armcompute.VirtualMachineScaleSetExtension{ // { // Name: to.Ptr("{extension-name}"), // Properties: &armcompute.VirtualMachineScaleSetExtensionProperties{ // Type: to.Ptr("{extension-Type}"), // AutoUpgradeMinorVersion: to.Ptr(false), // ProtectedSettingsFromKeyVault: &armcompute.KeyVaultSecretReference{ // SecretURL: to.Ptr("https://kvName.vault.azure.net/secrets/secretName/79b88b3a6f5440ffb2e73e44a0db712e"), // SourceVault: &armcompute.SubResource{ // ID: to.Ptr("/subscriptions/a53f7094-a16c-47af-abe4-b05c05d0d79a/resourceGroups/myResourceGroup/providers/Microsoft.KeyVault/vaults/kvName"), // }, // }, // Publisher: to.Ptr("{extension-Publisher}"), // Settings: map[string]any{ // }, // TypeHandlerVersion: to.Ptr("{handler-version}"), // }, // }}, // }, // NetworkProfile: &armcompute.VirtualMachineScaleSetNetworkProfile{ // NetworkInterfaceConfigurations: []*armcompute.VirtualMachineScaleSetNetworkConfiguration{ // { // Name: to.Ptr("{vmss-name}"), // Properties: &armcompute.VirtualMachineScaleSetNetworkConfigurationProperties{ // DNSSettings: &armcompute.VirtualMachineScaleSetNetworkConfigurationDNSSettings{ // DNSServers: []*string{ // }, // }, // EnableAcceleratedNetworking: to.Ptr(false), // EnableIPForwarding: to.Ptr(true), // IPConfigurations: []*armcompute.VirtualMachineScaleSetIPConfiguration{ // { // Name: to.Ptr("{vmss-name}"), // Properties: &armcompute.VirtualMachineScaleSetIPConfigurationProperties{ // PrivateIPAddressVersion: to.Ptr(armcompute.IPVersionIPv4), // Subnet: &armcompute.APIEntityReference{ // ID: to.Ptr("/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/virtualNetworks/nsgExistingVnet/subnets/nsgExistingSubnet"), // }, // }, // }}, // Primary: to.Ptr(true), // }, // }}, // }, // OSProfile: &armcompute.VirtualMachineScaleSetOSProfile{ // AdminUsername: to.Ptr("{your-username}"), // ComputerNamePrefix: to.Ptr("{vmss-name}"), // Secrets: []*armcompute.VaultSecretGroup{ // }, // WindowsConfiguration: &armcompute.WindowsConfiguration{ // EnableAutomaticUpdates: to.Ptr(true), // ProvisionVMAgent: to.Ptr(true), // }, // }, // StorageProfile: &armcompute.VirtualMachineScaleSetStorageProfile{ // ImageReference: &armcompute.ImageReference{ // Offer: to.Ptr("WindowsServer"), // Publisher: to.Ptr("MicrosoftWindowsServer"), // SKU: to.Ptr("2016-Datacenter"), // Version: to.Ptr("latest"), // }, // OSDisk: &armcompute.VirtualMachineScaleSetOSDisk{ // Caching: to.Ptr(armcompute.CachingTypesReadWrite), // CreateOption: to.Ptr(armcompute.DiskCreateOptionTypesFromImage), // ManagedDisk: &armcompute.VirtualMachineScaleSetManagedDiskParameters{ // StorageAccountType: to.Ptr(armcompute.StorageAccountTypesStandardLRS), // }, // }, // }, // }, // }, // SKU: &armcompute.SKU{ // Name: to.Ptr("Standard_D1_v2"), // Capacity: to.Ptr[int64](3), // Tier: to.Ptr("Standard"), // }, // }
Output:
Example (CreateOrUpdateAScaleSetWithCapacityReservation) ¶
Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/92de53a5f1e0e03c94b40475d2135d97148ed014/specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-03-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSet_Create_WithCapacityReservation.json
cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() clientFactory, err := armcompute.NewClientFactory("<subscription-id>", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } poller, err := clientFactory.NewVirtualMachineScaleSetsClient().BeginCreateOrUpdate(ctx, "myResourceGroup", "{vmss-name}", armcompute.VirtualMachineScaleSet{ Location: to.Ptr("westus"), Properties: &armcompute.VirtualMachineScaleSetProperties{ Overprovision: to.Ptr(true), UpgradePolicy: &armcompute.UpgradePolicy{ Mode: to.Ptr(armcompute.UpgradeModeManual), }, VirtualMachineProfile: &armcompute.VirtualMachineScaleSetVMProfile{ CapacityReservation: &armcompute.CapacityReservationProfile{ CapacityReservationGroup: &armcompute.SubResource{ ID: to.Ptr("subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/CapacityReservationGroups/{crgName}"), }, }, NetworkProfile: &armcompute.VirtualMachineScaleSetNetworkProfile{ NetworkInterfaceConfigurations: []*armcompute.VirtualMachineScaleSetNetworkConfiguration{ { Name: to.Ptr("{vmss-name}"), Properties: &armcompute.VirtualMachineScaleSetNetworkConfigurationProperties{ EnableIPForwarding: to.Ptr(true), IPConfigurations: []*armcompute.VirtualMachineScaleSetIPConfiguration{ { Name: to.Ptr("{vmss-name}"), Properties: &armcompute.VirtualMachineScaleSetIPConfigurationProperties{ Subnet: &armcompute.APIEntityReference{ ID: to.Ptr("/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/virtualNetworks/{existing-virtual-network-name}/subnets/{existing-subnet-name}"), }, }, }}, Primary: to.Ptr(true), }, }}, }, OSProfile: &armcompute.VirtualMachineScaleSetOSProfile{ AdminPassword: to.Ptr("{your-password}"), AdminUsername: to.Ptr("{your-username}"), ComputerNamePrefix: to.Ptr("{vmss-name}"), }, StorageProfile: &armcompute.VirtualMachineScaleSetStorageProfile{ ImageReference: &armcompute.ImageReference{ Offer: to.Ptr("WindowsServer"), Publisher: to.Ptr("MicrosoftWindowsServer"), SKU: to.Ptr("2016-Datacenter"), Version: to.Ptr("latest"), }, OSDisk: &armcompute.VirtualMachineScaleSetOSDisk{ Caching: to.Ptr(armcompute.CachingTypesReadWrite), CreateOption: to.Ptr(armcompute.DiskCreateOptionTypesFromImage), ManagedDisk: &armcompute.VirtualMachineScaleSetManagedDiskParameters{ StorageAccountType: to.Ptr(armcompute.StorageAccountTypesStandardLRS), }, }, }, }, }, SKU: &armcompute.SKU{ Name: to.Ptr("Standard_DS1_v2"), Capacity: to.Ptr[int64](3), Tier: to.Ptr("Standard"), }, }, &armcompute.VirtualMachineScaleSetsClientBeginCreateOrUpdateOptions{IfMatch: nil, IfNoneMatch: nil, }) if err != nil { log.Fatalf("failed to finish the request: %v", err) } res, err := poller.PollUntilDone(ctx, nil) if err != nil { log.Fatalf("failed to pull the result: %v", err) } // You could use response here. We use blank identifier for just demo purposes. _ = res // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. // res.VirtualMachineScaleSet = armcompute.VirtualMachineScaleSet{ // Name: to.Ptr("{vmss-name}"), // Type: to.Ptr("Microsoft.Compute/virtualMachineScaleSets"), // ID: to.Ptr("/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/virtualMachineScaleSets/{vmss-name}"), // Location: to.Ptr("westus"), // Properties: &armcompute.VirtualMachineScaleSetProperties{ // Overprovision: to.Ptr(true), // ProvisioningState: to.Ptr("Succeeded"), // SinglePlacementGroup: to.Ptr(true), // UniqueID: to.Ptr("d053ec5a-8da6-495f-ab13-38216503c6d7"), // UpgradePolicy: &armcompute.UpgradePolicy{ // Mode: to.Ptr(armcompute.UpgradeModeManual), // }, // VirtualMachineProfile: &armcompute.VirtualMachineScaleSetVMProfile{ // CapacityReservation: &armcompute.CapacityReservationProfile{ // CapacityReservationGroup: &armcompute.SubResource{ // ID: to.Ptr("subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/CapacityReservationGroups/{crgName}"), // }, // }, // NetworkProfile: &armcompute.VirtualMachineScaleSetNetworkProfile{ // NetworkInterfaceConfigurations: []*armcompute.VirtualMachineScaleSetNetworkConfiguration{ // { // Name: to.Ptr("{vmss-name}"), // Properties: &armcompute.VirtualMachineScaleSetNetworkConfigurationProperties{ // DNSSettings: &armcompute.VirtualMachineScaleSetNetworkConfigurationDNSSettings{ // DNSServers: []*string{ // }, // }, // EnableAcceleratedNetworking: to.Ptr(false), // EnableIPForwarding: to.Ptr(true), // IPConfigurations: []*armcompute.VirtualMachineScaleSetIPConfiguration{ // { // Name: to.Ptr("{vmss-name}"), // Properties: &armcompute.VirtualMachineScaleSetIPConfigurationProperties{ // PrivateIPAddressVersion: to.Ptr(armcompute.IPVersionIPv4), // Subnet: &armcompute.APIEntityReference{ // ID: to.Ptr("/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/virtualNetworks/nsgExistingVnet/subnets/nsgExistingSubnet"), // }, // }, // }}, // Primary: to.Ptr(true), // }, // }}, // }, // OSProfile: &armcompute.VirtualMachineScaleSetOSProfile{ // AdminUsername: to.Ptr("{your-username}"), // ComputerNamePrefix: to.Ptr("{vmss-name}"), // Secrets: []*armcompute.VaultSecretGroup{ // }, // WindowsConfiguration: &armcompute.WindowsConfiguration{ // EnableAutomaticUpdates: to.Ptr(true), // ProvisionVMAgent: to.Ptr(true), // }, // }, // StorageProfile: &armcompute.VirtualMachineScaleSetStorageProfile{ // ImageReference: &armcompute.ImageReference{ // Offer: to.Ptr("WindowsServer"), // Publisher: to.Ptr("MicrosoftWindowsServer"), // SKU: to.Ptr("2016-Datacenter"), // Version: to.Ptr("latest"), // }, // OSDisk: &armcompute.VirtualMachineScaleSetOSDisk{ // Caching: to.Ptr(armcompute.CachingTypesReadWrite), // CreateOption: to.Ptr(armcompute.DiskCreateOptionTypesFromImage), // ManagedDisk: &armcompute.VirtualMachineScaleSetManagedDiskParameters{ // StorageAccountType: to.Ptr(armcompute.StorageAccountTypesStandardLRS), // }, // }, // }, // }, // }, // SKU: &armcompute.SKU{ // Name: to.Ptr("Standard_DS1_v2"), // Capacity: to.Ptr[int64](3), // Tier: to.Ptr("Standard"), // }, // }
Output:
func (*VirtualMachineScaleSetsClient) BeginDeallocate ¶
func (client *VirtualMachineScaleSetsClient) BeginDeallocate(ctx context.Context, resourceGroupName string, vmScaleSetName string, options *VirtualMachineScaleSetsClientBeginDeallocateOptions) (*runtime.Poller[VirtualMachineScaleSetsClientDeallocateResponse], error)
BeginDeallocate - Deallocates specific virtual machines in a VM scale set. Shuts down the virtual machines and releases the compute resources. You are not billed for the compute resources that this virtual machine scale set deallocates. If the operation fails it returns an *azcore.ResponseError type.
Generated from API version 2024-03-01
- resourceGroupName - The name of the resource group.
- vmScaleSetName - The name of the VM scale set.
- options - VirtualMachineScaleSetsClientBeginDeallocateOptions contains the optional parameters for the VirtualMachineScaleSetsClient.BeginDeallocate method.
Example (VirtualMachineScaleSetDeallocateMaximumSetGen) ¶
Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/92de53a5f1e0e03c94b40475d2135d97148ed014/specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-03-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSet_Deallocate_MaximumSet_Gen.json
cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() clientFactory, err := armcompute.NewClientFactory("<subscription-id>", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } poller, err := clientFactory.NewVirtualMachineScaleSetsClient().BeginDeallocate(ctx, "rgcompute", "aaaaaaaaaaaaaaaaaaaaaaaaaaaa", &armcompute.VirtualMachineScaleSetsClientBeginDeallocateOptions{Hibernate: to.Ptr(true), VMInstanceIDs: &armcompute.VirtualMachineScaleSetVMInstanceIDs{ InstanceIDs: []*string{ to.Ptr("aaaaaaaaaaaaaaaaa")}, }, }) if err != nil { log.Fatalf("failed to finish the request: %v", err) } _, err = poller.PollUntilDone(ctx, nil) if err != nil { log.Fatalf("failed to pull the result: %v", err) }
Output:
Example (VirtualMachineScaleSetDeallocateMinimumSetGen) ¶
Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/92de53a5f1e0e03c94b40475d2135d97148ed014/specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-03-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSet_Deallocate_MinimumSet_Gen.json
cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() clientFactory, err := armcompute.NewClientFactory("<subscription-id>", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } poller, err := clientFactory.NewVirtualMachineScaleSetsClient().BeginDeallocate(ctx, "rgcompute", "aaaaaaaaaaaaaaaaaaaaaaaa", &armcompute.VirtualMachineScaleSetsClientBeginDeallocateOptions{Hibernate: nil, VMInstanceIDs: nil, }) if err != nil { log.Fatalf("failed to finish the request: %v", err) } _, err = poller.PollUntilDone(ctx, nil) if err != nil { log.Fatalf("failed to pull the result: %v", err) }
Output:
func (*VirtualMachineScaleSetsClient) BeginDelete ¶
func (client *VirtualMachineScaleSetsClient) BeginDelete(ctx context.Context, resourceGroupName string, vmScaleSetName string, options *VirtualMachineScaleSetsClientBeginDeleteOptions) (*runtime.Poller[VirtualMachineScaleSetsClientDeleteResponse], error)
BeginDelete - Deletes a VM scale set. If the operation fails it returns an *azcore.ResponseError type.
Generated from API version 2024-03-01
- resourceGroupName - The name of the resource group.
- vmScaleSetName - The name of the VM scale set.
- options - VirtualMachineScaleSetsClientBeginDeleteOptions contains the optional parameters for the VirtualMachineScaleSetsClient.BeginDelete method.
Example ¶
Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/92de53a5f1e0e03c94b40475d2135d97148ed014/specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-03-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSet_Delete_Force.json
cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() clientFactory, err := armcompute.NewClientFactory("<subscription-id>", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } poller, err := clientFactory.NewVirtualMachineScaleSetsClient().BeginDelete(ctx, "myResourceGroup", "myvmScaleSet", &armcompute.VirtualMachineScaleSetsClientBeginDeleteOptions{ForceDeletion: to.Ptr(true)}) if err != nil { log.Fatalf("failed to finish the request: %v", err) } _, err = poller.PollUntilDone(ctx, nil) if err != nil { log.Fatalf("failed to pull the result: %v", err) }
Output:
func (*VirtualMachineScaleSetsClient) BeginDeleteInstances ¶
func (client *VirtualMachineScaleSetsClient) BeginDeleteInstances(ctx context.Context, resourceGroupName string, vmScaleSetName string, vmInstanceIDs VirtualMachineScaleSetVMInstanceRequiredIDs, options *VirtualMachineScaleSetsClientBeginDeleteInstancesOptions) (*runtime.Poller[VirtualMachineScaleSetsClientDeleteInstancesResponse], error)
BeginDeleteInstances - Deletes virtual machines in a VM scale set. If the operation fails it returns an *azcore.ResponseError type.
Generated from API version 2024-03-01
- resourceGroupName - The name of the resource group.
- vmScaleSetName - The name of the VM scale set.
- vmInstanceIDs - A list of virtual machine instance IDs from the VM scale set.
- options - VirtualMachineScaleSetsClientBeginDeleteInstancesOptions contains the optional parameters for the VirtualMachineScaleSetsClient.BeginDeleteInstances method.
Example (VirtualMachineScaleSetDeleteInstancesMaximumSetGen) ¶
Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/92de53a5f1e0e03c94b40475d2135d97148ed014/specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-03-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSet_DeleteInstances_MaximumSet_Gen.json
cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() clientFactory, err := armcompute.NewClientFactory("<subscription-id>", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } poller, err := clientFactory.NewVirtualMachineScaleSetsClient().BeginDeleteInstances(ctx, "rgcompute", "aaaaaaaaaaaaaaaaaaaa", armcompute.VirtualMachineScaleSetVMInstanceRequiredIDs{ InstanceIDs: []*string{ to.Ptr("aaaaaaaaaaaaaaaaaaaaaaaaa")}, }, &armcompute.VirtualMachineScaleSetsClientBeginDeleteInstancesOptions{ForceDeletion: to.Ptr(true)}) if err != nil { log.Fatalf("failed to finish the request: %v", err) } _, err = poller.PollUntilDone(ctx, nil) if err != nil { log.Fatalf("failed to pull the result: %v", err) }
Output:
Example (VirtualMachineScaleSetDeleteInstancesMinimumSetGen) ¶
Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/92de53a5f1e0e03c94b40475d2135d97148ed014/specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-03-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSet_DeleteInstances_MinimumSet_Gen.json
cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() clientFactory, err := armcompute.NewClientFactory("<subscription-id>", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } poller, err := clientFactory.NewVirtualMachineScaleSetsClient().BeginDeleteInstances(ctx, "rgcompute", "aaaaaaaaaaaaaaa", armcompute.VirtualMachineScaleSetVMInstanceRequiredIDs{ InstanceIDs: []*string{ to.Ptr("aaaaaaaaaaaaaaaaaaaaaaaaa")}, }, &armcompute.VirtualMachineScaleSetsClientBeginDeleteInstancesOptions{ForceDeletion: nil}) if err != nil { log.Fatalf("failed to finish the request: %v", err) } _, err = poller.PollUntilDone(ctx, nil) if err != nil { log.Fatalf("failed to pull the result: %v", err) }
Output:
func (*VirtualMachineScaleSetsClient) BeginPerformMaintenance ¶
func (client *VirtualMachineScaleSetsClient) BeginPerformMaintenance(ctx context.Context, resourceGroupName string, vmScaleSetName string, options *VirtualMachineScaleSetsClientBeginPerformMaintenanceOptions) (*runtime.Poller[VirtualMachineScaleSetsClientPerformMaintenanceResponse], error)
BeginPerformMaintenance - Perform maintenance on one or more virtual machines in a VM scale set. Operation on instances which are not eligible for perform maintenance will be failed. Please refer to best practices for more details: https://docs.microsoft.com/azure/virtual-machine-scale-sets/virtual-machine-scale-sets-maintenance-notifications If the operation fails it returns an *azcore.ResponseError type.
Generated from API version 2024-03-01
- resourceGroupName - The name of the resource group.
- vmScaleSetName - The name of the VM scale set.
- options - VirtualMachineScaleSetsClientBeginPerformMaintenanceOptions contains the optional parameters for the VirtualMachineScaleSetsClient.BeginPerformMaintenance method.
Example (VirtualMachineScaleSetPerformMaintenanceMaximumSetGen) ¶
Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/92de53a5f1e0e03c94b40475d2135d97148ed014/specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-03-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSet_PerformMaintenance_MaximumSet_Gen.json
cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() clientFactory, err := armcompute.NewClientFactory("<subscription-id>", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } poller, err := clientFactory.NewVirtualMachineScaleSetsClient().BeginPerformMaintenance(ctx, "rgcompute", "aaaaaaaaaaa", &armcompute.VirtualMachineScaleSetsClientBeginPerformMaintenanceOptions{VMInstanceIDs: &armcompute.VirtualMachineScaleSetVMInstanceIDs{ InstanceIDs: []*string{ to.Ptr("aaaaaaaaaaaaaaaaa")}, }, }) if err != nil { log.Fatalf("failed to finish the request: %v", err) } _, err = poller.PollUntilDone(ctx, nil) if err != nil { log.Fatalf("failed to pull the result: %v", err) }
Output:
Example (VirtualMachineScaleSetPerformMaintenanceMinimumSetGen) ¶
Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/92de53a5f1e0e03c94b40475d2135d97148ed014/specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-03-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSet_PerformMaintenance_MinimumSet_Gen.json
cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() clientFactory, err := armcompute.NewClientFactory("<subscription-id>", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } poller, err := clientFactory.NewVirtualMachineScaleSetsClient().BeginPerformMaintenance(ctx, "rgcompute", "aa", &armcompute.VirtualMachineScaleSetsClientBeginPerformMaintenanceOptions{VMInstanceIDs: nil}) if err != nil { log.Fatalf("failed to finish the request: %v", err) } _, err = poller.PollUntilDone(ctx, nil) if err != nil { log.Fatalf("failed to pull the result: %v", err) }
Output:
func (*VirtualMachineScaleSetsClient) BeginPowerOff ¶
func (client *VirtualMachineScaleSetsClient) BeginPowerOff(ctx context.Context, resourceGroupName string, vmScaleSetName string, options *VirtualMachineScaleSetsClientBeginPowerOffOptions) (*runtime.Poller[VirtualMachineScaleSetsClientPowerOffResponse], error)
BeginPowerOff - Power off (stop) one or more virtual machines in a VM scale set. Note that resources are still attached and you are getting charged for the resources. Instead, use deallocate to release resources and avoid charges. If the operation fails it returns an *azcore.ResponseError type.
Generated from API version 2024-03-01
- resourceGroupName - The name of the resource group.
- vmScaleSetName - The name of the VM scale set.
- options - VirtualMachineScaleSetsClientBeginPowerOffOptions contains the optional parameters for the VirtualMachineScaleSetsClient.BeginPowerOff method.
Example (VirtualMachineScaleSetPowerOffMaximumSetGen) ¶
Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/92de53a5f1e0e03c94b40475d2135d97148ed014/specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-03-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSet_PowerOff_MaximumSet_Gen.json
cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() clientFactory, err := armcompute.NewClientFactory("<subscription-id>", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } poller, err := clientFactory.NewVirtualMachineScaleSetsClient().BeginPowerOff(ctx, "rgcompute", "aaaaaaaaaaaaaaaaaa", &armcompute.VirtualMachineScaleSetsClientBeginPowerOffOptions{SkipShutdown: to.Ptr(true), VMInstanceIDs: &armcompute.VirtualMachineScaleSetVMInstanceIDs{ InstanceIDs: []*string{ to.Ptr("aaaaaaaaaaaaaaaaa")}, }, }) if err != nil { log.Fatalf("failed to finish the request: %v", err) } _, err = poller.PollUntilDone(ctx, nil) if err != nil { log.Fatalf("failed to pull the result: %v", err) }
Output:
Example (VirtualMachineScaleSetPowerOffMinimumSetGen) ¶
Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/92de53a5f1e0e03c94b40475d2135d97148ed014/specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-03-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSet_PowerOff_MinimumSet_Gen.json
cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() clientFactory, err := armcompute.NewClientFactory("<subscription-id>", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } poller, err := clientFactory.NewVirtualMachineScaleSetsClient().BeginPowerOff(ctx, "rgcompute", "a", &armcompute.VirtualMachineScaleSetsClientBeginPowerOffOptions{SkipShutdown: nil, VMInstanceIDs: nil, }) if err != nil { log.Fatalf("failed to finish the request: %v", err) } _, err = poller.PollUntilDone(ctx, nil) if err != nil { log.Fatalf("failed to pull the result: %v", err) }
Output:
func (*VirtualMachineScaleSetsClient) BeginReapply ¶
func (client *VirtualMachineScaleSetsClient) BeginReapply(ctx context.Context, resourceGroupName string, vmScaleSetName string, options *VirtualMachineScaleSetsClientBeginReapplyOptions) (*runtime.Poller[VirtualMachineScaleSetsClientReapplyResponse], error)
BeginReapply - Reapplies the Virtual Machine Scale Set Virtual Machine Profile to the Virtual Machine Instances If the operation fails it returns an *azcore.ResponseError type.
Generated from API version 2024-03-01
- resourceGroupName - The name of the resource group.
- vmScaleSetName - The name of the VM scale set.
- options - VirtualMachineScaleSetsClientBeginReapplyOptions contains the optional parameters for the VirtualMachineScaleSetsClient.BeginReapply method.
Example (VirtualMachineScaleSetsReapplyMaximumSetGen) ¶
Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/92de53a5f1e0e03c94b40475d2135d97148ed014/specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-03-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSet_Reapply_MaximumSet_Gen.json
cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() clientFactory, err := armcompute.NewClientFactory("<subscription-id>", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } poller, err := clientFactory.NewVirtualMachineScaleSetsClient().BeginReapply(ctx, "VirtualMachineScaleSetReapplyTestRG", "VMSSReapply-Test-ScaleSet", nil) if err != nil { log.Fatalf("failed to finish the request: %v", err) } _, err = poller.PollUntilDone(ctx, nil) if err != nil { log.Fatalf("failed to pull the result: %v", err) }
Output:
Example (VirtualMachineScaleSetsReapplyMinimumSetGen) ¶
Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/92de53a5f1e0e03c94b40475d2135d97148ed014/specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-03-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSet_Reapply_MinimumSet_Gen.json
cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() clientFactory, err := armcompute.NewClientFactory("<subscription-id>", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } poller, err := clientFactory.NewVirtualMachineScaleSetsClient().BeginReapply(ctx, "VirtualMachineScaleSetReapplyTestRG", "VMSSReapply-Test-ScaleSet", nil) if err != nil { log.Fatalf("failed to finish the request: %v", err) } _, err = poller.PollUntilDone(ctx, nil) if err != nil { log.Fatalf("failed to pull the result: %v", err) }
Output:
func (*VirtualMachineScaleSetsClient) BeginRedeploy ¶
func (client *VirtualMachineScaleSetsClient) BeginRedeploy(ctx context.Context, resourceGroupName string, vmScaleSetName string, options *VirtualMachineScaleSetsClientBeginRedeployOptions) (*runtime.Poller[VirtualMachineScaleSetsClientRedeployResponse], error)
BeginRedeploy - Shuts down all the virtual machines in the virtual machine scale set, moves them to a new node, and powers them back on. If the operation fails it returns an *azcore.ResponseError type.
Generated from API version 2024-03-01
- resourceGroupName - The name of the resource group.
- vmScaleSetName - The name of the VM scale set.
- options - VirtualMachineScaleSetsClientBeginRedeployOptions contains the optional parameters for the VirtualMachineScaleSetsClient.BeginRedeploy method.
Example (VirtualMachineScaleSetRedeployMaximumSetGen) ¶
Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/92de53a5f1e0e03c94b40475d2135d97148ed014/specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-03-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSet_Redeploy_MaximumSet_Gen.json
cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() clientFactory, err := armcompute.NewClientFactory("<subscription-id>", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } poller, err := clientFactory.NewVirtualMachineScaleSetsClient().BeginRedeploy(ctx, "rgcompute", "aaaaaaaaaaaaaaaaaaaaaaaaaaaaa", &armcompute.VirtualMachineScaleSetsClientBeginRedeployOptions{VMInstanceIDs: &armcompute.VirtualMachineScaleSetVMInstanceIDs{ InstanceIDs: []*string{ to.Ptr("aaaaaaaaaaaaaaaaa")}, }, }) if err != nil { log.Fatalf("failed to finish the request: %v", err) } _, err = poller.PollUntilDone(ctx, nil) if err != nil { log.Fatalf("failed to pull the result: %v", err) }
Output:
Example (VirtualMachineScaleSetRedeployMinimumSetGen) ¶
Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/92de53a5f1e0e03c94b40475d2135d97148ed014/specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-03-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSet_Redeploy_MinimumSet_Gen.json
cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() clientFactory, err := armcompute.NewClientFactory("<subscription-id>", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } poller, err := clientFactory.NewVirtualMachineScaleSetsClient().BeginRedeploy(ctx, "rgcompute", "aaaaaaaaaaaaaaaaaaaaaa", &armcompute.VirtualMachineScaleSetsClientBeginRedeployOptions{VMInstanceIDs: nil}) if err != nil { log.Fatalf("failed to finish the request: %v", err) } _, err = poller.PollUntilDone(ctx, nil) if err != nil { log.Fatalf("failed to pull the result: %v", err) }
Output:
func (*VirtualMachineScaleSetsClient) BeginReimage ¶
func (client *VirtualMachineScaleSetsClient) BeginReimage(ctx context.Context, resourceGroupName string, vmScaleSetName string, options *VirtualMachineScaleSetsClientBeginReimageOptions) (*runtime.Poller[VirtualMachineScaleSetsClientReimageResponse], error)
BeginReimage - Reimages (upgrade the operating system) one or more virtual machines in a VM scale set which don't have a ephemeral OS disk, for virtual machines who have a ephemeral OS disk the virtual machine is reset to initial state. If the operation fails it returns an *azcore.ResponseError type.
Generated from API version 2024-03-01
- resourceGroupName - The name of the resource group.
- vmScaleSetName - The name of the VM scale set.
- options - VirtualMachineScaleSetsClientBeginReimageOptions contains the optional parameters for the VirtualMachineScaleSetsClient.BeginReimage method.
Example (VirtualMachineScaleSetReimageMaximumSetGen) ¶
Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/92de53a5f1e0e03c94b40475d2135d97148ed014/specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-03-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSet_Reimage_MaximumSet_Gen.json
cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() clientFactory, err := armcompute.NewClientFactory("<subscription-id>", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } poller, err := clientFactory.NewVirtualMachineScaleSetsClient().BeginReimage(ctx, "rgcompute", "aaaaaaaaaaaaaaaaaaaaaaaaaa", &armcompute.VirtualMachineScaleSetsClientBeginReimageOptions{VMScaleSetReimageInput: &armcompute.VirtualMachineScaleSetReimageParameters{ TempDisk: to.Ptr(true), ForceUpdateOSDiskForEphemeral: to.Ptr(true), InstanceIDs: []*string{ to.Ptr("aaaaaaaaaa")}, }, }) if err != nil { log.Fatalf("failed to finish the request: %v", err) } _, err = poller.PollUntilDone(ctx, nil) if err != nil { log.Fatalf("failed to pull the result: %v", err) }
Output:
Example (VirtualMachineScaleSetReimageMinimumSetGen) ¶
Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/92de53a5f1e0e03c94b40475d2135d97148ed014/specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-03-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSet_Reimage_MinimumSet_Gen.json
cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() clientFactory, err := armcompute.NewClientFactory("<subscription-id>", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } poller, err := clientFactory.NewVirtualMachineScaleSetsClient().BeginReimage(ctx, "rgcompute", "aaaaaaaaaaaaaaaaaaaaaaaaaaaa", &armcompute.VirtualMachineScaleSetsClientBeginReimageOptions{VMScaleSetReimageInput: nil}) if err != nil { log.Fatalf("failed to finish the request: %v", err) } _, err = poller.PollUntilDone(ctx, nil) if err != nil { log.Fatalf("failed to pull the result: %v", err) }
Output:
func (*VirtualMachineScaleSetsClient) BeginReimageAll ¶
func (client *VirtualMachineScaleSetsClient) BeginReimageAll(ctx context.Context, resourceGroupName string, vmScaleSetName string, options *VirtualMachineScaleSetsClientBeginReimageAllOptions) (*runtime.Poller[VirtualMachineScaleSetsClientReimageAllResponse], error)
BeginReimageAll - Reimages all the disks ( including data disks ) in the virtual machines in a VM scale set. This operation is only supported for managed disks. If the operation fails it returns an *azcore.ResponseError type.
Generated from API version 2024-03-01
- resourceGroupName - The name of the resource group.
- vmScaleSetName - The name of the VM scale set.
- options - VirtualMachineScaleSetsClientBeginReimageAllOptions contains the optional parameters for the VirtualMachineScaleSetsClient.BeginReimageAll method.
Example (VirtualMachineScaleSetReimageAllMaximumSetGen) ¶
Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/92de53a5f1e0e03c94b40475d2135d97148ed014/specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-03-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSet_ReimageAll_MaximumSet_Gen.json
cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() clientFactory, err := armcompute.NewClientFactory("<subscription-id>", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } poller, err := clientFactory.NewVirtualMachineScaleSetsClient().BeginReimageAll(ctx, "rgcompute", "aaaaaaaaaaaa", &armcompute.VirtualMachineScaleSetsClientBeginReimageAllOptions{VMInstanceIDs: &armcompute.VirtualMachineScaleSetVMInstanceIDs{ InstanceIDs: []*string{ to.Ptr("aaaaaaaaaaaaaaaaa")}, }, }) if err != nil { log.Fatalf("failed to finish the request: %v", err) } _, err = poller.PollUntilDone(ctx, nil) if err != nil { log.Fatalf("failed to pull the result: %v", err) }
Output:
Example (VirtualMachineScaleSetReimageAllMinimumSetGen) ¶
Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/92de53a5f1e0e03c94b40475d2135d97148ed014/specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-03-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSet_ReimageAll_MinimumSet_Gen.json
cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() clientFactory, err := armcompute.NewClientFactory("<subscription-id>", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } poller, err := clientFactory.NewVirtualMachineScaleSetsClient().BeginReimageAll(ctx, "rgcompute", "aaaaaaaaaaaaaaaaaaaaaa", &armcompute.VirtualMachineScaleSetsClientBeginReimageAllOptions{VMInstanceIDs: nil}) if err != nil { log.Fatalf("failed to finish the request: %v", err) } _, err = poller.PollUntilDone(ctx, nil) if err != nil { log.Fatalf("failed to pull the result: %v", err) }
Output:
func (*VirtualMachineScaleSetsClient) BeginRestart ¶
func (client *VirtualMachineScaleSetsClient) BeginRestart(ctx context.Context, resourceGroupName string, vmScaleSetName string, options *VirtualMachineScaleSetsClientBeginRestartOptions) (*runtime.Poller[VirtualMachineScaleSetsClientRestartResponse], error)
BeginRestart - Restarts one or more virtual machines in a VM scale set. If the operation fails it returns an *azcore.ResponseError type.
Generated from API version 2024-03-01
- resourceGroupName - The name of the resource group.
- vmScaleSetName - The name of the VM scale set.
- options - VirtualMachineScaleSetsClientBeginRestartOptions contains the optional parameters for the VirtualMachineScaleSetsClient.BeginRestart method.
Example (VirtualMachineScaleSetRestartMaximumSetGen) ¶
Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/92de53a5f1e0e03c94b40475d2135d97148ed014/specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-03-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSet_Restart_MaximumSet_Gen.json
cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() clientFactory, err := armcompute.NewClientFactory("<subscription-id>", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } poller, err := clientFactory.NewVirtualMachineScaleSetsClient().BeginRestart(ctx, "rgcompute", "aaaaaaaaaaaaaaaaaaa", &armcompute.VirtualMachineScaleSetsClientBeginRestartOptions{VMInstanceIDs: &armcompute.VirtualMachineScaleSetVMInstanceIDs{ InstanceIDs: []*string{ to.Ptr("aaaaaaaaaaaaaaaaa")}, }, }) if err != nil { log.Fatalf("failed to finish the request: %v", err) } _, err = poller.PollUntilDone(ctx, nil) if err != nil { log.Fatalf("failed to pull the result: %v", err) }
Output:
Example (VirtualMachineScaleSetRestartMinimumSetGen) ¶
Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/92de53a5f1e0e03c94b40475d2135d97148ed014/specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-03-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSet_Restart_MinimumSet_Gen.json
cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() clientFactory, err := armcompute.NewClientFactory("<subscription-id>", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } poller, err := clientFactory.NewVirtualMachineScaleSetsClient().BeginRestart(ctx, "rgcompute", "aaaa", &armcompute.VirtualMachineScaleSetsClientBeginRestartOptions{VMInstanceIDs: nil}) if err != nil { log.Fatalf("failed to finish the request: %v", err) } _, err = poller.PollUntilDone(ctx, nil) if err != nil { log.Fatalf("failed to pull the result: %v", err) }
Output:
func (*VirtualMachineScaleSetsClient) BeginSetOrchestrationServiceState ¶
func (client *VirtualMachineScaleSetsClient) BeginSetOrchestrationServiceState(ctx context.Context, resourceGroupName string, vmScaleSetName string, parameters OrchestrationServiceStateInput, options *VirtualMachineScaleSetsClientBeginSetOrchestrationServiceStateOptions) (*runtime.Poller[VirtualMachineScaleSetsClientSetOrchestrationServiceStateResponse], error)
BeginSetOrchestrationServiceState - Changes ServiceState property for a given service If the operation fails it returns an *azcore.ResponseError type.
Generated from API version 2024-03-01
- resourceGroupName - The name of the resource group.
- vmScaleSetName - The name of the virtual machine scale set to create or update.
- parameters - The input object for SetOrchestrationServiceState API.
- options - VirtualMachineScaleSetsClientBeginSetOrchestrationServiceStateOptions contains the optional parameters for the VirtualMachineScaleSetsClient.BeginSetOrchestrationServiceState method.
Example (VirtualMachineScaleSetSetOrchestrationServiceStateMaximumSetGen) ¶
Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/92de53a5f1e0e03c94b40475d2135d97148ed014/specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-03-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSet_SetOrchestrationServiceState_MaximumSet_Gen.json
cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() clientFactory, err := armcompute.NewClientFactory("<subscription-id>", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } poller, err := clientFactory.NewVirtualMachineScaleSetsClient().BeginSetOrchestrationServiceState(ctx, "rgcompute", "aaaaaaaaaaaaaaaa", armcompute.OrchestrationServiceStateInput{ Action: to.Ptr(armcompute.OrchestrationServiceStateActionResume), ServiceName: to.Ptr(armcompute.OrchestrationServiceNamesAutomaticRepairs), }, nil) if err != nil { log.Fatalf("failed to finish the request: %v", err) } _, err = poller.PollUntilDone(ctx, nil) if err != nil { log.Fatalf("failed to pull the result: %v", err) }
Output:
Example (VirtualMachineScaleSetSetOrchestrationServiceStateMinimumSetGen) ¶
Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/92de53a5f1e0e03c94b40475d2135d97148ed014/specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-03-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSet_SetOrchestrationServiceState_MinimumSet_Gen.json
cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() clientFactory, err := armcompute.NewClientFactory("<subscription-id>", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } poller, err := clientFactory.NewVirtualMachineScaleSetsClient().BeginSetOrchestrationServiceState(ctx, "rgcompute", "aaaaaaaaaaaaaaaaaaaaaaaa", armcompute.OrchestrationServiceStateInput{ Action: to.Ptr(armcompute.OrchestrationServiceStateActionResume), ServiceName: to.Ptr(armcompute.OrchestrationServiceNamesAutomaticRepairs), }, nil) if err != nil { log.Fatalf("failed to finish the request: %v", err) } _, err = poller.PollUntilDone(ctx, nil) if err != nil { log.Fatalf("failed to pull the result: %v", err) }
Output:
func (*VirtualMachineScaleSetsClient) BeginStart ¶
func (client *VirtualMachineScaleSetsClient) BeginStart(ctx context.Context, resourceGroupName string, vmScaleSetName string, options *VirtualMachineScaleSetsClientBeginStartOptions) (*runtime.Poller[VirtualMachineScaleSetsClientStartResponse], error)
BeginStart - Starts one or more virtual machines in a VM scale set. If the operation fails it returns an *azcore.ResponseError type.
Generated from API version 2024-03-01
- resourceGroupName - The name of the resource group.
- vmScaleSetName - The name of the VM scale set.
- options - VirtualMachineScaleSetsClientBeginStartOptions contains the optional parameters for the VirtualMachineScaleSetsClient.BeginStart method.
Example (VirtualMachineScaleSetStartMaximumSetGen) ¶
Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/92de53a5f1e0e03c94b40475d2135d97148ed014/specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-03-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSet_Start_MaximumSet_Gen.json
cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() clientFactory, err := armcompute.NewClientFactory("<subscription-id>", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } poller, err := clientFactory.NewVirtualMachineScaleSetsClient().BeginStart(ctx, "rgcompute", "aaaaaaaaaaaaaaaaaaaaaaaa", &armcompute.VirtualMachineScaleSetsClientBeginStartOptions{VMInstanceIDs: &armcompute.VirtualMachineScaleSetVMInstanceIDs{ InstanceIDs: []*string{ to.Ptr("aaaaaaaaaaaaaaaaa")}, }, }) if err != nil { log.Fatalf("failed to finish the request: %v", err) } _, err = poller.PollUntilDone(ctx, nil) if err != nil { log.Fatalf("failed to pull the result: %v", err) }
Output:
Example (VirtualMachineScaleSetStartMinimumSetGen) ¶
Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/92de53a5f1e0e03c94b40475d2135d97148ed014/specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-03-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSet_Start_MinimumSet_Gen.json
cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() clientFactory, err := armcompute.NewClientFactory("<subscription-id>", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } poller, err := clientFactory.NewVirtualMachineScaleSetsClient().BeginStart(ctx, "rgcompute", "aaaaaaaaaaaaaaaaaaa", &armcompute.VirtualMachineScaleSetsClientBeginStartOptions{VMInstanceIDs: nil}) if err != nil { log.Fatalf("failed to finish the request: %v", err) } _, err = poller.PollUntilDone(ctx, nil) if err != nil { log.Fatalf("failed to pull the result: %v", err) }
Output:
func (*VirtualMachineScaleSetsClient) BeginUpdate ¶
func (client *VirtualMachineScaleSetsClient) BeginUpdate(ctx context.Context, resourceGroupName string, vmScaleSetName string, parameters VirtualMachineScaleSetUpdate, options *VirtualMachineScaleSetsClientBeginUpdateOptions) (*runtime.Poller[VirtualMachineScaleSetsClientUpdateResponse], error)
BeginUpdate - Update a VM scale set. If the operation fails it returns an *azcore.ResponseError type.
Generated from API version 2024-03-01
- resourceGroupName - The name of the resource group.
- vmScaleSetName - The name of the VM scale set to create or update.
- parameters - The scale set object.
- options - VirtualMachineScaleSetsClientBeginUpdateOptions contains the optional parameters for the VirtualMachineScaleSetsClient.BeginUpdate method.
Example (VirtualMachineScaleSetUpdateMaximumSetGen) ¶
Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/92de53a5f1e0e03c94b40475d2135d97148ed014/specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-03-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSet_Update_MaximumSet_Gen.json
cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() clientFactory, err := armcompute.NewClientFactory("<subscription-id>", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } poller, err := clientFactory.NewVirtualMachineScaleSetsClient().BeginUpdate(ctx, "rgcompute", "aaaaaaaaaaaaa", armcompute.VirtualMachineScaleSetUpdate{ Tags: map[string]*string{ "key246": to.Ptr("aaaaaaaaaaaaaaaaaaaaaaaa"), }, Identity: &armcompute.VirtualMachineScaleSetIdentity{ Type: to.Ptr(armcompute.ResourceIdentityTypeSystemAssigned), UserAssignedIdentities: map[string]*armcompute.UserAssignedIdentitiesValue{ "key3951": {}, }, }, Plan: &armcompute.Plan{ Name: to.Ptr("windows2016"), Product: to.Ptr("windows-data-science-vm"), PromotionCode: to.Ptr("aaaaaaaaaa"), Publisher: to.Ptr("microsoft-ads"), }, Properties: &armcompute.VirtualMachineScaleSetUpdateProperties{ AdditionalCapabilities: &armcompute.AdditionalCapabilities{ HibernationEnabled: to.Ptr(true), UltraSSDEnabled: to.Ptr(true), }, AutomaticRepairsPolicy: &armcompute.AutomaticRepairsPolicy{ Enabled: to.Ptr(true), GracePeriod: to.Ptr("PT30M"), }, DoNotRunExtensionsOnOverprovisionedVMs: to.Ptr(true), Overprovision: to.Ptr(true), ProximityPlacementGroup: &armcompute.SubResource{ ID: to.Ptr("subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/snapshots/mySnapshot"), }, ScaleInPolicy: &armcompute.ScaleInPolicy{ ForceDeletion: to.Ptr(true), Rules: []*armcompute.VirtualMachineScaleSetScaleInRules{ to.Ptr(armcompute.VirtualMachineScaleSetScaleInRulesOldestVM)}, }, SinglePlacementGroup: to.Ptr(true), UpgradePolicy: &armcompute.UpgradePolicy{ AutomaticOSUpgradePolicy: &armcompute.AutomaticOSUpgradePolicy{ DisableAutomaticRollback: to.Ptr(true), EnableAutomaticOSUpgrade: to.Ptr(true), OSRollingUpgradeDeferral: to.Ptr(true), }, Mode: to.Ptr(armcompute.UpgradeModeManual), RollingUpgradePolicy: &armcompute.RollingUpgradePolicy{ EnableCrossZoneUpgrade: to.Ptr(true), MaxBatchInstancePercent: to.Ptr[int32](49), MaxSurge: to.Ptr(true), MaxUnhealthyInstancePercent: to.Ptr[int32](81), MaxUnhealthyUpgradedInstancePercent: to.Ptr[int32](98), PauseTimeBetweenBatches: to.Ptr("aaaaaaaaaaaaaaa"), PrioritizeUnhealthyInstances: to.Ptr(true), RollbackFailedInstancesOnPolicyBreach: to.Ptr(true), }, }, VirtualMachineProfile: &armcompute.VirtualMachineScaleSetUpdateVMProfile{ BillingProfile: &armcompute.BillingProfile{ MaxPrice: to.Ptr[float64](-1), }, DiagnosticsProfile: &armcompute.DiagnosticsProfile{ BootDiagnostics: &armcompute.BootDiagnostics{ Enabled: to.Ptr(true), StorageURI: to.Ptr("http://{existing-storage-account-name}.blob.core.windows.net"), }, }, ExtensionProfile: &armcompute.VirtualMachineScaleSetExtensionProfile{ ExtensionsTimeBudget: to.Ptr("PT1H20M"), Extensions: []*armcompute.VirtualMachineScaleSetExtension{ { Name: to.Ptr("{extension-name}"), Properties: &armcompute.VirtualMachineScaleSetExtensionProperties{ Type: to.Ptr("{extension-Type}"), AutoUpgradeMinorVersion: to.Ptr(true), EnableAutomaticUpgrade: to.Ptr(true), ForceUpdateTag: to.Ptr("aaaaaaaaa"), ProtectedSettings: map[string]any{}, ProvisionAfterExtensions: []*string{ to.Ptr("aa")}, Publisher: to.Ptr("{extension-Publisher}"), Settings: map[string]any{}, SuppressFailures: to.Ptr(true), TypeHandlerVersion: to.Ptr("{handler-version}"), }, }}, }, LicenseType: to.Ptr("aaaaaaaaaaaa"), NetworkProfile: &armcompute.VirtualMachineScaleSetUpdateNetworkProfile{ HealthProbe: &armcompute.APIEntityReference{ ID: to.Ptr("/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/disks/disk123"), }, NetworkAPIVersion: to.Ptr(armcompute.NetworkAPIVersionTwoThousandTwenty1101), NetworkInterfaceConfigurations: []*armcompute.VirtualMachineScaleSetUpdateNetworkConfiguration{ { Name: to.Ptr("aaaaaaaa"), Properties: &armcompute.VirtualMachineScaleSetUpdateNetworkConfigurationProperties{ DeleteOption: to.Ptr(armcompute.DeleteOptionsDelete), DNSSettings: &armcompute.VirtualMachineScaleSetNetworkConfigurationDNSSettings{ DNSServers: []*string{}, }, EnableAcceleratedNetworking: to.Ptr(true), EnableFpga: to.Ptr(true), EnableIPForwarding: to.Ptr(true), IPConfigurations: []*armcompute.VirtualMachineScaleSetUpdateIPConfiguration{ { Name: to.Ptr("aaaaaaaaaaaaaaaaaaaaaaaaaaaaa"), Properties: &armcompute.VirtualMachineScaleSetUpdateIPConfigurationProperties{ ApplicationGatewayBackendAddressPools: []*armcompute.SubResource{ { ID: to.Ptr("subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/snapshots/mySnapshot"), }}, ApplicationSecurityGroups: []*armcompute.SubResource{ { ID: to.Ptr("subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/snapshots/mySnapshot"), }}, LoadBalancerBackendAddressPools: []*armcompute.SubResource{ { ID: to.Ptr("subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/snapshots/mySnapshot"), }}, LoadBalancerInboundNatPools: []*armcompute.SubResource{ { ID: to.Ptr("subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/snapshots/mySnapshot"), }}, Primary: to.Ptr(true), PrivateIPAddressVersion: to.Ptr(armcompute.IPVersionIPv4), PublicIPAddressConfiguration: &armcompute.VirtualMachineScaleSetUpdatePublicIPAddressConfiguration{ Name: to.Ptr("a"), Properties: &armcompute.VirtualMachineScaleSetUpdatePublicIPAddressConfigurationProperties{ DeleteOption: to.Ptr(armcompute.DeleteOptionsDelete), DNSSettings: &armcompute.VirtualMachineScaleSetPublicIPAddressConfigurationDNSSettings{ DomainNameLabel: to.Ptr("aaaaaaaaaaaaaaaaaa"), }, IdleTimeoutInMinutes: to.Ptr[int32](3), }, }, Subnet: &armcompute.APIEntityReference{ ID: to.Ptr("/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/disks/disk123"), }, }, }}, NetworkSecurityGroup: &armcompute.SubResource{ ID: to.Ptr("subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/snapshots/mySnapshot"), }, Primary: to.Ptr(true), }, }}, }, OSProfile: &armcompute.VirtualMachineScaleSetUpdateOSProfile{ CustomData: to.Ptr("aaaaaaaaaaaaaaaaaaaaaaaaaa"), LinuxConfiguration: &armcompute.LinuxConfiguration{ DisablePasswordAuthentication: to.Ptr(true), PatchSettings: &armcompute.LinuxPatchSettings{ AssessmentMode: to.Ptr(armcompute.LinuxPatchAssessmentModeImageDefault), PatchMode: to.Ptr(armcompute.LinuxVMGuestPatchModeImageDefault), }, ProvisionVMAgent: to.Ptr(true), SSH: &armcompute.SSHConfiguration{ PublicKeys: []*armcompute.SSHPublicKey{ { Path: to.Ptr("/home/{your-username}/.ssh/authorized_keys"), KeyData: to.Ptr("ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQCeClRAk2ipUs/l5voIsDC5q9RI+YSRd1Bvd/O+axgY4WiBzG+4FwJWZm/mLLe5DoOdHQwmU2FrKXZSW4w2sYE70KeWnrFViCOX5MTVvJgPE8ClugNl8RWth/tU849DvM9sT7vFgfVSHcAS2yDRyDlueii+8nF2ym8XWAPltFVCyLHRsyBp5YPqK8JFYIa1eybKsY3hEAxRCA+/7bq8et+Gj3coOsuRmrehav7rE6N12Pb80I6ofa6SM5XNYq4Xk0iYNx7R3kdz0Jj9XgZYWjAHjJmT0gTRoOnt6upOuxK7xI/ykWrllgpXrCPu3Ymz+c+ujaqcxDopnAl2lmf69/J1"), }}, }, }, Secrets: []*armcompute.VaultSecretGroup{ { SourceVault: &armcompute.SubResource{ ID: to.Ptr("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/availabilitySets/{availabilitySetName}"), }, VaultCertificates: []*armcompute.VaultCertificate{ { CertificateStore: to.Ptr("aaaaaaaaaaaaaaaaaaaaaaaaa"), CertificateURL: to.Ptr("aaaaaaa"), }}, }}, WindowsConfiguration: &armcompute.WindowsConfiguration{ AdditionalUnattendContent: []*armcompute.AdditionalUnattendContent{ { ComponentName: to.Ptr("Microsoft-Windows-Shell-Setup"), Content: to.Ptr("aaaaaaaaaaaaaaaaaaaa"), PassName: to.Ptr("OobeSystem"), SettingName: to.Ptr(armcompute.SettingNamesAutoLogon), }}, EnableAutomaticUpdates: to.Ptr(true), PatchSettings: &armcompute.PatchSettings{ AssessmentMode: to.Ptr(armcompute.WindowsPatchAssessmentModeImageDefault), AutomaticByPlatformSettings: &armcompute.WindowsVMGuestPatchAutomaticByPlatformSettings{ RebootSetting: to.Ptr(armcompute.WindowsVMGuestPatchAutomaticByPlatformRebootSettingNever), }, EnableHotpatching: to.Ptr(true), PatchMode: to.Ptr(armcompute.WindowsVMGuestPatchModeAutomaticByPlatform), }, ProvisionVMAgent: to.Ptr(true), TimeZone: to.Ptr("aaaaaaaaaaaaaaaa"), WinRM: &armcompute.WinRMConfiguration{ Listeners: []*armcompute.WinRMListener{ { CertificateURL: to.Ptr("aaaaaaaaaaaaaaaaaaaaaa"), Protocol: to.Ptr(armcompute.ProtocolTypesHTTP), }}, }, }, }, ScheduledEventsProfile: &armcompute.ScheduledEventsProfile{ TerminateNotificationProfile: &armcompute.TerminateNotificationProfile{ Enable: to.Ptr(true), NotBeforeTimeout: to.Ptr("PT10M"), }, }, SecurityProfile: &armcompute.SecurityProfile{ EncryptionAtHost: to.Ptr(true), SecurityType: to.Ptr(armcompute.SecurityTypesTrustedLaunch), UefiSettings: &armcompute.UefiSettings{ SecureBootEnabled: to.Ptr(true), VTpmEnabled: to.Ptr(true), }, }, StorageProfile: &armcompute.VirtualMachineScaleSetUpdateStorageProfile{ DataDisks: []*armcompute.VirtualMachineScaleSetDataDisk{ { Name: to.Ptr("aaaaaaaaaaaaaaaaaaaaaaaaaa"), Caching: to.Ptr(armcompute.CachingTypesNone), CreateOption: to.Ptr(armcompute.DiskCreateOptionTypesEmpty), DiskIOPSReadWrite: to.Ptr[int64](28), DiskMBpsReadWrite: to.Ptr[int64](15), DiskSizeGB: to.Ptr[int32](1023), Lun: to.Ptr[int32](26), ManagedDisk: &armcompute.VirtualMachineScaleSetManagedDiskParameters{ DiskEncryptionSet: &armcompute.DiskEncryptionSetParameters{ ID: to.Ptr("aaaaaaaaaaaa"), }, StorageAccountType: to.Ptr(armcompute.StorageAccountTypesStandardLRS), }, WriteAcceleratorEnabled: to.Ptr(true), }}, ImageReference: &armcompute.ImageReference{ ID: to.Ptr("aaaaaaaaaaaaaaaaaaa"), Offer: to.Ptr("WindowsServer"), Publisher: to.Ptr("MicrosoftWindowsServer"), SharedGalleryImageID: to.Ptr("aaaaaa"), SKU: to.Ptr("2016-Datacenter"), Version: to.Ptr("latest"), }, OSDisk: &armcompute.VirtualMachineScaleSetUpdateOSDisk{ Caching: to.Ptr(armcompute.CachingTypesReadWrite), DiffDiskSettings: &armcompute.DiffDiskSettings{ Option: to.Ptr(armcompute.DiffDiskOptionsLocal), Placement: to.Ptr(armcompute.DiffDiskPlacementCacheDisk), }, DiskSizeGB: to.Ptr[int32](6), Image: &armcompute.VirtualHardDisk{ URI: to.Ptr("http://{existing-storage-account-name}.blob.core.windows.net/{existing-container-name}/myDisk.vhd"), }, ManagedDisk: &armcompute.VirtualMachineScaleSetManagedDiskParameters{ DiskEncryptionSet: &armcompute.DiskEncryptionSetParameters{ ID: to.Ptr("aaaaaaaaaaaa"), }, StorageAccountType: to.Ptr(armcompute.StorageAccountTypesStandardLRS), }, VhdContainers: []*string{ to.Ptr("aa")}, WriteAcceleratorEnabled: to.Ptr(true), }, }, UserData: to.Ptr("aaaaaaaaaaaaa"), }, }, SKU: &armcompute.SKU{ Name: to.Ptr("DSv3-Type1"), Capacity: to.Ptr[int64](7), Tier: to.Ptr("aaa"), }, }, &armcompute.VirtualMachineScaleSetsClientBeginUpdateOptions{IfMatch: nil, IfNoneMatch: nil, }) if err != nil { log.Fatalf("failed to finish the request: %v", err) } res, err := poller.PollUntilDone(ctx, nil) if err != nil { log.Fatalf("failed to pull the result: %v", err) } // You could use response here. We use blank identifier for just demo purposes. _ = res // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. // res.VirtualMachineScaleSet = armcompute.VirtualMachineScaleSet{ // Name: to.Ptr("{virtualMachineScaleSetName}"), // Type: to.Ptr("Microsoft.Compute/virtualMachineScaleSets"), // ID: to.Ptr("/subscriptions/{subscription-id}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{virtualMachineScaleSetName}"), // Location: to.Ptr("westus"), // Tags: map[string]*string{ // "key8425": to.Ptr("aaa"), // }, // ExtendedLocation: &armcompute.ExtendedLocation{ // Name: to.Ptr("aaaaaaaaaaaaaaaaaaaaa"), // Type: to.Ptr(armcompute.ExtendedLocationTypesEdgeZone), // }, // Identity: &armcompute.VirtualMachineScaleSetIdentity{ // Type: to.Ptr(armcompute.ResourceIdentityTypeSystemAssigned), // PrincipalID: to.Ptr("aaaaaaaaaaaaaaa"), // TenantID: to.Ptr("aaaaaaaaaaaaaaaa"), // UserAssignedIdentities: map[string]*armcompute.UserAssignedIdentitiesValue{ // "key3951": &armcompute.UserAssignedIdentitiesValue{ // ClientID: to.Ptr("aaaaaaaaaaaaaaaaaaaaaaaaaaa"), // PrincipalID: to.Ptr("aaaa"), // }, // }, // }, // Plan: &armcompute.Plan{ // Name: to.Ptr("aaaaaaaaaa"), // Product: to.Ptr("aaaaaaaaaaaaaaaaaaaa"), // PromotionCode: to.Ptr("aaaaaaaaaaaaaaaaaaaa"), // Publisher: to.Ptr("aaaaaaaaaaaaaaaaaaaaaa"), // }, // Properties: &armcompute.VirtualMachineScaleSetProperties{ // AdditionalCapabilities: &armcompute.AdditionalCapabilities{ // HibernationEnabled: to.Ptr(true), // UltraSSDEnabled: to.Ptr(true), // }, // AutomaticRepairsPolicy: &armcompute.AutomaticRepairsPolicy{ // Enabled: to.Ptr(true), // GracePeriod: to.Ptr("PT30M"), // }, // DoNotRunExtensionsOnOverprovisionedVMs: to.Ptr(true), // HostGroup: &armcompute.SubResource{ // ID: to.Ptr("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/availabilitySets/{availabilitySetName}"), // }, // OrchestrationMode: to.Ptr(armcompute.OrchestrationModeUniform), // Overprovision: to.Ptr(true), // PlatformFaultDomainCount: to.Ptr[int32](1), // ProvisioningState: to.Ptr("Succeeded"), // ProximityPlacementGroup: &armcompute.SubResource{ // ID: to.Ptr("subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/snapshots/mySnapshot"), // }, // ScaleInPolicy: &armcompute.ScaleInPolicy{ // ForceDeletion: to.Ptr(true), // Rules: []*armcompute.VirtualMachineScaleSetScaleInRules{ // to.Ptr(armcompute.VirtualMachineScaleSetScaleInRulesOldestVM)}, // }, // SinglePlacementGroup: to.Ptr(true), // SpotRestorePolicy: &armcompute.SpotRestorePolicy{ // Enabled: to.Ptr(true), // RestoreTimeout: to.Ptr("aaaaaaaaaa"), // }, // UniqueID: to.Ptr("aaaaaaaa"), // UpgradePolicy: &armcompute.UpgradePolicy{ // AutomaticOSUpgradePolicy: &armcompute.AutomaticOSUpgradePolicy{ // DisableAutomaticRollback: to.Ptr(true), // EnableAutomaticOSUpgrade: to.Ptr(true), // OSRollingUpgradeDeferral: to.Ptr(true), // }, // Mode: to.Ptr(armcompute.UpgradeModeManual), // RollingUpgradePolicy: &armcompute.RollingUpgradePolicy{ // EnableCrossZoneUpgrade: to.Ptr(true), // MaxBatchInstancePercent: to.Ptr[int32](49), // MaxSurge: to.Ptr(true), // MaxUnhealthyInstancePercent: to.Ptr[int32](81), // MaxUnhealthyUpgradedInstancePercent: to.Ptr[int32](98), // PauseTimeBetweenBatches: to.Ptr("aaaaaaaaaaaaaaa"), // PrioritizeUnhealthyInstances: to.Ptr(true), // }, // }, // VirtualMachineProfile: &armcompute.VirtualMachineScaleSetVMProfile{ // ApplicationProfile: &armcompute.ApplicationProfile{ // GalleryApplications: []*armcompute.VMGalleryApplication{ // { // ConfigurationReference: to.Ptr("aaaaa"), // Order: to.Ptr[int32](29), // PackageReferenceID: to.Ptr("aaaaaaaaaa"), // Tags: to.Ptr("aaaaaaaaaaa"), // }}, // }, // BillingProfile: &armcompute.BillingProfile{ // MaxPrice: to.Ptr[float64](-1), // }, // CapacityReservation: &armcompute.CapacityReservationProfile{ // CapacityReservationGroup: &armcompute.SubResource{ // ID: to.Ptr("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/availabilitySets/{availabilitySetName}"), // }, // }, // DiagnosticsProfile: &armcompute.DiagnosticsProfile{ // BootDiagnostics: &armcompute.BootDiagnostics{ // Enabled: to.Ptr(true), // StorageURI: to.Ptr("http://{existing-storage-account-name}.blob.core.windows.net"), // }, // }, // EvictionPolicy: to.Ptr(armcompute.VirtualMachineEvictionPolicyTypesDeallocate), // ExtensionProfile: &armcompute.VirtualMachineScaleSetExtensionProfile{ // ExtensionsTimeBudget: to.Ptr("PT1H20M"), // Extensions: []*armcompute.VirtualMachineScaleSetExtension{ // { // ID: to.Ptr("aaaaaaaaaaaaaaaaaaaaaa"), // Name: to.Ptr("{extension-name}"), // Type: to.Ptr("aaaaa"), // Properties: &armcompute.VirtualMachineScaleSetExtensionProperties{ // Type: to.Ptr("{extension-Type}"), // AutoUpgradeMinorVersion: to.Ptr(true), // EnableAutomaticUpgrade: to.Ptr(true), // ForceUpdateTag: to.Ptr("aaaaaaaaa"), // ProtectedSettings: map[string]any{ // }, // ProvisionAfterExtensions: []*string{ // to.Ptr("aa")}, // ProvisioningState: to.Ptr("Succeeded"), // Publisher: to.Ptr("{extension-Publisher}"), // Settings: map[string]any{ // }, // SuppressFailures: to.Ptr(true), // TypeHandlerVersion: to.Ptr("{handler-version}"), // }, // }}, // }, // LicenseType: to.Ptr("aaaaaaaaaaaa"), // NetworkProfile: &armcompute.VirtualMachineScaleSetNetworkProfile{ // HealthProbe: &armcompute.APIEntityReference{ // ID: to.Ptr("/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/disks/disk123"), // }, // NetworkAPIVersion: to.Ptr(armcompute.NetworkAPIVersionTwoThousandTwenty1101), // NetworkInterfaceConfigurations: []*armcompute.VirtualMachineScaleSetNetworkConfiguration{ // { // Name: to.Ptr("aaaaaaaa"), // Properties: &armcompute.VirtualMachineScaleSetNetworkConfigurationProperties{ // DeleteOption: to.Ptr(armcompute.DeleteOptionsDelete), // DNSSettings: &armcompute.VirtualMachineScaleSetNetworkConfigurationDNSSettings{ // DNSServers: []*string{ // to.Ptr("aaaaaaaaaaaa")}, // }, // EnableAcceleratedNetworking: to.Ptr(true), // EnableFpga: to.Ptr(true), // EnableIPForwarding: to.Ptr(true), // IPConfigurations: []*armcompute.VirtualMachineScaleSetIPConfiguration{ // { // Name: to.Ptr("aaaaaaaaaaaaaaaaaaaaaaaaaaaaa"), // Properties: &armcompute.VirtualMachineScaleSetIPConfigurationProperties{ // ApplicationGatewayBackendAddressPools: []*armcompute.SubResource{ // { // ID: to.Ptr("subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/snapshots/mySnapshot"), // }}, // ApplicationSecurityGroups: []*armcompute.SubResource{ // { // ID: to.Ptr("subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/snapshots/mySnapshot"), // }}, // LoadBalancerBackendAddressPools: []*armcompute.SubResource{ // { // ID: to.Ptr("subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/snapshots/mySnapshot"), // }}, // LoadBalancerInboundNatPools: []*armcompute.SubResource{ // { // ID: to.Ptr("subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/snapshots/mySnapshot"), // }}, // Primary: to.Ptr(true), // PrivateIPAddressVersion: to.Ptr(armcompute.IPVersionIPv4), // PublicIPAddressConfiguration: &armcompute.VirtualMachineScaleSetPublicIPAddressConfiguration{ // Name: to.Ptr("a"), // Properties: &armcompute.VirtualMachineScaleSetPublicIPAddressConfigurationProperties{ // DeleteOption: to.Ptr(armcompute.DeleteOptionsDelete), // DNSSettings: &armcompute.VirtualMachineScaleSetPublicIPAddressConfigurationDNSSettings{ // DomainNameLabel: to.Ptr("aaaaaaaaaaaaaaaaaa"), // }, // IdleTimeoutInMinutes: to.Ptr[int32](3), // IPTags: []*armcompute.VirtualMachineScaleSetIPTag{ // { // IPTagType: to.Ptr("aaaaaaa"), // Tag: to.Ptr("aaaaaaaaaaaaaaaaaaaaaaaaaaa"), // }}, // PublicIPAddressVersion: to.Ptr(armcompute.IPVersionIPv4), // PublicIPPrefix: &armcompute.SubResource{ // ID: to.Ptr("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/availabilitySets/{availabilitySetName}"), // }, // }, // SKU: &armcompute.PublicIPAddressSKU{ // Name: to.Ptr(armcompute.PublicIPAddressSKUNameBasic), // Tier: to.Ptr(armcompute.PublicIPAddressSKUTierRegional), // }, // }, // Subnet: &armcompute.APIEntityReference{ // ID: to.Ptr("/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/disks/disk123"), // }, // }, // }}, // NetworkSecurityGroup: &armcompute.SubResource{ // ID: to.Ptr("subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/snapshots/mySnapshot"), // }, // Primary: to.Ptr(true), // }, // }}, // }, // OSProfile: &armcompute.VirtualMachineScaleSetOSProfile{ // AdminUsername: to.Ptr("{your-username}"), // ComputerNamePrefix: to.Ptr("{vmss-name}"), // CustomData: to.Ptr("aaaaaaaaaaaaaaaaaaaaaaaaaa"), // LinuxConfiguration: &armcompute.LinuxConfiguration{ // DisablePasswordAuthentication: to.Ptr(true), // PatchSettings: &armcompute.LinuxPatchSettings{ // AssessmentMode: to.Ptr(armcompute.LinuxPatchAssessmentModeImageDefault), // PatchMode: to.Ptr(armcompute.LinuxVMGuestPatchModeImageDefault), // }, // ProvisionVMAgent: to.Ptr(true), // SSH: &armcompute.SSHConfiguration{ // PublicKeys: []*armcompute.SSHPublicKey{ // { // Path: to.Ptr("/home/{your-username}/.ssh/authorized_keys"), // KeyData: to.Ptr("ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQCeClRAk2ipUs/l5voIsDC5q9RI+YSRd1Bvd/O+axgY4WiBzG+4FwJWZm/mLLe5DoOdHQwmU2FrKXZSW4w2sYE70KeWnrFViCOX5MTVvJgPE8ClugNl8RWth/tU849DvM9sT7vFgfVSHcAS2yDRyDlueii+8nF2ym8XWAPltFVCyLHRsyBp5YPqK8JFYIa1eybKsY3hEAxRCA+/7bq8et+Gj3coOsuRmrehav7rE6N12Pb80I6ofa6SM5XNYq4Xk0iYNx7R3kdz0Jj9XgZYWjAHjJmT0gTRoOnt6upOuxK7xI/ykWrllgpXrCPu3Ymz+c+ujaqcxDopnAl2lmf69/J1"), // }}, // }, // }, // Secrets: []*armcompute.VaultSecretGroup{ // { // SourceVault: &armcompute.SubResource{ // ID: to.Ptr("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/availabilitySets/{availabilitySetName}"), // }, // VaultCertificates: []*armcompute.VaultCertificate{ // { // CertificateStore: to.Ptr("aaaaaaaaaaaaaaaaaaaaaaaaa"), // CertificateURL: to.Ptr("aaaaaaa"), // }}, // }}, // WindowsConfiguration: &armcompute.WindowsConfiguration{ // AdditionalUnattendContent: []*armcompute.AdditionalUnattendContent{ // { // ComponentName: to.Ptr("Microsoft-Windows-Shell-Setup"), // Content: to.Ptr("aaaaaaaaaaaaaaaaaaaa"), // PassName: to.Ptr("OobeSystem"), // SettingName: to.Ptr(armcompute.SettingNamesAutoLogon), // }}, // EnableAutomaticUpdates: to.Ptr(true), // PatchSettings: &armcompute.PatchSettings{ // AssessmentMode: to.Ptr(armcompute.WindowsPatchAssessmentModeImageDefault), // AutomaticByPlatformSettings: &armcompute.WindowsVMGuestPatchAutomaticByPlatformSettings{ // RebootSetting: to.Ptr(armcompute.WindowsVMGuestPatchAutomaticByPlatformRebootSettingNever), // }, // EnableHotpatching: to.Ptr(true), // PatchMode: to.Ptr(armcompute.WindowsVMGuestPatchModeAutomaticByPlatform), // }, // ProvisionVMAgent: to.Ptr(true), // TimeZone: to.Ptr("aaaaaaaaaaaaaaaa"), // WinRM: &armcompute.WinRMConfiguration{ // Listeners: []*armcompute.WinRMListener{ // { // CertificateURL: to.Ptr("aaaaaaaaaaaaaaaaaaaaaa"), // Protocol: to.Ptr(armcompute.ProtocolTypesHTTP), // }}, // }, // }, // }, // Priority: to.Ptr(armcompute.VirtualMachinePriorityTypesRegular), // ScheduledEventsProfile: &armcompute.ScheduledEventsProfile{ // TerminateNotificationProfile: &armcompute.TerminateNotificationProfile{ // Enable: to.Ptr(true), // NotBeforeTimeout: to.Ptr("PT10M"), // }, // }, // SecurityProfile: &armcompute.SecurityProfile{ // EncryptionAtHost: to.Ptr(true), // SecurityType: to.Ptr(armcompute.SecurityTypesTrustedLaunch), // UefiSettings: &armcompute.UefiSettings{ // SecureBootEnabled: to.Ptr(true), // VTpmEnabled: to.Ptr(true), // }, // }, // StorageProfile: &armcompute.VirtualMachineScaleSetStorageProfile{ // DataDisks: []*armcompute.VirtualMachineScaleSetDataDisk{ // { // Name: to.Ptr("aaaaaaaaaaaaaaaaaaaaaaaaaa"), // Caching: to.Ptr(armcompute.CachingTypesNone), // CreateOption: to.Ptr(armcompute.DiskCreateOptionTypesEmpty), // DiskIOPSReadWrite: to.Ptr[int64](28), // DiskMBpsReadWrite: to.Ptr[int64](15), // DiskSizeGB: to.Ptr[int32](1023), // Lun: to.Ptr[int32](26), // ManagedDisk: &armcompute.VirtualMachineScaleSetManagedDiskParameters{ // DiskEncryptionSet: &armcompute.DiskEncryptionSetParameters{ // ID: to.Ptr("aaaaaaaaaaaa"), // }, // StorageAccountType: to.Ptr(armcompute.StorageAccountTypesStandardLRS), // }, // WriteAcceleratorEnabled: to.Ptr(true), // }}, // ImageReference: &armcompute.ImageReference{ // ID: to.Ptr("aaaaaaaaaaaaaaaaaaa"), // ExactVersion: to.Ptr("aaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"), // Offer: to.Ptr("WindowsServer"), // Publisher: to.Ptr("MicrosoftWindowsServer"), // SharedGalleryImageID: to.Ptr("aaaaaa"), // SKU: to.Ptr("2016-Datacenter"), // Version: to.Ptr("latest"), // }, // OSDisk: &armcompute.VirtualMachineScaleSetOSDisk{ // Name: to.Ptr("aaaaaaaaaaaaaaa"), // Caching: to.Ptr(armcompute.CachingTypesReadWrite), // CreateOption: to.Ptr(armcompute.DiskCreateOptionTypesFromImage), // DiffDiskSettings: &armcompute.DiffDiskSettings{ // Option: to.Ptr(armcompute.DiffDiskOptionsLocal), // Placement: to.Ptr(armcompute.DiffDiskPlacementCacheDisk), // }, // DiskSizeGB: to.Ptr[int32](6), // Image: &armcompute.VirtualHardDisk{ // URI: to.Ptr("http://{existing-storage-account-name}.blob.core.windows.net/{existing-container-name}/myDisk.vhd"), // }, // ManagedDisk: &armcompute.VirtualMachineScaleSetManagedDiskParameters{ // DiskEncryptionSet: &armcompute.DiskEncryptionSetParameters{ // ID: to.Ptr("aaaaaaaaaaaa"), // }, // StorageAccountType: to.Ptr(armcompute.StorageAccountTypesStandardLRS), // }, // OSType: to.Ptr(armcompute.OperatingSystemTypesWindows), // VhdContainers: []*string{ // to.Ptr("aa")}, // WriteAcceleratorEnabled: to.Ptr(true), // }, // }, // UserData: to.Ptr("aaaaaaaaaaaaa"), // }, // ZoneBalance: to.Ptr(true), // }, // SKU: &armcompute.SKU{ // Name: to.Ptr("Standard_D1_v2"), // Capacity: to.Ptr[int64](3), // Tier: to.Ptr("Standard"), // }, // Zones: []*string{ // to.Ptr("aaaaaaaaaaaaaaaaaaaa")}, // }
Output:
Example (VirtualMachineScaleSetUpdateMinimumSetGen) ¶
Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/92de53a5f1e0e03c94b40475d2135d97148ed014/specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-03-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSet_Update_MinimumSet_Gen.json
cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() clientFactory, err := armcompute.NewClientFactory("<subscription-id>", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } poller, err := clientFactory.NewVirtualMachineScaleSetsClient().BeginUpdate(ctx, "rgcompute", "aaaaaaaaaaaaaa", armcompute.VirtualMachineScaleSetUpdate{}, &armcompute.VirtualMachineScaleSetsClientBeginUpdateOptions{IfMatch: nil, IfNoneMatch: nil, }) if err != nil { log.Fatalf("failed to finish the request: %v", err) } res, err := poller.PollUntilDone(ctx, nil) if err != nil { log.Fatalf("failed to pull the result: %v", err) } // You could use response here. We use blank identifier for just demo purposes. _ = res // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. // res.VirtualMachineScaleSet = armcompute.VirtualMachineScaleSet{ // Location: to.Ptr("westus"), // }
Output:
func (*VirtualMachineScaleSetsClient) BeginUpdateInstances ¶
func (client *VirtualMachineScaleSetsClient) BeginUpdateInstances(ctx context.Context, resourceGroupName string, vmScaleSetName string, vmInstanceIDs VirtualMachineScaleSetVMInstanceRequiredIDs, options *VirtualMachineScaleSetsClientBeginUpdateInstancesOptions) (*runtime.Poller[VirtualMachineScaleSetsClientUpdateInstancesResponse], error)
BeginUpdateInstances - Upgrades one or more virtual machines to the latest SKU set in the VM scale set model. If the operation fails it returns an *azcore.ResponseError type.
Generated from API version 2024-03-01
- resourceGroupName - The name of the resource group.
- vmScaleSetName - The name of the VM scale set.
- vmInstanceIDs - A list of virtual machine instance IDs from the VM scale set.
- options - VirtualMachineScaleSetsClientBeginUpdateInstancesOptions contains the optional parameters for the VirtualMachineScaleSetsClient.BeginUpdateInstances method.
Example (VirtualMachineScaleSetUpdateInstancesMaximumSetGen) ¶
Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/92de53a5f1e0e03c94b40475d2135d97148ed014/specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-03-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSet_UpdateInstances_MaximumSet_Gen.json
cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() clientFactory, err := armcompute.NewClientFactory("<subscription-id>", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } poller, err := clientFactory.NewVirtualMachineScaleSetsClient().BeginUpdateInstances(ctx, "rgcompute", "aaaaaaaaaaaaaaaaaaaaaaaa", armcompute.VirtualMachineScaleSetVMInstanceRequiredIDs{ InstanceIDs: []*string{ to.Ptr("aaaaaaaaaaaaaaaaaaaaaaaaa")}, }, nil) if err != nil { log.Fatalf("failed to finish the request: %v", err) } _, err = poller.PollUntilDone(ctx, nil) if err != nil { log.Fatalf("failed to pull the result: %v", err) }
Output:
Example (VirtualMachineScaleSetUpdateInstancesMinimumSetGen) ¶
Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/92de53a5f1e0e03c94b40475d2135d97148ed014/specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-03-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSet_UpdateInstances_MinimumSet_Gen.json
cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() clientFactory, err := armcompute.NewClientFactory("<subscription-id>", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } poller, err := clientFactory.NewVirtualMachineScaleSetsClient().BeginUpdateInstances(ctx, "rgcompute", "aaaaaaaaaaaaaaaaaaaaaaaaaaaaa", armcompute.VirtualMachineScaleSetVMInstanceRequiredIDs{ InstanceIDs: []*string{ to.Ptr("aaaaaaaaaaaaaaaaaaaaaaaaa")}, }, nil) if err != nil { log.Fatalf("failed to finish the request: %v", err) } _, err = poller.PollUntilDone(ctx, nil) if err != nil { log.Fatalf("failed to pull the result: %v", err) }
Output:
func (*VirtualMachineScaleSetsClient) ConvertToSinglePlacementGroup ¶
func (client *VirtualMachineScaleSetsClient) ConvertToSinglePlacementGroup(ctx context.Context, resourceGroupName string, vmScaleSetName string, parameters VMScaleSetConvertToSinglePlacementGroupInput, options *VirtualMachineScaleSetsClientConvertToSinglePlacementGroupOptions) (VirtualMachineScaleSetsClientConvertToSinglePlacementGroupResponse, error)
ConvertToSinglePlacementGroup - Converts SinglePlacementGroup property to false for a existing virtual machine scale set. If the operation fails it returns an *azcore.ResponseError type.
Generated from API version 2024-03-01
- resourceGroupName - The name of the resource group.
- vmScaleSetName - The name of the virtual machine scale set to create or update.
- parameters - The input object for ConvertToSinglePlacementGroup API.
- options - VirtualMachineScaleSetsClientConvertToSinglePlacementGroupOptions contains the optional parameters for the VirtualMachineScaleSetsClient.ConvertToSinglePlacementGroup method.
Example (VirtualMachineScaleSetConvertToSinglePlacementGroupMaximumSetGen) ¶
Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/92de53a5f1e0e03c94b40475d2135d97148ed014/specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-03-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSet_ConvertToSinglePlacementGroup_MaximumSet_Gen.json
cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() clientFactory, err := armcompute.NewClientFactory("<subscription-id>", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } _, err = clientFactory.NewVirtualMachineScaleSetsClient().ConvertToSinglePlacementGroup(ctx, "rgcompute", "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", armcompute.VMScaleSetConvertToSinglePlacementGroupInput{ ActivePlacementGroupID: to.Ptr("aaaaaaaaaaaaaaaaaaaaaaaaaaa"), }, nil) if err != nil { log.Fatalf("failed to finish the request: %v", err) }
Output:
Example (VirtualMachineScaleSetConvertToSinglePlacementGroupMinimumSetGen) ¶
Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/92de53a5f1e0e03c94b40475d2135d97148ed014/specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-03-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSet_ConvertToSinglePlacementGroup_MinimumSet_Gen.json
cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() clientFactory, err := armcompute.NewClientFactory("<subscription-id>", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } _, err = clientFactory.NewVirtualMachineScaleSetsClient().ConvertToSinglePlacementGroup(ctx, "rgcompute", "aaaaaaaaaaaaa", armcompute.VMScaleSetConvertToSinglePlacementGroupInput{}, nil) if err != nil { log.Fatalf("failed to finish the request: %v", err) }
Output:
func (*VirtualMachineScaleSetsClient) ForceRecoveryServiceFabricPlatformUpdateDomainWalk ¶
func (client *VirtualMachineScaleSetsClient) ForceRecoveryServiceFabricPlatformUpdateDomainWalk(ctx context.Context, resourceGroupName string, vmScaleSetName string, platformUpdateDomain int32, options *VirtualMachineScaleSetsClientForceRecoveryServiceFabricPlatformUpdateDomainWalkOptions) (VirtualMachineScaleSetsClientForceRecoveryServiceFabricPlatformUpdateDomainWalkResponse, error)
ForceRecoveryServiceFabricPlatformUpdateDomainWalk - Manual platform update domain walk to update virtual machines in a service fabric virtual machine scale set. If the operation fails it returns an *azcore.ResponseError type.
Generated from API version 2024-03-01
- resourceGroupName - The name of the resource group.
- vmScaleSetName - The name of the VM scale set.
- platformUpdateDomain - The platform update domain for which a manual recovery walk is requested
- options - VirtualMachineScaleSetsClientForceRecoveryServiceFabricPlatformUpdateDomainWalkOptions contains the optional parameters for the VirtualMachineScaleSetsClient.ForceRecoveryServiceFabricPlatformUpdateDomainWalk method.
Example (VirtualMachineScaleSetForceRecoveryServiceFabricPlatformUpdateDomainWalkMaximumSetGen) ¶
Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/92de53a5f1e0e03c94b40475d2135d97148ed014/specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-03-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSet_ForceRecoveryServiceFabricPlatformUpdateDomainWalk_MaximumSet_Gen.json
cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() clientFactory, err := armcompute.NewClientFactory("<subscription-id>", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } res, err := clientFactory.NewVirtualMachineScaleSetsClient().ForceRecoveryServiceFabricPlatformUpdateDomainWalk(ctx, "rgcompute", "aaaaaaaaaaaaaaaa", 30, &armcompute.VirtualMachineScaleSetsClientForceRecoveryServiceFabricPlatformUpdateDomainWalkOptions{Zone: nil, PlacementGroupID: nil, }) if err != nil { log.Fatalf("failed to finish the request: %v", err) } // You could use response here. We use blank identifier for just demo purposes. _ = res // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. // res.RecoveryWalkResponse = armcompute.RecoveryWalkResponse{ // NextPlatformUpdateDomain: to.Ptr[int32](7), // WalkPerformed: to.Ptr(true), // }
Output:
Example (VirtualMachineScaleSetForceRecoveryServiceFabricPlatformUpdateDomainWalkMinimumSetGen) ¶
Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/92de53a5f1e0e03c94b40475d2135d97148ed014/specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-03-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSet_ForceRecoveryServiceFabricPlatformUpdateDomainWalk_MinimumSet_Gen.json
cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() clientFactory, err := armcompute.NewClientFactory("<subscription-id>", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } res, err := clientFactory.NewVirtualMachineScaleSetsClient().ForceRecoveryServiceFabricPlatformUpdateDomainWalk(ctx, "rgcompute", "aaaaaaaaaaaa", 9, &armcompute.VirtualMachineScaleSetsClientForceRecoveryServiceFabricPlatformUpdateDomainWalkOptions{Zone: nil, PlacementGroupID: nil, }) if err != nil { log.Fatalf("failed to finish the request: %v", err) } // You could use response here. We use blank identifier for just demo purposes. _ = res // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. // res.RecoveryWalkResponse = armcompute.RecoveryWalkResponse{ // }
Output:
func (*VirtualMachineScaleSetsClient) Get ¶
func (client *VirtualMachineScaleSetsClient) Get(ctx context.Context, resourceGroupName string, vmScaleSetName string, options *VirtualMachineScaleSetsClientGetOptions) (VirtualMachineScaleSetsClientGetResponse, error)
Get - Display information about a virtual machine scale set. If the operation fails it returns an *azcore.ResponseError type.
Generated from API version 2024-03-01
- resourceGroupName - The name of the resource group.
- vmScaleSetName - The name of the VM scale set.
- options - VirtualMachineScaleSetsClientGetOptions contains the optional parameters for the VirtualMachineScaleSetsClient.Get method.
Example (GetAVirtualMachineScaleSet) ¶
Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/92de53a5f1e0e03c94b40475d2135d97148ed014/specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-03-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSet_Get.json
cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() clientFactory, err := armcompute.NewClientFactory("<subscription-id>", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } res, err := clientFactory.NewVirtualMachineScaleSetsClient().Get(ctx, "myResourceGroup", "myVirtualMachineScaleSet", &armcompute.VirtualMachineScaleSetsClientGetOptions{Expand: nil}) if err != nil { log.Fatalf("failed to finish the request: %v", err) } // You could use response here. We use blank identifier for just demo purposes. _ = res // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. // res.VirtualMachineScaleSet = armcompute.VirtualMachineScaleSet{ // Name: to.Ptr("myVirtualMachineScaleSet"), // Type: to.Ptr("Microsoft.Compute/virtualMachineScaleSets"), // ID: to.Ptr("/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/virtualMachineScaleSets/myVirtualMachineScaleSet"), // Location: to.Ptr("westus"), // Tags: map[string]*string{ // "myTag1": to.Ptr("tagValue1"), // }, // Etag: to.Ptr("\"1\""), // Properties: &armcompute.VirtualMachineScaleSetProperties{ // DoNotRunExtensionsOnOverprovisionedVMs: to.Ptr(false), // HostGroup: &armcompute.SubResource{ // ID: to.Ptr("/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/hostGroups/myHostGroup"), // }, // Overprovision: to.Ptr(false), // PlatformFaultDomainCount: to.Ptr[int32](1), // ProvisioningState: to.Ptr("Succeeded"), // SinglePlacementGroup: to.Ptr(false), // TimeCreated: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-06-27T01:02:38.313Z"); return t}()), // UpgradePolicy: &armcompute.UpgradePolicy{ // AutomaticOSUpgradePolicy: &armcompute.AutomaticOSUpgradePolicy{ // EnableAutomaticOSUpgrade: to.Ptr(false), // }, // Mode: to.Ptr(armcompute.UpgradeModeAutomatic), // }, // VirtualMachineProfile: &armcompute.VirtualMachineScaleSetVMProfile{ // ApplicationProfile: &armcompute.ApplicationProfile{ // GalleryApplications: []*armcompute.VMGalleryApplication{ // { // ConfigurationReference: to.Ptr("https://mystorageaccount.blob.core.windows.net/configurations/settings.config"), // Order: to.Ptr[int32](1), // PackageReferenceID: to.Ptr("/subscriptions/32c17a9e-aa7b-4ba5-a45b-e324116b6fdb/resourceGroups/myresourceGroupName2/providers/Microsoft.Compute/galleries/myGallery1/applications/MyApplication1/versions/1.0"), // Tags: to.Ptr("myTag1"), // }, // { // PackageReferenceID: to.Ptr("/subscriptions/32c17a9e-aa7b-4ba5-a45b-e324116b6fdg/resourceGroups/myresourceGroupName3/providers/Microsoft.Compute/galleries/myGallery2/applications/MyApplication2/versions/1.1"), // }}, // }, // NetworkProfile: &armcompute.VirtualMachineScaleSetNetworkProfile{ // NetworkInterfaceConfigurations: []*armcompute.VirtualMachineScaleSetNetworkConfiguration{ // { // Name: to.Ptr("myNic"), // Properties: &armcompute.VirtualMachineScaleSetNetworkConfigurationProperties{ // IPConfigurations: []*armcompute.VirtualMachineScaleSetIPConfiguration{ // { // Name: to.Ptr("myIPConfig"), // Properties: &armcompute.VirtualMachineScaleSetIPConfigurationProperties{ // Primary: to.Ptr(true), // Subnet: &armcompute.APIEntityReference{ // ID: to.Ptr("/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/virtualNetworks/myVNet/subnets/mySubnet"), // }, // }, // }}, // NetworkSecurityGroup: &armcompute.SubResource{ // ID: to.Ptr("/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/networkSecurityGroups/myNetworkSecurityGroup"), // }, // Primary: to.Ptr(true), // }, // }}, // }, // OSProfile: &armcompute.VirtualMachineScaleSetOSProfile{ // AdminUsername: to.Ptr("admin"), // ComputerNamePrefix: to.Ptr("myVirtualMachineScaleSet"), // LinuxConfiguration: &armcompute.LinuxConfiguration{ // DisablePasswordAuthentication: to.Ptr(false), // }, // }, // StorageProfile: &armcompute.VirtualMachineScaleSetStorageProfile{ // DataDisks: []*armcompute.VirtualMachineScaleSetDataDisk{ // }, // ImageReference: &armcompute.ImageReference{ // Offer: to.Ptr("databricks"), // Publisher: to.Ptr("azuredatabricks"), // SKU: to.Ptr("databricksworker"), // Version: to.Ptr("3.15.2"), // }, // OSDisk: &armcompute.VirtualMachineScaleSetOSDisk{ // Caching: to.Ptr(armcompute.CachingTypesReadWrite), // CreateOption: to.Ptr(armcompute.DiskCreateOptionTypesFromImage), // DiskSizeGB: to.Ptr[int32](30), // ManagedDisk: &armcompute.VirtualMachineScaleSetManagedDiskParameters{ // StorageAccountType: to.Ptr(armcompute.StorageAccountTypesPremiumLRS), // }, // }, // }, // TimeCreated: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-09-27T01:03:40.313Z"); return t}()), // UserData: to.Ptr("RXhhbXBsZSBVc2VyRGF0YQ=="), // }, // }, // SKU: &armcompute.SKU{ // Name: to.Ptr("Standard_D2s_v3"), // Capacity: to.Ptr[int64](4), // Tier: to.Ptr("Standard"), // }, // }
Output:
Example (GetAVirtualMachineScaleSetPlacedOnADedicatedHostGroupThroughAutomaticPlacement) ¶
Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/92de53a5f1e0e03c94b40475d2135d97148ed014/specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-03-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSet_Get_AutoPlacedOnDedicatedHostGroup.json
cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() clientFactory, err := armcompute.NewClientFactory("<subscription-id>", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } res, err := clientFactory.NewVirtualMachineScaleSetsClient().Get(ctx, "myResourceGroup", "myVirtualMachineScaleSet", &armcompute.VirtualMachineScaleSetsClientGetOptions{Expand: nil}) if err != nil { log.Fatalf("failed to finish the request: %v", err) } // You could use response here. We use blank identifier for just demo purposes. _ = res // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. // res.VirtualMachineScaleSet = armcompute.VirtualMachineScaleSet{ // Name: to.Ptr("myVirtualMachineScaleSet"), // Type: to.Ptr("Microsoft.Compute/virtualMachineScaleSets"), // ID: to.Ptr("/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/virtualMachineScaleSets/myVirtualMachineScaleSet"), // Location: to.Ptr("West US"), // Tags: map[string]*string{ // "myTag1": to.Ptr("tagValue1"), // }, // Properties: &armcompute.VirtualMachineScaleSetProperties{ // DoNotRunExtensionsOnOverprovisionedVMs: to.Ptr(false), // HostGroup: &armcompute.SubResource{ // ID: to.Ptr("/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/hostGroups/myHostGroup"), // }, // Overprovision: to.Ptr(false), // PlatformFaultDomainCount: to.Ptr[int32](1), // ProvisioningState: to.Ptr("Succeeded"), // SinglePlacementGroup: to.Ptr(false), // UpgradePolicy: &armcompute.UpgradePolicy{ // AutomaticOSUpgradePolicy: &armcompute.AutomaticOSUpgradePolicy{ // EnableAutomaticOSUpgrade: to.Ptr(false), // }, // Mode: to.Ptr(armcompute.UpgradeModeAutomatic), // }, // VirtualMachineProfile: &armcompute.VirtualMachineScaleSetVMProfile{ // NetworkProfile: &armcompute.VirtualMachineScaleSetNetworkProfile{ // NetworkInterfaceConfigurations: []*armcompute.VirtualMachineScaleSetNetworkConfiguration{ // { // Name: to.Ptr("myNic"), // Properties: &armcompute.VirtualMachineScaleSetNetworkConfigurationProperties{ // IPConfigurations: []*armcompute.VirtualMachineScaleSetIPConfiguration{ // { // Name: to.Ptr("myIPConfig"), // Properties: &armcompute.VirtualMachineScaleSetIPConfigurationProperties{ // Primary: to.Ptr(true), // Subnet: &armcompute.APIEntityReference{ // ID: to.Ptr("/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/virtualNetworks/myVNet/subnets/mySubnet"), // }, // }, // }}, // NetworkSecurityGroup: &armcompute.SubResource{ // ID: to.Ptr("/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/networkSecurityGroups/myNetworkSecurityGroup"), // }, // Primary: to.Ptr(true), // }, // }}, // }, // OSProfile: &armcompute.VirtualMachineScaleSetOSProfile{ // AdminUsername: to.Ptr("admin"), // ComputerNamePrefix: to.Ptr("myVirtualMachineScaleSet"), // LinuxConfiguration: &armcompute.LinuxConfiguration{ // DisablePasswordAuthentication: to.Ptr(false), // }, // }, // StorageProfile: &armcompute.VirtualMachineScaleSetStorageProfile{ // DataDisks: []*armcompute.VirtualMachineScaleSetDataDisk{ // }, // ImageReference: &armcompute.ImageReference{ // Offer: to.Ptr("databricks"), // Publisher: to.Ptr("azuredatabricks"), // SKU: to.Ptr("databricksworker"), // Version: to.Ptr("3.15.2"), // }, // OSDisk: &armcompute.VirtualMachineScaleSetOSDisk{ // Caching: to.Ptr(armcompute.CachingTypesReadWrite), // CreateOption: to.Ptr(armcompute.DiskCreateOptionTypesFromImage), // DiskSizeGB: to.Ptr[int32](30), // ManagedDisk: &armcompute.VirtualMachineScaleSetManagedDiskParameters{ // StorageAccountType: to.Ptr(armcompute.StorageAccountTypesPremiumLRS), // }, // }, // }, // }, // }, // SKU: &armcompute.SKU{ // Name: to.Ptr("Standard_D2s_v3"), // Capacity: to.Ptr[int64](4), // Tier: to.Ptr("Standard"), // }, // }
Output:
Example (GetAVirtualMachineScaleSetWithUserData) ¶
Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/92de53a5f1e0e03c94b40475d2135d97148ed014/specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-03-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSet_Get_WithUserData.json
cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() clientFactory, err := armcompute.NewClientFactory("<subscription-id>", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } res, err := clientFactory.NewVirtualMachineScaleSetsClient().Get(ctx, "myResourceGroup", "myVirtualMachineScaleSet", &armcompute.VirtualMachineScaleSetsClientGetOptions{Expand: to.Ptr(armcompute.ExpandTypesForGetVMScaleSetsUserData)}) if err != nil { log.Fatalf("failed to finish the request: %v", err) } // You could use response here. We use blank identifier for just demo purposes. _ = res // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. // res.VirtualMachineScaleSet = armcompute.VirtualMachineScaleSet{ // Name: to.Ptr("myVirtualMachineScaleSet"), // Type: to.Ptr("Microsoft.Compute/virtualMachineScaleSets"), // ID: to.Ptr("/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/virtualMachineScaleSets/myVirtualMachineScaleSet"), // Location: to.Ptr("westus"), // Tags: map[string]*string{ // "myTag1": to.Ptr("tagValue1"), // }, // Properties: &armcompute.VirtualMachineScaleSetProperties{ // DoNotRunExtensionsOnOverprovisionedVMs: to.Ptr(false), // HostGroup: &armcompute.SubResource{ // ID: to.Ptr("/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/hostGroups/myHostGroup"), // }, // Overprovision: to.Ptr(false), // PlatformFaultDomainCount: to.Ptr[int32](1), // ProvisioningState: to.Ptr("Succeeded"), // SinglePlacementGroup: to.Ptr(false), // UpgradePolicy: &armcompute.UpgradePolicy{ // AutomaticOSUpgradePolicy: &armcompute.AutomaticOSUpgradePolicy{ // EnableAutomaticOSUpgrade: to.Ptr(false), // }, // Mode: to.Ptr(armcompute.UpgradeModeAutomatic), // }, // VirtualMachineProfile: &armcompute.VirtualMachineScaleSetVMProfile{ // ApplicationProfile: &armcompute.ApplicationProfile{ // GalleryApplications: []*armcompute.VMGalleryApplication{ // { // ConfigurationReference: to.Ptr("https://mystorageaccount.blob.core.windows.net/configurations/settings.config"), // Order: to.Ptr[int32](1), // PackageReferenceID: to.Ptr("/subscriptions/32c17a9e-aa7b-4ba5-a45b-e324116b6fdb/resourceGroups/myresourceGroupName2/providers/Microsoft.Compute/galleries/myGallery1/applications/MyApplication1/versions/1.0"), // Tags: to.Ptr("myTag1"), // }, // { // PackageReferenceID: to.Ptr("/subscriptions/32c17a9e-aa7b-4ba5-a45b-e324116b6fdg/resourceGroups/myresourceGroupName3/providers/Microsoft.Compute/galleries/myGallery2/applications/MyApplication2/versions/1.1"), // }}, // }, // NetworkProfile: &armcompute.VirtualMachineScaleSetNetworkProfile{ // NetworkInterfaceConfigurations: []*armcompute.VirtualMachineScaleSetNetworkConfiguration{ // { // Name: to.Ptr("myNic"), // Properties: &armcompute.VirtualMachineScaleSetNetworkConfigurationProperties{ // IPConfigurations: []*armcompute.VirtualMachineScaleSetIPConfiguration{ // { // Name: to.Ptr("myIPConfig"), // Properties: &armcompute.VirtualMachineScaleSetIPConfigurationProperties{ // Primary: to.Ptr(true), // Subnet: &armcompute.APIEntityReference{ // ID: to.Ptr("/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/virtualNetworks/myVNet/subnets/mySubnet"), // }, // }, // }}, // NetworkSecurityGroup: &armcompute.SubResource{ // ID: to.Ptr("/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/networkSecurityGroups/myNetworkSecurityGroup"), // }, // Primary: to.Ptr(true), // }, // }}, // }, // OSProfile: &armcompute.VirtualMachineScaleSetOSProfile{ // AdminUsername: to.Ptr("admin"), // ComputerNamePrefix: to.Ptr("myVirtualMachineScaleSet"), // LinuxConfiguration: &armcompute.LinuxConfiguration{ // DisablePasswordAuthentication: to.Ptr(false), // }, // }, // StorageProfile: &armcompute.VirtualMachineScaleSetStorageProfile{ // DataDisks: []*armcompute.VirtualMachineScaleSetDataDisk{ // }, // ImageReference: &armcompute.ImageReference{ // Offer: to.Ptr("databricks"), // Publisher: to.Ptr("azuredatabricks"), // SKU: to.Ptr("databricksworker"), // Version: to.Ptr("3.15.2"), // }, // OSDisk: &armcompute.VirtualMachineScaleSetOSDisk{ // Caching: to.Ptr(armcompute.CachingTypesReadWrite), // CreateOption: to.Ptr(armcompute.DiskCreateOptionTypesFromImage), // DiskSizeGB: to.Ptr[int32](30), // ManagedDisk: &armcompute.VirtualMachineScaleSetManagedDiskParameters{ // StorageAccountType: to.Ptr(armcompute.StorageAccountTypesPremiumLRS), // }, // }, // }, // UserData: to.Ptr("RXhhbXBsZSBVc2VyRGF0YQ=="), // }, // }, // SKU: &armcompute.SKU{ // Name: to.Ptr("Standard_D2s_v3"), // Capacity: to.Ptr[int64](4), // Tier: to.Ptr("Standard"), // }, // }
Output:
Example (GetVmScaleSetVmWithDiskControllerType) ¶
Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/92de53a5f1e0e03c94b40475d2135d97148ed014/specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-03-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSet_Get_WithDiskControllerType.json
cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() clientFactory, err := armcompute.NewClientFactory("<subscription-id>", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } res, err := clientFactory.NewVirtualMachineScaleSetsClient().Get(ctx, "myResourceGroup", "myVirtualMachineScaleSet", &armcompute.VirtualMachineScaleSetsClientGetOptions{Expand: to.Ptr(armcompute.ExpandTypesForGetVMScaleSetsUserData)}) if err != nil { log.Fatalf("failed to finish the request: %v", err) } // You could use response here. We use blank identifier for just demo purposes. _ = res // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. // res.VirtualMachineScaleSet = armcompute.VirtualMachineScaleSet{ // Name: to.Ptr("myVirtualMachineScaleSet"), // Type: to.Ptr("Microsoft.Compute/virtualMachineScaleSets"), // ID: to.Ptr("/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/virtualMachineScaleSets/myVirtualMachineScaleSet"), // Location: to.Ptr("westus"), // Tags: map[string]*string{ // "myTag1": to.Ptr("tagValue1"), // }, // Properties: &armcompute.VirtualMachineScaleSetProperties{ // DoNotRunExtensionsOnOverprovisionedVMs: to.Ptr(false), // HostGroup: &armcompute.SubResource{ // ID: to.Ptr("/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/hostGroups/myHostGroup"), // }, // Overprovision: to.Ptr(false), // PlatformFaultDomainCount: to.Ptr[int32](1), // ProvisioningState: to.Ptr("Succeeded"), // SinglePlacementGroup: to.Ptr(false), // UpgradePolicy: &armcompute.UpgradePolicy{ // AutomaticOSUpgradePolicy: &armcompute.AutomaticOSUpgradePolicy{ // EnableAutomaticOSUpgrade: to.Ptr(false), // }, // Mode: to.Ptr(armcompute.UpgradeModeAutomatic), // }, // VirtualMachineProfile: &armcompute.VirtualMachineScaleSetVMProfile{ // ApplicationProfile: &armcompute.ApplicationProfile{ // GalleryApplications: []*armcompute.VMGalleryApplication{ // { // ConfigurationReference: to.Ptr("https://mystorageaccount.blob.core.windows.net/configurations/settings.config"), // Order: to.Ptr[int32](1), // PackageReferenceID: to.Ptr("/subscriptions/32c17a9e-aa7b-4ba5-a45b-e324116b6fdb/resourceGroups/myresourceGroupName2/providers/Microsoft.Compute/galleries/myGallery1/applications/MyApplication1/versions/1.0"), // Tags: to.Ptr("myTag1"), // }, // { // PackageReferenceID: to.Ptr("/subscriptions/32c17a9e-aa7b-4ba5-a45b-e324116b6fdg/resourceGroups/myresourceGroupName3/providers/Microsoft.Compute/galleries/myGallery2/applications/MyApplication2/versions/1.1"), // }}, // }, // NetworkProfile: &armcompute.VirtualMachineScaleSetNetworkProfile{ // NetworkInterfaceConfigurations: []*armcompute.VirtualMachineScaleSetNetworkConfiguration{ // { // Name: to.Ptr("myNic"), // Properties: &armcompute.VirtualMachineScaleSetNetworkConfigurationProperties{ // IPConfigurations: []*armcompute.VirtualMachineScaleSetIPConfiguration{ // { // Name: to.Ptr("myIPConfig"), // Properties: &armcompute.VirtualMachineScaleSetIPConfigurationProperties{ // Primary: to.Ptr(true), // Subnet: &armcompute.APIEntityReference{ // ID: to.Ptr("/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/virtualNetworks/myVNet/subnets/mySubnet"), // }, // }, // }}, // NetworkSecurityGroup: &armcompute.SubResource{ // ID: to.Ptr("/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/networkSecurityGroups/myNetworkSecurityGroup"), // }, // Primary: to.Ptr(true), // }, // }}, // }, // OSProfile: &armcompute.VirtualMachineScaleSetOSProfile{ // AdminUsername: to.Ptr("admin"), // ComputerNamePrefix: to.Ptr("myVirtualMachineScaleSet"), // LinuxConfiguration: &armcompute.LinuxConfiguration{ // DisablePasswordAuthentication: to.Ptr(false), // }, // }, // StorageProfile: &armcompute.VirtualMachineScaleSetStorageProfile{ // DataDisks: []*armcompute.VirtualMachineScaleSetDataDisk{ // }, // DiskControllerType: to.Ptr("NVMe"), // ImageReference: &armcompute.ImageReference{ // Offer: to.Ptr("databricks"), // Publisher: to.Ptr("azuredatabricks"), // SKU: to.Ptr("databricksworker"), // Version: to.Ptr("3.15.2"), // }, // OSDisk: &armcompute.VirtualMachineScaleSetOSDisk{ // Caching: to.Ptr(armcompute.CachingTypesReadWrite), // CreateOption: to.Ptr(armcompute.DiskCreateOptionTypesFromImage), // DiskSizeGB: to.Ptr[int32](30), // ManagedDisk: &armcompute.VirtualMachineScaleSetManagedDiskParameters{ // StorageAccountType: to.Ptr(armcompute.StorageAccountTypesPremiumLRS), // }, // }, // }, // UserData: to.Ptr("RXhhbXBsZSBVc2VyRGF0YQ=="), // }, // }, // SKU: &armcompute.SKU{ // Name: to.Ptr("Standard_D2s_v3"), // Capacity: to.Ptr[int64](4), // Tier: to.Ptr("Standard"), // }, // }
Output:
func (*VirtualMachineScaleSetsClient) GetInstanceView ¶
func (client *VirtualMachineScaleSetsClient) GetInstanceView(ctx context.Context, resourceGroupName string, vmScaleSetName string, options *VirtualMachineScaleSetsClientGetInstanceViewOptions) (VirtualMachineScaleSetsClientGetInstanceViewResponse, error)
GetInstanceView - Gets the status of a VM scale set instance. If the operation fails it returns an *azcore.ResponseError type.
Generated from API version 2024-03-01
- resourceGroupName - The name of the resource group.
- vmScaleSetName - The name of the VM scale set.
- options - VirtualMachineScaleSetsClientGetInstanceViewOptions contains the optional parameters for the VirtualMachineScaleSetsClient.GetInstanceView method.
Example (VirtualMachineScaleSetGetInstanceViewMaximumSetGen) ¶
Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/92de53a5f1e0e03c94b40475d2135d97148ed014/specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-03-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSet_GetInstanceView_MaximumSet_Gen.json
cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() clientFactory, err := armcompute.NewClientFactory("<subscription-id>", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } res, err := clientFactory.NewVirtualMachineScaleSetsClient().GetInstanceView(ctx, "rgcompute", "aaaaaaaaaaaaaaa", nil) if err != nil { log.Fatalf("failed to finish the request: %v", err) } // You could use response here. We use blank identifier for just demo purposes. _ = res // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. // res.VirtualMachineScaleSetInstanceView = armcompute.VirtualMachineScaleSetInstanceView{ // OrchestrationServices: []*armcompute.OrchestrationServiceSummary{ // { // ServiceName: to.Ptr(armcompute.OrchestrationServiceNamesAutomaticRepairs), // ServiceState: to.Ptr(armcompute.OrchestrationServiceStateNotRunning), // }}, // Statuses: []*armcompute.InstanceViewStatus{ // { // Code: to.Ptr("ProvisioningState/succeeded"), // DisplayStatus: to.Ptr("Provisioning succeeded"), // Level: to.Ptr(armcompute.StatusLevelTypesInfo), // Message: to.Ptr("aaaaaaaaaaaaaaaaaaaaaaa"), // Time: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-11-30T12:58:26.526Z"); return t}()), // }}, // VirtualMachine: &armcompute.VirtualMachineScaleSetInstanceViewStatusesSummary{ // StatusesSummary: []*armcompute.VirtualMachineStatusCodeCount{ // { // Code: to.Ptr("aa"), // Count: to.Ptr[int32](21), // }}, // }, // Extensions: []*armcompute.VirtualMachineScaleSetVMExtensionsSummary{ // { // Name: to.Ptr("aaaaaaaaaaa"), // StatusesSummary: []*armcompute.VirtualMachineStatusCodeCount{ // { // Code: to.Ptr("aa"), // Count: to.Ptr[int32](21), // }}, // }}, // }
Output:
Example (VirtualMachineScaleSetGetInstanceViewMinimumSetGen) ¶
Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/92de53a5f1e0e03c94b40475d2135d97148ed014/specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-03-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSet_GetInstanceView_MinimumSet_Gen.json
cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() clientFactory, err := armcompute.NewClientFactory("<subscription-id>", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } res, err := clientFactory.NewVirtualMachineScaleSetsClient().GetInstanceView(ctx, "rgcompute", "aaaaaaaaaaaaaaa", nil) if err != nil { log.Fatalf("failed to finish the request: %v", err) } // You could use response here. We use blank identifier for just demo purposes. _ = res // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. // res.VirtualMachineScaleSetInstanceView = armcompute.VirtualMachineScaleSetInstanceView{ // }
Output:
func (*VirtualMachineScaleSetsClient) NewGetOSUpgradeHistoryPager ¶
func (client *VirtualMachineScaleSetsClient) NewGetOSUpgradeHistoryPager(resourceGroupName string, vmScaleSetName string, options *VirtualMachineScaleSetsClientGetOSUpgradeHistoryOptions) *runtime.Pager[VirtualMachineScaleSetsClientGetOSUpgradeHistoryResponse]
NewGetOSUpgradeHistoryPager - Gets list of OS upgrades on a VM scale set instance.
Generated from API version 2024-03-01
- resourceGroupName - The name of the resource group.
- vmScaleSetName - The name of the VM scale set.
- options - VirtualMachineScaleSetsClientGetOSUpgradeHistoryOptions contains the optional parameters for the VirtualMachineScaleSetsClient.NewGetOSUpgradeHistoryPager method.
Example (VirtualMachineScaleSetGetOsUpgradeHistoryMaximumSetGen) ¶
Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/92de53a5f1e0e03c94b40475d2135d97148ed014/specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-03-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSet_GetOSUpgradeHistory_MaximumSet_Gen.json
cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() clientFactory, err := armcompute.NewClientFactory("<subscription-id>", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } pager := clientFactory.NewVirtualMachineScaleSetsClient().NewGetOSUpgradeHistoryPager("rgcompute", "aaaaaa", nil) for pager.More() { page, err := pager.NextPage(ctx) if err != nil { log.Fatalf("failed to advance page: %v", err) } for _, v := range page.Value { // You could use page here. We use blank identifier for just demo purposes. _ = v } // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. // page.VirtualMachineScaleSetListOSUpgradeHistory = armcompute.VirtualMachineScaleSetListOSUpgradeHistory{ // Value: []*armcompute.UpgradeOperationHistoricalStatusInfo{ // { // Type: to.Ptr("aaaaaaaaaaaaaaaaaaa"), // Location: to.Ptr("aaaaaaaaaaaaa"), // Properties: &armcompute.UpgradeOperationHistoricalStatusInfoProperties{ // Error: &armcompute.APIError{ // Code: to.Ptr("aaaaaaa"), // Innererror: &armcompute.InnerError{ // Errordetail: to.Ptr("aaaaaaaaaaaaaaaaaaaaaaaa"), // Exceptiontype: to.Ptr("aaaaaaaaaaaaaaaaaaaaaaaaaaaaa"), // }, // Message: to.Ptr("aaaaaaaaa"), // Target: to.Ptr("aaaaaaa"), // Details: []*armcompute.APIErrorBase{ // { // Code: to.Ptr("aaaaaaaaaaaaaaaaaaaaaaaa"), // Message: to.Ptr("aa"), // Target: to.Ptr("aaaa"), // }}, // }, // Progress: &armcompute.RollingUpgradeProgressInfo{ // FailedInstanceCount: to.Ptr[int32](25), // InProgressInstanceCount: to.Ptr[int32](20), // PendingInstanceCount: to.Ptr[int32](27), // SuccessfulInstanceCount: to.Ptr[int32](6), // }, // RollbackInfo: &armcompute.RollbackStatusInfo{ // FailedRolledbackInstanceCount: to.Ptr[int32](2), // RollbackError: &armcompute.APIError{ // Code: to.Ptr("aaaaaaa"), // Innererror: &armcompute.InnerError{ // Errordetail: to.Ptr("aaaaaaaaaaaaaaaaaaaaaaaa"), // Exceptiontype: to.Ptr("aaaaaaaaaaaaaaaaaaaaaaaaaaaaa"), // }, // Message: to.Ptr("aaaaaaaaa"), // Target: to.Ptr("aaaaaaa"), // Details: []*armcompute.APIErrorBase{ // { // Code: to.Ptr("aaaaaaaaaaaaaaaaaaaaaaaa"), // Message: to.Ptr("aa"), // Target: to.Ptr("aaaa"), // }}, // }, // SuccessfullyRolledbackInstanceCount: to.Ptr[int32](12), // }, // RunningStatus: &armcompute.UpgradeOperationHistoryStatus{ // Code: to.Ptr(armcompute.UpgradeStateRollingForward), // EndTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-11-30T13:05:40.443Z"); return t}()), // StartTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-11-30T13:05:40.442Z"); return t}()), // }, // StartedBy: to.Ptr(armcompute.UpgradeOperationInvokerUnknown), // TargetImageReference: &armcompute.ImageReference{ // ID: to.Ptr("aaaaaaaaaaaaaaaaaaa"), // ExactVersion: to.Ptr("aaaaaaa"), // Offer: to.Ptr("WindowsServer"), // Publisher: to.Ptr("MicrosoftWindowsServer"), // SharedGalleryImageID: to.Ptr("aaaaaa"), // SKU: to.Ptr("2016-Datacenter"), // Version: to.Ptr("latest"), // }, // }, // }}, // } }
Output:
Example (VirtualMachineScaleSetGetOsUpgradeHistoryMinimumSetGen) ¶
Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/92de53a5f1e0e03c94b40475d2135d97148ed014/specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-03-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSet_GetOSUpgradeHistory_MinimumSet_Gen.json
cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() clientFactory, err := armcompute.NewClientFactory("<subscription-id>", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } pager := clientFactory.NewVirtualMachineScaleSetsClient().NewGetOSUpgradeHistoryPager("rgcompute", "aaaaaaaaaaaaaaaaaaaaaaaaaa", nil) for pager.More() { page, err := pager.NextPage(ctx) if err != nil { log.Fatalf("failed to advance page: %v", err) } for _, v := range page.Value { // You could use page here. We use blank identifier for just demo purposes. _ = v } // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. // page.VirtualMachineScaleSetListOSUpgradeHistory = armcompute.VirtualMachineScaleSetListOSUpgradeHistory{ // Value: []*armcompute.UpgradeOperationHistoricalStatusInfo{ // { // }}, // } }
Output:
func (*VirtualMachineScaleSetsClient) NewListAllPager ¶
func (client *VirtualMachineScaleSetsClient) NewListAllPager(options *VirtualMachineScaleSetsClientListAllOptions) *runtime.Pager[VirtualMachineScaleSetsClientListAllResponse]
NewListAllPager - Gets a list of all VM Scale Sets in the subscription, regardless of the associated resource group. Use nextLink property in the response to get the next page of VM Scale Sets. Do this till nextLink is null to fetch all the VM Scale Sets.
Generated from API version 2024-03-01
- options - VirtualMachineScaleSetsClientListAllOptions contains the optional parameters for the VirtualMachineScaleSetsClient.NewListAllPager method.
Example (VirtualMachineScaleSetListAllMaximumSetGen) ¶
Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/92de53a5f1e0e03c94b40475d2135d97148ed014/specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-03-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSet_ListAll_MaximumSet_Gen.json
cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() clientFactory, err := armcompute.NewClientFactory("<subscription-id>", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } pager := clientFactory.NewVirtualMachineScaleSetsClient().NewListAllPager(nil) for pager.More() { page, err := pager.NextPage(ctx) if err != nil { log.Fatalf("failed to advance page: %v", err) } for _, v := range page.Value { // You could use page here. We use blank identifier for just demo purposes. _ = v } // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. // page.VirtualMachineScaleSetListWithLinkResult = armcompute.VirtualMachineScaleSetListWithLinkResult{ // Value: []*armcompute.VirtualMachineScaleSet{ // { // Name: to.Ptr("{virtualMachineScaleSetName}"), // Type: to.Ptr("Microsoft.Compute/virtualMachineScaleSets"), // ID: to.Ptr("/subscriptions/{subscription-id}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{virtualMachineScaleSetName}"), // Location: to.Ptr("westus"), // Tags: map[string]*string{ // "key8425": to.Ptr("aaa"), // }, // ExtendedLocation: &armcompute.ExtendedLocation{ // Name: to.Ptr("aaaaaaaaaaaaaaaaaaaaa"), // Type: to.Ptr(armcompute.ExtendedLocationTypesEdgeZone), // }, // Identity: &armcompute.VirtualMachineScaleSetIdentity{ // Type: to.Ptr(armcompute.ResourceIdentityTypeSystemAssigned), // PrincipalID: to.Ptr("aaaaaaaaaaaaaaa"), // TenantID: to.Ptr("aaaaaaaaaaaaaaaa"), // UserAssignedIdentities: map[string]*armcompute.UserAssignedIdentitiesValue{ // "key3951": &armcompute.UserAssignedIdentitiesValue{ // ClientID: to.Ptr("aaaaaaaaaaaaaaaaaaaaaaaaaaa"), // PrincipalID: to.Ptr("aaaa"), // }, // }, // }, // Plan: &armcompute.Plan{ // Name: to.Ptr("aaaaaaaaaa"), // Product: to.Ptr("aaaaaaaaaaaaaaaaaaaa"), // PromotionCode: to.Ptr("aaaaaaaaaaaaaaaaaaaa"), // Publisher: to.Ptr("aaaaaaaaaaaaaaaaaaaaaa"), // }, // Properties: &armcompute.VirtualMachineScaleSetProperties{ // AdditionalCapabilities: &armcompute.AdditionalCapabilities{ // HibernationEnabled: to.Ptr(true), // UltraSSDEnabled: to.Ptr(true), // }, // AutomaticRepairsPolicy: &armcompute.AutomaticRepairsPolicy{ // Enabled: to.Ptr(true), // GracePeriod: to.Ptr("aaaaaaaaaaaaaaaaaaaaaaaaa"), // }, // DoNotRunExtensionsOnOverprovisionedVMs: to.Ptr(true), // HostGroup: &armcompute.SubResource{ // ID: to.Ptr("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/availabilitySets/{availabilitySetName}"), // }, // OrchestrationMode: to.Ptr(armcompute.OrchestrationModeUniform), // Overprovision: to.Ptr(true), // PlatformFaultDomainCount: to.Ptr[int32](1), // ProvisioningState: to.Ptr("Succeeded"), // ProximityPlacementGroup: &armcompute.SubResource{ // ID: to.Ptr("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/availabilitySets/{availabilitySetName}"), // }, // ScaleInPolicy: &armcompute.ScaleInPolicy{ // ForceDeletion: to.Ptr(true), // Rules: []*armcompute.VirtualMachineScaleSetScaleInRules{ // to.Ptr(armcompute.VirtualMachineScaleSetScaleInRulesDefault)}, // }, // SinglePlacementGroup: to.Ptr(true), // SpotRestorePolicy: &armcompute.SpotRestorePolicy{ // Enabled: to.Ptr(true), // RestoreTimeout: to.Ptr("aaaaaaaaaa"), // }, // UniqueID: to.Ptr("aaaaaaaa"), // UpgradePolicy: &armcompute.UpgradePolicy{ // AutomaticOSUpgradePolicy: &armcompute.AutomaticOSUpgradePolicy{ // DisableAutomaticRollback: to.Ptr(true), // EnableAutomaticOSUpgrade: to.Ptr(true), // OSRollingUpgradeDeferral: to.Ptr(true), // }, // Mode: to.Ptr(armcompute.UpgradeModeManual), // RollingUpgradePolicy: &armcompute.RollingUpgradePolicy{ // EnableCrossZoneUpgrade: to.Ptr(true), // MaxBatchInstancePercent: to.Ptr[int32](49), // MaxSurge: to.Ptr(true), // MaxUnhealthyInstancePercent: to.Ptr[int32](81), // MaxUnhealthyUpgradedInstancePercent: to.Ptr[int32](98), // PauseTimeBetweenBatches: to.Ptr("aaaaaaaaaaaaaaa"), // PrioritizeUnhealthyInstances: to.Ptr(true), // RollbackFailedInstancesOnPolicyBreach: to.Ptr(true), // }, // }, // VirtualMachineProfile: &armcompute.VirtualMachineScaleSetVMProfile{ // ApplicationProfile: &armcompute.ApplicationProfile{ // GalleryApplications: []*armcompute.VMGalleryApplication{ // { // ConfigurationReference: to.Ptr("aaaaa"), // Order: to.Ptr[int32](29), // PackageReferenceID: to.Ptr("aaaaaaaaaa"), // Tags: to.Ptr("aaaaaaaaaaa"), // }}, // }, // BillingProfile: &armcompute.BillingProfile{ // MaxPrice: to.Ptr[float64](4), // }, // CapacityReservation: &armcompute.CapacityReservationProfile{ // CapacityReservationGroup: &armcompute.SubResource{ // ID: to.Ptr("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/availabilitySets/{availabilitySetName}"), // }, // }, // DiagnosticsProfile: &armcompute.DiagnosticsProfile{ // BootDiagnostics: &armcompute.BootDiagnostics{ // Enabled: to.Ptr(true), // StorageURI: to.Ptr("aaaaaaaaaaaaaaaaaaa"), // }, // }, // EvictionPolicy: to.Ptr(armcompute.VirtualMachineEvictionPolicyTypesDeallocate), // ExtensionProfile: &armcompute.VirtualMachineScaleSetExtensionProfile{ // ExtensionsTimeBudget: to.Ptr("aaaaaaaaaaaaaaaaaaaaaaaaaa"), // Extensions: []*armcompute.VirtualMachineScaleSetExtension{ // { // ID: to.Ptr("aaaaaaaaaaaaaaaaaaaaaa"), // Name: to.Ptr("aa"), // Type: to.Ptr("aaaaa"), // Properties: &armcompute.VirtualMachineScaleSetExtensionProperties{ // Type: to.Ptr("aaaaaaaa"), // AutoUpgradeMinorVersion: to.Ptr(true), // EnableAutomaticUpgrade: to.Ptr(true), // ForceUpdateTag: to.Ptr("aaaaaaaaaaaaaaaaaaaaaaaaaaa"), // ProtectedSettings: map[string]any{ // }, // ProvisionAfterExtensions: []*string{ // to.Ptr("aaaaaaaaaaaaaa")}, // ProvisioningState: to.Ptr("Succeeded"), // Publisher: to.Ptr("aaaaaaaaaaaaa"), // Settings: map[string]any{ // }, // SuppressFailures: to.Ptr(true), // TypeHandlerVersion: to.Ptr("aaaaaaaaaaaaaaaaaaaaaaaaaaa"), // }, // }}, // }, // LicenseType: to.Ptr("aaaaaaaaaa"), // NetworkProfile: &armcompute.VirtualMachineScaleSetNetworkProfile{ // HealthProbe: &armcompute.APIEntityReference{ // ID: to.Ptr("/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/restorePointCollections/rpcName/restorePoints/restorePointName/diskRestorePoints/testingexcludedisk_OsDisk_1_74cdaedcea50483d9833c96adefa100f_22b4bdfe-6c54-4f72-84d8-85d8860f0c57"), // }, // NetworkAPIVersion: to.Ptr(armcompute.NetworkAPIVersionTwoThousandTwenty1101), // NetworkInterfaceConfigurations: []*armcompute.VirtualMachineScaleSetNetworkConfiguration{ // { // Name: to.Ptr("{vmss-name}"), // Properties: &armcompute.VirtualMachineScaleSetNetworkConfigurationProperties{ // DeleteOption: to.Ptr(armcompute.DeleteOptionsDelete), // DNSSettings: &armcompute.VirtualMachineScaleSetNetworkConfigurationDNSSettings{ // DNSServers: []*string{ // to.Ptr("aaaaaaaaaaaa")}, // }, // EnableAcceleratedNetworking: to.Ptr(true), // EnableFpga: to.Ptr(true), // EnableIPForwarding: to.Ptr(true), // IPConfigurations: []*armcompute.VirtualMachineScaleSetIPConfiguration{ // { // Name: to.Ptr("{vmss-name}"), // Properties: &armcompute.VirtualMachineScaleSetIPConfigurationProperties{ // ApplicationGatewayBackendAddressPools: []*armcompute.SubResource{ // { // ID: to.Ptr("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/availabilitySets/{availabilitySetName}"), // }}, // ApplicationSecurityGroups: []*armcompute.SubResource{ // { // ID: to.Ptr("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/availabilitySets/{availabilitySetName}"), // }}, // LoadBalancerBackendAddressPools: []*armcompute.SubResource{ // { // ID: to.Ptr("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/availabilitySets/{availabilitySetName}"), // }}, // LoadBalancerInboundNatPools: []*armcompute.SubResource{ // { // ID: to.Ptr("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/availabilitySets/{availabilitySetName}"), // }}, // Primary: to.Ptr(true), // PrivateIPAddressVersion: to.Ptr(armcompute.IPVersionIPv4), // PublicIPAddressConfiguration: &armcompute.VirtualMachineScaleSetPublicIPAddressConfiguration{ // Name: to.Ptr("aaaaaaaaaaaaaaaaaa"), // Properties: &armcompute.VirtualMachineScaleSetPublicIPAddressConfigurationProperties{ // DeleteOption: to.Ptr(armcompute.DeleteOptionsDelete), // DNSSettings: &armcompute.VirtualMachineScaleSetPublicIPAddressConfigurationDNSSettings{ // DomainNameLabel: to.Ptr("aaaaaaaaaaaaaaaaaa"), // DomainNameLabelScope: to.Ptr(armcompute.DomainNameLabelScopeTypesTenantReuse), // }, // IdleTimeoutInMinutes: to.Ptr[int32](18), // IPTags: []*armcompute.VirtualMachineScaleSetIPTag{ // { // IPTagType: to.Ptr("aaaaaaa"), // Tag: to.Ptr("aaaaaaaaaaaaaaaaaaaaaaaaaaa"), // }}, // PublicIPAddressVersion: to.Ptr(armcompute.IPVersionIPv4), // PublicIPPrefix: &armcompute.SubResource{ // ID: to.Ptr("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/availabilitySets/{availabilitySetName}"), // }, // }, // SKU: &armcompute.PublicIPAddressSKU{ // Name: to.Ptr(armcompute.PublicIPAddressSKUNameBasic), // Tier: to.Ptr(armcompute.PublicIPAddressSKUTierRegional), // }, // }, // Subnet: &armcompute.APIEntityReference{ // ID: to.Ptr("/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/virtualNetworks/{existing-virtual-network-name}/subnets/{existing-subnet-name}"), // }, // }, // }}, // NetworkSecurityGroup: &armcompute.SubResource{ // ID: to.Ptr("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/availabilitySets/{availabilitySetName}"), // }, // Primary: to.Ptr(true), // }, // }}, // }, // OSProfile: &armcompute.VirtualMachineScaleSetOSProfile{ // AdminUsername: to.Ptr("{your-username}"), // ComputerNamePrefix: to.Ptr("{vmss-name}"), // CustomData: to.Ptr("aaaaaaaaaaaaaaaaaaaaaaaaaa"), // LinuxConfiguration: &armcompute.LinuxConfiguration{ // DisablePasswordAuthentication: to.Ptr(true), // PatchSettings: &armcompute.LinuxPatchSettings{ // AssessmentMode: to.Ptr(armcompute.LinuxPatchAssessmentModeImageDefault), // PatchMode: to.Ptr(armcompute.LinuxVMGuestPatchModeImageDefault), // }, // ProvisionVMAgent: to.Ptr(true), // SSH: &armcompute.SSHConfiguration{ // PublicKeys: []*armcompute.SSHPublicKey{ // { // Path: to.Ptr("aaa"), // KeyData: to.Ptr("aaaaaa"), // }}, // }, // }, // Secrets: []*armcompute.VaultSecretGroup{ // { // SourceVault: &armcompute.SubResource{ // ID: to.Ptr("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/availabilitySets/{availabilitySetName}"), // }, // VaultCertificates: []*armcompute.VaultCertificate{ // { // CertificateStore: to.Ptr("aaaaaaaaaaaaaaaaaaaaaaaaa"), // CertificateURL: to.Ptr("aaaaaaa"), // }}, // }}, // WindowsConfiguration: &armcompute.WindowsConfiguration{ // AdditionalUnattendContent: []*armcompute.AdditionalUnattendContent{ // { // ComponentName: to.Ptr("Microsoft-Windows-Shell-Setup"), // Content: to.Ptr("aaaaaaaaaaaaaaaaaaaa"), // PassName: to.Ptr("OobeSystem"), // SettingName: to.Ptr(armcompute.SettingNamesAutoLogon), // }}, // EnableAutomaticUpdates: to.Ptr(true), // PatchSettings: &armcompute.PatchSettings{ // AssessmentMode: to.Ptr(armcompute.WindowsPatchAssessmentModeImageDefault), // EnableHotpatching: to.Ptr(true), // PatchMode: to.Ptr(armcompute.WindowsVMGuestPatchModeManual), // }, // ProvisionVMAgent: to.Ptr(true), // TimeZone: to.Ptr("aaaaaaaaaaaaaaaaaaaaaaaaaaaaa"), // WinRM: &armcompute.WinRMConfiguration{ // Listeners: []*armcompute.WinRMListener{ // { // CertificateURL: to.Ptr("aaaaaaaaaaaaaaaaaaaaaa"), // Protocol: to.Ptr(armcompute.ProtocolTypesHTTP), // }}, // }, // }, // }, // Priority: to.Ptr(armcompute.VirtualMachinePriorityTypesRegular), // ScheduledEventsProfile: &armcompute.ScheduledEventsProfile{ // TerminateNotificationProfile: &armcompute.TerminateNotificationProfile{ // Enable: to.Ptr(true), // NotBeforeTimeout: to.Ptr("aa"), // }, // }, // SecurityProfile: &armcompute.SecurityProfile{ // EncryptionAtHost: to.Ptr(true), // SecurityType: to.Ptr(armcompute.SecurityTypesTrustedLaunch), // UefiSettings: &armcompute.UefiSettings{ // SecureBootEnabled: to.Ptr(true), // VTpmEnabled: to.Ptr(true), // }, // }, // StorageProfile: &armcompute.VirtualMachineScaleSetStorageProfile{ // DataDisks: []*armcompute.VirtualMachineScaleSetDataDisk{ // { // Name: to.Ptr("aaaaaaaaaaaaaa"), // Caching: to.Ptr(armcompute.CachingTypesNone), // CreateOption: to.Ptr(armcompute.DiskCreateOptionTypesFromImage), // DiskIOPSReadWrite: to.Ptr[int64](11), // DiskMBpsReadWrite: to.Ptr[int64](13), // DiskSizeGB: to.Ptr[int32](11), // Lun: to.Ptr[int32](24), // ManagedDisk: &armcompute.VirtualMachineScaleSetManagedDiskParameters{ // DiskEncryptionSet: &armcompute.DiskEncryptionSetParameters{ // ID: to.Ptr("aaaaaaaaaaaa"), // }, // StorageAccountType: to.Ptr(armcompute.StorageAccountTypesStandardLRS), // }, // WriteAcceleratorEnabled: to.Ptr(true), // }}, // ImageReference: &armcompute.ImageReference{ // ID: to.Ptr("a"), // ExactVersion: to.Ptr("aaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"), // Offer: to.Ptr("WindowsServer"), // Publisher: to.Ptr("MicrosoftWindowsServer"), // SharedGalleryImageID: to.Ptr("aaaaaaaaaaaaaaaaaaaaaa"), // SKU: to.Ptr("2016-Datacenter"), // Version: to.Ptr("latest"), // }, // OSDisk: &armcompute.VirtualMachineScaleSetOSDisk{ // Name: to.Ptr("aaaaaaaaaaaaaaa"), // Caching: to.Ptr(armcompute.CachingTypesReadWrite), // CreateOption: to.Ptr(armcompute.DiskCreateOptionTypesFromImage), // DiffDiskSettings: &armcompute.DiffDiskSettings{ // Option: to.Ptr(armcompute.DiffDiskOptionsLocal), // Placement: to.Ptr(armcompute.DiffDiskPlacementCacheDisk), // }, // DiskSizeGB: to.Ptr[int32](30), // Image: &armcompute.VirtualHardDisk{ // URI: to.Ptr("https://{storageAccountName}.blob.core.windows.net/{containerName}/{vhdName}.vhd"), // }, // ManagedDisk: &armcompute.VirtualMachineScaleSetManagedDiskParameters{ // DiskEncryptionSet: &armcompute.DiskEncryptionSetParameters{ // ID: to.Ptr("aaaaaaaaaaaa"), // }, // StorageAccountType: to.Ptr(armcompute.StorageAccountTypesStandardLRS), // }, // OSType: to.Ptr(armcompute.OperatingSystemTypesWindows), // VhdContainers: []*string{ // to.Ptr("aaaaaaaaaaaaaaaaaaaaaaaaa")}, // WriteAcceleratorEnabled: to.Ptr(true), // }, // }, // UserData: to.Ptr("aaa"), // }, // ZoneBalance: to.Ptr(true), // }, // SKU: &armcompute.SKU{ // Name: to.Ptr("Standard_D1_v2"), // Capacity: to.Ptr[int64](3), // Tier: to.Ptr("Standard"), // }, // Zones: []*string{ // to.Ptr("aaaaaaaaaaaaaaaaaaaa")}, // }}, // } }
Output:
Example (VirtualMachineScaleSetListAllMinimumSetGen) ¶
Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/92de53a5f1e0e03c94b40475d2135d97148ed014/specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-03-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSet_ListAll_MinimumSet_Gen.json
cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() clientFactory, err := armcompute.NewClientFactory("<subscription-id>", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } pager := clientFactory.NewVirtualMachineScaleSetsClient().NewListAllPager(nil) for pager.More() { page, err := pager.NextPage(ctx) if err != nil { log.Fatalf("failed to advance page: %v", err) } for _, v := range page.Value { // You could use page here. We use blank identifier for just demo purposes. _ = v } // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. // page.VirtualMachineScaleSetListWithLinkResult = armcompute.VirtualMachineScaleSetListWithLinkResult{ // Value: []*armcompute.VirtualMachineScaleSet{ // { // ID: to.Ptr("/subscriptions/{subscription-id}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{virtualMachineScaleSetName}"), // Location: to.Ptr("westus"), // }}, // } }
Output:
func (*VirtualMachineScaleSetsClient) NewListByLocationPager ¶
func (client *VirtualMachineScaleSetsClient) NewListByLocationPager(location string, options *VirtualMachineScaleSetsClientListByLocationOptions) *runtime.Pager[VirtualMachineScaleSetsClientListByLocationResponse]
NewListByLocationPager - Gets all the VM scale sets under the specified subscription for the specified location.
Generated from API version 2024-03-01
- location - The location for which VM scale sets under the subscription are queried.
- options - VirtualMachineScaleSetsClientListByLocationOptions contains the optional parameters for the VirtualMachineScaleSetsClient.NewListByLocationPager method.
Example ¶
Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/92de53a5f1e0e03c94b40475d2135d97148ed014/specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-03-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSet_ListBySubscription_ByLocation.json
cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() clientFactory, err := armcompute.NewClientFactory("<subscription-id>", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } pager := clientFactory.NewVirtualMachineScaleSetsClient().NewListByLocationPager("eastus", nil) for pager.More() { page, err := pager.NextPage(ctx) if err != nil { log.Fatalf("failed to advance page: %v", err) } for _, v := range page.Value { // You could use page here. We use blank identifier for just demo purposes. _ = v } // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. // page.VirtualMachineScaleSetListResult = armcompute.VirtualMachineScaleSetListResult{ // Value: []*armcompute.VirtualMachineScaleSet{ // { // Name: to.Ptr("{virtualMachineScaleSetName}"), // Type: to.Ptr("Microsoft.Compute/virtualMachineScaleSets"), // ID: to.Ptr("/subscriptions/{subscription-id}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{virtualMachineScaleSetName}"), // Location: to.Ptr("eastus"), // Tags: map[string]*string{ // "myTag1": to.Ptr("tagValue1"), // }, // Properties: &armcompute.VirtualMachineScaleSetProperties{ // DoNotRunExtensionsOnOverprovisionedVMs: to.Ptr(false), // Overprovision: to.Ptr(false), // PlatformFaultDomainCount: to.Ptr[int32](1), // ProvisioningState: to.Ptr("Succeeded"), // SinglePlacementGroup: to.Ptr(false), // UpgradePolicy: &armcompute.UpgradePolicy{ // AutomaticOSUpgradePolicy: &armcompute.AutomaticOSUpgradePolicy{ // EnableAutomaticOSUpgrade: to.Ptr(false), // }, // Mode: to.Ptr(armcompute.UpgradeModeAutomatic), // }, // VirtualMachineProfile: &armcompute.VirtualMachineScaleSetVMProfile{ // NetworkProfile: &armcompute.VirtualMachineScaleSetNetworkProfile{ // NetworkInterfaceConfigurations: []*armcompute.VirtualMachineScaleSetNetworkConfiguration{ // { // Name: to.Ptr("myNic"), // Properties: &armcompute.VirtualMachineScaleSetNetworkConfigurationProperties{ // IPConfigurations: []*armcompute.VirtualMachineScaleSetIPConfiguration{ // { // Name: to.Ptr("myIPConfig"), // Properties: &armcompute.VirtualMachineScaleSetIPConfigurationProperties{ // Primary: to.Ptr(true), // Subnet: &armcompute.APIEntityReference{ // ID: to.Ptr("/subscriptions/{subscription-id}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworks/myVNet/subnets/mySubnet"), // }, // }, // }}, // NetworkSecurityGroup: &armcompute.SubResource{ // ID: to.Ptr("/subscriptions/{subscription-id}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkSecurityGroups/myNetworkSecurityGroup"), // }, // Primary: to.Ptr(true), // }, // }}, // }, // OSProfile: &armcompute.VirtualMachineScaleSetOSProfile{ // AdminUsername: to.Ptr("admin"), // ComputerNamePrefix: to.Ptr("{virtualMachineScaleSetName}"), // LinuxConfiguration: &armcompute.LinuxConfiguration{ // DisablePasswordAuthentication: to.Ptr(false), // }, // }, // StorageProfile: &armcompute.VirtualMachineScaleSetStorageProfile{ // DataDisks: []*armcompute.VirtualMachineScaleSetDataDisk{ // }, // ImageReference: &armcompute.ImageReference{ // Offer: to.Ptr("databricks"), // Publisher: to.Ptr("azuredatabricks"), // SKU: to.Ptr("databricksworker"), // Version: to.Ptr("3.15.2"), // }, // OSDisk: &armcompute.VirtualMachineScaleSetOSDisk{ // Caching: to.Ptr(armcompute.CachingTypesReadWrite), // CreateOption: to.Ptr(armcompute.DiskCreateOptionTypesFromImage), // DiskSizeGB: to.Ptr[int32](30), // ManagedDisk: &armcompute.VirtualMachineScaleSetManagedDiskParameters{ // StorageAccountType: to.Ptr(armcompute.StorageAccountTypesPremiumLRS), // }, // }, // }, // }, // }, // SKU: &armcompute.SKU{ // Name: to.Ptr("Standard_D2s_v3"), // Capacity: to.Ptr[int64](4), // Tier: to.Ptr("Standard"), // }, // }, // { // Name: to.Ptr("{virtualMachineScaleSetName}"), // Type: to.Ptr("Microsoft.Compute/virtualMachineScaleSets"), // ID: to.Ptr("/subscriptions/{subscription-id}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{virtualMachineScaleSetName}1"), // Location: to.Ptr("eastus"), // Tags: map[string]*string{ // "myTag1": to.Ptr("tagValue2"), // }, // Properties: &armcompute.VirtualMachineScaleSetProperties{ // DoNotRunExtensionsOnOverprovisionedVMs: to.Ptr(false), // Overprovision: to.Ptr(false), // PlatformFaultDomainCount: to.Ptr[int32](1), // ProvisioningState: to.Ptr("Succeeded"), // SinglePlacementGroup: to.Ptr(false), // UpgradePolicy: &armcompute.UpgradePolicy{ // AutomaticOSUpgradePolicy: &armcompute.AutomaticOSUpgradePolicy{ // EnableAutomaticOSUpgrade: to.Ptr(false), // }, // Mode: to.Ptr(armcompute.UpgradeModeAutomatic), // }, // VirtualMachineProfile: &armcompute.VirtualMachineScaleSetVMProfile{ // NetworkProfile: &armcompute.VirtualMachineScaleSetNetworkProfile{ // NetworkInterfaceConfigurations: []*armcompute.VirtualMachineScaleSetNetworkConfiguration{ // { // Name: to.Ptr("myNic1"), // Properties: &armcompute.VirtualMachineScaleSetNetworkConfigurationProperties{ // IPConfigurations: []*armcompute.VirtualMachineScaleSetIPConfiguration{ // { // Name: to.Ptr("myIPConfig"), // Properties: &armcompute.VirtualMachineScaleSetIPConfigurationProperties{ // Primary: to.Ptr(true), // Subnet: &armcompute.APIEntityReference{ // ID: to.Ptr("/subscriptions/{subscription-id}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworks/myVNet/subnets/mySubnet"), // }, // }, // }}, // NetworkSecurityGroup: &armcompute.SubResource{ // ID: to.Ptr("/subscriptions/{subscription-id}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkSecurityGroups/myNetworkSecurityGroup"), // }, // Primary: to.Ptr(true), // }, // }}, // }, // OSProfile: &armcompute.VirtualMachineScaleSetOSProfile{ // AdminUsername: to.Ptr("admin"), // ComputerNamePrefix: to.Ptr("{virtualMachineScaleSetName}"), // LinuxConfiguration: &armcompute.LinuxConfiguration{ // DisablePasswordAuthentication: to.Ptr(false), // }, // }, // StorageProfile: &armcompute.VirtualMachineScaleSetStorageProfile{ // DataDisks: []*armcompute.VirtualMachineScaleSetDataDisk{ // }, // ImageReference: &armcompute.ImageReference{ // Offer: to.Ptr("databricks"), // Publisher: to.Ptr("azuredatabricks"), // SKU: to.Ptr("databricksworker"), // Version: to.Ptr("3.15.2"), // }, // OSDisk: &armcompute.VirtualMachineScaleSetOSDisk{ // Caching: to.Ptr(armcompute.CachingTypesReadWrite), // CreateOption: to.Ptr(armcompute.DiskCreateOptionTypesFromImage), // DiskSizeGB: to.Ptr[int32](30), // ManagedDisk: &armcompute.VirtualMachineScaleSetManagedDiskParameters{ // StorageAccountType: to.Ptr(armcompute.StorageAccountTypesPremiumLRS), // }, // }, // }, // }, // }, // SKU: &armcompute.SKU{ // Name: to.Ptr("Standard_D2s_v3"), // Capacity: to.Ptr[int64](4), // Tier: to.Ptr("Standard"), // }, // }}, // } }
Output:
func (*VirtualMachineScaleSetsClient) NewListPager ¶
func (client *VirtualMachineScaleSetsClient) NewListPager(resourceGroupName string, options *VirtualMachineScaleSetsClientListOptions) *runtime.Pager[VirtualMachineScaleSetsClientListResponse]
NewListPager - Gets a list of all VM scale sets under a resource group.
Generated from API version 2024-03-01
- resourceGroupName - The name of the resource group.
- options - VirtualMachineScaleSetsClientListOptions contains the optional parameters for the VirtualMachineScaleSetsClient.NewListPager method.
Example (VirtualMachineScaleSetListMaximumSetGen) ¶
Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/92de53a5f1e0e03c94b40475d2135d97148ed014/specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-03-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSet_List_MaximumSet_Gen.json
cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() clientFactory, err := armcompute.NewClientFactory("<subscription-id>", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } pager := clientFactory.NewVirtualMachineScaleSetsClient().NewListPager("rgcompute", nil) for pager.More() { page, err := pager.NextPage(ctx) if err != nil { log.Fatalf("failed to advance page: %v", err) } for _, v := range page.Value { // You could use page here. We use blank identifier for just demo purposes. _ = v } // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. // page.VirtualMachineScaleSetListResult = armcompute.VirtualMachineScaleSetListResult{ // Value: []*armcompute.VirtualMachineScaleSet{ // { // Name: to.Ptr("{virtualMachineScaleSetName}"), // Type: to.Ptr("Microsoft.Compute/virtualMachineScaleSets"), // ID: to.Ptr("/subscriptions/{subscription-id}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{virtualMachineScaleSetName}"), // Location: to.Ptr("eastus"), // Tags: map[string]*string{ // }, // ExtendedLocation: &armcompute.ExtendedLocation{ // Name: to.Ptr("aaaaaaaaaaaaaaaaaaaaa"), // Type: to.Ptr(armcompute.ExtendedLocationTypesEdgeZone), // }, // Identity: &armcompute.VirtualMachineScaleSetIdentity{ // Type: to.Ptr(armcompute.ResourceIdentityTypeSystemAssigned), // PrincipalID: to.Ptr("aaaaaaaaaaaaaaa"), // TenantID: to.Ptr("aaaaaaaaaaaaaaaa"), // UserAssignedIdentities: map[string]*armcompute.UserAssignedIdentitiesValue{ // "key3951": &armcompute.UserAssignedIdentitiesValue{ // ClientID: to.Ptr("aaaaaaaaaaaaaaaaaaaaaaaaaaa"), // PrincipalID: to.Ptr("aaaa"), // }, // }, // }, // Plan: &armcompute.Plan{ // Name: to.Ptr("aaaaaaaaaa"), // Product: to.Ptr("aaaaaaaaaaaaaaaaaaaa"), // PromotionCode: to.Ptr("aaaaaaaaaaaaaaaaaaaa"), // Publisher: to.Ptr("aaaaaaaaaaaaaaaaaaaaaa"), // }, // Properties: &armcompute.VirtualMachineScaleSetProperties{ // AdditionalCapabilities: &armcompute.AdditionalCapabilities{ // HibernationEnabled: to.Ptr(true), // UltraSSDEnabled: to.Ptr(true), // }, // AutomaticRepairsPolicy: &armcompute.AutomaticRepairsPolicy{ // Enabled: to.Ptr(true), // GracePeriod: to.Ptr("aaaaaaaaaaaaaaaaaaaaaaaaa"), // }, // DoNotRunExtensionsOnOverprovisionedVMs: to.Ptr(true), // HostGroup: &armcompute.SubResource{ // ID: to.Ptr("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/availabilitySets/{availabilitySetName}"), // }, // OrchestrationMode: to.Ptr(armcompute.OrchestrationModeUniform), // Overprovision: to.Ptr(true), // PlatformFaultDomainCount: to.Ptr[int32](1), // ProvisioningState: to.Ptr("Succeeded"), // ProximityPlacementGroup: &armcompute.SubResource{ // ID: to.Ptr("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/availabilitySets/{availabilitySetName}"), // }, // ScaleInPolicy: &armcompute.ScaleInPolicy{ // ForceDeletion: to.Ptr(true), // Rules: []*armcompute.VirtualMachineScaleSetScaleInRules{ // to.Ptr(armcompute.VirtualMachineScaleSetScaleInRulesDefault)}, // }, // SinglePlacementGroup: to.Ptr(true), // SpotRestorePolicy: &armcompute.SpotRestorePolicy{ // Enabled: to.Ptr(true), // RestoreTimeout: to.Ptr("aaaaaaaaaa"), // }, // UniqueID: to.Ptr("aaaaaaaaaaaaaaaaaaaaaaa"), // UpgradePolicy: &armcompute.UpgradePolicy{ // AutomaticOSUpgradePolicy: &armcompute.AutomaticOSUpgradePolicy{ // DisableAutomaticRollback: to.Ptr(true), // EnableAutomaticOSUpgrade: to.Ptr(true), // OSRollingUpgradeDeferral: to.Ptr(true), // UseRollingUpgradePolicy: to.Ptr(true), // }, // Mode: to.Ptr(armcompute.UpgradeModeAutomatic), // RollingUpgradePolicy: &armcompute.RollingUpgradePolicy{ // EnableCrossZoneUpgrade: to.Ptr(true), // MaxBatchInstancePercent: to.Ptr[int32](49), // MaxSurge: to.Ptr(true), // MaxUnhealthyInstancePercent: to.Ptr[int32](81), // MaxUnhealthyUpgradedInstancePercent: to.Ptr[int32](98), // PauseTimeBetweenBatches: to.Ptr("aaaaaaaaaaaaaaa"), // PrioritizeUnhealthyInstances: to.Ptr(true), // RollbackFailedInstancesOnPolicyBreach: to.Ptr(true), // }, // }, // VirtualMachineProfile: &armcompute.VirtualMachineScaleSetVMProfile{ // ApplicationProfile: &armcompute.ApplicationProfile{ // GalleryApplications: []*armcompute.VMGalleryApplication{ // { // ConfigurationReference: to.Ptr("aaaaa"), // Order: to.Ptr[int32](29), // PackageReferenceID: to.Ptr("aaaaaaaaaa"), // Tags: to.Ptr("aaaaaaaaaaa"), // }}, // }, // BillingProfile: &armcompute.BillingProfile{ // MaxPrice: to.Ptr[float64](4), // }, // CapacityReservation: &armcompute.CapacityReservationProfile{ // CapacityReservationGroup: &armcompute.SubResource{ // ID: to.Ptr("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/availabilitySets/{availabilitySetName}"), // }, // }, // DiagnosticsProfile: &armcompute.DiagnosticsProfile{ // BootDiagnostics: &armcompute.BootDiagnostics{ // Enabled: to.Ptr(true), // StorageURI: to.Ptr("aaaaaaaaaaaaaaaaaaa"), // }, // }, // EvictionPolicy: to.Ptr(armcompute.VirtualMachineEvictionPolicyTypesDeallocate), // ExtensionProfile: &armcompute.VirtualMachineScaleSetExtensionProfile{ // ExtensionsTimeBudget: to.Ptr("aaaaaaaaaaaaaaaaaaaaaaaaaa"), // Extensions: []*armcompute.VirtualMachineScaleSetExtension{ // { // ID: to.Ptr("aaaaaaaaaaaaaaaaaaaaaa"), // Name: to.Ptr("aa"), // Type: to.Ptr("aaaaa"), // Properties: &armcompute.VirtualMachineScaleSetExtensionProperties{ // Type: to.Ptr("aaaaaaaa"), // AutoUpgradeMinorVersion: to.Ptr(true), // EnableAutomaticUpgrade: to.Ptr(true), // ForceUpdateTag: to.Ptr("aaaaaaaaaaaaaaaaaaaaaaaaaaa"), // ProtectedSettings: map[string]any{ // }, // ProvisionAfterExtensions: []*string{ // to.Ptr("aaaaaaaaaaaaaa")}, // ProvisioningState: to.Ptr("Succeeded"), // Publisher: to.Ptr("aaaaaaaaaaaaa"), // Settings: map[string]any{ // }, // SuppressFailures: to.Ptr(true), // TypeHandlerVersion: to.Ptr("aaaaaaaaaaaaaaaaaaaaaaaaaaa"), // }, // }}, // }, // LicenseType: to.Ptr("aaaa"), // NetworkProfile: &armcompute.VirtualMachineScaleSetNetworkProfile{ // HealthProbe: &armcompute.APIEntityReference{ // ID: to.Ptr("/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/restorePointCollections/rpcName/restorePoints/restorePointName/diskRestorePoints/testingexcludedisk_OsDisk_1_74cdaedcea50483d9833c96adefa100f_22b4bdfe-6c54-4f72-84d8-85d8860f0c57"), // }, // NetworkAPIVersion: to.Ptr(armcompute.NetworkAPIVersionTwoThousandTwenty1101), // NetworkInterfaceConfigurations: []*armcompute.VirtualMachineScaleSetNetworkConfiguration{ // { // Name: to.Ptr("myNic"), // Properties: &armcompute.VirtualMachineScaleSetNetworkConfigurationProperties{ // DeleteOption: to.Ptr(armcompute.DeleteOptionsDelete), // DNSSettings: &armcompute.VirtualMachineScaleSetNetworkConfigurationDNSSettings{ // DNSServers: []*string{ // to.Ptr("aaaaaaaaaaaa")}, // }, // EnableAcceleratedNetworking: to.Ptr(true), // EnableFpga: to.Ptr(true), // EnableIPForwarding: to.Ptr(true), // IPConfigurations: []*armcompute.VirtualMachineScaleSetIPConfiguration{ // { // Name: to.Ptr("myIPConfig"), // Properties: &armcompute.VirtualMachineScaleSetIPConfigurationProperties{ // ApplicationGatewayBackendAddressPools: []*armcompute.SubResource{ // { // ID: to.Ptr("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/availabilitySets/{availabilitySetName}"), // }}, // ApplicationSecurityGroups: []*armcompute.SubResource{ // { // ID: to.Ptr("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/availabilitySets/{availabilitySetName}"), // }}, // LoadBalancerBackendAddressPools: []*armcompute.SubResource{ // { // ID: to.Ptr("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/availabilitySets/{availabilitySetName}"), // }}, // LoadBalancerInboundNatPools: []*armcompute.SubResource{ // { // ID: to.Ptr("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/availabilitySets/{availabilitySetName}"), // }}, // Primary: to.Ptr(true), // PrivateIPAddressVersion: to.Ptr(armcompute.IPVersionIPv4), // PublicIPAddressConfiguration: &armcompute.VirtualMachineScaleSetPublicIPAddressConfiguration{ // Name: to.Ptr("aaaaaaaaaaaaaaaaaa"), // Properties: &armcompute.VirtualMachineScaleSetPublicIPAddressConfigurationProperties{ // DeleteOption: to.Ptr(armcompute.DeleteOptionsDelete), // DNSSettings: &armcompute.VirtualMachineScaleSetPublicIPAddressConfigurationDNSSettings{ // DomainNameLabel: to.Ptr("aaaaaaaaaaaaaaaaaa"), // }, // IdleTimeoutInMinutes: to.Ptr[int32](18), // IPTags: []*armcompute.VirtualMachineScaleSetIPTag{ // { // IPTagType: to.Ptr("aaaaaaa"), // Tag: to.Ptr("aaaaaaaaaaaaaaaaaaaaaaaaaaa"), // }}, // PublicIPAddressVersion: to.Ptr(armcompute.IPVersionIPv4), // PublicIPPrefix: &armcompute.SubResource{ // ID: to.Ptr("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/availabilitySets/{availabilitySetName}"), // }, // }, // SKU: &armcompute.PublicIPAddressSKU{ // Name: to.Ptr(armcompute.PublicIPAddressSKUNameBasic), // Tier: to.Ptr(armcompute.PublicIPAddressSKUTierRegional), // }, // }, // Subnet: &armcompute.APIEntityReference{ // ID: to.Ptr("/subscriptions/{subscription-id}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworks/myVNet/subnets/mySubnet"), // }, // }, // }}, // NetworkSecurityGroup: &armcompute.SubResource{ // ID: to.Ptr("/subscriptions/{subscription-id}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkSecurityGroups/myNetworkSecurityGroup"), // }, // Primary: to.Ptr(true), // }, // }}, // }, // OSProfile: &armcompute.VirtualMachineScaleSetOSProfile{ // AdminUsername: to.Ptr("admin"), // ComputerNamePrefix: to.Ptr("{virtualMachineScaleSetName}"), // CustomData: to.Ptr("aaaaaaaaaaaaaaaaaa"), // LinuxConfiguration: &armcompute.LinuxConfiguration{ // DisablePasswordAuthentication: to.Ptr(true), // PatchSettings: &armcompute.LinuxPatchSettings{ // AssessmentMode: to.Ptr(armcompute.LinuxPatchAssessmentModeImageDefault), // PatchMode: to.Ptr(armcompute.LinuxVMGuestPatchModeImageDefault), // }, // ProvisionVMAgent: to.Ptr(true), // SSH: &armcompute.SSHConfiguration{ // PublicKeys: []*armcompute.SSHPublicKey{ // { // Path: to.Ptr("aaa"), // KeyData: to.Ptr("aaaaaa"), // }}, // }, // }, // Secrets: []*armcompute.VaultSecretGroup{ // { // SourceVault: &armcompute.SubResource{ // ID: to.Ptr("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/availabilitySets/{availabilitySetName}"), // }, // VaultCertificates: []*armcompute.VaultCertificate{ // { // CertificateStore: to.Ptr("aaaaaaaaaaaaaaaaaaaaaaaaa"), // CertificateURL: to.Ptr("aaaaaaa"), // }}, // }}, // WindowsConfiguration: &armcompute.WindowsConfiguration{ // AdditionalUnattendContent: []*armcompute.AdditionalUnattendContent{ // { // ComponentName: to.Ptr("Microsoft-Windows-Shell-Setup"), // Content: to.Ptr("aaaaaaaaaaaaaaaaaaaa"), // PassName: to.Ptr("OobeSystem"), // SettingName: to.Ptr(armcompute.SettingNamesAutoLogon), // }}, // EnableAutomaticUpdates: to.Ptr(true), // PatchSettings: &armcompute.PatchSettings{ // AssessmentMode: to.Ptr(armcompute.WindowsPatchAssessmentModeImageDefault), // EnableHotpatching: to.Ptr(true), // PatchMode: to.Ptr(armcompute.WindowsVMGuestPatchModeManual), // }, // ProvisionVMAgent: to.Ptr(true), // TimeZone: to.Ptr("aaaaaaaaaaaaaaaaaaaaaaaaaaaaa"), // WinRM: &armcompute.WinRMConfiguration{ // Listeners: []*armcompute.WinRMListener{ // { // CertificateURL: to.Ptr("aaaaaaaaaaaaaaaaaaaaaa"), // Protocol: to.Ptr(armcompute.ProtocolTypesHTTP), // }}, // }, // }, // }, // Priority: to.Ptr(armcompute.VirtualMachinePriorityTypesRegular), // ScheduledEventsProfile: &armcompute.ScheduledEventsProfile{ // TerminateNotificationProfile: &armcompute.TerminateNotificationProfile{ // Enable: to.Ptr(true), // NotBeforeTimeout: to.Ptr("aa"), // }, // }, // SecurityProfile: &armcompute.SecurityProfile{ // EncryptionAtHost: to.Ptr(true), // SecurityType: to.Ptr(armcompute.SecurityTypesTrustedLaunch), // UefiSettings: &armcompute.UefiSettings{ // SecureBootEnabled: to.Ptr(true), // VTpmEnabled: to.Ptr(true), // }, // }, // StorageProfile: &armcompute.VirtualMachineScaleSetStorageProfile{ // DataDisks: []*armcompute.VirtualMachineScaleSetDataDisk{ // }, // ImageReference: &armcompute.ImageReference{ // ID: to.Ptr("aaaaaaaaaa"), // ExactVersion: to.Ptr("aaaaaaaaaaaaaaaaaaaaaaa"), // Offer: to.Ptr("databricks"), // Publisher: to.Ptr("azuredatabricks"), // SharedGalleryImageID: to.Ptr("aaaaaaaaaaaaaaaaaaaaaa"), // SKU: to.Ptr("databricksworker"), // Version: to.Ptr("3.15.2"), // }, // OSDisk: &armcompute.VirtualMachineScaleSetOSDisk{ // Name: to.Ptr("aaaaaaaaaaaaaaaaaaaaaaa"), // Caching: to.Ptr(armcompute.CachingTypesReadWrite), // CreateOption: to.Ptr(armcompute.DiskCreateOptionTypesFromImage), // DiffDiskSettings: &armcompute.DiffDiskSettings{ // Option: to.Ptr(armcompute.DiffDiskOptionsLocal), // Placement: to.Ptr(armcompute.DiffDiskPlacementCacheDisk), // }, // DiskSizeGB: to.Ptr[int32](30), // Image: &armcompute.VirtualHardDisk{ // URI: to.Ptr("https://{storageAccountName}.blob.core.windows.net/{containerName}/{vhdName}.vhd"), // }, // ManagedDisk: &armcompute.VirtualMachineScaleSetManagedDiskParameters{ // DiskEncryptionSet: &armcompute.DiskEncryptionSetParameters{ // ID: to.Ptr("aaaaaaaaaaaa"), // }, // StorageAccountType: to.Ptr(armcompute.StorageAccountTypesPremiumLRS), // }, // OSType: to.Ptr(armcompute.OperatingSystemTypesWindows), // VhdContainers: []*string{ // to.Ptr("aaaaaaaaaaaaaaaaaaaaaaaaaaaaa")}, // WriteAcceleratorEnabled: to.Ptr(true), // }, // }, // UserData: to.Ptr("aaaaaaaaaaaaaaaaaaaaaaaaa"), // }, // ZoneBalance: to.Ptr(true), // }, // SKU: &armcompute.SKU{ // Name: to.Ptr("Standard_D2s_v3"), // Capacity: to.Ptr[int64](4), // Tier: to.Ptr("Standard"), // }, // Zones: []*string{ // to.Ptr("aaaaaaa")}, // }, // { // Name: to.Ptr("{virtualMachineScaleSetName}"), // Type: to.Ptr("Microsoft.Compute/virtualMachineScaleSets"), // ID: to.Ptr("/subscriptions/{subscription-id}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{virtualMachineScaleSetName}1"), // Location: to.Ptr("eastus"), // Tags: map[string]*string{ // }, // ExtendedLocation: &armcompute.ExtendedLocation{ // Name: to.Ptr("aaaaaaaaaaaaaaaaaaaaa"), // Type: to.Ptr(armcompute.ExtendedLocationTypesEdgeZone), // }, // Identity: &armcompute.VirtualMachineScaleSetIdentity{ // Type: to.Ptr(armcompute.ResourceIdentityTypeSystemAssigned), // PrincipalID: to.Ptr("aaaaaaaaaaaaaaa"), // TenantID: to.Ptr("aaaaaaaaaaaaaaaa"), // UserAssignedIdentities: map[string]*armcompute.UserAssignedIdentitiesValue{ // "key3951": &armcompute.UserAssignedIdentitiesValue{ // ClientID: to.Ptr("aaaaaaaaaaaaaaaaaaaaaaaaaaa"), // PrincipalID: to.Ptr("aaaa"), // }, // }, // }, // Plan: &armcompute.Plan{ // Name: to.Ptr("aaaaaaaaaa"), // Product: to.Ptr("aaaaaaaaaaaaaaaaaaaa"), // PromotionCode: to.Ptr("aaaaaaaaaaaaaaaaaaaa"), // Publisher: to.Ptr("aaaaaaaaaaaaaaaaaaaaaa"), // }, // Properties: &armcompute.VirtualMachineScaleSetProperties{ // AdditionalCapabilities: &armcompute.AdditionalCapabilities{ // HibernationEnabled: to.Ptr(true), // UltraSSDEnabled: to.Ptr(true), // }, // AutomaticRepairsPolicy: &armcompute.AutomaticRepairsPolicy{ // Enabled: to.Ptr(true), // GracePeriod: to.Ptr("aaaaaaaaaaaaaaaaaaaaaaaaa"), // }, // DoNotRunExtensionsOnOverprovisionedVMs: to.Ptr(true), // HostGroup: &armcompute.SubResource{ // ID: to.Ptr("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/availabilitySets/{availabilitySetName}"), // }, // OrchestrationMode: to.Ptr(armcompute.OrchestrationModeUniform), // Overprovision: to.Ptr(true), // PlatformFaultDomainCount: to.Ptr[int32](1), // ProvisioningState: to.Ptr("Succeeded"), // ProximityPlacementGroup: &armcompute.SubResource{ // ID: to.Ptr("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/availabilitySets/{availabilitySetName}"), // }, // ScaleInPolicy: &armcompute.ScaleInPolicy{ // ForceDeletion: to.Ptr(true), // Rules: []*armcompute.VirtualMachineScaleSetScaleInRules{ // to.Ptr(armcompute.VirtualMachineScaleSetScaleInRulesDefault)}, // }, // SinglePlacementGroup: to.Ptr(true), // SpotRestorePolicy: &armcompute.SpotRestorePolicy{ // Enabled: to.Ptr(true), // RestoreTimeout: to.Ptr("aaaaaaaaaa"), // }, // UniqueID: to.Ptr("aaaaa"), // UpgradePolicy: &armcompute.UpgradePolicy{ // AutomaticOSUpgradePolicy: &armcompute.AutomaticOSUpgradePolicy{ // DisableAutomaticRollback: to.Ptr(true), // EnableAutomaticOSUpgrade: to.Ptr(true), // OSRollingUpgradeDeferral: to.Ptr(true), // UseRollingUpgradePolicy: to.Ptr(true), // }, // Mode: to.Ptr(armcompute.UpgradeModeAutomatic), // RollingUpgradePolicy: &armcompute.RollingUpgradePolicy{ // EnableCrossZoneUpgrade: to.Ptr(true), // MaxBatchInstancePercent: to.Ptr[int32](49), // MaxSurge: to.Ptr(true), // MaxUnhealthyInstancePercent: to.Ptr[int32](81), // MaxUnhealthyUpgradedInstancePercent: to.Ptr[int32](98), // PauseTimeBetweenBatches: to.Ptr("aaaaaaaaaaaaaaa"), // PrioritizeUnhealthyInstances: to.Ptr(true), // }, // }, // VirtualMachineProfile: &armcompute.VirtualMachineScaleSetVMProfile{ // ApplicationProfile: &armcompute.ApplicationProfile{ // GalleryApplications: []*armcompute.VMGalleryApplication{ // { // ConfigurationReference: to.Ptr("aaaaa"), // Order: to.Ptr[int32](29), // PackageReferenceID: to.Ptr("aaaaaaaaaa"), // Tags: to.Ptr("aaaaaaaaaaa"), // }}, // }, // BillingProfile: &armcompute.BillingProfile{ // MaxPrice: to.Ptr[float64](4), // }, // CapacityReservation: &armcompute.CapacityReservationProfile{ // CapacityReservationGroup: &armcompute.SubResource{ // ID: to.Ptr("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/availabilitySets/{availabilitySetName}"), // }, // }, // DiagnosticsProfile: &armcompute.DiagnosticsProfile{ // BootDiagnostics: &armcompute.BootDiagnostics{ // Enabled: to.Ptr(true), // StorageURI: to.Ptr("aaaaaaaaaaaaaaaaaaa"), // }, // }, // EvictionPolicy: to.Ptr(armcompute.VirtualMachineEvictionPolicyTypesDeallocate), // ExtensionProfile: &armcompute.VirtualMachineScaleSetExtensionProfile{ // ExtensionsTimeBudget: to.Ptr("aaaaaaaaaaaaaaaaaaaaaaaaaa"), // Extensions: []*armcompute.VirtualMachineScaleSetExtension{ // { // ID: to.Ptr("aaaaaaaaaaaaaaaaaaaaaa"), // Name: to.Ptr("aa"), // Type: to.Ptr("aaaaa"), // Properties: &armcompute.VirtualMachineScaleSetExtensionProperties{ // Type: to.Ptr("aaaaaaaa"), // AutoUpgradeMinorVersion: to.Ptr(true), // EnableAutomaticUpgrade: to.Ptr(true), // ForceUpdateTag: to.Ptr("aaaaaaaaaaaaaaaaaaaaaaaaaaa"), // ProtectedSettings: map[string]any{ // }, // ProvisionAfterExtensions: []*string{ // to.Ptr("aaaaaaaaaaaaaa")}, // ProvisioningState: to.Ptr("Succeeded"), // Publisher: to.Ptr("aaaaaaaaaaaaa"), // Settings: map[string]any{ // }, // SuppressFailures: to.Ptr(true), // TypeHandlerVersion: to.Ptr("aaaaaaaaaaaaaaaaaaaaaaaaaaa"), // }, // }}, // }, // LicenseType: to.Ptr("aaaaaaaaaaaaaaaaaaaaaaa"), // NetworkProfile: &armcompute.VirtualMachineScaleSetNetworkProfile{ // HealthProbe: &armcompute.APIEntityReference{ // ID: to.Ptr("/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/restorePointCollections/rpcName/restorePoints/restorePointName/diskRestorePoints/testingexcludedisk_OsDisk_1_74cdaedcea50483d9833c96adefa100f_22b4bdfe-6c54-4f72-84d8-85d8860f0c57"), // }, // NetworkAPIVersion: to.Ptr(armcompute.NetworkAPIVersionTwoThousandTwenty1101), // NetworkInterfaceConfigurations: []*armcompute.VirtualMachineScaleSetNetworkConfiguration{ // { // Name: to.Ptr("myNic1"), // Properties: &armcompute.VirtualMachineScaleSetNetworkConfigurationProperties{ // DeleteOption: to.Ptr(armcompute.DeleteOptionsDelete), // DNSSettings: &armcompute.VirtualMachineScaleSetNetworkConfigurationDNSSettings{ // DNSServers: []*string{ // to.Ptr("aaaaaaaaaaaa")}, // }, // EnableAcceleratedNetworking: to.Ptr(true), // EnableFpga: to.Ptr(true), // EnableIPForwarding: to.Ptr(true), // IPConfigurations: []*armcompute.VirtualMachineScaleSetIPConfiguration{ // { // Name: to.Ptr("myIPConfig"), // Properties: &armcompute.VirtualMachineScaleSetIPConfigurationProperties{ // ApplicationGatewayBackendAddressPools: []*armcompute.SubResource{ // { // ID: to.Ptr("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/availabilitySets/{availabilitySetName}"), // }}, // ApplicationSecurityGroups: []*armcompute.SubResource{ // { // ID: to.Ptr("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/availabilitySets/{availabilitySetName}"), // }}, // LoadBalancerBackendAddressPools: []*armcompute.SubResource{ // { // ID: to.Ptr("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/availabilitySets/{availabilitySetName}"), // }}, // LoadBalancerInboundNatPools: []*armcompute.SubResource{ // { // ID: to.Ptr("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/availabilitySets/{availabilitySetName}"), // }}, // Primary: to.Ptr(true), // PrivateIPAddressVersion: to.Ptr(armcompute.IPVersionIPv4), // PublicIPAddressConfiguration: &armcompute.VirtualMachineScaleSetPublicIPAddressConfiguration{ // Name: to.Ptr("aaaaaaaaaaaaaaaaaa"), // Properties: &armcompute.VirtualMachineScaleSetPublicIPAddressConfigurationProperties{ // DeleteOption: to.Ptr(armcompute.DeleteOptionsDelete), // DNSSettings: &armcompute.VirtualMachineScaleSetPublicIPAddressConfigurationDNSSettings{ // DomainNameLabel: to.Ptr("aaaaaaaaaaaaaaaaaa"), // }, // IdleTimeoutInMinutes: to.Ptr[int32](18), // IPTags: []*armcompute.VirtualMachineScaleSetIPTag{ // { // IPTagType: to.Ptr("aaaaaaa"), // Tag: to.Ptr("aaaaaaaaaaaaaaaaaaaaaaaaaaa"), // }}, // PublicIPAddressVersion: to.Ptr(armcompute.IPVersionIPv4), // PublicIPPrefix: &armcompute.SubResource{ // ID: to.Ptr("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/availabilitySets/{availabilitySetName}"), // }, // }, // SKU: &armcompute.PublicIPAddressSKU{ // Name: to.Ptr(armcompute.PublicIPAddressSKUNameBasic), // Tier: to.Ptr(armcompute.PublicIPAddressSKUTierRegional), // }, // }, // Subnet: &armcompute.APIEntityReference{ // ID: to.Ptr("/subscriptions/{subscription-id}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworks/myVNet/subnets/mySubnet"), // }, // }, // }}, // NetworkSecurityGroup: &armcompute.SubResource{ // ID: to.Ptr("/subscriptions/{subscription-id}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkSecurityGroups/myNetworkSecurityGroup"), // }, // Primary: to.Ptr(true), // }, // }}, // }, // OSProfile: &armcompute.VirtualMachineScaleSetOSProfile{ // AdminUsername: to.Ptr("admin"), // ComputerNamePrefix: to.Ptr("{virtualMachineScaleSetName}"), // CustomData: to.Ptr("a"), // LinuxConfiguration: &armcompute.LinuxConfiguration{ // DisablePasswordAuthentication: to.Ptr(true), // PatchSettings: &armcompute.LinuxPatchSettings{ // AssessmentMode: to.Ptr(armcompute.LinuxPatchAssessmentModeImageDefault), // PatchMode: to.Ptr(armcompute.LinuxVMGuestPatchModeImageDefault), // }, // ProvisionVMAgent: to.Ptr(true), // SSH: &armcompute.SSHConfiguration{ // PublicKeys: []*armcompute.SSHPublicKey{ // { // Path: to.Ptr("aaa"), // KeyData: to.Ptr("aaaaaa"), // }}, // }, // }, // Secrets: []*armcompute.VaultSecretGroup{ // { // SourceVault: &armcompute.SubResource{ // ID: to.Ptr("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/availabilitySets/{availabilitySetName}"), // }, // VaultCertificates: []*armcompute.VaultCertificate{ // { // CertificateStore: to.Ptr("aaaaaaaaaaaaaaaaaaaaaaaaa"), // CertificateURL: to.Ptr("aaaaaaa"), // }}, // }}, // WindowsConfiguration: &armcompute.WindowsConfiguration{ // AdditionalUnattendContent: []*armcompute.AdditionalUnattendContent{ // { // ComponentName: to.Ptr("Microsoft-Windows-Shell-Setup"), // Content: to.Ptr("aaaaaaaaaaaaaaaaaaaa"), // PassName: to.Ptr("OobeSystem"), // SettingName: to.Ptr(armcompute.SettingNamesAutoLogon), // }}, // EnableAutomaticUpdates: to.Ptr(true), // PatchSettings: &armcompute.PatchSettings{ // AssessmentMode: to.Ptr(armcompute.WindowsPatchAssessmentModeImageDefault), // EnableHotpatching: to.Ptr(true), // PatchMode: to.Ptr(armcompute.WindowsVMGuestPatchModeManual), // }, // ProvisionVMAgent: to.Ptr(true), // TimeZone: to.Ptr("aaaaaaaaaaaaaaaaaaaaaaaaaaaaa"), // WinRM: &armcompute.WinRMConfiguration{ // Listeners: []*armcompute.WinRMListener{ // { // CertificateURL: to.Ptr("aaaaaaaaaaaaaaaaaaaaaa"), // Protocol: to.Ptr(armcompute.ProtocolTypesHTTP), // }}, // }, // }, // }, // Priority: to.Ptr(armcompute.VirtualMachinePriorityTypesRegular), // ScheduledEventsProfile: &armcompute.ScheduledEventsProfile{ // TerminateNotificationProfile: &armcompute.TerminateNotificationProfile{ // Enable: to.Ptr(true), // NotBeforeTimeout: to.Ptr("aa"), // }, // }, // SecurityProfile: &armcompute.SecurityProfile{ // EncryptionAtHost: to.Ptr(true), // SecurityType: to.Ptr(armcompute.SecurityTypesTrustedLaunch), // UefiSettings: &armcompute.UefiSettings{ // SecureBootEnabled: to.Ptr(true), // VTpmEnabled: to.Ptr(true), // }, // }, // StorageProfile: &armcompute.VirtualMachineScaleSetStorageProfile{ // DataDisks: []*armcompute.VirtualMachineScaleSetDataDisk{ // }, // ImageReference: &armcompute.ImageReference{ // ID: to.Ptr("aaa"), // ExactVersion: to.Ptr("aa"), // Offer: to.Ptr("databricks"), // Publisher: to.Ptr("azuredatabricks"), // SharedGalleryImageID: to.Ptr("aaaaaaa"), // SKU: to.Ptr("databricksworker"), // Version: to.Ptr("3.15.2"), // }, // OSDisk: &armcompute.VirtualMachineScaleSetOSDisk{ // Name: to.Ptr("a"), // Caching: to.Ptr(armcompute.CachingTypesReadWrite), // CreateOption: to.Ptr(armcompute.DiskCreateOptionTypesFromImage), // DiffDiskSettings: &armcompute.DiffDiskSettings{ // Option: to.Ptr(armcompute.DiffDiskOptionsLocal), // Placement: to.Ptr(armcompute.DiffDiskPlacementCacheDisk), // }, // DiskSizeGB: to.Ptr[int32](30), // Image: &armcompute.VirtualHardDisk{ // URI: to.Ptr("https://{storageAccountName}.blob.core.windows.net/{containerName}/{vhdName}.vhd"), // }, // ManagedDisk: &armcompute.VirtualMachineScaleSetManagedDiskParameters{ // DiskEncryptionSet: &armcompute.DiskEncryptionSetParameters{ // ID: to.Ptr("aaaaaaaaaaaa"), // }, // StorageAccountType: to.Ptr(armcompute.StorageAccountTypesPremiumLRS), // }, // OSType: to.Ptr(armcompute.OperatingSystemTypesWindows), // VhdContainers: []*string{ // to.Ptr("aaaaaaaaaaaaaaaa")}, // WriteAcceleratorEnabled: to.Ptr(true), // }, // }, // UserData: to.Ptr("aaaaaaaaaaaaaaaaaaaaaa"), // }, // ZoneBalance: to.Ptr(true), // }, // SKU: &armcompute.SKU{ // Name: to.Ptr("Standard_D2s_v3"), // Capacity: to.Ptr[int64](4), // Tier: to.Ptr("Standard"), // }, // Zones: []*string{ // to.Ptr("aaaaaaaa")}, // }}, // } }
Output:
Example (VirtualMachineScaleSetListMinimumSetGen) ¶
Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/92de53a5f1e0e03c94b40475d2135d97148ed014/specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-03-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSet_List_MinimumSet_Gen.json
cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() clientFactory, err := armcompute.NewClientFactory("<subscription-id>", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } pager := clientFactory.NewVirtualMachineScaleSetsClient().NewListPager("rgcompute", nil) for pager.More() { page, err := pager.NextPage(ctx) if err != nil { log.Fatalf("failed to advance page: %v", err) } for _, v := range page.Value { // You could use page here. We use blank identifier for just demo purposes. _ = v } // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. // page.VirtualMachineScaleSetListResult = armcompute.VirtualMachineScaleSetListResult{ // Value: []*armcompute.VirtualMachineScaleSet{ // { // ID: to.Ptr("/subscriptions/{subscription-id}/resourceGroups/rgcompute/providers/Microsoft.Compute/virtualMachineScaleSets/{virtualMachineScaleSetName}"), // Location: to.Ptr("eastus"), // }, // { // ID: to.Ptr("/subscriptions/{subscription-id}/resourceGroups/rgcompute/providers/Microsoft.Compute/virtualMachineScaleSets/{virtualMachineScaleSetName}"), // Location: to.Ptr("eastus"), // }}, // } }
Output:
func (*VirtualMachineScaleSetsClient) NewListSKUsPager ¶
func (client *VirtualMachineScaleSetsClient) NewListSKUsPager(resourceGroupName string, vmScaleSetName string, options *VirtualMachineScaleSetsClientListSKUsOptions) *runtime.Pager[VirtualMachineScaleSetsClientListSKUsResponse]
NewListSKUsPager - Gets a list of SKUs available for your VM scale set, including the minimum and maximum VM instances allowed for each SKU.
Generated from API version 2024-03-01
- resourceGroupName - The name of the resource group.
- vmScaleSetName - The name of the VM scale set.
- options - VirtualMachineScaleSetsClientListSKUsOptions contains the optional parameters for the VirtualMachineScaleSetsClient.NewListSKUsPager method.
Example (VirtualMachineScaleSetListSkusMaximumSetGen) ¶
Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/92de53a5f1e0e03c94b40475d2135d97148ed014/specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-03-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSet_ListSkus_MaximumSet_Gen.json
cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() clientFactory, err := armcompute.NewClientFactory("<subscription-id>", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } pager := clientFactory.NewVirtualMachineScaleSetsClient().NewListSKUsPager("rgcompute", "aaaaaa", nil) for pager.More() { page, err := pager.NextPage(ctx) if err != nil { log.Fatalf("failed to advance page: %v", err) } for _, v := range page.Value { // You could use page here. We use blank identifier for just demo purposes. _ = v } // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. // page.VirtualMachineScaleSetListSKUsResult = armcompute.VirtualMachineScaleSetListSKUsResult{ // Value: []*armcompute.VirtualMachineScaleSetSKU{ // { // Capacity: &armcompute.VirtualMachineScaleSetSKUCapacity{ // DefaultCapacity: to.Ptr[int64](20), // Maximum: to.Ptr[int64](27), // Minimum: to.Ptr[int64](22), // ScaleType: to.Ptr(armcompute.VirtualMachineScaleSetSKUScaleTypeAutomatic), // }, // ResourceType: to.Ptr("aaaaaaaaaaaaaaaaa"), // SKU: &armcompute.SKU{ // Name: to.Ptr("DSv3-Type1"), // Capacity: to.Ptr[int64](7), // Tier: to.Ptr("aaa"), // }, // }}, // } }
Output:
Example (VirtualMachineScaleSetListSkusMinimumSetGen) ¶
Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/92de53a5f1e0e03c94b40475d2135d97148ed014/specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-03-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSet_ListSkus_MinimumSet_Gen.json
cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() clientFactory, err := armcompute.NewClientFactory("<subscription-id>", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } pager := clientFactory.NewVirtualMachineScaleSetsClient().NewListSKUsPager("rgcompute", "aaaaaaaaaaaaaaaa", nil) for pager.More() { page, err := pager.NextPage(ctx) if err != nil { log.Fatalf("failed to advance page: %v", err) } for _, v := range page.Value { // You could use page here. We use blank identifier for just demo purposes. _ = v } // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. // page.VirtualMachineScaleSetListSKUsResult = armcompute.VirtualMachineScaleSetListSKUsResult{ // Value: []*armcompute.VirtualMachineScaleSetSKU{ // { // }}, // } }
Output:
type VirtualMachineScaleSetsClientApproveRollingUpgradeResponse ¶ added in v5.4.0
type VirtualMachineScaleSetsClientApproveRollingUpgradeResponse struct { }
VirtualMachineScaleSetsClientApproveRollingUpgradeResponse contains the response from method VirtualMachineScaleSetsClient.BeginApproveRollingUpgrade.
type VirtualMachineScaleSetsClientBeginApproveRollingUpgradeOptions ¶ added in v5.4.0
type VirtualMachineScaleSetsClientBeginApproveRollingUpgradeOptions struct { // Resumes the LRO from the provided token. ResumeToken string // A list of virtual machine instance IDs from the VM scale set. VMInstanceIDs *VirtualMachineScaleSetVMInstanceIDs }
VirtualMachineScaleSetsClientBeginApproveRollingUpgradeOptions contains the optional parameters for the VirtualMachineScaleSetsClient.BeginApproveRollingUpgrade method.
type VirtualMachineScaleSetsClientBeginCreateOrUpdateOptions ¶
type VirtualMachineScaleSetsClientBeginCreateOrUpdateOptions struct { // The ETag of the transformation. Omit this value to always overwrite the current resource. Specify the last-seen ETag value // to prevent accidentally overwriting concurrent changes. IfMatch *string // Set to '*' to allow a new record set to be created, but to prevent updating an existing record set. Other values will result // in error from server as they are not supported. IfNoneMatch *string // Resumes the LRO from the provided token. ResumeToken string }
VirtualMachineScaleSetsClientBeginCreateOrUpdateOptions contains the optional parameters for the VirtualMachineScaleSetsClient.BeginCreateOrUpdate method.
type VirtualMachineScaleSetsClientBeginDeallocateOptions ¶
type VirtualMachineScaleSetsClientBeginDeallocateOptions struct { // Optional parameter to hibernate a virtual machine from the VM scale set. (This feature is available for VMSS with Flexible // OrchestrationMode only) Hibernate *bool // Resumes the LRO from the provided token. ResumeToken string // A list of virtual machine instance IDs from the VM scale set. VMInstanceIDs *VirtualMachineScaleSetVMInstanceIDs }
VirtualMachineScaleSetsClientBeginDeallocateOptions contains the optional parameters for the VirtualMachineScaleSetsClient.BeginDeallocate method.
type VirtualMachineScaleSetsClientBeginDeleteInstancesOptions ¶
type VirtualMachineScaleSetsClientBeginDeleteInstancesOptions struct { // Optional parameter to force delete virtual machines from the VM scale set. (Feature in Preview) ForceDeletion *bool // Resumes the LRO from the provided token. ResumeToken string }
VirtualMachineScaleSetsClientBeginDeleteInstancesOptions contains the optional parameters for the VirtualMachineScaleSetsClient.BeginDeleteInstances method.
type VirtualMachineScaleSetsClientBeginDeleteOptions ¶
type VirtualMachineScaleSetsClientBeginDeleteOptions struct { // Optional parameter to force delete a VM scale set. (Feature in Preview) ForceDeletion *bool // Resumes the LRO from the provided token. ResumeToken string }
VirtualMachineScaleSetsClientBeginDeleteOptions contains the optional parameters for the VirtualMachineScaleSetsClient.BeginDelete method.
type VirtualMachineScaleSetsClientBeginPerformMaintenanceOptions ¶
type VirtualMachineScaleSetsClientBeginPerformMaintenanceOptions struct { // Resumes the LRO from the provided token. ResumeToken string // A list of virtual machine instance IDs from the VM scale set. VMInstanceIDs *VirtualMachineScaleSetVMInstanceIDs }
VirtualMachineScaleSetsClientBeginPerformMaintenanceOptions contains the optional parameters for the VirtualMachineScaleSetsClient.BeginPerformMaintenance method.
type VirtualMachineScaleSetsClientBeginPowerOffOptions ¶
type VirtualMachineScaleSetsClientBeginPowerOffOptions struct { // Resumes the LRO from the provided token. ResumeToken string // The parameter to request non-graceful VM shutdown. True value for this flag indicates non-graceful shutdown whereas false // indicates otherwise. Default value for this flag is false if not specified SkipShutdown *bool // A list of virtual machine instance IDs from the VM scale set. VMInstanceIDs *VirtualMachineScaleSetVMInstanceIDs }
VirtualMachineScaleSetsClientBeginPowerOffOptions contains the optional parameters for the VirtualMachineScaleSetsClient.BeginPowerOff method.
type VirtualMachineScaleSetsClientBeginReapplyOptions ¶
type VirtualMachineScaleSetsClientBeginReapplyOptions struct { // Resumes the LRO from the provided token. ResumeToken string }
VirtualMachineScaleSetsClientBeginReapplyOptions contains the optional parameters for the VirtualMachineScaleSetsClient.BeginReapply method.
type VirtualMachineScaleSetsClientBeginRedeployOptions ¶
type VirtualMachineScaleSetsClientBeginRedeployOptions struct { // Resumes the LRO from the provided token. ResumeToken string // A list of virtual machine instance IDs from the VM scale set. VMInstanceIDs *VirtualMachineScaleSetVMInstanceIDs }
VirtualMachineScaleSetsClientBeginRedeployOptions contains the optional parameters for the VirtualMachineScaleSetsClient.BeginRedeploy method.
type VirtualMachineScaleSetsClientBeginReimageAllOptions ¶
type VirtualMachineScaleSetsClientBeginReimageAllOptions struct { // Resumes the LRO from the provided token. ResumeToken string // A list of virtual machine instance IDs from the VM scale set. VMInstanceIDs *VirtualMachineScaleSetVMInstanceIDs }
VirtualMachineScaleSetsClientBeginReimageAllOptions contains the optional parameters for the VirtualMachineScaleSetsClient.BeginReimageAll method.
type VirtualMachineScaleSetsClientBeginReimageOptions ¶
type VirtualMachineScaleSetsClientBeginReimageOptions struct { // Resumes the LRO from the provided token. ResumeToken string // Parameters for Reimaging VM ScaleSet. VMScaleSetReimageInput *VirtualMachineScaleSetReimageParameters }
VirtualMachineScaleSetsClientBeginReimageOptions contains the optional parameters for the VirtualMachineScaleSetsClient.BeginReimage method.
type VirtualMachineScaleSetsClientBeginRestartOptions ¶
type VirtualMachineScaleSetsClientBeginRestartOptions struct { // Resumes the LRO from the provided token. ResumeToken string // A list of virtual machine instance IDs from the VM scale set. VMInstanceIDs *VirtualMachineScaleSetVMInstanceIDs }
VirtualMachineScaleSetsClientBeginRestartOptions contains the optional parameters for the VirtualMachineScaleSetsClient.BeginRestart method.
type VirtualMachineScaleSetsClientBeginSetOrchestrationServiceStateOptions ¶
type VirtualMachineScaleSetsClientBeginSetOrchestrationServiceStateOptions struct { // Resumes the LRO from the provided token. ResumeToken string }
VirtualMachineScaleSetsClientBeginSetOrchestrationServiceStateOptions contains the optional parameters for the VirtualMachineScaleSetsClient.BeginSetOrchestrationServiceState method.
type VirtualMachineScaleSetsClientBeginStartOptions ¶
type VirtualMachineScaleSetsClientBeginStartOptions struct { // Resumes the LRO from the provided token. ResumeToken string // A list of virtual machine instance IDs from the VM scale set. VMInstanceIDs *VirtualMachineScaleSetVMInstanceIDs }
VirtualMachineScaleSetsClientBeginStartOptions contains the optional parameters for the VirtualMachineScaleSetsClient.BeginStart method.
type VirtualMachineScaleSetsClientBeginUpdateInstancesOptions ¶
type VirtualMachineScaleSetsClientBeginUpdateInstancesOptions struct { // Resumes the LRO from the provided token. ResumeToken string }
VirtualMachineScaleSetsClientBeginUpdateInstancesOptions contains the optional parameters for the VirtualMachineScaleSetsClient.BeginUpdateInstances method.
type VirtualMachineScaleSetsClientBeginUpdateOptions ¶
type VirtualMachineScaleSetsClientBeginUpdateOptions struct { // The ETag of the transformation. Omit this value to always overwrite the current resource. Specify the last-seen ETag value // to prevent accidentally overwriting concurrent changes. IfMatch *string // Set to '*' to allow a new record set to be created, but to prevent updating an existing record set. Other values will result // in error from server as they are not supported. IfNoneMatch *string // Resumes the LRO from the provided token. ResumeToken string }
VirtualMachineScaleSetsClientBeginUpdateOptions contains the optional parameters for the VirtualMachineScaleSetsClient.BeginUpdate method.
type VirtualMachineScaleSetsClientConvertToSinglePlacementGroupOptions ¶
type VirtualMachineScaleSetsClientConvertToSinglePlacementGroupOptions struct { }
VirtualMachineScaleSetsClientConvertToSinglePlacementGroupOptions contains the optional parameters for the VirtualMachineScaleSetsClient.ConvertToSinglePlacementGroup method.
type VirtualMachineScaleSetsClientConvertToSinglePlacementGroupResponse ¶
type VirtualMachineScaleSetsClientConvertToSinglePlacementGroupResponse struct { }
VirtualMachineScaleSetsClientConvertToSinglePlacementGroupResponse contains the response from method VirtualMachineScaleSetsClient.ConvertToSinglePlacementGroup.
type VirtualMachineScaleSetsClientCreateOrUpdateResponse ¶
type VirtualMachineScaleSetsClientCreateOrUpdateResponse struct { // Describes a Virtual Machine Scale Set. VirtualMachineScaleSet }
VirtualMachineScaleSetsClientCreateOrUpdateResponse contains the response from method VirtualMachineScaleSetsClient.BeginCreateOrUpdate.
type VirtualMachineScaleSetsClientDeallocateResponse ¶
type VirtualMachineScaleSetsClientDeallocateResponse struct { }
VirtualMachineScaleSetsClientDeallocateResponse contains the response from method VirtualMachineScaleSetsClient.BeginDeallocate.
type VirtualMachineScaleSetsClientDeleteInstancesResponse ¶
type VirtualMachineScaleSetsClientDeleteInstancesResponse struct { }
VirtualMachineScaleSetsClientDeleteInstancesResponse contains the response from method VirtualMachineScaleSetsClient.BeginDeleteInstances.
type VirtualMachineScaleSetsClientDeleteResponse ¶
type VirtualMachineScaleSetsClientDeleteResponse struct { }
VirtualMachineScaleSetsClientDeleteResponse contains the response from method VirtualMachineScaleSetsClient.BeginDelete.
type VirtualMachineScaleSetsClientForceRecoveryServiceFabricPlatformUpdateDomainWalkOptions ¶
type VirtualMachineScaleSetsClientForceRecoveryServiceFabricPlatformUpdateDomainWalkOptions struct { // The placement group id for which the manual recovery walk is requested. PlacementGroupID *string // The zone in which the manual recovery walk is requested for cross zone virtual machine scale set Zone *string }
VirtualMachineScaleSetsClientForceRecoveryServiceFabricPlatformUpdateDomainWalkOptions contains the optional parameters for the VirtualMachineScaleSetsClient.ForceRecoveryServiceFabricPlatformUpdateDomainWalk method.
type VirtualMachineScaleSetsClientForceRecoveryServiceFabricPlatformUpdateDomainWalkResponse ¶
type VirtualMachineScaleSetsClientForceRecoveryServiceFabricPlatformUpdateDomainWalkResponse struct { // Response after calling a manual recovery walk RecoveryWalkResponse }
VirtualMachineScaleSetsClientForceRecoveryServiceFabricPlatformUpdateDomainWalkResponse contains the response from method VirtualMachineScaleSetsClient.ForceRecoveryServiceFabricPlatformUpdateDomainWalk.
type VirtualMachineScaleSetsClientGetInstanceViewOptions ¶
type VirtualMachineScaleSetsClientGetInstanceViewOptions struct { }
VirtualMachineScaleSetsClientGetInstanceViewOptions contains the optional parameters for the VirtualMachineScaleSetsClient.GetInstanceView method.
type VirtualMachineScaleSetsClientGetInstanceViewResponse ¶
type VirtualMachineScaleSetsClientGetInstanceViewResponse struct { // The instance view of a virtual machine scale set. VirtualMachineScaleSetInstanceView }
VirtualMachineScaleSetsClientGetInstanceViewResponse contains the response from method VirtualMachineScaleSetsClient.GetInstanceView.
type VirtualMachineScaleSetsClientGetOSUpgradeHistoryOptions ¶
type VirtualMachineScaleSetsClientGetOSUpgradeHistoryOptions struct { }
VirtualMachineScaleSetsClientGetOSUpgradeHistoryOptions contains the optional parameters for the VirtualMachineScaleSetsClient.NewGetOSUpgradeHistoryPager method.
type VirtualMachineScaleSetsClientGetOSUpgradeHistoryResponse ¶
type VirtualMachineScaleSetsClientGetOSUpgradeHistoryResponse struct { // List of Virtual Machine Scale Set OS Upgrade History operation response. VirtualMachineScaleSetListOSUpgradeHistory }
VirtualMachineScaleSetsClientGetOSUpgradeHistoryResponse contains the response from method VirtualMachineScaleSetsClient.NewGetOSUpgradeHistoryPager.
type VirtualMachineScaleSetsClientGetOptions ¶
type VirtualMachineScaleSetsClientGetOptions struct { // The expand expression to apply on the operation. 'UserData' retrieves the UserData property of the VM scale set that was // provided by the user during the VM scale set Create/Update operation Expand *ExpandTypesForGetVMScaleSets }
VirtualMachineScaleSetsClientGetOptions contains the optional parameters for the VirtualMachineScaleSetsClient.Get method.
type VirtualMachineScaleSetsClientGetResponse ¶
type VirtualMachineScaleSetsClientGetResponse struct { // Describes a Virtual Machine Scale Set. VirtualMachineScaleSet }
VirtualMachineScaleSetsClientGetResponse contains the response from method VirtualMachineScaleSetsClient.Get.
type VirtualMachineScaleSetsClientListAllOptions ¶
type VirtualMachineScaleSetsClientListAllOptions struct { }
VirtualMachineScaleSetsClientListAllOptions contains the optional parameters for the VirtualMachineScaleSetsClient.NewListAllPager method.
type VirtualMachineScaleSetsClientListAllResponse ¶
type VirtualMachineScaleSetsClientListAllResponse struct { // The List Virtual Machine operation response. VirtualMachineScaleSetListWithLinkResult }
VirtualMachineScaleSetsClientListAllResponse contains the response from method VirtualMachineScaleSetsClient.NewListAllPager.
type VirtualMachineScaleSetsClientListByLocationOptions ¶
type VirtualMachineScaleSetsClientListByLocationOptions struct { }
VirtualMachineScaleSetsClientListByLocationOptions contains the optional parameters for the VirtualMachineScaleSetsClient.NewListByLocationPager method.
type VirtualMachineScaleSetsClientListByLocationResponse ¶
type VirtualMachineScaleSetsClientListByLocationResponse struct { // The List Virtual Machine operation response. VirtualMachineScaleSetListResult }
VirtualMachineScaleSetsClientListByLocationResponse contains the response from method VirtualMachineScaleSetsClient.NewListByLocationPager.
type VirtualMachineScaleSetsClientListOptions ¶
type VirtualMachineScaleSetsClientListOptions struct { }
VirtualMachineScaleSetsClientListOptions contains the optional parameters for the VirtualMachineScaleSetsClient.NewListPager method.
type VirtualMachineScaleSetsClientListResponse ¶
type VirtualMachineScaleSetsClientListResponse struct { // The List Virtual Machine operation response. VirtualMachineScaleSetListResult }
VirtualMachineScaleSetsClientListResponse contains the response from method VirtualMachineScaleSetsClient.NewListPager.
type VirtualMachineScaleSetsClientListSKUsOptions ¶
type VirtualMachineScaleSetsClientListSKUsOptions struct { }
VirtualMachineScaleSetsClientListSKUsOptions contains the optional parameters for the VirtualMachineScaleSetsClient.NewListSKUsPager method.
type VirtualMachineScaleSetsClientListSKUsResponse ¶
type VirtualMachineScaleSetsClientListSKUsResponse struct { // The Virtual Machine Scale Set List Skus operation response. VirtualMachineScaleSetListSKUsResult }
VirtualMachineScaleSetsClientListSKUsResponse contains the response from method VirtualMachineScaleSetsClient.NewListSKUsPager.
type VirtualMachineScaleSetsClientPerformMaintenanceResponse ¶
type VirtualMachineScaleSetsClientPerformMaintenanceResponse struct { }
VirtualMachineScaleSetsClientPerformMaintenanceResponse contains the response from method VirtualMachineScaleSetsClient.BeginPerformMaintenance.
type VirtualMachineScaleSetsClientPowerOffResponse ¶
type VirtualMachineScaleSetsClientPowerOffResponse struct { }
VirtualMachineScaleSetsClientPowerOffResponse contains the response from method VirtualMachineScaleSetsClient.BeginPowerOff.
type VirtualMachineScaleSetsClientReapplyResponse ¶
type VirtualMachineScaleSetsClientReapplyResponse struct { }
VirtualMachineScaleSetsClientReapplyResponse contains the response from method VirtualMachineScaleSetsClient.BeginReapply.
type VirtualMachineScaleSetsClientRedeployResponse ¶
type VirtualMachineScaleSetsClientRedeployResponse struct { }
VirtualMachineScaleSetsClientRedeployResponse contains the response from method VirtualMachineScaleSetsClient.BeginRedeploy.
type VirtualMachineScaleSetsClientReimageAllResponse ¶
type VirtualMachineScaleSetsClientReimageAllResponse struct { }
VirtualMachineScaleSetsClientReimageAllResponse contains the response from method VirtualMachineScaleSetsClient.BeginReimageAll.
type VirtualMachineScaleSetsClientReimageResponse ¶
type VirtualMachineScaleSetsClientReimageResponse struct { }
VirtualMachineScaleSetsClientReimageResponse contains the response from method VirtualMachineScaleSetsClient.BeginReimage.
type VirtualMachineScaleSetsClientRestartResponse ¶
type VirtualMachineScaleSetsClientRestartResponse struct { }
VirtualMachineScaleSetsClientRestartResponse contains the response from method VirtualMachineScaleSetsClient.BeginRestart.
type VirtualMachineScaleSetsClientSetOrchestrationServiceStateResponse ¶
type VirtualMachineScaleSetsClientSetOrchestrationServiceStateResponse struct { }
VirtualMachineScaleSetsClientSetOrchestrationServiceStateResponse contains the response from method VirtualMachineScaleSetsClient.BeginSetOrchestrationServiceState.
type VirtualMachineScaleSetsClientStartResponse ¶
type VirtualMachineScaleSetsClientStartResponse struct { }
VirtualMachineScaleSetsClientStartResponse contains the response from method VirtualMachineScaleSetsClient.BeginStart.
type VirtualMachineScaleSetsClientUpdateInstancesResponse ¶
type VirtualMachineScaleSetsClientUpdateInstancesResponse struct { }
VirtualMachineScaleSetsClientUpdateInstancesResponse contains the response from method VirtualMachineScaleSetsClient.BeginUpdateInstances.
type VirtualMachineScaleSetsClientUpdateResponse ¶
type VirtualMachineScaleSetsClientUpdateResponse struct { // Describes a Virtual Machine Scale Set. VirtualMachineScaleSet }
VirtualMachineScaleSetsClientUpdateResponse contains the response from method VirtualMachineScaleSetsClient.BeginUpdate.
type VirtualMachineSize ¶
type VirtualMachineSize struct { // The maximum number of data disks that can be attached to the virtual machine size. MaxDataDiskCount *int32 // The amount of memory, in MB, supported by the virtual machine size. MemoryInMB *int32 // The name of the virtual machine size. Name *string // The number of cores supported by the virtual machine size. For Constrained vCPU capable VM sizes, this number represents // the total vCPUs of quota that the VM uses. For accurate vCPU count, please // refer to https://docs.microsoft.com/azure/virtual-machines/constrained-vcpu or https://docs.microsoft.com/rest/api/compute/resourceskus/list NumberOfCores *int32 // The OS disk size, in MB, allowed by the virtual machine size. OSDiskSizeInMB *int32 // The resource disk size, in MB, allowed by the virtual machine size. ResourceDiskSizeInMB *int32 }
VirtualMachineSize - Describes the properties of a VM size.
func (VirtualMachineSize) MarshalJSON ¶
func (v VirtualMachineSize) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type VirtualMachineSize.
func (*VirtualMachineSize) UnmarshalJSON ¶
func (v *VirtualMachineSize) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type VirtualMachineSize.
type VirtualMachineSizeListResult ¶
type VirtualMachineSizeListResult struct { // The list of virtual machine sizes. Value []*VirtualMachineSize }
VirtualMachineSizeListResult - The List Virtual Machine operation response.
func (VirtualMachineSizeListResult) MarshalJSON ¶
func (v VirtualMachineSizeListResult) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type VirtualMachineSizeListResult.
func (*VirtualMachineSizeListResult) UnmarshalJSON ¶
func (v *VirtualMachineSizeListResult) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type VirtualMachineSizeListResult.
type VirtualMachineSizeTypes ¶
type VirtualMachineSizeTypes string
VirtualMachineSizeTypes - Specifies the size of the virtual machine. The enum data type is currently deprecated and will be removed by December 23rd 2023. The recommended way to get the list of available sizes is using these APIs: List all available virtual machine sizes in an availability set [https://docs.microsoft.com/rest/api/compute/availabilitysets/listavailablesizes], List all available virtual machine sizes in a region [https://docs.microsoft.com/rest/api/compute/resourceskus/list], List all available virtual machine sizes for resizing [https://docs.microsoft.com/rest/api/compute/virtualmachines/listavailablesizes]. For more information about virtual machine sizes, see Sizes for virtual machines [https://docs.microsoft.com/azure/virtual-machines/sizes]. The available VM sizes depend on region and availability set.
const ( VirtualMachineSizeTypesBasicA0 VirtualMachineSizeTypes = "Basic_A0" VirtualMachineSizeTypesBasicA1 VirtualMachineSizeTypes = "Basic_A1" VirtualMachineSizeTypesBasicA2 VirtualMachineSizeTypes = "Basic_A2" VirtualMachineSizeTypesBasicA3 VirtualMachineSizeTypes = "Basic_A3" VirtualMachineSizeTypesBasicA4 VirtualMachineSizeTypes = "Basic_A4" VirtualMachineSizeTypesStandardA0 VirtualMachineSizeTypes = "Standard_A0" VirtualMachineSizeTypesStandardA1 VirtualMachineSizeTypes = "Standard_A1" VirtualMachineSizeTypesStandardA10 VirtualMachineSizeTypes = "Standard_A10" VirtualMachineSizeTypesStandardA11 VirtualMachineSizeTypes = "Standard_A11" VirtualMachineSizeTypesStandardA1V2 VirtualMachineSizeTypes = "Standard_A1_v2" VirtualMachineSizeTypesStandardA2 VirtualMachineSizeTypes = "Standard_A2" VirtualMachineSizeTypesStandardA2MV2 VirtualMachineSizeTypes = "Standard_A2m_v2" VirtualMachineSizeTypesStandardA2V2 VirtualMachineSizeTypes = "Standard_A2_v2" VirtualMachineSizeTypesStandardA3 VirtualMachineSizeTypes = "Standard_A3" VirtualMachineSizeTypesStandardA4 VirtualMachineSizeTypes = "Standard_A4" VirtualMachineSizeTypesStandardA4MV2 VirtualMachineSizeTypes = "Standard_A4m_v2" VirtualMachineSizeTypesStandardA4V2 VirtualMachineSizeTypes = "Standard_A4_v2" VirtualMachineSizeTypesStandardA5 VirtualMachineSizeTypes = "Standard_A5" VirtualMachineSizeTypesStandardA6 VirtualMachineSizeTypes = "Standard_A6" VirtualMachineSizeTypesStandardA7 VirtualMachineSizeTypes = "Standard_A7" VirtualMachineSizeTypesStandardA8 VirtualMachineSizeTypes = "Standard_A8" VirtualMachineSizeTypesStandardA8MV2 VirtualMachineSizeTypes = "Standard_A8m_v2" VirtualMachineSizeTypesStandardA8V2 VirtualMachineSizeTypes = "Standard_A8_v2" VirtualMachineSizeTypesStandardA9 VirtualMachineSizeTypes = "Standard_A9" VirtualMachineSizeTypesStandardB1Ms VirtualMachineSizeTypes = "Standard_B1ms" VirtualMachineSizeTypesStandardB1S VirtualMachineSizeTypes = "Standard_B1s" VirtualMachineSizeTypesStandardB2Ms VirtualMachineSizeTypes = "Standard_B2ms" VirtualMachineSizeTypesStandardB2S VirtualMachineSizeTypes = "Standard_B2s" VirtualMachineSizeTypesStandardB4Ms VirtualMachineSizeTypes = "Standard_B4ms" VirtualMachineSizeTypesStandardB8Ms VirtualMachineSizeTypes = "Standard_B8ms" VirtualMachineSizeTypesStandardD1 VirtualMachineSizeTypes = "Standard_D1" VirtualMachineSizeTypesStandardD11 VirtualMachineSizeTypes = "Standard_D11" VirtualMachineSizeTypesStandardD11V2 VirtualMachineSizeTypes = "Standard_D11_v2" VirtualMachineSizeTypesStandardD12 VirtualMachineSizeTypes = "Standard_D12" VirtualMachineSizeTypesStandardD12V2 VirtualMachineSizeTypes = "Standard_D12_v2" VirtualMachineSizeTypesStandardD13 VirtualMachineSizeTypes = "Standard_D13" VirtualMachineSizeTypesStandardD13V2 VirtualMachineSizeTypes = "Standard_D13_v2" VirtualMachineSizeTypesStandardD14 VirtualMachineSizeTypes = "Standard_D14" VirtualMachineSizeTypesStandardD14V2 VirtualMachineSizeTypes = "Standard_D14_v2" VirtualMachineSizeTypesStandardD15V2 VirtualMachineSizeTypes = "Standard_D15_v2" VirtualMachineSizeTypesStandardD16SV3 VirtualMachineSizeTypes = "Standard_D16s_v3" VirtualMachineSizeTypesStandardD16V3 VirtualMachineSizeTypes = "Standard_D16_v3" VirtualMachineSizeTypesStandardD1V2 VirtualMachineSizeTypes = "Standard_D1_v2" VirtualMachineSizeTypesStandardD2 VirtualMachineSizeTypes = "Standard_D2" VirtualMachineSizeTypesStandardD2SV3 VirtualMachineSizeTypes = "Standard_D2s_v3" VirtualMachineSizeTypesStandardD2V2 VirtualMachineSizeTypes = "Standard_D2_v2" VirtualMachineSizeTypesStandardD2V3 VirtualMachineSizeTypes = "Standard_D2_v3" VirtualMachineSizeTypesStandardD3 VirtualMachineSizeTypes = "Standard_D3" VirtualMachineSizeTypesStandardD32SV3 VirtualMachineSizeTypes = "Standard_D32s_v3" VirtualMachineSizeTypesStandardD32V3 VirtualMachineSizeTypes = "Standard_D32_v3" VirtualMachineSizeTypesStandardD3V2 VirtualMachineSizeTypes = "Standard_D3_v2" VirtualMachineSizeTypesStandardD4 VirtualMachineSizeTypes = "Standard_D4" VirtualMachineSizeTypesStandardD4SV3 VirtualMachineSizeTypes = "Standard_D4s_v3" VirtualMachineSizeTypesStandardD4V2 VirtualMachineSizeTypes = "Standard_D4_v2" VirtualMachineSizeTypesStandardD4V3 VirtualMachineSizeTypes = "Standard_D4_v3" VirtualMachineSizeTypesStandardD5V2 VirtualMachineSizeTypes = "Standard_D5_v2" VirtualMachineSizeTypesStandardD64SV3 VirtualMachineSizeTypes = "Standard_D64s_v3" VirtualMachineSizeTypesStandardD64V3 VirtualMachineSizeTypes = "Standard_D64_v3" VirtualMachineSizeTypesStandardD8SV3 VirtualMachineSizeTypes = "Standard_D8s_v3" VirtualMachineSizeTypesStandardD8V3 VirtualMachineSizeTypes = "Standard_D8_v3" VirtualMachineSizeTypesStandardDS1 VirtualMachineSizeTypes = "Standard_DS1" VirtualMachineSizeTypesStandardDS11 VirtualMachineSizeTypes = "Standard_DS11" VirtualMachineSizeTypesStandardDS11V2 VirtualMachineSizeTypes = "Standard_DS11_v2" VirtualMachineSizeTypesStandardDS12 VirtualMachineSizeTypes = "Standard_DS12" VirtualMachineSizeTypesStandardDS12V2 VirtualMachineSizeTypes = "Standard_DS12_v2" VirtualMachineSizeTypesStandardDS13 VirtualMachineSizeTypes = "Standard_DS13" VirtualMachineSizeTypesStandardDS132V2 VirtualMachineSizeTypes = "Standard_DS13-2_v2" VirtualMachineSizeTypesStandardDS134V2 VirtualMachineSizeTypes = "Standard_DS13-4_v2" VirtualMachineSizeTypesStandardDS13V2 VirtualMachineSizeTypes = "Standard_DS13_v2" VirtualMachineSizeTypesStandardDS14 VirtualMachineSizeTypes = "Standard_DS14" VirtualMachineSizeTypesStandardDS144V2 VirtualMachineSizeTypes = "Standard_DS14-4_v2" VirtualMachineSizeTypesStandardDS148V2 VirtualMachineSizeTypes = "Standard_DS14-8_v2" VirtualMachineSizeTypesStandardDS14V2 VirtualMachineSizeTypes = "Standard_DS14_v2" VirtualMachineSizeTypesStandardDS15V2 VirtualMachineSizeTypes = "Standard_DS15_v2" VirtualMachineSizeTypesStandardDS1V2 VirtualMachineSizeTypes = "Standard_DS1_v2" VirtualMachineSizeTypesStandardDS2 VirtualMachineSizeTypes = "Standard_DS2" VirtualMachineSizeTypesStandardDS2V2 VirtualMachineSizeTypes = "Standard_DS2_v2" VirtualMachineSizeTypesStandardDS3 VirtualMachineSizeTypes = "Standard_DS3" VirtualMachineSizeTypesStandardDS3V2 VirtualMachineSizeTypes = "Standard_DS3_v2" VirtualMachineSizeTypesStandardDS4 VirtualMachineSizeTypes = "Standard_DS4" VirtualMachineSizeTypesStandardDS4V2 VirtualMachineSizeTypes = "Standard_DS4_v2" VirtualMachineSizeTypesStandardDS5V2 VirtualMachineSizeTypes = "Standard_DS5_v2" VirtualMachineSizeTypesStandardE16SV3 VirtualMachineSizeTypes = "Standard_E16s_v3" VirtualMachineSizeTypesStandardE16V3 VirtualMachineSizeTypes = "Standard_E16_v3" VirtualMachineSizeTypesStandardE2SV3 VirtualMachineSizeTypes = "Standard_E2s_v3" VirtualMachineSizeTypesStandardE2V3 VirtualMachineSizeTypes = "Standard_E2_v3" VirtualMachineSizeTypesStandardE3216V3 VirtualMachineSizeTypes = "Standard_E32-16_v3" VirtualMachineSizeTypesStandardE328SV3 VirtualMachineSizeTypes = "Standard_E32-8s_v3" VirtualMachineSizeTypesStandardE32SV3 VirtualMachineSizeTypes = "Standard_E32s_v3" VirtualMachineSizeTypesStandardE32V3 VirtualMachineSizeTypes = "Standard_E32_v3" VirtualMachineSizeTypesStandardE4SV3 VirtualMachineSizeTypes = "Standard_E4s_v3" VirtualMachineSizeTypesStandardE4V3 VirtualMachineSizeTypes = "Standard_E4_v3" VirtualMachineSizeTypesStandardE6416SV3 VirtualMachineSizeTypes = "Standard_E64-16s_v3" VirtualMachineSizeTypesStandardE6432SV3 VirtualMachineSizeTypes = "Standard_E64-32s_v3" VirtualMachineSizeTypesStandardE64SV3 VirtualMachineSizeTypes = "Standard_E64s_v3" VirtualMachineSizeTypesStandardE64V3 VirtualMachineSizeTypes = "Standard_E64_v3" VirtualMachineSizeTypesStandardE8SV3 VirtualMachineSizeTypes = "Standard_E8s_v3" VirtualMachineSizeTypesStandardE8V3 VirtualMachineSizeTypes = "Standard_E8_v3" VirtualMachineSizeTypesStandardF1 VirtualMachineSizeTypes = "Standard_F1" VirtualMachineSizeTypesStandardF16 VirtualMachineSizeTypes = "Standard_F16" VirtualMachineSizeTypesStandardF16S VirtualMachineSizeTypes = "Standard_F16s" VirtualMachineSizeTypesStandardF16SV2 VirtualMachineSizeTypes = "Standard_F16s_v2" VirtualMachineSizeTypesStandardF1S VirtualMachineSizeTypes = "Standard_F1s" VirtualMachineSizeTypesStandardF2 VirtualMachineSizeTypes = "Standard_F2" VirtualMachineSizeTypesStandardF2S VirtualMachineSizeTypes = "Standard_F2s" VirtualMachineSizeTypesStandardF2SV2 VirtualMachineSizeTypes = "Standard_F2s_v2" VirtualMachineSizeTypesStandardF32SV2 VirtualMachineSizeTypes = "Standard_F32s_v2" VirtualMachineSizeTypesStandardF4 VirtualMachineSizeTypes = "Standard_F4" VirtualMachineSizeTypesStandardF4S VirtualMachineSizeTypes = "Standard_F4s" VirtualMachineSizeTypesStandardF4SV2 VirtualMachineSizeTypes = "Standard_F4s_v2" VirtualMachineSizeTypesStandardF64SV2 VirtualMachineSizeTypes = "Standard_F64s_v2" VirtualMachineSizeTypesStandardF72SV2 VirtualMachineSizeTypes = "Standard_F72s_v2" VirtualMachineSizeTypesStandardF8 VirtualMachineSizeTypes = "Standard_F8" VirtualMachineSizeTypesStandardF8S VirtualMachineSizeTypes = "Standard_F8s" VirtualMachineSizeTypesStandardF8SV2 VirtualMachineSizeTypes = "Standard_F8s_v2" VirtualMachineSizeTypesStandardG1 VirtualMachineSizeTypes = "Standard_G1" VirtualMachineSizeTypesStandardG2 VirtualMachineSizeTypes = "Standard_G2" VirtualMachineSizeTypesStandardG3 VirtualMachineSizeTypes = "Standard_G3" VirtualMachineSizeTypesStandardG4 VirtualMachineSizeTypes = "Standard_G4" VirtualMachineSizeTypesStandardG5 VirtualMachineSizeTypes = "Standard_G5" VirtualMachineSizeTypesStandardGS1 VirtualMachineSizeTypes = "Standard_GS1" VirtualMachineSizeTypesStandardGS2 VirtualMachineSizeTypes = "Standard_GS2" VirtualMachineSizeTypesStandardGS3 VirtualMachineSizeTypes = "Standard_GS3" VirtualMachineSizeTypesStandardGS4 VirtualMachineSizeTypes = "Standard_GS4" VirtualMachineSizeTypesStandardGS44 VirtualMachineSizeTypes = "Standard_GS4-4" VirtualMachineSizeTypesStandardGS48 VirtualMachineSizeTypes = "Standard_GS4-8" VirtualMachineSizeTypesStandardGS5 VirtualMachineSizeTypes = "Standard_GS5" VirtualMachineSizeTypesStandardGS516 VirtualMachineSizeTypes = "Standard_GS5-16" VirtualMachineSizeTypesStandardGS58 VirtualMachineSizeTypes = "Standard_GS5-8" VirtualMachineSizeTypesStandardH16 VirtualMachineSizeTypes = "Standard_H16" VirtualMachineSizeTypesStandardH16M VirtualMachineSizeTypes = "Standard_H16m" VirtualMachineSizeTypesStandardH16Mr VirtualMachineSizeTypes = "Standard_H16mr" VirtualMachineSizeTypesStandardH16R VirtualMachineSizeTypes = "Standard_H16r" VirtualMachineSizeTypesStandardH8 VirtualMachineSizeTypes = "Standard_H8" VirtualMachineSizeTypesStandardH8M VirtualMachineSizeTypes = "Standard_H8m" VirtualMachineSizeTypesStandardL16S VirtualMachineSizeTypes = "Standard_L16s" VirtualMachineSizeTypesStandardL32S VirtualMachineSizeTypes = "Standard_L32s" VirtualMachineSizeTypesStandardL4S VirtualMachineSizeTypes = "Standard_L4s" VirtualMachineSizeTypesStandardL8S VirtualMachineSizeTypes = "Standard_L8s" VirtualMachineSizeTypesStandardM12832Ms VirtualMachineSizeTypes = "Standard_M128-32ms" VirtualMachineSizeTypesStandardM12864Ms VirtualMachineSizeTypes = "Standard_M128-64ms" VirtualMachineSizeTypesStandardM128Ms VirtualMachineSizeTypes = "Standard_M128ms" VirtualMachineSizeTypesStandardM128S VirtualMachineSizeTypes = "Standard_M128s" VirtualMachineSizeTypesStandardM6416Ms VirtualMachineSizeTypes = "Standard_M64-16ms" VirtualMachineSizeTypesStandardM6432Ms VirtualMachineSizeTypes = "Standard_M64-32ms" VirtualMachineSizeTypesStandardM64Ms VirtualMachineSizeTypes = "Standard_M64ms" VirtualMachineSizeTypesStandardM64S VirtualMachineSizeTypes = "Standard_M64s" VirtualMachineSizeTypesStandardNC12 VirtualMachineSizeTypes = "Standard_NC12" VirtualMachineSizeTypesStandardNC12SV2 VirtualMachineSizeTypes = "Standard_NC12s_v2" VirtualMachineSizeTypesStandardNC12SV3 VirtualMachineSizeTypes = "Standard_NC12s_v3" VirtualMachineSizeTypesStandardNC24 VirtualMachineSizeTypes = "Standard_NC24" VirtualMachineSizeTypesStandardNC24R VirtualMachineSizeTypes = "Standard_NC24r" VirtualMachineSizeTypesStandardNC24RsV2 VirtualMachineSizeTypes = "Standard_NC24rs_v2" VirtualMachineSizeTypesStandardNC24RsV3 VirtualMachineSizeTypes = "Standard_NC24rs_v3" VirtualMachineSizeTypesStandardNC24SV2 VirtualMachineSizeTypes = "Standard_NC24s_v2" VirtualMachineSizeTypesStandardNC24SV3 VirtualMachineSizeTypes = "Standard_NC24s_v3" VirtualMachineSizeTypesStandardNC6 VirtualMachineSizeTypes = "Standard_NC6" VirtualMachineSizeTypesStandardNC6SV2 VirtualMachineSizeTypes = "Standard_NC6s_v2" VirtualMachineSizeTypesStandardNC6SV3 VirtualMachineSizeTypes = "Standard_NC6s_v3" VirtualMachineSizeTypesStandardND12S VirtualMachineSizeTypes = "Standard_ND12s" VirtualMachineSizeTypesStandardND24Rs VirtualMachineSizeTypes = "Standard_ND24rs" VirtualMachineSizeTypesStandardND24S VirtualMachineSizeTypes = "Standard_ND24s" VirtualMachineSizeTypesStandardND6S VirtualMachineSizeTypes = "Standard_ND6s" VirtualMachineSizeTypesStandardNV12 VirtualMachineSizeTypes = "Standard_NV12" VirtualMachineSizeTypesStandardNV24 VirtualMachineSizeTypes = "Standard_NV24" VirtualMachineSizeTypesStandardNV6 VirtualMachineSizeTypes = "Standard_NV6" )
func PossibleVirtualMachineSizeTypesValues ¶
func PossibleVirtualMachineSizeTypesValues() []VirtualMachineSizeTypes
PossibleVirtualMachineSizeTypesValues returns the possible values for the VirtualMachineSizeTypes const type.
type VirtualMachineSizesClient ¶
type VirtualMachineSizesClient struct {
// contains filtered or unexported fields
}
VirtualMachineSizesClient contains the methods for the VirtualMachineSizes group. Don't use this type directly, use NewVirtualMachineSizesClient() instead.
func NewVirtualMachineSizesClient ¶
func NewVirtualMachineSizesClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*VirtualMachineSizesClient, error)
NewVirtualMachineSizesClient creates a new instance of VirtualMachineSizesClient 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 (*VirtualMachineSizesClient) NewListPager ¶
func (client *VirtualMachineSizesClient) NewListPager(location string, options *VirtualMachineSizesClientListOptions) *runtime.Pager[VirtualMachineSizesClientListResponse]
NewListPager - This API is deprecated. Use Resources Skus [https://docs.microsoft.com/rest/api/compute/resourceskus/list]
Generated from API version 2024-03-01
- location - The location upon which virtual-machine-sizes is queried.
- options - VirtualMachineSizesClientListOptions contains the optional parameters for the VirtualMachineSizesClient.NewListPager method.
Example (VirtualMachineSizesListMaximumSetGen) ¶
Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/92de53a5f1e0e03c94b40475d2135d97148ed014/specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-03-01/examples/computeRPCommonExamples/VirtualMachineSizes_List_MaximumSet_Gen.json
cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() clientFactory, err := armcompute.NewClientFactory("<subscription-id>", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } pager := clientFactory.NewVirtualMachineSizesClient().NewListPager("-e", nil) for pager.More() { page, err := pager.NextPage(ctx) if err != nil { log.Fatalf("failed to advance page: %v", err) } for _, v := range page.Value { // You could use page here. We use blank identifier for just demo purposes. _ = v } // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. // page.VirtualMachineSizeListResult = armcompute.VirtualMachineSizeListResult{ // Value: []*armcompute.VirtualMachineSize{ // { // Name: to.Ptr("Standard_A1_V2"), // MaxDataDiskCount: to.Ptr[int32](2), // MemoryInMB: to.Ptr[int32](2048), // NumberOfCores: to.Ptr[int32](1), // OSDiskSizeInMB: to.Ptr[int32](1047552), // ResourceDiskSizeInMB: to.Ptr[int32](10240), // }, // { // Name: to.Ptr("Standard_A2_V2"), // MaxDataDiskCount: to.Ptr[int32](4), // MemoryInMB: to.Ptr[int32](4096), // NumberOfCores: to.Ptr[int32](2), // OSDiskSizeInMB: to.Ptr[int32](1047552), // ResourceDiskSizeInMB: to.Ptr[int32](20480), // }}, // } }
Output:
Example (VirtualMachineSizesListMinimumSetGen) ¶
Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/92de53a5f1e0e03c94b40475d2135d97148ed014/specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-03-01/examples/computeRPCommonExamples/VirtualMachineSizes_List_MinimumSet_Gen.json
cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() clientFactory, err := armcompute.NewClientFactory("<subscription-id>", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } pager := clientFactory.NewVirtualMachineSizesClient().NewListPager("._..", nil) for pager.More() { page, err := pager.NextPage(ctx) if err != nil { log.Fatalf("failed to advance page: %v", err) } for _, v := range page.Value { // You could use page here. We use blank identifier for just demo purposes. _ = v } // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. // page.VirtualMachineSizeListResult = armcompute.VirtualMachineSizeListResult{ // } }
Output:
type VirtualMachineSizesClientListOptions ¶
type VirtualMachineSizesClientListOptions struct { }
VirtualMachineSizesClientListOptions contains the optional parameters for the VirtualMachineSizesClient.NewListPager method.
type VirtualMachineSizesClientListResponse ¶
type VirtualMachineSizesClientListResponse struct { // The List Virtual Machine operation response. VirtualMachineSizeListResult }
VirtualMachineSizesClientListResponse contains the response from method VirtualMachineSizesClient.NewListPager.
type VirtualMachineSoftwarePatchProperties ¶
type VirtualMachineSoftwarePatchProperties struct { // READ-ONLY; The activity ID of the operation that produced this result. It is used to correlate across CRP and extension // logs. ActivityID *string // READ-ONLY; Describes the availability of a given patch. AssessmentState *PatchAssessmentState // READ-ONLY; The classification(s) of the patch as provided by the patch publisher. Classifications []*string // READ-ONLY; The KBID of the patch. Only applies to Windows patches. KbID *string // READ-ONLY; The UTC timestamp of the last update to this patch record. LastModifiedDateTime *time.Time // READ-ONLY; The friendly name of the patch. Name *string // READ-ONLY; A unique identifier for the patch. PatchID *string // READ-ONLY; The UTC timestamp when the repository published this patch. PublishedDate *time.Time // READ-ONLY; Describes the reboot requirements of the patch. RebootBehavior *VMGuestPatchRebootBehavior // READ-ONLY; The version number of the patch. This property applies only to Linux patches. Version *string }
VirtualMachineSoftwarePatchProperties - Describes the properties of a Virtual Machine software patch.
func (VirtualMachineSoftwarePatchProperties) MarshalJSON ¶
func (v VirtualMachineSoftwarePatchProperties) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type VirtualMachineSoftwarePatchProperties.
func (*VirtualMachineSoftwarePatchProperties) UnmarshalJSON ¶
func (v *VirtualMachineSoftwarePatchProperties) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type VirtualMachineSoftwarePatchProperties.
type VirtualMachineStatusCodeCount ¶
type VirtualMachineStatusCodeCount struct { // READ-ONLY; The instance view status code. Code *string // READ-ONLY; The number of instances having a particular status code. Count *int32 }
VirtualMachineStatusCodeCount - The status code and count of the virtual machine scale set instance view status summary.
func (VirtualMachineStatusCodeCount) MarshalJSON ¶
func (v VirtualMachineStatusCodeCount) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type VirtualMachineStatusCodeCount.
func (*VirtualMachineStatusCodeCount) UnmarshalJSON ¶
func (v *VirtualMachineStatusCodeCount) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type VirtualMachineStatusCodeCount.
type VirtualMachineUpdate ¶
type VirtualMachineUpdate struct { // The identity of the virtual machine, if configured. Identity *VirtualMachineIdentity // Specifies information about the marketplace image used to create the virtual machine. This element is only used for marketplace // images. Before you can use a marketplace image from an API, you must // enable the image for programmatic use. In the Azure portal, find the marketplace image that you want to use and then click // Want to deploy programmatically, Get Started ->. Enter any required // information and then click Save. Plan *Plan // Describes the properties of a Virtual Machine. Properties *VirtualMachineProperties // Resource tags Tags map[string]*string // The virtual machine zones. Zones []*string }
VirtualMachineUpdate - Describes a Virtual Machine Update.
func (VirtualMachineUpdate) MarshalJSON ¶
func (v VirtualMachineUpdate) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type VirtualMachineUpdate.
func (*VirtualMachineUpdate) UnmarshalJSON ¶
func (v *VirtualMachineUpdate) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type VirtualMachineUpdate.
type VirtualMachinesClient ¶
type VirtualMachinesClient struct {
// contains filtered or unexported fields
}
VirtualMachinesClient contains the methods for the VirtualMachines group. Don't use this type directly, use NewVirtualMachinesClient() instead.
func NewVirtualMachinesClient ¶
func NewVirtualMachinesClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*VirtualMachinesClient, error)
NewVirtualMachinesClient creates a new instance of VirtualMachinesClient 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 (*VirtualMachinesClient) BeginAssessPatches ¶
func (client *VirtualMachinesClient) BeginAssessPatches(ctx context.Context, resourceGroupName string, vmName string, options *VirtualMachinesClientBeginAssessPatchesOptions) (*runtime.Poller[VirtualMachinesClientAssessPatchesResponse], error)
BeginAssessPatches - Assess patches on the VM. If the operation fails it returns an *azcore.ResponseError type.
Generated from API version 2024-03-01
- resourceGroupName - The name of the resource group.
- vmName - The name of the virtual machine.
- options - VirtualMachinesClientBeginAssessPatchesOptions contains the optional parameters for the VirtualMachinesClient.BeginAssessPatches method.
Example ¶
Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/92de53a5f1e0e03c94b40475d2135d97148ed014/specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-03-01/examples/virtualMachineExamples/VirtualMachine_AssessPatches.json
cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() clientFactory, err := armcompute.NewClientFactory("<subscription-id>", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } poller, err := clientFactory.NewVirtualMachinesClient().BeginAssessPatches(ctx, "myResourceGroupName", "myVMName", nil) if err != nil { log.Fatalf("failed to finish the request: %v", err) } res, err := poller.PollUntilDone(ctx, nil) if err != nil { log.Fatalf("failed to pull the result: %v", err) } // You could use response here. We use blank identifier for just demo purposes. _ = res // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. // res.VirtualMachineAssessPatchesResult = armcompute.VirtualMachineAssessPatchesResult{ // AssessmentActivityID: to.Ptr("68f8b292-dfc2-4646-9781-33cc88631968"), // AvailablePatches: []*armcompute.VirtualMachineSoftwarePatchProperties{ // { // Name: to.Ptr("Definition Update for Windows Defender Antivirus - KB2267602 (Definition 1.279.1373.0)"), // ActivityID: to.Ptr("68f8b292-dfc2-4646-9781-33cc88631968"), // AssessmentState: to.Ptr(armcompute.PatchAssessmentStateAvailable), // Classifications: []*string{ // to.Ptr("Definition Updates")}, // KbID: to.Ptr("2267602"), // LastModifiedDateTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-04-24T21:18:45.283Z"); return t}()), // PatchID: to.Ptr("35428702-5784-4ba4-a6e0-5222258b5411"), // PublishedDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2018-11-07T00:00:00.000Z"); return t}()), // RebootBehavior: to.Ptr(armcompute.VMGuestPatchRebootBehaviorNeverReboots), // Version: to.Ptr(""), // }, // { // Name: to.Ptr("Windows Malicious Software Removal Tool x64 - October 2018 (KB890830)"), // ActivityID: to.Ptr("68f8b292-dfc2-4646-9781-33cc88631968"), // AssessmentState: to.Ptr(armcompute.PatchAssessmentStateAvailable), // Classifications: []*string{ // to.Ptr("Update Rollups")}, // KbID: to.Ptr("890830"), // LastModifiedDateTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-04-24T21:18:45.283Z"); return t}()), // PatchID: to.Ptr("39f9cdd1-795c-4d0e-8c0a-73ab3f31746d"), // PublishedDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2018-11-07T00:00:00.000Z"); return t}()), // RebootBehavior: to.Ptr(armcompute.VMGuestPatchRebootBehaviorCanRequestReboot), // Version: to.Ptr(""), // }}, // CriticalAndSecurityPatchCount: to.Ptr[int32](1), // OtherPatchCount: to.Ptr[int32](2), // RebootPending: to.Ptr(true), // StartDateTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-04-24T21:02:04.255Z"); return t}()), // Status: to.Ptr(armcompute.PatchOperationStatusSucceeded), // }
Output:
func (*VirtualMachinesClient) BeginAttachDetachDataDisks ¶ added in v5.4.0
func (client *VirtualMachinesClient) BeginAttachDetachDataDisks(ctx context.Context, resourceGroupName string, vmName string, parameters AttachDetachDataDisksRequest, options *VirtualMachinesClientBeginAttachDetachDataDisksOptions) (*runtime.Poller[VirtualMachinesClientAttachDetachDataDisksResponse], error)
BeginAttachDetachDataDisks - Attach and detach data disks to/from the virtual machine. If the operation fails it returns an *azcore.ResponseError type.
Generated from API version 2024-03-01
- resourceGroupName - The name of the resource group.
- vmName - The name of the virtual machine.
- parameters - Parameters supplied to the attach and detach data disks operation on the virtual machine.
- options - VirtualMachinesClientBeginAttachDetachDataDisksOptions contains the optional parameters for the VirtualMachinesClient.BeginAttachDetachDataDisks method.
Example (VirtualMachineAttachDetachDataDisksMaximumSetGen) ¶
Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/92de53a5f1e0e03c94b40475d2135d97148ed014/specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-03-01/examples/virtualMachineExamples/VirtualMachine_AttachDetachDataDisks_MaximumSet_Gen.json
cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() clientFactory, err := armcompute.NewClientFactory("<subscription-id>", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } poller, err := clientFactory.NewVirtualMachinesClient().BeginAttachDetachDataDisks(ctx, "rgcompute", "aaaaaaaaaaaaaaaaaaaa", armcompute.AttachDetachDataDisksRequest{ DataDisksToAttach: []*armcompute.DataDisksToAttach{ { Caching: to.Ptr(armcompute.CachingTypesReadOnly), DeleteOption: to.Ptr(armcompute.DiskDeleteOptionTypesDelete), DiskEncryptionSet: &armcompute.DiskEncryptionSetParameters{ ID: to.Ptr("/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/diskEncryptionSets/{existing-diskEncryptionSet-name}"), }, DiskID: to.Ptr("/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/disks/vmss3176_vmss3176_0_disk2_6c4f554bdafa49baa780eb2d128ff39d"), Lun: to.Ptr[int32](1), WriteAcceleratorEnabled: to.Ptr(true), }, { Caching: to.Ptr(armcompute.CachingTypesReadWrite), DeleteOption: to.Ptr(armcompute.DiskDeleteOptionTypesDetach), DiskEncryptionSet: &armcompute.DiskEncryptionSetParameters{ ID: to.Ptr("/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/diskEncryptionSets/{existing-diskEncryptionSet-name}"), }, DiskID: to.Ptr("/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/disks/vmss3176_vmss3176_2_disk3_7d5e664bdafa49baa780eb2d128ff38e"), Lun: to.Ptr[int32](2), WriteAcceleratorEnabled: to.Ptr(false), }}, DataDisksToDetach: []*armcompute.DataDisksToDetach{ { DetachOption: to.Ptr(armcompute.DiskDetachOptionTypesForceDetach), DiskID: to.Ptr("/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/disks/vmss3176_vmss3176_1_disk1_1a4e784bdafa49baa780eb2d128ff65x"), }, { DetachOption: to.Ptr(armcompute.DiskDetachOptionTypesForceDetach), DiskID: to.Ptr("/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/disks/vmss3176_vmss3176_4_disk4_4d4e784bdafa49baa780eb2d256ff41z"), }}, }, nil) if err != nil { log.Fatalf("failed to finish the request: %v", err) } res, err := poller.PollUntilDone(ctx, nil) if err != nil { log.Fatalf("failed to pull the result: %v", err) } // You could use response here. We use blank identifier for just demo purposes. _ = res // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. // res.StorageProfile = armcompute.StorageProfile{ // DataDisks: []*armcompute.DataDisk{ // { // Name: to.Ptr("vmss3176_vmss3176_0_disk2_6c4f554bdafa49baa780eb2d128ff39d"), // Caching: to.Ptr(armcompute.CachingTypesReadOnly), // CreateOption: to.Ptr(armcompute.DiskCreateOptionTypesAttach), // DeleteOption: to.Ptr(armcompute.DiskDeleteOptionTypesDelete), // DiskSizeGB: to.Ptr[int32](30), // Lun: to.Ptr[int32](1), // ManagedDisk: &armcompute.ManagedDiskParameters{ // ID: to.Ptr("/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/disks/vmss3176_vmss3176_0_disk2_6c4f554bdafa49baa780eb2d128ff39d"), // DiskEncryptionSet: &armcompute.DiskEncryptionSetParameters{ // ID: to.Ptr("/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/diskEncryptionSets/{existing-diskEncryptionSet-name}"), // }, // StorageAccountType: to.Ptr(armcompute.StorageAccountTypesPremiumLRS), // }, // WriteAcceleratorEnabled: to.Ptr(true), // }, // { // Name: to.Ptr("vmss3176_vmss3176_2_disk3_7d5e664bdafa49baa780eb2d128ff38e"), // Caching: to.Ptr(armcompute.CachingTypesReadWrite), // CreateOption: to.Ptr(armcompute.DiskCreateOptionTypesAttach), // DeleteOption: to.Ptr(armcompute.DiskDeleteOptionTypesDetach), // DiskSizeGB: to.Ptr[int32](100), // Lun: to.Ptr[int32](2), // ManagedDisk: &armcompute.ManagedDiskParameters{ // ID: to.Ptr("/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/disks/vmss3176_vmss3176_2_disk3_7d5e664bdafa49baa780eb2d128ff38e"), // DiskEncryptionSet: &armcompute.DiskEncryptionSetParameters{ // ID: to.Ptr("/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/diskEncryptionSets/{existing-diskEncryptionSet-name}"), // }, // StorageAccountType: to.Ptr(armcompute.StorageAccountTypesPremiumLRS), // }, // WriteAcceleratorEnabled: to.Ptr(false), // }}, // ImageReference: &armcompute.ImageReference{ // Offer: to.Ptr("WindowsServer"), // Publisher: to.Ptr("MicrosoftWindowsServer"), // SKU: to.Ptr("2016-Datacenter"), // Version: to.Ptr("latest"), // }, // OSDisk: &armcompute.OSDisk{ // Name: to.Ptr("myOsDisk"), // Caching: to.Ptr(armcompute.CachingTypesReadWrite), // CreateOption: to.Ptr(armcompute.DiskCreateOptionTypesFromImage), // DiskSizeGB: to.Ptr[int32](30), // ManagedDisk: &armcompute.ManagedDiskParameters{ // ID: to.Ptr("/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/disks/myOsDisk"), // StorageAccountType: to.Ptr(armcompute.StorageAccountTypesPremiumLRS), // }, // OSType: to.Ptr(armcompute.OperatingSystemTypesWindows), // }, // }
Output:
Example (VirtualMachineAttachDetachDataDisksMinimumSetGen) ¶
Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/92de53a5f1e0e03c94b40475d2135d97148ed014/specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-03-01/examples/virtualMachineExamples/VirtualMachine_AttachDetachDataDisks_MinimumSet_Gen.json
cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() clientFactory, err := armcompute.NewClientFactory("<subscription-id>", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } poller, err := clientFactory.NewVirtualMachinesClient().BeginAttachDetachDataDisks(ctx, "rgcompute", "azure-vm", armcompute.AttachDetachDataDisksRequest{ DataDisksToAttach: []*armcompute.DataDisksToAttach{ { DiskID: to.Ptr("/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/disks/vmss3176_vmss3176_0_disk2_6c4f554bdafa49baa780eb2d128ff39d"), }}, DataDisksToDetach: []*armcompute.DataDisksToDetach{ { DiskID: to.Ptr("/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/disks/vmss3176_vmss3176_1_disk1_1a4e784bdafa49baa780eb2d128ff65x"), }}, }, nil) if err != nil { log.Fatalf("failed to finish the request: %v", err) } res, err := poller.PollUntilDone(ctx, nil) if err != nil { log.Fatalf("failed to pull the result: %v", err) } // You could use response here. We use blank identifier for just demo purposes. _ = res // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. // res.StorageProfile = armcompute.StorageProfile{ // DataDisks: []*armcompute.DataDisk{ // { // Name: to.Ptr("vmss3176_vmss3176_0_disk2_6c4f554bdafa49baa780eb2d128ff39d"), // Caching: to.Ptr(armcompute.CachingTypesReadWrite), // CreateOption: to.Ptr(armcompute.DiskCreateOptionTypesAttach), // DiskSizeGB: to.Ptr[int32](30), // Lun: to.Ptr[int32](0), // ManagedDisk: &armcompute.ManagedDiskParameters{ // ID: to.Ptr("/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/disks/vmss3176_vmss3176_0_disk2_6c4f554bdafa49baa780eb2d128ff39d"), // StorageAccountType: to.Ptr(armcompute.StorageAccountTypesPremiumLRS), // }, // }}, // ImageReference: &armcompute.ImageReference{ // Offer: to.Ptr("WindowsServer"), // Publisher: to.Ptr("MicrosoftWindowsServer"), // SKU: to.Ptr("2016-Datacenter"), // Version: to.Ptr("latest"), // }, // OSDisk: &armcompute.OSDisk{ // Name: to.Ptr("myOsDisk"), // Caching: to.Ptr(armcompute.CachingTypesReadWrite), // CreateOption: to.Ptr(armcompute.DiskCreateOptionTypesFromImage), // DiskSizeGB: to.Ptr[int32](30), // ManagedDisk: &armcompute.ManagedDiskParameters{ // ID: to.Ptr("/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/disks/myOsDisk"), // StorageAccountType: to.Ptr(armcompute.StorageAccountTypesPremiumLRS), // }, // OSType: to.Ptr(armcompute.OperatingSystemTypesWindows), // }, // }
Output:
func (*VirtualMachinesClient) BeginCapture ¶
func (client *VirtualMachinesClient) BeginCapture(ctx context.Context, resourceGroupName string, vmName string, parameters VirtualMachineCaptureParameters, options *VirtualMachinesClientBeginCaptureOptions) (*runtime.Poller[VirtualMachinesClientCaptureResponse], error)
BeginCapture - Captures the VM by copying virtual hard disks of the VM and outputs a template that can be used to create similar VMs. If the operation fails it returns an *azcore.ResponseError type.
Generated from API version 2024-03-01
- resourceGroupName - The name of the resource group.
- vmName - The name of the virtual machine.
- parameters - Parameters supplied to the Capture Virtual Machine operation.
- options - VirtualMachinesClientBeginCaptureOptions contains the optional parameters for the VirtualMachinesClient.BeginCapture method.
Example (VirtualMachineCaptureMaximumSetGen) ¶
Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/92de53a5f1e0e03c94b40475d2135d97148ed014/specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-03-01/examples/virtualMachineExamples/VirtualMachine_Capture_MaximumSet_Gen.json
cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() clientFactory, err := armcompute.NewClientFactory("<subscription-id>", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } poller, err := clientFactory.NewVirtualMachinesClient().BeginCapture(ctx, "rgcompute", "aaaaaaaaaaaaaaaaaaaa", armcompute.VirtualMachineCaptureParameters{ DestinationContainerName: to.Ptr("aaaaaaa"), OverwriteVhds: to.Ptr(true), VhdPrefix: to.Ptr("aaaaaaaaa"), }, nil) if err != nil { log.Fatalf("failed to finish the request: %v", err) } res, err := poller.PollUntilDone(ctx, nil) if err != nil { log.Fatalf("failed to pull the result: %v", err) } // You could use response here. We use blank identifier for just demo purposes. _ = res // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. // res.VirtualMachineCaptureResult = armcompute.VirtualMachineCaptureResult{ // ID: to.Ptr("aaaaaaaaaaaaaaaaaaaaaaaa"), // Schema: to.Ptr("aaaaa"), // ContentVersion: to.Ptr("aaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"), // Parameters: map[string]any{ // }, // Resources: []any{ // map[string]any{ // }}, // }
Output:
Example (VirtualMachineCaptureMinimumSetGen) ¶
Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/92de53a5f1e0e03c94b40475d2135d97148ed014/specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-03-01/examples/virtualMachineExamples/VirtualMachine_Capture_MinimumSet_Gen.json
cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() clientFactory, err := armcompute.NewClientFactory("<subscription-id>", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } poller, err := clientFactory.NewVirtualMachinesClient().BeginCapture(ctx, "rgcompute", "aaaaaaaaaaaaa", armcompute.VirtualMachineCaptureParameters{ DestinationContainerName: to.Ptr("aaaaaaa"), OverwriteVhds: to.Ptr(true), VhdPrefix: to.Ptr("aaaaaaaaa"), }, nil) if err != nil { log.Fatalf("failed to finish the request: %v", err) } res, err := poller.PollUntilDone(ctx, nil) if err != nil { log.Fatalf("failed to pull the result: %v", err) } // You could use response here. We use blank identifier for just demo purposes. _ = res // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. // res.VirtualMachineCaptureResult = armcompute.VirtualMachineCaptureResult{ // }
Output:
func (*VirtualMachinesClient) BeginConvertToManagedDisks ¶
func (client *VirtualMachinesClient) BeginConvertToManagedDisks(ctx context.Context, resourceGroupName string, vmName string, options *VirtualMachinesClientBeginConvertToManagedDisksOptions) (*runtime.Poller[VirtualMachinesClientConvertToManagedDisksResponse], error)
BeginConvertToManagedDisks - Converts virtual machine disks from blob-based to managed disks. Virtual machine must be stop-deallocated before invoking this operation. If the operation fails it returns an *azcore.ResponseError type.
Generated from API version 2024-03-01
- resourceGroupName - The name of the resource group.
- vmName - The name of the virtual machine.
- options - VirtualMachinesClientBeginConvertToManagedDisksOptions contains the optional parameters for the VirtualMachinesClient.BeginConvertToManagedDisks method.
Example (VirtualMachineConvertToManagedDisksMaximumSetGen) ¶
Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/92de53a5f1e0e03c94b40475d2135d97148ed014/specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-03-01/examples/virtualMachineExamples/VirtualMachine_ConvertToManagedDisks_MaximumSet_Gen.json
cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() clientFactory, err := armcompute.NewClientFactory("<subscription-id>", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } poller, err := clientFactory.NewVirtualMachinesClient().BeginConvertToManagedDisks(ctx, "rgcompute", "aaaaaaa", nil) if err != nil { log.Fatalf("failed to finish the request: %v", err) } _, err = poller.PollUntilDone(ctx, nil) if err != nil { log.Fatalf("failed to pull the result: %v", err) }
Output:
Example (VirtualMachineConvertToManagedDisksMinimumSetGen) ¶
Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/92de53a5f1e0e03c94b40475d2135d97148ed014/specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-03-01/examples/virtualMachineExamples/VirtualMachine_ConvertToManagedDisks_MinimumSet_Gen.json
cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() clientFactory, err := armcompute.NewClientFactory("<subscription-id>", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } poller, err := clientFactory.NewVirtualMachinesClient().BeginConvertToManagedDisks(ctx, "rgcompute", "aaaaaaaaaaa", nil) if err != nil { log.Fatalf("failed to finish the request: %v", err) } _, err = poller.PollUntilDone(ctx, nil) if err != nil { log.Fatalf("failed to pull the result: %v", err) }
Output:
func (*VirtualMachinesClient) BeginCreateOrUpdate ¶
func (client *VirtualMachinesClient) BeginCreateOrUpdate(ctx context.Context, resourceGroupName string, vmName string, parameters VirtualMachine, options *VirtualMachinesClientBeginCreateOrUpdateOptions) (*runtime.Poller[VirtualMachinesClientCreateOrUpdateResponse], error)
BeginCreateOrUpdate - The operation to create or update a virtual machine. Please note some properties can be set only during virtual machine creation. If the operation fails it returns an *azcore.ResponseError type.
Generated from API version 2024-03-01
- resourceGroupName - The name of the resource group.
- vmName - The name of the virtual machine.
- parameters - Parameters supplied to the Create Virtual Machine operation.
- options - VirtualMachinesClientBeginCreateOrUpdateOptions contains the optional parameters for the VirtualMachinesClient.BeginCreateOrUpdate method.
Example (CreateACustomImageVmFromAnUnmanagedGeneralizedOsImage) ¶
Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/92de53a5f1e0e03c94b40475d2135d97148ed014/specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-03-01/examples/virtualMachineExamples/VirtualMachine_Create_CustomImageVmFromAnUnmanagedGeneralizedOsImage.json
cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() clientFactory, err := armcompute.NewClientFactory("<subscription-id>", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } poller, err := clientFactory.NewVirtualMachinesClient().BeginCreateOrUpdate(ctx, "myResourceGroup", "{vm-name}", armcompute.VirtualMachine{ Location: to.Ptr("westus"), Properties: &armcompute.VirtualMachineProperties{ HardwareProfile: &armcompute.HardwareProfile{ VMSize: to.Ptr(armcompute.VirtualMachineSizeTypesStandardD1V2), }, NetworkProfile: &armcompute.NetworkProfile{ NetworkInterfaces: []*armcompute.NetworkInterfaceReference{ { ID: to.Ptr("/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/networkInterfaces/{existing-nic-name}"), Properties: &armcompute.NetworkInterfaceReferenceProperties{ Primary: to.Ptr(true), }, }}, }, OSProfile: &armcompute.OSProfile{ AdminPassword: to.Ptr("{your-password}"), AdminUsername: to.Ptr("{your-username}"), ComputerName: to.Ptr("myVM"), }, StorageProfile: &armcompute.StorageProfile{ OSDisk: &armcompute.OSDisk{ Name: to.Ptr("myVMosdisk"), Caching: to.Ptr(armcompute.CachingTypesReadWrite), CreateOption: to.Ptr(armcompute.DiskCreateOptionTypesFromImage), Image: &armcompute.VirtualHardDisk{ URI: to.Ptr("http://{existing-storage-account-name}.blob.core.windows.net/{existing-container-name}/{existing-generalized-os-image-blob-name}.vhd"), }, OSType: to.Ptr(armcompute.OperatingSystemTypesWindows), Vhd: &armcompute.VirtualHardDisk{ URI: to.Ptr("http://{existing-storage-account-name}.blob.core.windows.net/{existing-container-name}/myDisk.vhd"), }, }, }, }, }, &armcompute.VirtualMachinesClientBeginCreateOrUpdateOptions{IfMatch: nil, IfNoneMatch: nil, }) if err != nil { log.Fatalf("failed to finish the request: %v", err) } res, err := poller.PollUntilDone(ctx, nil) if err != nil { log.Fatalf("failed to pull the result: %v", err) } // You could use response here. We use blank identifier for just demo purposes. _ = res // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. // res.VirtualMachine = armcompute.VirtualMachine{ // Name: to.Ptr("myVM"), // Type: to.Ptr("Microsoft.Compute/virtualMachines"), // ID: to.Ptr("/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/virtualMachines/myVM"), // Location: to.Ptr("westus"), // Properties: &armcompute.VirtualMachineProperties{ // HardwareProfile: &armcompute.HardwareProfile{ // VMSize: to.Ptr(armcompute.VirtualMachineSizeTypesStandardD1V2), // }, // NetworkProfile: &armcompute.NetworkProfile{ // NetworkInterfaces: []*armcompute.NetworkInterfaceReference{ // { // ID: to.Ptr("/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/networkInterfaces/nsgExistingNic"), // Properties: &armcompute.NetworkInterfaceReferenceProperties{ // Primary: to.Ptr(true), // }, // }}, // }, // OSProfile: &armcompute.OSProfile{ // AdminUsername: to.Ptr("{your-username}"), // ComputerName: to.Ptr("myVM"), // Secrets: []*armcompute.VaultSecretGroup{ // }, // WindowsConfiguration: &armcompute.WindowsConfiguration{ // EnableAutomaticUpdates: to.Ptr(true), // ProvisionVMAgent: to.Ptr(true), // }, // }, // ProvisioningState: to.Ptr("Succeeded"), // StorageProfile: &armcompute.StorageProfile{ // DataDisks: []*armcompute.DataDisk{ // }, // OSDisk: &armcompute.OSDisk{ // Name: to.Ptr("myVMosdisk"), // Caching: to.Ptr(armcompute.CachingTypesReadWrite), // CreateOption: to.Ptr(armcompute.DiskCreateOptionTypesFromImage), // Image: &armcompute.VirtualHardDisk{ // URI: to.Ptr("https://{existing-storage-account-name}.blob.core.windows.net/system/Microsoft.Compute/Images/vhds/{existing-generalized-os-image-blob-name}.vhd"), // }, // OSType: to.Ptr(armcompute.OperatingSystemTypesWindows), // Vhd: &armcompute.VirtualHardDisk{ // URI: to.Ptr("http://{existing-storage-account-name}.blob.core.windows.net/vhds/myDisk.vhd"), // }, // }, // }, // VMID: to.Ptr("926cd555-a07c-4ff5-b214-4aa4dd09d79b"), // }, // }
Output:
Example (CreateALinuxVmWithAPatchSettingAssessmentModeOfImageDefault) ¶
Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/92de53a5f1e0e03c94b40475d2135d97148ed014/specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-03-01/examples/virtualMachineExamples/VirtualMachine_Create_LinuxVmWithPatchSettingAssessmentModeOfImageDefault.json
cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() clientFactory, err := armcompute.NewClientFactory("<subscription-id>", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } poller, err := clientFactory.NewVirtualMachinesClient().BeginCreateOrUpdate(ctx, "myResourceGroup", "myVM", armcompute.VirtualMachine{ Location: to.Ptr("westus"), Properties: &armcompute.VirtualMachineProperties{ HardwareProfile: &armcompute.HardwareProfile{ VMSize: to.Ptr(armcompute.VirtualMachineSizeTypesStandardD2SV3), }, NetworkProfile: &armcompute.NetworkProfile{ NetworkInterfaces: []*armcompute.NetworkInterfaceReference{ { ID: to.Ptr("/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/networkInterfaces/{existing-nic-name}"), Properties: &armcompute.NetworkInterfaceReferenceProperties{ Primary: to.Ptr(true), }, }}, }, OSProfile: &armcompute.OSProfile{ AdminPassword: to.Ptr("{your-password}"), AdminUsername: to.Ptr("{your-username}"), ComputerName: to.Ptr("myVM"), LinuxConfiguration: &armcompute.LinuxConfiguration{ PatchSettings: &armcompute.LinuxPatchSettings{ AssessmentMode: to.Ptr(armcompute.LinuxPatchAssessmentModeImageDefault), }, ProvisionVMAgent: to.Ptr(true), }, }, StorageProfile: &armcompute.StorageProfile{ ImageReference: &armcompute.ImageReference{ Offer: to.Ptr("UbuntuServer"), Publisher: to.Ptr("Canonical"), SKU: to.Ptr("16.04-LTS"), Version: to.Ptr("latest"), }, OSDisk: &armcompute.OSDisk{ Name: to.Ptr("myVMosdisk"), Caching: to.Ptr(armcompute.CachingTypesReadWrite), CreateOption: to.Ptr(armcompute.DiskCreateOptionTypesFromImage), ManagedDisk: &armcompute.ManagedDiskParameters{ StorageAccountType: to.Ptr(armcompute.StorageAccountTypesPremiumLRS), }, }, }, }, }, &armcompute.VirtualMachinesClientBeginCreateOrUpdateOptions{IfMatch: nil, IfNoneMatch: nil, }) if err != nil { log.Fatalf("failed to finish the request: %v", err) } res, err := poller.PollUntilDone(ctx, nil) if err != nil { log.Fatalf("failed to pull the result: %v", err) } // You could use response here. We use blank identifier for just demo purposes. _ = res // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. // res.VirtualMachine = armcompute.VirtualMachine{ // Name: to.Ptr("myVM"), // Type: to.Ptr("Microsoft.Compute/virtualMachines"), // ID: to.Ptr("/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/virtualMachines/myVM"), // Location: to.Ptr("westus"), // Properties: &armcompute.VirtualMachineProperties{ // HardwareProfile: &armcompute.HardwareProfile{ // VMSize: to.Ptr(armcompute.VirtualMachineSizeTypesStandardD2SV3), // }, // NetworkProfile: &armcompute.NetworkProfile{ // NetworkInterfaces: []*armcompute.NetworkInterfaceReference{ // { // ID: to.Ptr("/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/networkInterfaces/nsgExistingNic"), // Properties: &armcompute.NetworkInterfaceReferenceProperties{ // Primary: to.Ptr(true), // }, // }}, // }, // OSProfile: &armcompute.OSProfile{ // AdminUsername: to.Ptr("{your-username}"), // ComputerName: to.Ptr("myVM"), // LinuxConfiguration: &armcompute.LinuxConfiguration{ // PatchSettings: &armcompute.LinuxPatchSettings{ // AssessmentMode: to.Ptr(armcompute.LinuxPatchAssessmentModeImageDefault), // }, // ProvisionVMAgent: to.Ptr(true), // }, // Secrets: []*armcompute.VaultSecretGroup{ // }, // }, // ProvisioningState: to.Ptr("Succeeded"), // StorageProfile: &armcompute.StorageProfile{ // DataDisks: []*armcompute.DataDisk{ // }, // ImageReference: &armcompute.ImageReference{ // Offer: to.Ptr("UbuntuServer"), // Publisher: to.Ptr("Canonical"), // SKU: to.Ptr("16.04-LTS"), // Version: to.Ptr("latest"), // }, // OSDisk: &armcompute.OSDisk{ // Name: to.Ptr("myVMosdisk"), // Caching: to.Ptr(armcompute.CachingTypesReadWrite), // CreateOption: to.Ptr(armcompute.DiskCreateOptionTypesFromImage), // ManagedDisk: &armcompute.ManagedDiskParameters{ // StorageAccountType: to.Ptr(armcompute.StorageAccountTypesPremiumLRS), // }, // OSType: to.Ptr(armcompute.OperatingSystemTypesLinux), // }, // }, // VMID: to.Ptr("a149cd25-409f-41af-8088-275f5486bc93"), // }, // }
Output:
Example (CreateALinuxVmWithAPatchSettingPatchModeOfAutomaticByPlatformAndAutomaticByPlatformSettings) ¶
Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/92de53a5f1e0e03c94b40475d2135d97148ed014/specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-03-01/examples/virtualMachineExamples/VirtualMachine_Create_LinuxVmWithAutomaticByPlatformSettings.json
cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() clientFactory, err := armcompute.NewClientFactory("<subscription-id>", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } poller, err := clientFactory.NewVirtualMachinesClient().BeginCreateOrUpdate(ctx, "myResourceGroup", "myVM", armcompute.VirtualMachine{ Location: to.Ptr("westus"), Properties: &armcompute.VirtualMachineProperties{ HardwareProfile: &armcompute.HardwareProfile{ VMSize: to.Ptr(armcompute.VirtualMachineSizeTypesStandardD2SV3), }, NetworkProfile: &armcompute.NetworkProfile{ NetworkInterfaces: []*armcompute.NetworkInterfaceReference{ { ID: to.Ptr("/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/networkInterfaces/{existing-nic-name}"), Properties: &armcompute.NetworkInterfaceReferenceProperties{ Primary: to.Ptr(true), }, }}, }, OSProfile: &armcompute.OSProfile{ AdminPassword: to.Ptr("{your-password}"), AdminUsername: to.Ptr("{your-username}"), ComputerName: to.Ptr("myVM"), LinuxConfiguration: &armcompute.LinuxConfiguration{ PatchSettings: &armcompute.LinuxPatchSettings{ AssessmentMode: to.Ptr(armcompute.LinuxPatchAssessmentModeAutomaticByPlatform), AutomaticByPlatformSettings: &armcompute.LinuxVMGuestPatchAutomaticByPlatformSettings{ BypassPlatformSafetyChecksOnUserSchedule: to.Ptr(true), RebootSetting: to.Ptr(armcompute.LinuxVMGuestPatchAutomaticByPlatformRebootSettingNever), }, PatchMode: to.Ptr(armcompute.LinuxVMGuestPatchModeAutomaticByPlatform), }, ProvisionVMAgent: to.Ptr(true), }, }, StorageProfile: &armcompute.StorageProfile{ ImageReference: &armcompute.ImageReference{ Offer: to.Ptr("UbuntuServer"), Publisher: to.Ptr("Canonical"), SKU: to.Ptr("16.04-LTS"), Version: to.Ptr("latest"), }, OSDisk: &armcompute.OSDisk{ Name: to.Ptr("myVMosdisk"), Caching: to.Ptr(armcompute.CachingTypesReadWrite), CreateOption: to.Ptr(armcompute.DiskCreateOptionTypesFromImage), ManagedDisk: &armcompute.ManagedDiskParameters{ StorageAccountType: to.Ptr(armcompute.StorageAccountTypesPremiumLRS), }, }, }, }, }, &armcompute.VirtualMachinesClientBeginCreateOrUpdateOptions{IfMatch: nil, IfNoneMatch: nil, }) if err != nil { log.Fatalf("failed to finish the request: %v", err) } res, err := poller.PollUntilDone(ctx, nil) if err != nil { log.Fatalf("failed to pull the result: %v", err) } // You could use response here. We use blank identifier for just demo purposes. _ = res // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. // res.VirtualMachine = armcompute.VirtualMachine{ // Name: to.Ptr("myVM"), // Type: to.Ptr("Microsoft.Compute/virtualMachines"), // ID: to.Ptr("/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/virtualMachines/myVM"), // Location: to.Ptr("westus"), // Properties: &armcompute.VirtualMachineProperties{ // HardwareProfile: &armcompute.HardwareProfile{ // VMSize: to.Ptr(armcompute.VirtualMachineSizeTypesStandardD2SV3), // }, // NetworkProfile: &armcompute.NetworkProfile{ // NetworkInterfaces: []*armcompute.NetworkInterfaceReference{ // { // ID: to.Ptr("/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/networkInterfaces/nsgExistingNic"), // Properties: &armcompute.NetworkInterfaceReferenceProperties{ // Primary: to.Ptr(true), // }, // }}, // }, // OSProfile: &armcompute.OSProfile{ // AdminUsername: to.Ptr("{your-username}"), // ComputerName: to.Ptr("myVM"), // LinuxConfiguration: &armcompute.LinuxConfiguration{ // PatchSettings: &armcompute.LinuxPatchSettings{ // AssessmentMode: to.Ptr(armcompute.LinuxPatchAssessmentModeAutomaticByPlatform), // AutomaticByPlatformSettings: &armcompute.LinuxVMGuestPatchAutomaticByPlatformSettings{ // BypassPlatformSafetyChecksOnUserSchedule: to.Ptr(true), // RebootSetting: to.Ptr(armcompute.LinuxVMGuestPatchAutomaticByPlatformRebootSettingNever), // }, // PatchMode: to.Ptr(armcompute.LinuxVMGuestPatchModeAutomaticByPlatform), // }, // ProvisionVMAgent: to.Ptr(true), // }, // Secrets: []*armcompute.VaultSecretGroup{ // }, // }, // ProvisioningState: to.Ptr("Succeeded"), // StorageProfile: &armcompute.StorageProfile{ // DataDisks: []*armcompute.DataDisk{ // }, // ImageReference: &armcompute.ImageReference{ // Offer: to.Ptr("UbuntuServer"), // Publisher: to.Ptr("Canonical"), // SKU: to.Ptr("16.04-LTS"), // Version: to.Ptr("latest"), // }, // OSDisk: &armcompute.OSDisk{ // Name: to.Ptr("myVMosdisk"), // Caching: to.Ptr(armcompute.CachingTypesReadWrite), // CreateOption: to.Ptr(armcompute.DiskCreateOptionTypesFromImage), // ManagedDisk: &armcompute.ManagedDiskParameters{ // StorageAccountType: to.Ptr(armcompute.StorageAccountTypesPremiumLRS), // }, // OSType: to.Ptr(armcompute.OperatingSystemTypesLinux), // }, // }, // VMID: to.Ptr("a149cd25-409f-41af-8088-275f5486bc93"), // }, // }
Output:
Example (CreateALinuxVmWithAPatchSettingPatchModeOfImageDefault) ¶
Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/92de53a5f1e0e03c94b40475d2135d97148ed014/specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-03-01/examples/virtualMachineExamples/VirtualMachine_Create_LinuxVmWithPatchSettingModeOfImageDefault.json
cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() clientFactory, err := armcompute.NewClientFactory("<subscription-id>", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } poller, err := clientFactory.NewVirtualMachinesClient().BeginCreateOrUpdate(ctx, "myResourceGroup", "myVM", armcompute.VirtualMachine{ Location: to.Ptr("westus"), Properties: &armcompute.VirtualMachineProperties{ HardwareProfile: &armcompute.HardwareProfile{ VMSize: to.Ptr(armcompute.VirtualMachineSizeTypesStandardD2SV3), }, NetworkProfile: &armcompute.NetworkProfile{ NetworkInterfaces: []*armcompute.NetworkInterfaceReference{ { ID: to.Ptr("/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/networkInterfaces/{existing-nic-name}"), Properties: &armcompute.NetworkInterfaceReferenceProperties{ Primary: to.Ptr(true), }, }}, }, OSProfile: &armcompute.OSProfile{ AdminPassword: to.Ptr("{your-password}"), AdminUsername: to.Ptr("{your-username}"), ComputerName: to.Ptr("myVM"), LinuxConfiguration: &armcompute.LinuxConfiguration{ PatchSettings: &armcompute.LinuxPatchSettings{ PatchMode: to.Ptr(armcompute.LinuxVMGuestPatchModeImageDefault), }, ProvisionVMAgent: to.Ptr(true), }, }, StorageProfile: &armcompute.StorageProfile{ ImageReference: &armcompute.ImageReference{ Offer: to.Ptr("UbuntuServer"), Publisher: to.Ptr("Canonical"), SKU: to.Ptr("16.04-LTS"), Version: to.Ptr("latest"), }, OSDisk: &armcompute.OSDisk{ Name: to.Ptr("myVMosdisk"), Caching: to.Ptr(armcompute.CachingTypesReadWrite), CreateOption: to.Ptr(armcompute.DiskCreateOptionTypesFromImage), ManagedDisk: &armcompute.ManagedDiskParameters{ StorageAccountType: to.Ptr(armcompute.StorageAccountTypesPremiumLRS), }, }, }, }, }, &armcompute.VirtualMachinesClientBeginCreateOrUpdateOptions{IfMatch: nil, IfNoneMatch: nil, }) if err != nil { log.Fatalf("failed to finish the request: %v", err) } res, err := poller.PollUntilDone(ctx, nil) if err != nil { log.Fatalf("failed to pull the result: %v", err) } // You could use response here. We use blank identifier for just demo purposes. _ = res // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. // res.VirtualMachine = armcompute.VirtualMachine{ // Name: to.Ptr("myVM"), // Type: to.Ptr("Microsoft.Compute/virtualMachines"), // ID: to.Ptr("/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/virtualMachines/myVM"), // Location: to.Ptr("westus"), // Properties: &armcompute.VirtualMachineProperties{ // HardwareProfile: &armcompute.HardwareProfile{ // VMSize: to.Ptr(armcompute.VirtualMachineSizeTypesStandardD2SV3), // }, // NetworkProfile: &armcompute.NetworkProfile{ // NetworkInterfaces: []*armcompute.NetworkInterfaceReference{ // { // ID: to.Ptr("/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/networkInterfaces/nsgExistingNic"), // Properties: &armcompute.NetworkInterfaceReferenceProperties{ // Primary: to.Ptr(true), // }, // }}, // }, // OSProfile: &armcompute.OSProfile{ // AdminUsername: to.Ptr("{your-username}"), // ComputerName: to.Ptr("myVM"), // LinuxConfiguration: &armcompute.LinuxConfiguration{ // PatchSettings: &armcompute.LinuxPatchSettings{ // PatchMode: to.Ptr(armcompute.LinuxVMGuestPatchModeImageDefault), // }, // ProvisionVMAgent: to.Ptr(true), // }, // Secrets: []*armcompute.VaultSecretGroup{ // }, // }, // ProvisioningState: to.Ptr("Succeeded"), // StorageProfile: &armcompute.StorageProfile{ // DataDisks: []*armcompute.DataDisk{ // }, // ImageReference: &armcompute.ImageReference{ // Offer: to.Ptr("UbuntuServer"), // Publisher: to.Ptr("Canonical"), // SKU: to.Ptr("16.04-LTS"), // Version: to.Ptr("latest"), // }, // OSDisk: &armcompute.OSDisk{ // Name: to.Ptr("myVMosdisk"), // Caching: to.Ptr(armcompute.CachingTypesReadWrite), // CreateOption: to.Ptr(armcompute.DiskCreateOptionTypesFromImage), // ManagedDisk: &armcompute.ManagedDiskParameters{ // StorageAccountType: to.Ptr(armcompute.StorageAccountTypesPremiumLRS), // }, // OSType: to.Ptr(armcompute.OperatingSystemTypesLinux), // }, // }, // VMID: to.Ptr("a149cd25-409f-41af-8088-275f5486bc93"), // }, // }
Output:
Example (CreateALinuxVmWithAPatchSettingsPatchModeAndAssessmentModeSetToAutomaticByPlatform) ¶
Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/92de53a5f1e0e03c94b40475d2135d97148ed014/specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-03-01/examples/virtualMachineExamples/VirtualMachine_Create_LinuxVmWithPatchSettingModesOfAutomaticByPlatform.json
cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() clientFactory, err := armcompute.NewClientFactory("<subscription-id>", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } poller, err := clientFactory.NewVirtualMachinesClient().BeginCreateOrUpdate(ctx, "myResourceGroup", "myVM", armcompute.VirtualMachine{ Location: to.Ptr("westus"), Properties: &armcompute.VirtualMachineProperties{ HardwareProfile: &armcompute.HardwareProfile{ VMSize: to.Ptr(armcompute.VirtualMachineSizeTypesStandardD2SV3), }, NetworkProfile: &armcompute.NetworkProfile{ NetworkInterfaces: []*armcompute.NetworkInterfaceReference{ { ID: to.Ptr("/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/networkInterfaces/{existing-nic-name}"), Properties: &armcompute.NetworkInterfaceReferenceProperties{ Primary: to.Ptr(true), }, }}, }, OSProfile: &armcompute.OSProfile{ AdminPassword: to.Ptr("{your-password}"), AdminUsername: to.Ptr("{your-username}"), ComputerName: to.Ptr("myVM"), LinuxConfiguration: &armcompute.LinuxConfiguration{ PatchSettings: &armcompute.LinuxPatchSettings{ AssessmentMode: to.Ptr(armcompute.LinuxPatchAssessmentModeAutomaticByPlatform), PatchMode: to.Ptr(armcompute.LinuxVMGuestPatchModeAutomaticByPlatform), }, ProvisionVMAgent: to.Ptr(true), }, }, StorageProfile: &armcompute.StorageProfile{ ImageReference: &armcompute.ImageReference{ Offer: to.Ptr("UbuntuServer"), Publisher: to.Ptr("Canonical"), SKU: to.Ptr("16.04-LTS"), Version: to.Ptr("latest"), }, OSDisk: &armcompute.OSDisk{ Name: to.Ptr("myVMosdisk"), Caching: to.Ptr(armcompute.CachingTypesReadWrite), CreateOption: to.Ptr(armcompute.DiskCreateOptionTypesFromImage), ManagedDisk: &armcompute.ManagedDiskParameters{ StorageAccountType: to.Ptr(armcompute.StorageAccountTypesPremiumLRS), }, }, }, }, }, &armcompute.VirtualMachinesClientBeginCreateOrUpdateOptions{IfMatch: nil, IfNoneMatch: nil, }) if err != nil { log.Fatalf("failed to finish the request: %v", err) } res, err := poller.PollUntilDone(ctx, nil) if err != nil { log.Fatalf("failed to pull the result: %v", err) } // You could use response here. We use blank identifier for just demo purposes. _ = res // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. // res.VirtualMachine = armcompute.VirtualMachine{ // Name: to.Ptr("myVM"), // Type: to.Ptr("Microsoft.Compute/virtualMachines"), // ID: to.Ptr("/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/virtualMachines/myVM"), // Location: to.Ptr("westus"), // Properties: &armcompute.VirtualMachineProperties{ // HardwareProfile: &armcompute.HardwareProfile{ // VMSize: to.Ptr(armcompute.VirtualMachineSizeTypesStandardD2SV3), // }, // NetworkProfile: &armcompute.NetworkProfile{ // NetworkInterfaces: []*armcompute.NetworkInterfaceReference{ // { // ID: to.Ptr("/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/networkInterfaces/nsgExistingNic"), // Properties: &armcompute.NetworkInterfaceReferenceProperties{ // Primary: to.Ptr(true), // }, // }}, // }, // OSProfile: &armcompute.OSProfile{ // AdminUsername: to.Ptr("{your-username}"), // ComputerName: to.Ptr("myVM"), // LinuxConfiguration: &armcompute.LinuxConfiguration{ // PatchSettings: &armcompute.LinuxPatchSettings{ // AssessmentMode: to.Ptr(armcompute.LinuxPatchAssessmentModeAutomaticByPlatform), // PatchMode: to.Ptr(armcompute.LinuxVMGuestPatchModeAutomaticByPlatform), // }, // ProvisionVMAgent: to.Ptr(true), // }, // Secrets: []*armcompute.VaultSecretGroup{ // }, // }, // ProvisioningState: to.Ptr("Succeeded"), // StorageProfile: &armcompute.StorageProfile{ // DataDisks: []*armcompute.DataDisk{ // }, // ImageReference: &armcompute.ImageReference{ // Offer: to.Ptr("UbuntuServer"), // Publisher: to.Ptr("Canonical"), // SKU: to.Ptr("16.04-LTS"), // Version: to.Ptr("latest"), // }, // OSDisk: &armcompute.OSDisk{ // Name: to.Ptr("myVMosdisk"), // Caching: to.Ptr(armcompute.CachingTypesReadWrite), // CreateOption: to.Ptr(armcompute.DiskCreateOptionTypesFromImage), // ManagedDisk: &armcompute.ManagedDiskParameters{ // StorageAccountType: to.Ptr(armcompute.StorageAccountTypesPremiumLRS), // }, // OSType: to.Ptr(armcompute.OperatingSystemTypesLinux), // }, // }, // VMID: to.Ptr("a149cd25-409f-41af-8088-275f5486bc93"), // }, // }
Output:
Example (CreateAPlatformImageVmWithUnmanagedOsAndDataDisks) ¶
Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/92de53a5f1e0e03c94b40475d2135d97148ed014/specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-03-01/examples/virtualMachineExamples/VirtualMachine_Create_PlatformImageVmWithUnmanagedOsAndDataDisks.json
cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() clientFactory, err := armcompute.NewClientFactory("<subscription-id>", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } poller, err := clientFactory.NewVirtualMachinesClient().BeginCreateOrUpdate(ctx, "myResourceGroup", "{vm-name}", armcompute.VirtualMachine{ Location: to.Ptr("westus"), Properties: &armcompute.VirtualMachineProperties{ HardwareProfile: &armcompute.HardwareProfile{ VMSize: to.Ptr(armcompute.VirtualMachineSizeTypesStandardD2V2), }, NetworkProfile: &armcompute.NetworkProfile{ NetworkInterfaces: []*armcompute.NetworkInterfaceReference{ { ID: to.Ptr("/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/networkInterfaces/{existing-nic-name}"), Properties: &armcompute.NetworkInterfaceReferenceProperties{ Primary: to.Ptr(true), }, }}, }, OSProfile: &armcompute.OSProfile{ AdminPassword: to.Ptr("{your-password}"), AdminUsername: to.Ptr("{your-username}"), ComputerName: to.Ptr("myVM"), }, StorageProfile: &armcompute.StorageProfile{ DataDisks: []*armcompute.DataDisk{ { CreateOption: to.Ptr(armcompute.DiskCreateOptionTypesEmpty), DiskSizeGB: to.Ptr[int32](1023), Lun: to.Ptr[int32](0), Vhd: &armcompute.VirtualHardDisk{ URI: to.Ptr("http://{existing-storage-account-name}.blob.core.windows.net/{existing-container-name}/myDisk0.vhd"), }, }, { CreateOption: to.Ptr(armcompute.DiskCreateOptionTypesEmpty), DiskSizeGB: to.Ptr[int32](1023), Lun: to.Ptr[int32](1), Vhd: &armcompute.VirtualHardDisk{ URI: to.Ptr("http://{existing-storage-account-name}.blob.core.windows.net/{existing-container-name}/myDisk1.vhd"), }, }}, ImageReference: &armcompute.ImageReference{ Offer: to.Ptr("WindowsServer"), Publisher: to.Ptr("MicrosoftWindowsServer"), SKU: to.Ptr("2016-Datacenter"), Version: to.Ptr("latest"), }, OSDisk: &armcompute.OSDisk{ Name: to.Ptr("myVMosdisk"), Caching: to.Ptr(armcompute.CachingTypesReadWrite), CreateOption: to.Ptr(armcompute.DiskCreateOptionTypesFromImage), Vhd: &armcompute.VirtualHardDisk{ URI: to.Ptr("http://{existing-storage-account-name}.blob.core.windows.net/{existing-container-name}/myDisk.vhd"), }, }, }, }, }, &armcompute.VirtualMachinesClientBeginCreateOrUpdateOptions{IfMatch: nil, IfNoneMatch: nil, }) if err != nil { log.Fatalf("failed to finish the request: %v", err) } res, err := poller.PollUntilDone(ctx, nil) if err != nil { log.Fatalf("failed to pull the result: %v", err) } // You could use response here. We use blank identifier for just demo purposes. _ = res // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. // res.VirtualMachine = armcompute.VirtualMachine{ // Name: to.Ptr("myVM"), // Type: to.Ptr("Microsoft.Compute/virtualMachines"), // ID: to.Ptr("/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/virtualMachines/myVM"), // Location: to.Ptr("westus"), // Properties: &armcompute.VirtualMachineProperties{ // HardwareProfile: &armcompute.HardwareProfile{ // VMSize: to.Ptr(armcompute.VirtualMachineSizeTypesStandardD2V2), // }, // NetworkProfile: &armcompute.NetworkProfile{ // NetworkInterfaces: []*armcompute.NetworkInterfaceReference{ // { // ID: to.Ptr("/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/networkInterfaces/nsgExistingNic"), // Properties: &armcompute.NetworkInterfaceReferenceProperties{ // Primary: to.Ptr(true), // }, // }}, // }, // OSProfile: &armcompute.OSProfile{ // AdminUsername: to.Ptr("{your-username}"), // ComputerName: to.Ptr("myVM"), // Secrets: []*armcompute.VaultSecretGroup{ // }, // WindowsConfiguration: &armcompute.WindowsConfiguration{ // EnableAutomaticUpdates: to.Ptr(true), // ProvisionVMAgent: to.Ptr(true), // }, // }, // ProvisioningState: to.Ptr("Succeeded"), // StorageProfile: &armcompute.StorageProfile{ // DataDisks: []*armcompute.DataDisk{ // { // Name: to.Ptr("dataDisk0"), // Caching: to.Ptr(armcompute.CachingTypesNone), // CreateOption: to.Ptr(armcompute.DiskCreateOptionTypesEmpty), // DiskSizeGB: to.Ptr[int32](1023), // Lun: to.Ptr[int32](0), // Vhd: &armcompute.VirtualHardDisk{ // URI: to.Ptr("http://{existing-storage-account-name}.blob.core.windows.net/vhds/myDisk0.vhd"), // }, // }, // { // Name: to.Ptr("dataDisk1"), // Caching: to.Ptr(armcompute.CachingTypesNone), // CreateOption: to.Ptr(armcompute.DiskCreateOptionTypesEmpty), // DiskSizeGB: to.Ptr[int32](1023), // Lun: to.Ptr[int32](1), // Vhd: &armcompute.VirtualHardDisk{ // URI: to.Ptr("http://{existing-storage-account-name}.blob.core.windows.net/vhds/myDisk1.vhd"), // }, // }}, // ImageReference: &armcompute.ImageReference{ // Offer: to.Ptr("WindowsServer"), // Publisher: to.Ptr("MicrosoftWindowsServer"), // SKU: to.Ptr("2016-Datacenter"), // Version: to.Ptr("latest"), // }, // OSDisk: &armcompute.OSDisk{ // Name: to.Ptr("myVMosdisk"), // Caching: to.Ptr(armcompute.CachingTypesReadWrite), // CreateOption: to.Ptr(armcompute.DiskCreateOptionTypesFromImage), // OSType: to.Ptr(armcompute.OperatingSystemTypesWindows), // Vhd: &armcompute.VirtualHardDisk{ // URI: to.Ptr("http://{existing-storage-account-name}.blob.core.windows.net/vhds/myDisk.vhd"), // }, // }, // }, // VMID: to.Ptr("5230a749-2f68-4830-900b-702182d32e63"), // }, // }
Output:
Example (CreateAVmFromACommunityGalleryImage) ¶
Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/92de53a5f1e0e03c94b40475d2135d97148ed014/specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-03-01/examples/virtualMachineExamples/VirtualMachine_Create_FromACommunityGalleryImage.json
cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() clientFactory, err := armcompute.NewClientFactory("<subscription-id>", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } poller, err := clientFactory.NewVirtualMachinesClient().BeginCreateOrUpdate(ctx, "myResourceGroup", "myVM", armcompute.VirtualMachine{ Location: to.Ptr("westus"), Properties: &armcompute.VirtualMachineProperties{ HardwareProfile: &armcompute.HardwareProfile{ VMSize: to.Ptr(armcompute.VirtualMachineSizeTypesStandardD1V2), }, NetworkProfile: &armcompute.NetworkProfile{ NetworkInterfaces: []*armcompute.NetworkInterfaceReference{ { ID: to.Ptr("/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/networkInterfaces/{existing-nic-name}"), Properties: &armcompute.NetworkInterfaceReferenceProperties{ Primary: to.Ptr(true), }, }}, }, OSProfile: &armcompute.OSProfile{ AdminPassword: to.Ptr("{your-password}"), AdminUsername: to.Ptr("{your-username}"), ComputerName: to.Ptr("myVM"), }, StorageProfile: &armcompute.StorageProfile{ ImageReference: &armcompute.ImageReference{ CommunityGalleryImageID: to.Ptr("/CommunityGalleries/galleryPublicName/Images/communityGalleryImageName/Versions/communityGalleryImageVersionName"), }, OSDisk: &armcompute.OSDisk{ Name: to.Ptr("myVMosdisk"), Caching: to.Ptr(armcompute.CachingTypesReadWrite), CreateOption: to.Ptr(armcompute.DiskCreateOptionTypesFromImage), ManagedDisk: &armcompute.ManagedDiskParameters{ StorageAccountType: to.Ptr(armcompute.StorageAccountTypesStandardLRS), }, }, }, }, }, &armcompute.VirtualMachinesClientBeginCreateOrUpdateOptions{IfMatch: nil, IfNoneMatch: nil, }) if err != nil { log.Fatalf("failed to finish the request: %v", err) } res, err := poller.PollUntilDone(ctx, nil) if err != nil { log.Fatalf("failed to pull the result: %v", err) } // You could use response here. We use blank identifier for just demo purposes. _ = res // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. // res.VirtualMachine = armcompute.VirtualMachine{ // Name: to.Ptr("myVM"), // Type: to.Ptr("Microsoft.Compute/virtualMachines"), // ID: to.Ptr("/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/virtualMachines/myVM"), // Location: to.Ptr("westus"), // Properties: &armcompute.VirtualMachineProperties{ // HardwareProfile: &armcompute.HardwareProfile{ // VMSize: to.Ptr(armcompute.VirtualMachineSizeTypesStandardD1V2), // }, // NetworkProfile: &armcompute.NetworkProfile{ // NetworkInterfaces: []*armcompute.NetworkInterfaceReference{ // { // ID: to.Ptr("/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/networkInterfaces/nsgExistingNic"), // Properties: &armcompute.NetworkInterfaceReferenceProperties{ // Primary: to.Ptr(true), // }, // }}, // }, // OSProfile: &armcompute.OSProfile{ // AdminUsername: to.Ptr("{your-username}"), // ComputerName: to.Ptr("myVM"), // LinuxConfiguration: &armcompute.LinuxConfiguration{ // DisablePasswordAuthentication: to.Ptr(false), // }, // Secrets: []*armcompute.VaultSecretGroup{ // }, // }, // ProvisioningState: to.Ptr("Succeeded"), // StorageProfile: &armcompute.StorageProfile{ // DataDisks: []*armcompute.DataDisk{ // }, // ImageReference: &armcompute.ImageReference{ // CommunityGalleryImageID: to.Ptr("/CommunityGalleries/galleryPublicName/Images/communityGalleryImageName/Versions/communityGalleryImageVersionName"), // }, // OSDisk: &armcompute.OSDisk{ // Name: to.Ptr("myVMosdisk"), // Caching: to.Ptr(armcompute.CachingTypesReadWrite), // CreateOption: to.Ptr(armcompute.DiskCreateOptionTypesFromImage), // DiskSizeGB: to.Ptr[int32](30), // ManagedDisk: &armcompute.ManagedDiskParameters{ // StorageAccountType: to.Ptr(armcompute.StorageAccountTypesStandardLRS), // }, // OSType: to.Ptr(armcompute.OperatingSystemTypesLinux), // }, // }, // VMID: to.Ptr("71aa3d5a-d73d-4970-9182-8580433b2865"), // }, // }
Output:
Example (CreateAVmFromACustomImage) ¶
Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/92de53a5f1e0e03c94b40475d2135d97148ed014/specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-03-01/examples/virtualMachineExamples/VirtualMachine_Create_FromACustomImage.json
cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() clientFactory, err := armcompute.NewClientFactory("<subscription-id>", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } poller, err := clientFactory.NewVirtualMachinesClient().BeginCreateOrUpdate(ctx, "myResourceGroup", "myVM", armcompute.VirtualMachine{ Location: to.Ptr("westus"), Properties: &armcompute.VirtualMachineProperties{ HardwareProfile: &armcompute.HardwareProfile{ VMSize: to.Ptr(armcompute.VirtualMachineSizeTypesStandardD1V2), }, NetworkProfile: &armcompute.NetworkProfile{ NetworkInterfaces: []*armcompute.NetworkInterfaceReference{ { ID: to.Ptr("/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/networkInterfaces/{existing-nic-name}"), Properties: &armcompute.NetworkInterfaceReferenceProperties{ Primary: to.Ptr(true), }, }}, }, OSProfile: &armcompute.OSProfile{ AdminPassword: to.Ptr("{your-password}"), AdminUsername: to.Ptr("{your-username}"), ComputerName: to.Ptr("myVM"), }, StorageProfile: &armcompute.StorageProfile{ ImageReference: &armcompute.ImageReference{ ID: to.Ptr("/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/images/{existing-custom-image-name}"), }, OSDisk: &armcompute.OSDisk{ Name: to.Ptr("myVMosdisk"), Caching: to.Ptr(armcompute.CachingTypesReadWrite), CreateOption: to.Ptr(armcompute.DiskCreateOptionTypesFromImage), ManagedDisk: &armcompute.ManagedDiskParameters{ StorageAccountType: to.Ptr(armcompute.StorageAccountTypesStandardLRS), }, }, }, }, }, &armcompute.VirtualMachinesClientBeginCreateOrUpdateOptions{IfMatch: nil, IfNoneMatch: nil, }) if err != nil { log.Fatalf("failed to finish the request: %v", err) } res, err := poller.PollUntilDone(ctx, nil) if err != nil { log.Fatalf("failed to pull the result: %v", err) } // You could use response here. We use blank identifier for just demo purposes. _ = res // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. // res.VirtualMachine = armcompute.VirtualMachine{ // Name: to.Ptr("myVM"), // Type: to.Ptr("Microsoft.Compute/virtualMachines"), // ID: to.Ptr("/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/virtualMachines/myVM"), // Location: to.Ptr("westus"), // Properties: &armcompute.VirtualMachineProperties{ // HardwareProfile: &armcompute.HardwareProfile{ // VMSize: to.Ptr(armcompute.VirtualMachineSizeTypesStandardD1V2), // }, // NetworkProfile: &armcompute.NetworkProfile{ // NetworkInterfaces: []*armcompute.NetworkInterfaceReference{ // { // ID: to.Ptr("/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/networkInterfaces/nsgExistingNic"), // Properties: &armcompute.NetworkInterfaceReferenceProperties{ // Primary: to.Ptr(true), // }, // }}, // }, // OSProfile: &armcompute.OSProfile{ // AdminUsername: to.Ptr("{your-username}"), // ComputerName: to.Ptr("myVM"), // LinuxConfiguration: &armcompute.LinuxConfiguration{ // DisablePasswordAuthentication: to.Ptr(false), // }, // Secrets: []*armcompute.VaultSecretGroup{ // }, // }, // ProvisioningState: to.Ptr("Succeeded"), // StorageProfile: &armcompute.StorageProfile{ // DataDisks: []*armcompute.DataDisk{ // }, // ImageReference: &armcompute.ImageReference{ // ID: to.Ptr("/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/images/nsgcustom"), // }, // OSDisk: &armcompute.OSDisk{ // Name: to.Ptr("myVMosdisk"), // Caching: to.Ptr(armcompute.CachingTypesReadWrite), // CreateOption: to.Ptr(armcompute.DiskCreateOptionTypesFromImage), // DiskSizeGB: to.Ptr[int32](30), // ManagedDisk: &armcompute.ManagedDiskParameters{ // StorageAccountType: to.Ptr(armcompute.StorageAccountTypesStandardLRS), // }, // OSType: to.Ptr(armcompute.OperatingSystemTypesLinux), // }, // }, // VMID: to.Ptr("71aa3d5a-d73d-4970-9182-8580433b2865"), // }, // }
Output:
Example (CreateAVmInAVirtualMachineScaleSetWithCustomerAssignedPlatformFaultDomain) ¶
Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/92de53a5f1e0e03c94b40475d2135d97148ed014/specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-03-01/examples/virtualMachineExamples/VirtualMachine_Create_InAVmssWithCustomerAssignedPlatformFaultDomain.json
cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() clientFactory, err := armcompute.NewClientFactory("<subscription-id>", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } poller, err := clientFactory.NewVirtualMachinesClient().BeginCreateOrUpdate(ctx, "myResourceGroup", "myVM", armcompute.VirtualMachine{ Location: to.Ptr("westus"), Properties: &armcompute.VirtualMachineProperties{ HardwareProfile: &armcompute.HardwareProfile{ VMSize: to.Ptr(armcompute.VirtualMachineSizeTypesStandardD1V2), }, NetworkProfile: &armcompute.NetworkProfile{ NetworkInterfaces: []*armcompute.NetworkInterfaceReference{ { ID: to.Ptr("/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/networkInterfaces/{existing-nic-name}"), Properties: &armcompute.NetworkInterfaceReferenceProperties{ Primary: to.Ptr(true), }, }}, }, OSProfile: &armcompute.OSProfile{ AdminPassword: to.Ptr("{your-password}"), AdminUsername: to.Ptr("{your-username}"), ComputerName: to.Ptr("myVM"), }, PlatformFaultDomain: to.Ptr[int32](1), StorageProfile: &armcompute.StorageProfile{ ImageReference: &armcompute.ImageReference{ Offer: to.Ptr("WindowsServer"), Publisher: to.Ptr("MicrosoftWindowsServer"), SKU: to.Ptr("2016-Datacenter"), Version: to.Ptr("latest"), }, OSDisk: &armcompute.OSDisk{ Name: to.Ptr("myVMosdisk"), Caching: to.Ptr(armcompute.CachingTypesReadWrite), CreateOption: to.Ptr(armcompute.DiskCreateOptionTypesFromImage), ManagedDisk: &armcompute.ManagedDiskParameters{ StorageAccountType: to.Ptr(armcompute.StorageAccountTypesStandardLRS), }, }, }, VirtualMachineScaleSet: &armcompute.SubResource{ ID: to.Ptr("/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/virtualMachineScaleSets/{existing-flex-vmss-name-with-platformFaultDomainCount-greater-than-1}"), }, }, }, &armcompute.VirtualMachinesClientBeginCreateOrUpdateOptions{IfMatch: nil, IfNoneMatch: nil, }) if err != nil { log.Fatalf("failed to finish the request: %v", err) } res, err := poller.PollUntilDone(ctx, nil) if err != nil { log.Fatalf("failed to pull the result: %v", err) } // You could use response here. We use blank identifier for just demo purposes. _ = res // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. // res.VirtualMachine = armcompute.VirtualMachine{ // Name: to.Ptr("myVM"), // Type: to.Ptr("Microsoft.Compute/virtualMachines"), // ID: to.Ptr("/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/virtualMachines/myVM"), // Location: to.Ptr("westus"), // Properties: &armcompute.VirtualMachineProperties{ // HardwareProfile: &armcompute.HardwareProfile{ // VMSize: to.Ptr(armcompute.VirtualMachineSizeTypesStandardD1V2), // }, // NetworkProfile: &armcompute.NetworkProfile{ // NetworkInterfaces: []*armcompute.NetworkInterfaceReference{ // { // ID: to.Ptr("/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/networkInterfaces/nsgExistingNic"), // Properties: &armcompute.NetworkInterfaceReferenceProperties{ // Primary: to.Ptr(true), // }, // }}, // }, // OSProfile: &armcompute.OSProfile{ // AdminUsername: to.Ptr("{your-username}"), // ComputerName: to.Ptr("myVM"), // Secrets: []*armcompute.VaultSecretGroup{ // }, // WindowsConfiguration: &armcompute.WindowsConfiguration{ // EnableAutomaticUpdates: to.Ptr(true), // ProvisionVMAgent: to.Ptr(true), // }, // }, // PlatformFaultDomain: to.Ptr[int32](1), // ProvisioningState: to.Ptr("Succeeded"), // StorageProfile: &armcompute.StorageProfile{ // DataDisks: []*armcompute.DataDisk{ // }, // ImageReference: &armcompute.ImageReference{ // Offer: to.Ptr("WindowsServer"), // Publisher: to.Ptr("MicrosoftWindowsServer"), // SKU: to.Ptr("2016-Datacenter"), // Version: to.Ptr("latest"), // }, // OSDisk: &armcompute.OSDisk{ // Name: to.Ptr("myVMosdisk"), // Caching: to.Ptr(armcompute.CachingTypesReadWrite), // CreateOption: to.Ptr(armcompute.DiskCreateOptionTypesFromImage), // ManagedDisk: &armcompute.ManagedDiskParameters{ // StorageAccountType: to.Ptr(armcompute.StorageAccountTypesStandardLRS), // }, // OSType: to.Ptr(armcompute.OperatingSystemTypesWindows), // }, // }, // VirtualMachineScaleSet: &armcompute.SubResource{ // ID: to.Ptr("/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/virtualMachineScaleSets/myExistingFlexVmss"), // }, // VMID: to.Ptr("7cce54f2-ecd3-4ddd-a8d9-50984faa3918"), // }, // }
Output:
Example (CreateAVmInAnAvailabilitySet) ¶
Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/92de53a5f1e0e03c94b40475d2135d97148ed014/specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-03-01/examples/virtualMachineExamples/VirtualMachine_Create_InAnAvailabilitySet.json
cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() clientFactory, err := armcompute.NewClientFactory("<subscription-id>", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } poller, err := clientFactory.NewVirtualMachinesClient().BeginCreateOrUpdate(ctx, "myResourceGroup", "myVM", armcompute.VirtualMachine{ Location: to.Ptr("westus"), Properties: &armcompute.VirtualMachineProperties{ AvailabilitySet: &armcompute.SubResource{ ID: to.Ptr("/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/availabilitySets/{existing-availability-set-name}"), }, HardwareProfile: &armcompute.HardwareProfile{ VMSize: to.Ptr(armcompute.VirtualMachineSizeTypesStandardD1V2), }, NetworkProfile: &armcompute.NetworkProfile{ NetworkInterfaces: []*armcompute.NetworkInterfaceReference{ { ID: to.Ptr("/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/networkInterfaces/{existing-nic-name}"), Properties: &armcompute.NetworkInterfaceReferenceProperties{ Primary: to.Ptr(true), }, }}, }, OSProfile: &armcompute.OSProfile{ AdminPassword: to.Ptr("{your-password}"), AdminUsername: to.Ptr("{your-username}"), ComputerName: to.Ptr("myVM"), }, StorageProfile: &armcompute.StorageProfile{ ImageReference: &armcompute.ImageReference{ Offer: to.Ptr("WindowsServer"), Publisher: to.Ptr("MicrosoftWindowsServer"), SKU: to.Ptr("2016-Datacenter"), Version: to.Ptr("latest"), }, OSDisk: &armcompute.OSDisk{ Name: to.Ptr("myVMosdisk"), Caching: to.Ptr(armcompute.CachingTypesReadWrite), CreateOption: to.Ptr(armcompute.DiskCreateOptionTypesFromImage), ManagedDisk: &armcompute.ManagedDiskParameters{ StorageAccountType: to.Ptr(armcompute.StorageAccountTypesStandardLRS), }, }, }, }, }, &armcompute.VirtualMachinesClientBeginCreateOrUpdateOptions{IfMatch: nil, IfNoneMatch: nil, }) if err != nil { log.Fatalf("failed to finish the request: %v", err) } res, err := poller.PollUntilDone(ctx, nil) if err != nil { log.Fatalf("failed to pull the result: %v", err) } // You could use response here. We use blank identifier for just demo purposes. _ = res // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. // res.VirtualMachine = armcompute.VirtualMachine{ // Name: to.Ptr("myVM"), // Type: to.Ptr("Microsoft.Compute/virtualMachines"), // ID: to.Ptr("/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/virtualMachines/myVM"), // Location: to.Ptr("westus"), // Properties: &armcompute.VirtualMachineProperties{ // AvailabilitySet: &armcompute.SubResource{ // ID: to.Ptr("/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/availabilitySets/NSGEXISTINGAS"), // }, // HardwareProfile: &armcompute.HardwareProfile{ // VMSize: to.Ptr(armcompute.VirtualMachineSizeTypesStandardD1V2), // }, // NetworkProfile: &armcompute.NetworkProfile{ // NetworkInterfaces: []*armcompute.NetworkInterfaceReference{ // { // ID: to.Ptr("/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/networkInterfaces/nsgExistingNic"), // Properties: &armcompute.NetworkInterfaceReferenceProperties{ // Primary: to.Ptr(true), // }, // }}, // }, // OSProfile: &armcompute.OSProfile{ // AdminUsername: to.Ptr("{your-username}"), // ComputerName: to.Ptr("myVM"), // Secrets: []*armcompute.VaultSecretGroup{ // }, // WindowsConfiguration: &armcompute.WindowsConfiguration{ // EnableAutomaticUpdates: to.Ptr(true), // ProvisionVMAgent: to.Ptr(true), // }, // }, // ProvisioningState: to.Ptr("Succeeded"), // StorageProfile: &armcompute.StorageProfile{ // DataDisks: []*armcompute.DataDisk{ // }, // ImageReference: &armcompute.ImageReference{ // Offer: to.Ptr("WindowsServer"), // Publisher: to.Ptr("MicrosoftWindowsServer"), // SKU: to.Ptr("2016-Datacenter"), // Version: to.Ptr("latest"), // }, // OSDisk: &armcompute.OSDisk{ // Name: to.Ptr("myVMosdisk"), // Caching: to.Ptr(armcompute.CachingTypesReadWrite), // CreateOption: to.Ptr(armcompute.DiskCreateOptionTypesFromImage), // ManagedDisk: &armcompute.ManagedDiskParameters{ // StorageAccountType: to.Ptr(armcompute.StorageAccountTypesStandardLRS), // }, // OSType: to.Ptr(armcompute.OperatingSystemTypesWindows), // }, // }, // VMID: to.Ptr("b7a098cc-b0b8-46e8-a205-62f301a62a8f"), // }, // }
Output:
Example (CreateAVmWithAMarketplaceImagePlan) ¶
Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/92de53a5f1e0e03c94b40475d2135d97148ed014/specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-03-01/examples/virtualMachineExamples/VirtualMachine_Create_WithAMarketplaceImagePlan.json
cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() clientFactory, err := armcompute.NewClientFactory("<subscription-id>", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } poller, err := clientFactory.NewVirtualMachinesClient().BeginCreateOrUpdate(ctx, "myResourceGroup", "myVM", armcompute.VirtualMachine{ Location: to.Ptr("westus"), Plan: &armcompute.Plan{ Name: to.Ptr("windows2016"), Product: to.Ptr("windows-data-science-vm"), Publisher: to.Ptr("microsoft-ads"), }, Properties: &armcompute.VirtualMachineProperties{ HardwareProfile: &armcompute.HardwareProfile{ VMSize: to.Ptr(armcompute.VirtualMachineSizeTypesStandardD1V2), }, NetworkProfile: &armcompute.NetworkProfile{ NetworkInterfaces: []*armcompute.NetworkInterfaceReference{ { ID: to.Ptr("/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/networkInterfaces/{existing-nic-name}"), Properties: &armcompute.NetworkInterfaceReferenceProperties{ Primary: to.Ptr(true), }, }}, }, OSProfile: &armcompute.OSProfile{ AdminPassword: to.Ptr("{your-password}"), AdminUsername: to.Ptr("{your-username}"), ComputerName: to.Ptr("myVM"), }, StorageProfile: &armcompute.StorageProfile{ ImageReference: &armcompute.ImageReference{ Offer: to.Ptr("windows-data-science-vm"), Publisher: to.Ptr("microsoft-ads"), SKU: to.Ptr("windows2016"), Version: to.Ptr("latest"), }, OSDisk: &armcompute.OSDisk{ Name: to.Ptr("myVMosdisk"), Caching: to.Ptr(armcompute.CachingTypesReadWrite), CreateOption: to.Ptr(armcompute.DiskCreateOptionTypesFromImage), ManagedDisk: &armcompute.ManagedDiskParameters{ StorageAccountType: to.Ptr(armcompute.StorageAccountTypesStandardLRS), }, }, }, }, }, &armcompute.VirtualMachinesClientBeginCreateOrUpdateOptions{IfMatch: nil, IfNoneMatch: nil, }) if err != nil { log.Fatalf("failed to finish the request: %v", err) } res, err := poller.PollUntilDone(ctx, nil) if err != nil { log.Fatalf("failed to pull the result: %v", err) } // You could use response here. We use blank identifier for just demo purposes. _ = res // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. // res.VirtualMachine = armcompute.VirtualMachine{ // Name: to.Ptr("myVM"), // Type: to.Ptr("Microsoft.Compute/virtualMachines"), // ID: to.Ptr("/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/virtualMachines/myVM"), // Location: to.Ptr("westus"), // Plan: &armcompute.Plan{ // Name: to.Ptr("standard-data-science-vm"), // Product: to.Ptr("standard-data-science-vm"), // Publisher: to.Ptr("microsoft-ads"), // }, // Properties: &armcompute.VirtualMachineProperties{ // HardwareProfile: &armcompute.HardwareProfile{ // VMSize: to.Ptr(armcompute.VirtualMachineSizeTypesStandardD1V2), // }, // NetworkProfile: &armcompute.NetworkProfile{ // NetworkInterfaces: []*armcompute.NetworkInterfaceReference{ // { // ID: to.Ptr("/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/networkInterfaces/nsgExistingNic"), // Properties: &armcompute.NetworkInterfaceReferenceProperties{ // Primary: to.Ptr(true), // }, // }}, // }, // OSProfile: &armcompute.OSProfile{ // AdminUsername: to.Ptr("{your-username}"), // ComputerName: to.Ptr("myVM"), // Secrets: []*armcompute.VaultSecretGroup{ // }, // WindowsConfiguration: &armcompute.WindowsConfiguration{ // EnableAutomaticUpdates: to.Ptr(true), // ProvisionVMAgent: to.Ptr(true), // }, // }, // ProvisioningState: to.Ptr("Succeeded"), // StorageProfile: &armcompute.StorageProfile{ // DataDisks: []*armcompute.DataDisk{ // }, // ImageReference: &armcompute.ImageReference{ // Offer: to.Ptr("standard-data-science-vm"), // Publisher: to.Ptr("microsoft-ads"), // SKU: to.Ptr("standard-data-science-vm"), // Version: to.Ptr("latest"), // }, // OSDisk: &armcompute.OSDisk{ // Name: to.Ptr("myVMosdisk"), // Caching: to.Ptr(armcompute.CachingTypesReadWrite), // CreateOption: to.Ptr(armcompute.DiskCreateOptionTypesFromImage), // ManagedDisk: &armcompute.ManagedDiskParameters{ // StorageAccountType: to.Ptr(armcompute.StorageAccountTypesStandardLRS), // }, // OSType: to.Ptr(armcompute.OperatingSystemTypesWindows), // }, // }, // VMID: to.Ptr("5c0d55a7-c407-4ed6-bf7d-ddb810267c85"), // }, // }
Output:
Example (CreateAVmWithAnExtensionsTimeBudget) ¶
Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/92de53a5f1e0e03c94b40475d2135d97148ed014/specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-03-01/examples/virtualMachineExamples/VirtualMachine_Create_WithExtensionsTimeBudget.json
cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() clientFactory, err := armcompute.NewClientFactory("<subscription-id>", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } poller, err := clientFactory.NewVirtualMachinesClient().BeginCreateOrUpdate(ctx, "myResourceGroup", "myVM", armcompute.VirtualMachine{ Location: to.Ptr("westus"), Properties: &armcompute.VirtualMachineProperties{ DiagnosticsProfile: &armcompute.DiagnosticsProfile{ BootDiagnostics: &armcompute.BootDiagnostics{ Enabled: to.Ptr(true), StorageURI: to.Ptr("http://{existing-storage-account-name}.blob.core.windows.net"), }, }, ExtensionsTimeBudget: to.Ptr("PT30M"), HardwareProfile: &armcompute.HardwareProfile{ VMSize: to.Ptr(armcompute.VirtualMachineSizeTypesStandardD1V2), }, NetworkProfile: &armcompute.NetworkProfile{ NetworkInterfaces: []*armcompute.NetworkInterfaceReference{ { ID: to.Ptr("/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/networkInterfaces/{existing-nic-name}"), Properties: &armcompute.NetworkInterfaceReferenceProperties{ Primary: to.Ptr(true), }, }}, }, OSProfile: &armcompute.OSProfile{ AdminPassword: to.Ptr("{your-password}"), AdminUsername: to.Ptr("{your-username}"), ComputerName: to.Ptr("myVM"), }, StorageProfile: &armcompute.StorageProfile{ ImageReference: &armcompute.ImageReference{ Offer: to.Ptr("WindowsServer"), Publisher: to.Ptr("MicrosoftWindowsServer"), SKU: to.Ptr("2016-Datacenter"), Version: to.Ptr("latest"), }, OSDisk: &armcompute.OSDisk{ Name: to.Ptr("myVMosdisk"), Caching: to.Ptr(armcompute.CachingTypesReadWrite), CreateOption: to.Ptr(armcompute.DiskCreateOptionTypesFromImage), ManagedDisk: &armcompute.ManagedDiskParameters{ StorageAccountType: to.Ptr(armcompute.StorageAccountTypesStandardLRS), }, }, }, }, }, &armcompute.VirtualMachinesClientBeginCreateOrUpdateOptions{IfMatch: nil, IfNoneMatch: nil, }) if err != nil { log.Fatalf("failed to finish the request: %v", err) } res, err := poller.PollUntilDone(ctx, nil) if err != nil { log.Fatalf("failed to pull the result: %v", err) } // You could use response here. We use blank identifier for just demo purposes. _ = res // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. // res.VirtualMachine = armcompute.VirtualMachine{ // Name: to.Ptr("myVM"), // Type: to.Ptr("Microsoft.Compute/virtualMachines"), // ID: to.Ptr("/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/virtualMachines/myVM"), // Location: to.Ptr("westus"), // Properties: &armcompute.VirtualMachineProperties{ // DiagnosticsProfile: &armcompute.DiagnosticsProfile{ // BootDiagnostics: &armcompute.BootDiagnostics{ // Enabled: to.Ptr(true), // StorageURI: to.Ptr("http://nsgdiagnostic.blob.core.windows.net"), // }, // }, // ExtensionsTimeBudget: to.Ptr("PT30M"), // HardwareProfile: &armcompute.HardwareProfile{ // VMSize: to.Ptr(armcompute.VirtualMachineSizeTypesStandardD1V2), // }, // NetworkProfile: &armcompute.NetworkProfile{ // NetworkInterfaces: []*armcompute.NetworkInterfaceReference{ // { // ID: to.Ptr("/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/networkInterfaces/nsgExistingNic"), // Properties: &armcompute.NetworkInterfaceReferenceProperties{ // Primary: to.Ptr(true), // }, // }}, // }, // OSProfile: &armcompute.OSProfile{ // AdminUsername: to.Ptr("{your-username}"), // ComputerName: to.Ptr("myVM"), // Secrets: []*armcompute.VaultSecretGroup{ // }, // WindowsConfiguration: &armcompute.WindowsConfiguration{ // EnableAutomaticUpdates: to.Ptr(true), // ProvisionVMAgent: to.Ptr(true), // }, // }, // ProvisioningState: to.Ptr("Succeeded"), // StorageProfile: &armcompute.StorageProfile{ // DataDisks: []*armcompute.DataDisk{ // }, // ImageReference: &armcompute.ImageReference{ // Offer: to.Ptr("WindowsServer"), // Publisher: to.Ptr("MicrosoftWindowsServer"), // SKU: to.Ptr("2016-Datacenter"), // Version: to.Ptr("latest"), // }, // OSDisk: &armcompute.OSDisk{ // Name: to.Ptr("myVMosdisk"), // Caching: to.Ptr(armcompute.CachingTypesReadWrite), // CreateOption: to.Ptr(armcompute.DiskCreateOptionTypesFromImage), // ManagedDisk: &armcompute.ManagedDiskParameters{ // StorageAccountType: to.Ptr(armcompute.StorageAccountTypesStandardLRS), // }, // OSType: to.Ptr(armcompute.OperatingSystemTypesWindows), // }, // }, // VMID: to.Ptr("676420ba-7a24-4bfe-80bd-9c841ee184fa"), // }, // }
Output:
Example (CreateAVmWithApplicationProfile) ¶
Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/92de53a5f1e0e03c94b40475d2135d97148ed014/specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-03-01/examples/virtualMachineExamples/VirtualMachine_Create_WithApplicationProfile.json
cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() clientFactory, err := armcompute.NewClientFactory("<subscription-id>", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } poller, err := clientFactory.NewVirtualMachinesClient().BeginCreateOrUpdate(ctx, "myResourceGroup", "myVM", armcompute.VirtualMachine{ Location: to.Ptr("westus"), Properties: &armcompute.VirtualMachineProperties{ ApplicationProfile: &armcompute.ApplicationProfile{ GalleryApplications: []*armcompute.VMGalleryApplication{ { ConfigurationReference: to.Ptr("https://mystorageaccount.blob.core.windows.net/configurations/settings.config"), EnableAutomaticUpgrade: to.Ptr(false), Order: to.Ptr[int32](1), PackageReferenceID: to.Ptr("/subscriptions/32c17a9e-aa7b-4ba5-a45b-e324116b6fdb/resourceGroups/myresourceGroupName2/providers/Microsoft.Compute/galleries/myGallery1/applications/MyApplication1/versions/1.0"), Tags: to.Ptr("myTag1"), TreatFailureAsDeploymentFailure: to.Ptr(false), }, { PackageReferenceID: to.Ptr("/subscriptions/32c17a9e-aa7b-4ba5-a45b-e324116b6fdg/resourceGroups/myresourceGroupName3/providers/Microsoft.Compute/galleries/myGallery2/applications/MyApplication2/versions/1.1"), }}, }, HardwareProfile: &armcompute.HardwareProfile{ VMSize: to.Ptr(armcompute.VirtualMachineSizeTypesStandardD1V2), }, NetworkProfile: &armcompute.NetworkProfile{ NetworkInterfaces: []*armcompute.NetworkInterfaceReference{ { ID: to.Ptr("/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/networkInterfaces/{existing-nic-name}"), Properties: &armcompute.NetworkInterfaceReferenceProperties{ Primary: to.Ptr(true), }, }}, }, OSProfile: &armcompute.OSProfile{ AdminPassword: to.Ptr("{your-password}"), AdminUsername: to.Ptr("{your-username}"), ComputerName: to.Ptr("myVM"), }, StorageProfile: &armcompute.StorageProfile{ ImageReference: &armcompute.ImageReference{ Offer: to.Ptr("{image_offer}"), Publisher: to.Ptr("{image_publisher}"), SKU: to.Ptr("{image_sku}"), Version: to.Ptr("latest"), }, OSDisk: &armcompute.OSDisk{ Name: to.Ptr("myVMosdisk"), Caching: to.Ptr(armcompute.CachingTypesReadWrite), CreateOption: to.Ptr(armcompute.DiskCreateOptionTypesFromImage), ManagedDisk: &armcompute.ManagedDiskParameters{ StorageAccountType: to.Ptr(armcompute.StorageAccountTypesStandardLRS), }, }, }, }, }, &armcompute.VirtualMachinesClientBeginCreateOrUpdateOptions{IfMatch: nil, IfNoneMatch: nil, }) if err != nil { log.Fatalf("failed to finish the request: %v", err) } res, err := poller.PollUntilDone(ctx, nil) if err != nil { log.Fatalf("failed to pull the result: %v", err) } // You could use response here. We use blank identifier for just demo purposes. _ = res // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. // res.VirtualMachine = armcompute.VirtualMachine{ // Name: to.Ptr("myVM"), // Type: to.Ptr("Microsoft.Compute/virtualMachines"), // ID: to.Ptr("/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/virtualMachines/myVM"), // Location: to.Ptr("westus"), // Properties: &armcompute.VirtualMachineProperties{ // ApplicationProfile: &armcompute.ApplicationProfile{ // GalleryApplications: []*armcompute.VMGalleryApplication{ // { // ConfigurationReference: to.Ptr("https://mystorageaccount.blob.core.windows.net/configurations/settings.config"), // Order: to.Ptr[int32](1), // PackageReferenceID: to.Ptr("/subscriptions/32c17a9e-aa7b-4ba5-a45b-e324116b6fdb/resourceGroups/myresourceGroupName2/providers/Microsoft.Compute/galleries/myGallery1/applications/MyApplication1/versions/1.0"), // Tags: to.Ptr("myTag1"), // }, // { // PackageReferenceID: to.Ptr("/subscriptions/32c17a9e-aa7b-4ba5-a45b-e324116b6fdg/resourceGroups/myresourceGroupName3/providers/Microsoft.Compute/galleries/myGallery2/applications/MyApplication2/versions/1.1"), // }}, // }, // HardwareProfile: &armcompute.HardwareProfile{ // VMSize: to.Ptr(armcompute.VirtualMachineSizeTypesStandardD1V2), // }, // NetworkProfile: &armcompute.NetworkProfile{ // NetworkInterfaces: []*armcompute.NetworkInterfaceReference{ // { // ID: to.Ptr("/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/networkInterfaces/nsgExistingNic"), // Properties: &armcompute.NetworkInterfaceReferenceProperties{ // Primary: to.Ptr(true), // }, // }}, // }, // OSProfile: &armcompute.OSProfile{ // AdminUsername: to.Ptr("{your-username}"), // ComputerName: to.Ptr("myVM"), // LinuxConfiguration: &armcompute.LinuxConfiguration{ // DisablePasswordAuthentication: to.Ptr(true), // SSH: &armcompute.SSHConfiguration{ // PublicKeys: []*armcompute.SSHPublicKey{ // { // Path: to.Ptr("/home/{your-username}/.ssh/authorized_keys"), // KeyData: to.Ptr("ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQCeClRAk2ipUs/l5voIsDC5q9RI+YSRd1Bvd/O+axgY4WiBzG+4FwJWZm/mLLe5DoOdHQwmU2FrKXZSW4w2sYE70KeWnrFViCOX5MTVvJgPE8ClugNl8RWth/tU849DvM9sT7vFgfVSHcAS2yDRyDlueii+8nF2ym8XWAPltFVCyLHRsyBp5YPqK8JFYIa1eybKsY3hEAxRCA+/7bq8et+Gj3coOsuRmrehav7rE6N12Pb80I6ofa6SM5XNYq4Xk0iYNx7R3kdz0Jj9XgZYWjAHjJmT0gTRoOnt6upOuxK7xI/ykWrllgpXrCPu3Ymz+c+ujaqcxDopnAl2lmf69/J1"), // }}, // }, // }, // Secrets: []*armcompute.VaultSecretGroup{ // }, // }, // ProvisioningState: to.Ptr("Succeeded"), // StorageProfile: &armcompute.StorageProfile{ // DataDisks: []*armcompute.DataDisk{ // }, // ImageReference: &armcompute.ImageReference{ // Offer: to.Ptr("UbuntuServer"), // Publisher: to.Ptr("Canonical"), // SKU: to.Ptr("16.04-LTS"), // Version: to.Ptr("latest"), // }, // OSDisk: &armcompute.OSDisk{ // Name: to.Ptr("myVMosdisk"), // Caching: to.Ptr(armcompute.CachingTypesReadWrite), // CreateOption: to.Ptr(armcompute.DiskCreateOptionTypesFromImage), // ManagedDisk: &armcompute.ManagedDiskParameters{ // StorageAccountType: to.Ptr(armcompute.StorageAccountTypesStandardLRS), // }, // OSType: to.Ptr(armcompute.OperatingSystemTypesLinux), // }, // }, // VMID: to.Ptr("e0de9b84-a506-4b95-9623-00a425d05c90"), // }, // }
Output:
Example (CreateAVmWithBootDiagnostics) ¶
Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/92de53a5f1e0e03c94b40475d2135d97148ed014/specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-03-01/examples/virtualMachineExamples/VirtualMachine_Create_WithBootDiagnostics.json
cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() clientFactory, err := armcompute.NewClientFactory("<subscription-id>", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } poller, err := clientFactory.NewVirtualMachinesClient().BeginCreateOrUpdate(ctx, "myResourceGroup", "myVM", armcompute.VirtualMachine{ Location: to.Ptr("westus"), Properties: &armcompute.VirtualMachineProperties{ DiagnosticsProfile: &armcompute.DiagnosticsProfile{ BootDiagnostics: &armcompute.BootDiagnostics{ Enabled: to.Ptr(true), StorageURI: to.Ptr("http://{existing-storage-account-name}.blob.core.windows.net"), }, }, HardwareProfile: &armcompute.HardwareProfile{ VMSize: to.Ptr(armcompute.VirtualMachineSizeTypesStandardD1V2), }, NetworkProfile: &armcompute.NetworkProfile{ NetworkInterfaces: []*armcompute.NetworkInterfaceReference{ { ID: to.Ptr("/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/networkInterfaces/{existing-nic-name}"), Properties: &armcompute.NetworkInterfaceReferenceProperties{ Primary: to.Ptr(true), }, }}, }, OSProfile: &armcompute.OSProfile{ AdminPassword: to.Ptr("{your-password}"), AdminUsername: to.Ptr("{your-username}"), ComputerName: to.Ptr("myVM"), }, StorageProfile: &armcompute.StorageProfile{ ImageReference: &armcompute.ImageReference{ Offer: to.Ptr("WindowsServer"), Publisher: to.Ptr("MicrosoftWindowsServer"), SKU: to.Ptr("2016-Datacenter"), Version: to.Ptr("latest"), }, OSDisk: &armcompute.OSDisk{ Name: to.Ptr("myVMosdisk"), Caching: to.Ptr(armcompute.CachingTypesReadWrite), CreateOption: to.Ptr(armcompute.DiskCreateOptionTypesFromImage), ManagedDisk: &armcompute.ManagedDiskParameters{ StorageAccountType: to.Ptr(armcompute.StorageAccountTypesStandardLRS), }, }, }, }, }, &armcompute.VirtualMachinesClientBeginCreateOrUpdateOptions{IfMatch: nil, IfNoneMatch: nil, }) if err != nil { log.Fatalf("failed to finish the request: %v", err) } res, err := poller.PollUntilDone(ctx, nil) if err != nil { log.Fatalf("failed to pull the result: %v", err) } // You could use response here. We use blank identifier for just demo purposes. _ = res // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. // res.VirtualMachine = armcompute.VirtualMachine{ // Name: to.Ptr("myVM"), // Type: to.Ptr("Microsoft.Compute/virtualMachines"), // ID: to.Ptr("/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/virtualMachines/myVM"), // Location: to.Ptr("westus"), // Properties: &armcompute.VirtualMachineProperties{ // DiagnosticsProfile: &armcompute.DiagnosticsProfile{ // BootDiagnostics: &armcompute.BootDiagnostics{ // Enabled: to.Ptr(true), // StorageURI: to.Ptr("http://nsgdiagnostic.blob.core.windows.net"), // }, // }, // HardwareProfile: &armcompute.HardwareProfile{ // VMSize: to.Ptr(armcompute.VirtualMachineSizeTypesStandardD1V2), // }, // NetworkProfile: &armcompute.NetworkProfile{ // NetworkInterfaces: []*armcompute.NetworkInterfaceReference{ // { // ID: to.Ptr("/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/networkInterfaces/nsgExistingNic"), // Properties: &armcompute.NetworkInterfaceReferenceProperties{ // Primary: to.Ptr(true), // }, // }}, // }, // OSProfile: &armcompute.OSProfile{ // AdminUsername: to.Ptr("{your-username}"), // ComputerName: to.Ptr("myVM"), // Secrets: []*armcompute.VaultSecretGroup{ // }, // WindowsConfiguration: &armcompute.WindowsConfiguration{ // EnableAutomaticUpdates: to.Ptr(true), // ProvisionVMAgent: to.Ptr(true), // }, // }, // ProvisioningState: to.Ptr("Succeeded"), // StorageProfile: &armcompute.StorageProfile{ // DataDisks: []*armcompute.DataDisk{ // }, // ImageReference: &armcompute.ImageReference{ // Offer: to.Ptr("WindowsServer"), // Publisher: to.Ptr("MicrosoftWindowsServer"), // SKU: to.Ptr("2016-Datacenter"), // Version: to.Ptr("latest"), // }, // OSDisk: &armcompute.OSDisk{ // Name: to.Ptr("myVMosdisk"), // Caching: to.Ptr(armcompute.CachingTypesReadWrite), // CreateOption: to.Ptr(armcompute.DiskCreateOptionTypesFromImage), // ManagedDisk: &armcompute.ManagedDiskParameters{ // StorageAccountType: to.Ptr(armcompute.StorageAccountTypesStandardLRS), // }, // OSType: to.Ptr(armcompute.OperatingSystemTypesWindows), // }, // }, // VMID: to.Ptr("676420ba-7a24-4bfe-80bd-9c841ee184fa"), // }, // }
Output:
Example (CreateAVmWithDataDisksUsingCopyAndRestoreOptions) ¶
Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/92de53a5f1e0e03c94b40475d2135d97148ed014/specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-03-01/examples/virtualMachineExamples/VirtualMachine_Create_WithDataDisksFromSourceResource.json
cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() clientFactory, err := armcompute.NewClientFactory("<subscription-id>", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } poller, err := clientFactory.NewVirtualMachinesClient().BeginCreateOrUpdate(ctx, "myResourceGroup", "myVM", armcompute.VirtualMachine{ Location: to.Ptr("westus"), Properties: &armcompute.VirtualMachineProperties{ HardwareProfile: &armcompute.HardwareProfile{ VMSize: to.Ptr(armcompute.VirtualMachineSizeTypesStandardD2V2), }, NetworkProfile: &armcompute.NetworkProfile{ NetworkInterfaces: []*armcompute.NetworkInterfaceReference{ { ID: to.Ptr("/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/networkInterfaces/{existing-nic-name}"), Properties: &armcompute.NetworkInterfaceReferenceProperties{ Primary: to.Ptr(true), }, }}, }, OSProfile: &armcompute.OSProfile{ AdminPassword: to.Ptr("{your-password}"), AdminUsername: to.Ptr("{your-username}"), ComputerName: to.Ptr("myVM"), }, StorageProfile: &armcompute.StorageProfile{ DataDisks: []*armcompute.DataDisk{ { CreateOption: to.Ptr(armcompute.DiskCreateOptionTypesCopy), DiskSizeGB: to.Ptr[int32](1023), Lun: to.Ptr[int32](0), SourceResource: &armcompute.APIEntityReference{ ID: to.Ptr("/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/snapshots/{existing-snapshot-name}"), }, }, { CreateOption: to.Ptr(armcompute.DiskCreateOptionTypesCopy), DiskSizeGB: to.Ptr[int32](1023), Lun: to.Ptr[int32](1), SourceResource: &armcompute.APIEntityReference{ ID: to.Ptr("/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/disks/{existing-disk-name}"), }, }, { CreateOption: to.Ptr(armcompute.DiskCreateOptionTypesRestore), DiskSizeGB: to.Ptr[int32](1023), Lun: to.Ptr[int32](2), SourceResource: &armcompute.APIEntityReference{ ID: to.Ptr("/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/restorePointCollections/{existing-rpc-name}/restorePoints/{existing-rp-name}/diskRestorePoints/{existing-disk-restore-point-name}"), }, }}, ImageReference: &armcompute.ImageReference{ Offer: to.Ptr("WindowsServer"), Publisher: to.Ptr("MicrosoftWindowsServer"), SKU: to.Ptr("2016-Datacenter"), Version: to.Ptr("latest"), }, OSDisk: &armcompute.OSDisk{ Name: to.Ptr("myVMosdisk"), Caching: to.Ptr(armcompute.CachingTypesReadWrite), CreateOption: to.Ptr(armcompute.DiskCreateOptionTypesFromImage), ManagedDisk: &armcompute.ManagedDiskParameters{ StorageAccountType: to.Ptr(armcompute.StorageAccountTypesStandardLRS), }, }, }, }, }, &armcompute.VirtualMachinesClientBeginCreateOrUpdateOptions{IfMatch: nil, IfNoneMatch: nil, }) if err != nil { log.Fatalf("failed to finish the request: %v", err) } res, err := poller.PollUntilDone(ctx, nil) if err != nil { log.Fatalf("failed to pull the result: %v", err) } // You could use response here. We use blank identifier for just demo purposes. _ = res // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. // res.VirtualMachine = armcompute.VirtualMachine{ // Name: to.Ptr("myVM"), // Type: to.Ptr("Microsoft.Compute/virtualMachines"), // ID: to.Ptr("/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/virtualMachines/myVM"), // Location: to.Ptr("westus"), // Properties: &armcompute.VirtualMachineProperties{ // HardwareProfile: &armcompute.HardwareProfile{ // VMSize: to.Ptr(armcompute.VirtualMachineSizeTypesStandardD2V2), // }, // NetworkProfile: &armcompute.NetworkProfile{ // NetworkInterfaces: []*armcompute.NetworkInterfaceReference{ // { // ID: to.Ptr("/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/networkInterfaces/nsgExistingNic"), // Properties: &armcompute.NetworkInterfaceReferenceProperties{ // Primary: to.Ptr(true), // }, // }}, // }, // OSProfile: &armcompute.OSProfile{ // AdminUsername: to.Ptr("{your-username}"), // ComputerName: to.Ptr("myVM"), // Secrets: []*armcompute.VaultSecretGroup{ // }, // WindowsConfiguration: &armcompute.WindowsConfiguration{ // EnableAutomaticUpdates: to.Ptr(true), // ProvisionVMAgent: to.Ptr(true), // }, // }, // ProvisioningState: to.Ptr("Succeeded"), // StorageProfile: &armcompute.StorageProfile{ // DataDisks: []*armcompute.DataDisk{ // { // Caching: to.Ptr(armcompute.CachingTypesNone), // CreateOption: to.Ptr(armcompute.DiskCreateOptionTypesCopy), // DiskSizeGB: to.Ptr[int32](1023), // Lun: to.Ptr[int32](0), // ManagedDisk: &armcompute.ManagedDiskParameters{ // StorageAccountType: to.Ptr(armcompute.StorageAccountTypesStandardLRS), // }, // SourceResource: &armcompute.APIEntityReference{ // ID: to.Ptr("/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/snapshots/{existing-snapshot-name}"), // }, // }, // { // Caching: to.Ptr(armcompute.CachingTypesNone), // CreateOption: to.Ptr(armcompute.DiskCreateOptionTypesCopy), // DiskSizeGB: to.Ptr[int32](1023), // Lun: to.Ptr[int32](1), // ManagedDisk: &armcompute.ManagedDiskParameters{ // StorageAccountType: to.Ptr(armcompute.StorageAccountTypesStandardLRS), // }, // SourceResource: &armcompute.APIEntityReference{ // ID: to.Ptr("/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/disks/{existing-disk-name}"), // }, // }, // { // Caching: to.Ptr(armcompute.CachingTypesNone), // CreateOption: to.Ptr(armcompute.DiskCreateOptionTypesRestore), // DiskSizeGB: to.Ptr[int32](1023), // Lun: to.Ptr[int32](2), // ManagedDisk: &armcompute.ManagedDiskParameters{ // StorageAccountType: to.Ptr(armcompute.StorageAccountTypesStandardLRS), // }, // SourceResource: &armcompute.APIEntityReference{ // ID: to.Ptr("/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/restorePointCollections/{existing-rpc-name}/restorePoints/{existing-rp-name}/diskRestorePoints/{existing-disk-restore-point-name}"), // }, // }}, // ImageReference: &armcompute.ImageReference{ // Offer: to.Ptr("WindowsServer"), // Publisher: to.Ptr("MicrosoftWindowsServer"), // SKU: to.Ptr("2016-Datacenter"), // Version: to.Ptr("latest"), // }, // OSDisk: &armcompute.OSDisk{ // Name: to.Ptr("myVMosdisk"), // Caching: to.Ptr(armcompute.CachingTypesReadWrite), // CreateOption: to.Ptr(armcompute.DiskCreateOptionTypesFromImage), // ManagedDisk: &armcompute.ManagedDiskParameters{ // StorageAccountType: to.Ptr(armcompute.StorageAccountTypesStandardLRS), // }, // OSType: to.Ptr(armcompute.OperatingSystemTypesWindows), // }, // }, // VMID: to.Ptr("3906fef9-a1e5-4b83-a8a8-540858b41df0"), // }, // }
Output:
Example (CreateAVmWithDiskControllerType) ¶
Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/92de53a5f1e0e03c94b40475d2135d97148ed014/specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-03-01/examples/virtualMachineExamples/VirtualMachine_Create_WithDiskControllerType.json
cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() clientFactory, err := armcompute.NewClientFactory("<subscription-id>", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } poller, err := clientFactory.NewVirtualMachinesClient().BeginCreateOrUpdate(ctx, "myResourceGroup", "myVM", armcompute.VirtualMachine{ Location: to.Ptr("westus"), Properties: &armcompute.VirtualMachineProperties{ DiagnosticsProfile: &armcompute.DiagnosticsProfile{ BootDiagnostics: &armcompute.BootDiagnostics{ Enabled: to.Ptr(true), StorageURI: to.Ptr("http://{existing-storage-account-name}.blob.core.windows.net"), }, }, HardwareProfile: &armcompute.HardwareProfile{ VMSize: to.Ptr(armcompute.VirtualMachineSizeTypesStandardD4V3), }, NetworkProfile: &armcompute.NetworkProfile{ NetworkInterfaces: []*armcompute.NetworkInterfaceReference{ { ID: to.Ptr("/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/networkInterfaces/{existing-nic-name}"), Properties: &armcompute.NetworkInterfaceReferenceProperties{ Primary: to.Ptr(true), }, }}, }, OSProfile: &armcompute.OSProfile{ AdminPassword: to.Ptr("{your-password}"), AdminUsername: to.Ptr("{your-username}"), ComputerName: to.Ptr("myVM"), }, ScheduledEventsPolicy: &armcompute.ScheduledEventsPolicy{ ScheduledEventsAdditionalPublishingTargets: &armcompute.ScheduledEventsAdditionalPublishingTargets{ EventGridAndResourceGraph: &armcompute.EventGridAndResourceGraph{ Enable: to.Ptr(true), }, }, UserInitiatedReboot: &armcompute.UserInitiatedReboot{ AutomaticallyApprove: to.Ptr(true), }, UserInitiatedRedeploy: &armcompute.UserInitiatedRedeploy{ AutomaticallyApprove: to.Ptr(true), }, }, StorageProfile: &armcompute.StorageProfile{ DiskControllerType: to.Ptr(armcompute.DiskControllerTypesNVMe), ImageReference: &armcompute.ImageReference{ Offer: to.Ptr("WindowsServer"), Publisher: to.Ptr("MicrosoftWindowsServer"), SKU: to.Ptr("2016-Datacenter"), Version: to.Ptr("latest"), }, OSDisk: &armcompute.OSDisk{ Name: to.Ptr("myVMosdisk"), Caching: to.Ptr(armcompute.CachingTypesReadWrite), CreateOption: to.Ptr(armcompute.DiskCreateOptionTypesFromImage), ManagedDisk: &armcompute.ManagedDiskParameters{ StorageAccountType: to.Ptr(armcompute.StorageAccountTypesStandardLRS), }, }, }, UserData: to.Ptr("U29tZSBDdXN0b20gRGF0YQ=="), }, }, &armcompute.VirtualMachinesClientBeginCreateOrUpdateOptions{IfMatch: nil, IfNoneMatch: nil, }) if err != nil { log.Fatalf("failed to finish the request: %v", err) } res, err := poller.PollUntilDone(ctx, nil) if err != nil { log.Fatalf("failed to pull the result: %v", err) } // You could use response here. We use blank identifier for just demo purposes. _ = res // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. // res.VirtualMachine = armcompute.VirtualMachine{ // Name: to.Ptr("myVM"), // Type: to.Ptr("Microsoft.Compute/virtualMachines"), // ID: to.Ptr("/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/virtualMachines/myVM"), // Location: to.Ptr("westus"), // Properties: &armcompute.VirtualMachineProperties{ // DiagnosticsProfile: &armcompute.DiagnosticsProfile{ // BootDiagnostics: &armcompute.BootDiagnostics{ // Enabled: to.Ptr(true), // StorageURI: to.Ptr("http://nsgdiagnostic.blob.core.windows.net"), // }, // }, // HardwareProfile: &armcompute.HardwareProfile{ // VMSize: to.Ptr(armcompute.VirtualMachineSizeTypesStandardD4V3), // }, // NetworkProfile: &armcompute.NetworkProfile{ // NetworkInterfaces: []*armcompute.NetworkInterfaceReference{ // { // ID: to.Ptr("/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/networkInterfaces/nsgExistingNic"), // Properties: &armcompute.NetworkInterfaceReferenceProperties{ // Primary: to.Ptr(true), // }, // }}, // }, // OSProfile: &armcompute.OSProfile{ // AdminUsername: to.Ptr("{your-username}"), // ComputerName: to.Ptr("myVM"), // Secrets: []*armcompute.VaultSecretGroup{ // }, // WindowsConfiguration: &armcompute.WindowsConfiguration{ // EnableAutomaticUpdates: to.Ptr(true), // ProvisionVMAgent: to.Ptr(true), // }, // }, // ProvisioningState: to.Ptr("Succeeded"), // ScheduledEventsPolicy: &armcompute.ScheduledEventsPolicy{ // ScheduledEventsAdditionalPublishingTargets: &armcompute.ScheduledEventsAdditionalPublishingTargets{ // EventGridAndResourceGraph: &armcompute.EventGridAndResourceGraph{ // Enable: to.Ptr(true), // }, // }, // UserInitiatedReboot: &armcompute.UserInitiatedReboot{ // AutomaticallyApprove: to.Ptr(true), // }, // UserInitiatedRedeploy: &armcompute.UserInitiatedRedeploy{ // AutomaticallyApprove: to.Ptr(true), // }, // }, // StorageProfile: &armcompute.StorageProfile{ // DataDisks: []*armcompute.DataDisk{ // }, // DiskControllerType: to.Ptr(armcompute.DiskControllerTypesNVMe), // ImageReference: &armcompute.ImageReference{ // Offer: to.Ptr("WindowsServer"), // Publisher: to.Ptr("MicrosoftWindowsServer"), // SKU: to.Ptr("2016-Datacenter"), // Version: to.Ptr("latest"), // }, // OSDisk: &armcompute.OSDisk{ // Name: to.Ptr("myVMosdisk"), // Caching: to.Ptr(armcompute.CachingTypesReadWrite), // CreateOption: to.Ptr(armcompute.DiskCreateOptionTypesFromImage), // ManagedDisk: &armcompute.ManagedDiskParameters{ // StorageAccountType: to.Ptr(armcompute.StorageAccountTypesStandardLRS), // }, // OSType: to.Ptr(armcompute.OperatingSystemTypesWindows), // }, // }, // VMID: to.Ptr("676420ba-7a24-4bfe-80bd-9c841ee184fa"), // }, // }
Output:
Example (CreateAVmWithDiskEncryptionSetResourceIdInTheOsDiskAndDataDisk) ¶
Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/92de53a5f1e0e03c94b40475d2135d97148ed014/specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-03-01/examples/virtualMachineExamples/VirtualMachine_Create_WithDiskEncryptionSetResource.json
cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() clientFactory, err := armcompute.NewClientFactory("<subscription-id>", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } poller, err := clientFactory.NewVirtualMachinesClient().BeginCreateOrUpdate(ctx, "myResourceGroup", "myVM", armcompute.VirtualMachine{ Location: to.Ptr("westus"), Properties: &armcompute.VirtualMachineProperties{ HardwareProfile: &armcompute.HardwareProfile{ VMSize: to.Ptr(armcompute.VirtualMachineSizeTypesStandardD1V2), }, NetworkProfile: &armcompute.NetworkProfile{ NetworkInterfaces: []*armcompute.NetworkInterfaceReference{ { ID: to.Ptr("/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/networkInterfaces/{existing-nic-name}"), Properties: &armcompute.NetworkInterfaceReferenceProperties{ Primary: to.Ptr(true), }, }}, }, OSProfile: &armcompute.OSProfile{ AdminPassword: to.Ptr("{your-password}"), AdminUsername: to.Ptr("{your-username}"), ComputerName: to.Ptr("myVM"), }, StorageProfile: &armcompute.StorageProfile{ DataDisks: []*armcompute.DataDisk{ { Caching: to.Ptr(armcompute.CachingTypesReadWrite), CreateOption: to.Ptr(armcompute.DiskCreateOptionTypesEmpty), DiskSizeGB: to.Ptr[int32](1023), Lun: to.Ptr[int32](0), ManagedDisk: &armcompute.ManagedDiskParameters{ DiskEncryptionSet: &armcompute.DiskEncryptionSetParameters{ ID: to.Ptr("/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/diskEncryptionSets/{existing-diskEncryptionSet-name}"), }, StorageAccountType: to.Ptr(armcompute.StorageAccountTypesStandardLRS), }, }, { Caching: to.Ptr(armcompute.CachingTypesReadWrite), CreateOption: to.Ptr(armcompute.DiskCreateOptionTypesAttach), DiskSizeGB: to.Ptr[int32](1023), Lun: to.Ptr[int32](1), ManagedDisk: &armcompute.ManagedDiskParameters{ ID: to.Ptr("/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/disks/{existing-managed-disk-name}"), DiskEncryptionSet: &armcompute.DiskEncryptionSetParameters{ ID: to.Ptr("/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/diskEncryptionSets/{existing-diskEncryptionSet-name}"), }, StorageAccountType: to.Ptr(armcompute.StorageAccountTypesStandardLRS), }, }}, ImageReference: &armcompute.ImageReference{ ID: to.Ptr("/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/images/{existing-custom-image-name}"), }, OSDisk: &armcompute.OSDisk{ Name: to.Ptr("myVMosdisk"), Caching: to.Ptr(armcompute.CachingTypesReadWrite), CreateOption: to.Ptr(armcompute.DiskCreateOptionTypesFromImage), ManagedDisk: &armcompute.ManagedDiskParameters{ DiskEncryptionSet: &armcompute.DiskEncryptionSetParameters{ ID: to.Ptr("/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/diskEncryptionSets/{existing-diskEncryptionSet-name}"), }, StorageAccountType: to.Ptr(armcompute.StorageAccountTypesStandardLRS), }, }, }, }, }, &armcompute.VirtualMachinesClientBeginCreateOrUpdateOptions{IfMatch: nil, IfNoneMatch: nil, }) if err != nil { log.Fatalf("failed to finish the request: %v", err) } res, err := poller.PollUntilDone(ctx, nil) if err != nil { log.Fatalf("failed to pull the result: %v", err) } // You could use response here. We use blank identifier for just demo purposes. _ = res // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. // res.VirtualMachine = armcompute.VirtualMachine{ // Name: to.Ptr("myVM"), // Type: to.Ptr("Microsoft.Compute/virtualMachines"), // ID: to.Ptr("/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/virtualMachines/myVM"), // Location: to.Ptr("westus"), // Properties: &armcompute.VirtualMachineProperties{ // HardwareProfile: &armcompute.HardwareProfile{ // VMSize: to.Ptr(armcompute.VirtualMachineSizeTypesStandardD1V2), // }, // NetworkProfile: &armcompute.NetworkProfile{ // NetworkInterfaces: []*armcompute.NetworkInterfaceReference{ // { // ID: to.Ptr("/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/networkInterfaces/nsgExistingNic"), // Properties: &armcompute.NetworkInterfaceReferenceProperties{ // Primary: to.Ptr(true), // }, // }}, // }, // OSProfile: &armcompute.OSProfile{ // AdminUsername: to.Ptr("{your-username}"), // ComputerName: to.Ptr("myVM"), // LinuxConfiguration: &armcompute.LinuxConfiguration{ // DisablePasswordAuthentication: to.Ptr(false), // }, // Secrets: []*armcompute.VaultSecretGroup{ // }, // }, // ProvisioningState: to.Ptr("Succeeded"), // StorageProfile: &armcompute.StorageProfile{ // DataDisks: []*armcompute.DataDisk{ // { // Caching: to.Ptr(armcompute.CachingTypesReadWrite), // CreateOption: to.Ptr(armcompute.DiskCreateOptionTypesEmpty), // DiskSizeGB: to.Ptr[int32](1023), // Lun: to.Ptr[int32](0), // ManagedDisk: &armcompute.ManagedDiskParameters{ // DiskEncryptionSet: &armcompute.DiskEncryptionSetParameters{ // ID: to.Ptr("/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/diskEncryptionSets/{existing-diskEncryptionSet-name}"), // }, // StorageAccountType: to.Ptr(armcompute.StorageAccountTypesStandardLRS), // }, // }, // { // Caching: to.Ptr(armcompute.CachingTypesReadWrite), // CreateOption: to.Ptr(armcompute.DiskCreateOptionTypesAttach), // DiskSizeGB: to.Ptr[int32](1023), // Lun: to.Ptr[int32](1), // ManagedDisk: &armcompute.ManagedDiskParameters{ // ID: to.Ptr("/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/disks/{existing-managed-disk-name}"), // DiskEncryptionSet: &armcompute.DiskEncryptionSetParameters{ // ID: to.Ptr("/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/diskEncryptionSets/{existing-diskEncryptionSet-name}"), // }, // StorageAccountType: to.Ptr(armcompute.StorageAccountTypesStandardLRS), // }, // }}, // ImageReference: &armcompute.ImageReference{ // ID: to.Ptr("/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/images/nsgcustom"), // }, // OSDisk: &armcompute.OSDisk{ // Name: to.Ptr("myVMosdisk"), // Caching: to.Ptr(armcompute.CachingTypesReadWrite), // CreateOption: to.Ptr(armcompute.DiskCreateOptionTypesFromImage), // DiskSizeGB: to.Ptr[int32](30), // ManagedDisk: &armcompute.ManagedDiskParameters{ // DiskEncryptionSet: &armcompute.DiskEncryptionSetParameters{ // ID: to.Ptr("/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/diskEncryptionSets/{existing-diskencryptionset-name}"), // }, // StorageAccountType: to.Ptr(armcompute.StorageAccountTypesStandardLRS), // }, // OSType: to.Ptr(armcompute.OperatingSystemTypesLinux), // }, // }, // VMID: to.Ptr("71aa3d5a-d73d-4970-9182-8580433b2865"), // }, // }
Output:
Example (CreateAVmWithEmptyDataDisks) ¶
Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/92de53a5f1e0e03c94b40475d2135d97148ed014/specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-03-01/examples/virtualMachineExamples/VirtualMachine_Create_WithEmptyDataDisks.json
cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() clientFactory, err := armcompute.NewClientFactory("<subscription-id>", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } poller, err := clientFactory.NewVirtualMachinesClient().BeginCreateOrUpdate(ctx, "myResourceGroup", "myVM", armcompute.VirtualMachine{ Location: to.Ptr("westus"), Properties: &armcompute.VirtualMachineProperties{ HardwareProfile: &armcompute.HardwareProfile{ VMSize: to.Ptr(armcompute.VirtualMachineSizeTypesStandardD2V2), }, NetworkProfile: &armcompute.NetworkProfile{ NetworkInterfaces: []*armcompute.NetworkInterfaceReference{ { ID: to.Ptr("/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/networkInterfaces/{existing-nic-name}"), Properties: &armcompute.NetworkInterfaceReferenceProperties{ Primary: to.Ptr(true), }, }}, }, OSProfile: &armcompute.OSProfile{ AdminPassword: to.Ptr("{your-password}"), AdminUsername: to.Ptr("{your-username}"), ComputerName: to.Ptr("myVM"), }, StorageProfile: &armcompute.StorageProfile{ DataDisks: []*armcompute.DataDisk{ { CreateOption: to.Ptr(armcompute.DiskCreateOptionTypesEmpty), DiskSizeGB: to.Ptr[int32](1023), Lun: to.Ptr[int32](0), }, { CreateOption: to.Ptr(armcompute.DiskCreateOptionTypesEmpty), DiskSizeGB: to.Ptr[int32](1023), Lun: to.Ptr[int32](1), }}, ImageReference: &armcompute.ImageReference{ Offer: to.Ptr("WindowsServer"), Publisher: to.Ptr("MicrosoftWindowsServer"), SKU: to.Ptr("2016-Datacenter"), Version: to.Ptr("latest"), }, OSDisk: &armcompute.OSDisk{ Name: to.Ptr("myVMosdisk"), Caching: to.Ptr(armcompute.CachingTypesReadWrite), CreateOption: to.Ptr(armcompute.DiskCreateOptionTypesFromImage), ManagedDisk: &armcompute.ManagedDiskParameters{ StorageAccountType: to.Ptr(armcompute.StorageAccountTypesStandardLRS), }, }, }, }, }, &armcompute.VirtualMachinesClientBeginCreateOrUpdateOptions{IfMatch: nil, IfNoneMatch: nil, }) if err != nil { log.Fatalf("failed to finish the request: %v", err) } res, err := poller.PollUntilDone(ctx, nil) if err != nil { log.Fatalf("failed to pull the result: %v", err) } // You could use response here. We use blank identifier for just demo purposes. _ = res // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. // res.VirtualMachine = armcompute.VirtualMachine{ // Name: to.Ptr("myVM"), // Type: to.Ptr("Microsoft.Compute/virtualMachines"), // ID: to.Ptr("/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/virtualMachines/myVM"), // Location: to.Ptr("westus"), // Properties: &armcompute.VirtualMachineProperties{ // HardwareProfile: &armcompute.HardwareProfile{ // VMSize: to.Ptr(armcompute.VirtualMachineSizeTypesStandardD2V2), // }, // NetworkProfile: &armcompute.NetworkProfile{ // NetworkInterfaces: []*armcompute.NetworkInterfaceReference{ // { // ID: to.Ptr("/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/networkInterfaces/nsgExistingNic"), // Properties: &armcompute.NetworkInterfaceReferenceProperties{ // Primary: to.Ptr(true), // }, // }}, // }, // OSProfile: &armcompute.OSProfile{ // AdminUsername: to.Ptr("{your-username}"), // ComputerName: to.Ptr("myVM"), // Secrets: []*armcompute.VaultSecretGroup{ // }, // WindowsConfiguration: &armcompute.WindowsConfiguration{ // EnableAutomaticUpdates: to.Ptr(true), // ProvisionVMAgent: to.Ptr(true), // }, // }, // ProvisioningState: to.Ptr("Succeeded"), // StorageProfile: &armcompute.StorageProfile{ // DataDisks: []*armcompute.DataDisk{ // { // Caching: to.Ptr(armcompute.CachingTypesNone), // CreateOption: to.Ptr(armcompute.DiskCreateOptionTypesEmpty), // DiskSizeGB: to.Ptr[int32](1023), // Lun: to.Ptr[int32](0), // ManagedDisk: &armcompute.ManagedDiskParameters{ // StorageAccountType: to.Ptr(armcompute.StorageAccountTypesStandardLRS), // }, // }, // { // Caching: to.Ptr(armcompute.CachingTypesNone), // CreateOption: to.Ptr(armcompute.DiskCreateOptionTypesEmpty), // DiskSizeGB: to.Ptr[int32](1023), // Lun: to.Ptr[int32](1), // ManagedDisk: &armcompute.ManagedDiskParameters{ // StorageAccountType: to.Ptr(armcompute.StorageAccountTypesStandardLRS), // }, // }}, // ImageReference: &armcompute.ImageReference{ // Offer: to.Ptr("WindowsServer"), // Publisher: to.Ptr("MicrosoftWindowsServer"), // SKU: to.Ptr("2016-Datacenter"), // Version: to.Ptr("latest"), // }, // OSDisk: &armcompute.OSDisk{ // Name: to.Ptr("myVMosdisk"), // Caching: to.Ptr(armcompute.CachingTypesReadWrite), // CreateOption: to.Ptr(armcompute.DiskCreateOptionTypesFromImage), // ManagedDisk: &armcompute.ManagedDiskParameters{ // StorageAccountType: to.Ptr(armcompute.StorageAccountTypesStandardLRS), // }, // OSType: to.Ptr(armcompute.OperatingSystemTypesWindows), // }, // }, // VMID: to.Ptr("3906fef9-a1e5-4b83-a8a8-540858b41df0"), // }, // }
Output:
Example (CreateAVmWithEncryptionIdentity) ¶
Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/92de53a5f1e0e03c94b40475d2135d97148ed014/specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-03-01/examples/virtualMachineExamples/VirtualMachine_Create_WithEncryptionIdentity.json
cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() clientFactory, err := armcompute.NewClientFactory("<subscription-id>", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } poller, err := clientFactory.NewVirtualMachinesClient().BeginCreateOrUpdate(ctx, "myResourceGroup", "myVM", armcompute.VirtualMachine{ Location: to.Ptr("westus"), Identity: &armcompute.VirtualMachineIdentity{ Type: to.Ptr(armcompute.ResourceIdentityTypeUserAssigned), UserAssignedIdentities: map[string]*armcompute.UserAssignedIdentitiesValue{ "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.ManagedIdentity/userAssignedIdentities/myIdentity": {}, }, }, Properties: &armcompute.VirtualMachineProperties{ HardwareProfile: &armcompute.HardwareProfile{ VMSize: to.Ptr(armcompute.VirtualMachineSizeTypesStandardD2SV3), }, NetworkProfile: &armcompute.NetworkProfile{ NetworkInterfaces: []*armcompute.NetworkInterfaceReference{ { ID: to.Ptr("/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/networkInterfaces/{existing-nic-name}"), Properties: &armcompute.NetworkInterfaceReferenceProperties{ Primary: to.Ptr(true), }, }}, }, OSProfile: &armcompute.OSProfile{ AdminPassword: to.Ptr("{your-password}"), AdminUsername: to.Ptr("{your-username}"), ComputerName: to.Ptr("myVM"), }, SecurityProfile: &armcompute.SecurityProfile{ EncryptionIdentity: &armcompute.EncryptionIdentity{ UserAssignedIdentityResourceID: to.Ptr("/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.ManagedIdentity/userAssignedIdentities/myIdentity"), }, }, StorageProfile: &armcompute.StorageProfile{ ImageReference: &armcompute.ImageReference{ Offer: to.Ptr("WindowsServer"), Publisher: to.Ptr("MicrosoftWindowsServer"), SKU: to.Ptr("2019-Datacenter"), Version: to.Ptr("latest"), }, OSDisk: &armcompute.OSDisk{ Name: to.Ptr("myVMosdisk"), Caching: to.Ptr(armcompute.CachingTypesReadOnly), CreateOption: to.Ptr(armcompute.DiskCreateOptionTypesFromImage), ManagedDisk: &armcompute.ManagedDiskParameters{ StorageAccountType: to.Ptr(armcompute.StorageAccountTypesStandardSSDLRS), }, }, }, }, }, &armcompute.VirtualMachinesClientBeginCreateOrUpdateOptions{IfMatch: nil, IfNoneMatch: nil, }) if err != nil { log.Fatalf("failed to finish the request: %v", err) } res, err := poller.PollUntilDone(ctx, nil) if err != nil { log.Fatalf("failed to pull the result: %v", err) } // You could use response here. We use blank identifier for just demo purposes. _ = res // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. // res.VirtualMachine = armcompute.VirtualMachine{ // Name: to.Ptr("myVM"), // Type: to.Ptr("Microsoft.Compute/virtualMachines"), // ID: to.Ptr("/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/virtualMachines/myVM"), // Location: to.Ptr("westus"), // Identity: &armcompute.VirtualMachineIdentity{ // Type: to.Ptr(armcompute.ResourceIdentityTypeUserAssigned), // UserAssignedIdentities: map[string]*armcompute.UserAssignedIdentitiesValue{ // "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.ManagedIdentity/userAssignedIdentities/myIdentity": &armcompute.UserAssignedIdentitiesValue{ // }, // }, // }, // Properties: &armcompute.VirtualMachineProperties{ // HardwareProfile: &armcompute.HardwareProfile{ // VMSize: to.Ptr(armcompute.VirtualMachineSizeTypesStandardD2SV3), // }, // NetworkProfile: &armcompute.NetworkProfile{ // NetworkInterfaces: []*armcompute.NetworkInterfaceReference{ // { // ID: to.Ptr("/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/networkInterfaces/nsgExistingNic"), // Properties: &armcompute.NetworkInterfaceReferenceProperties{ // Primary: to.Ptr(true), // }, // }}, // }, // OSProfile: &armcompute.OSProfile{ // AdminUsername: to.Ptr("{your-username}"), // ComputerName: to.Ptr("myVM"), // Secrets: []*armcompute.VaultSecretGroup{ // }, // WindowsConfiguration: &armcompute.WindowsConfiguration{ // EnableAutomaticUpdates: to.Ptr(true), // ProvisionVMAgent: to.Ptr(true), // }, // }, // ProvisioningState: to.Ptr("Succeeded"), // SecurityProfile: &armcompute.SecurityProfile{ // EncryptionIdentity: &armcompute.EncryptionIdentity{ // UserAssignedIdentityResourceID: to.Ptr("/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.ManagedIdentity/userAssignedIdentities/myIdentity"), // }, // }, // StorageProfile: &armcompute.StorageProfile{ // DataDisks: []*armcompute.DataDisk{ // }, // ImageReference: &armcompute.ImageReference{ // Offer: to.Ptr("WindowsServer"), // Publisher: to.Ptr("MicrosoftWindowsServer"), // SKU: to.Ptr("2019-Datacenter"), // Version: to.Ptr("latest"), // }, // OSDisk: &armcompute.OSDisk{ // Name: to.Ptr("myVMosdisk"), // Caching: to.Ptr(armcompute.CachingTypesReadOnly), // CreateOption: to.Ptr(armcompute.DiskCreateOptionTypesFromImage), // ManagedDisk: &armcompute.ManagedDiskParameters{ // StorageAccountType: to.Ptr(armcompute.StorageAccountTypesStandardSSDLRS), // }, // OSType: to.Ptr(armcompute.OperatingSystemTypesWindows), // }, // }, // VMID: to.Ptr("5c0d55a7-c407-4ed6-bf7d-ddb810267c85"), // }, // }
Output:
Example (CreateAVmWithEphemeralOsDisk) ¶
Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/92de53a5f1e0e03c94b40475d2135d97148ed014/specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-03-01/examples/virtualMachineExamples/VirtualMachine_Create_WithADiffOsDisk.json
cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() clientFactory, err := armcompute.NewClientFactory("<subscription-id>", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } poller, err := clientFactory.NewVirtualMachinesClient().BeginCreateOrUpdate(ctx, "myResourceGroup", "myVM", armcompute.VirtualMachine{ Location: to.Ptr("westus"), Plan: &armcompute.Plan{ Name: to.Ptr("windows2016"), Product: to.Ptr("windows-data-science-vm"), Publisher: to.Ptr("microsoft-ads"), }, Properties: &armcompute.VirtualMachineProperties{ HardwareProfile: &armcompute.HardwareProfile{ VMSize: to.Ptr(armcompute.VirtualMachineSizeTypesStandardDS1V2), }, NetworkProfile: &armcompute.NetworkProfile{ NetworkInterfaces: []*armcompute.NetworkInterfaceReference{ { ID: to.Ptr("/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/networkInterfaces/{existing-nic-name}"), Properties: &armcompute.NetworkInterfaceReferenceProperties{ Primary: to.Ptr(true), }, }}, }, OSProfile: &armcompute.OSProfile{ AdminPassword: to.Ptr("{your-password}"), AdminUsername: to.Ptr("{your-username}"), ComputerName: to.Ptr("myVM"), }, StorageProfile: &armcompute.StorageProfile{ ImageReference: &armcompute.ImageReference{ Offer: to.Ptr("windows-data-science-vm"), Publisher: to.Ptr("microsoft-ads"), SKU: to.Ptr("windows2016"), Version: to.Ptr("latest"), }, OSDisk: &armcompute.OSDisk{ Name: to.Ptr("myVMosdisk"), Caching: to.Ptr(armcompute.CachingTypesReadOnly), CreateOption: to.Ptr(armcompute.DiskCreateOptionTypesFromImage), DiffDiskSettings: &armcompute.DiffDiskSettings{ Option: to.Ptr(armcompute.DiffDiskOptionsLocal), }, ManagedDisk: &armcompute.ManagedDiskParameters{ StorageAccountType: to.Ptr(armcompute.StorageAccountTypesStandardLRS), }, }, }, }, }, &armcompute.VirtualMachinesClientBeginCreateOrUpdateOptions{IfMatch: nil, IfNoneMatch: nil, }) if err != nil { log.Fatalf("failed to finish the request: %v", err) } res, err := poller.PollUntilDone(ctx, nil) if err != nil { log.Fatalf("failed to pull the result: %v", err) } // You could use response here. We use blank identifier for just demo purposes. _ = res // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. // res.VirtualMachine = armcompute.VirtualMachine{ // Name: to.Ptr("myVM"), // Type: to.Ptr("Microsoft.Compute/virtualMachines"), // ID: to.Ptr("/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/virtualMachines/myVM"), // Location: to.Ptr("westus"), // Plan: &armcompute.Plan{ // Name: to.Ptr("standard-data-science-vm"), // Product: to.Ptr("standard-data-science-vm"), // Publisher: to.Ptr("microsoft-ads"), // }, // Properties: &armcompute.VirtualMachineProperties{ // HardwareProfile: &armcompute.HardwareProfile{ // VMSize: to.Ptr(armcompute.VirtualMachineSizeTypesStandardDS1V2), // }, // NetworkProfile: &armcompute.NetworkProfile{ // NetworkInterfaces: []*armcompute.NetworkInterfaceReference{ // { // ID: to.Ptr("/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/networkInterfaces/nsgExistingNic"), // Properties: &armcompute.NetworkInterfaceReferenceProperties{ // Primary: to.Ptr(true), // }, // }}, // }, // OSProfile: &armcompute.OSProfile{ // AdminUsername: to.Ptr("{your-username}"), // ComputerName: to.Ptr("myVM"), // Secrets: []*armcompute.VaultSecretGroup{ // }, // WindowsConfiguration: &armcompute.WindowsConfiguration{ // EnableAutomaticUpdates: to.Ptr(true), // ProvisionVMAgent: to.Ptr(true), // }, // }, // ProvisioningState: to.Ptr("Succeeded"), // StorageProfile: &armcompute.StorageProfile{ // DataDisks: []*armcompute.DataDisk{ // }, // ImageReference: &armcompute.ImageReference{ // Offer: to.Ptr("standard-data-science-vm"), // Publisher: to.Ptr("microsoft-ads"), // SKU: to.Ptr("standard-data-science-vm"), // Version: to.Ptr("latest"), // }, // OSDisk: &armcompute.OSDisk{ // Name: to.Ptr("myVMosdisk"), // Caching: to.Ptr(armcompute.CachingTypesReadOnly), // CreateOption: to.Ptr(armcompute.DiskCreateOptionTypesFromImage), // DiffDiskSettings: &armcompute.DiffDiskSettings{ // Option: to.Ptr(armcompute.DiffDiskOptionsLocal), // }, // ManagedDisk: &armcompute.ManagedDiskParameters{ // StorageAccountType: to.Ptr(armcompute.StorageAccountTypesStandardLRS), // }, // OSType: to.Ptr(armcompute.OperatingSystemTypesWindows), // }, // }, // VMID: to.Ptr("5c0d55a7-c407-4ed6-bf7d-ddb810267c85"), // }, // }
Output:
Example (CreateAVmWithEphemeralOsDiskProvisioningInCacheDiskUsingPlacementProperty) ¶
Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/92de53a5f1e0e03c94b40475d2135d97148ed014/specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-03-01/examples/virtualMachineExamples/VirtualMachine_Create_WithADiffOsDiskUsingDiffDiskPlacementAsCacheDisk.json
cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() clientFactory, err := armcompute.NewClientFactory("<subscription-id>", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } poller, err := clientFactory.NewVirtualMachinesClient().BeginCreateOrUpdate(ctx, "myResourceGroup", "myVM", armcompute.VirtualMachine{ Location: to.Ptr("westus"), Plan: &armcompute.Plan{ Name: to.Ptr("windows2016"), Product: to.Ptr("windows-data-science-vm"), Publisher: to.Ptr("microsoft-ads"), }, Properties: &armcompute.VirtualMachineProperties{ HardwareProfile: &armcompute.HardwareProfile{ VMSize: to.Ptr(armcompute.VirtualMachineSizeTypesStandardDS1V2), }, NetworkProfile: &armcompute.NetworkProfile{ NetworkInterfaces: []*armcompute.NetworkInterfaceReference{ { ID: to.Ptr("/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/networkInterfaces/{existing-nic-name}"), Properties: &armcompute.NetworkInterfaceReferenceProperties{ Primary: to.Ptr(true), }, }}, }, OSProfile: &armcompute.OSProfile{ AdminPassword: to.Ptr("{your-password}"), AdminUsername: to.Ptr("{your-username}"), ComputerName: to.Ptr("myVM"), }, StorageProfile: &armcompute.StorageProfile{ ImageReference: &armcompute.ImageReference{ Offer: to.Ptr("windows-data-science-vm"), Publisher: to.Ptr("microsoft-ads"), SKU: to.Ptr("windows2016"), Version: to.Ptr("latest"), }, OSDisk: &armcompute.OSDisk{ Name: to.Ptr("myVMosdisk"), Caching: to.Ptr(armcompute.CachingTypesReadOnly), CreateOption: to.Ptr(armcompute.DiskCreateOptionTypesFromImage), DiffDiskSettings: &armcompute.DiffDiskSettings{ Option: to.Ptr(armcompute.DiffDiskOptionsLocal), Placement: to.Ptr(armcompute.DiffDiskPlacementCacheDisk), }, ManagedDisk: &armcompute.ManagedDiskParameters{ StorageAccountType: to.Ptr(armcompute.StorageAccountTypesStandardLRS), }, }, }, }, }, &armcompute.VirtualMachinesClientBeginCreateOrUpdateOptions{IfMatch: nil, IfNoneMatch: nil, }) if err != nil { log.Fatalf("failed to finish the request: %v", err) } res, err := poller.PollUntilDone(ctx, nil) if err != nil { log.Fatalf("failed to pull the result: %v", err) } // You could use response here. We use blank identifier for just demo purposes. _ = res // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. // res.VirtualMachine = armcompute.VirtualMachine{ // Name: to.Ptr("myVM"), // Type: to.Ptr("Microsoft.Compute/virtualMachines"), // ID: to.Ptr("/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/virtualMachines/myVM"), // Location: to.Ptr("westus"), // Plan: &armcompute.Plan{ // Name: to.Ptr("standard-data-science-vm"), // Product: to.Ptr("standard-data-science-vm"), // Publisher: to.Ptr("microsoft-ads"), // }, // Properties: &armcompute.VirtualMachineProperties{ // HardwareProfile: &armcompute.HardwareProfile{ // VMSize: to.Ptr(armcompute.VirtualMachineSizeTypesStandardDS1V2), // }, // NetworkProfile: &armcompute.NetworkProfile{ // NetworkInterfaces: []*armcompute.NetworkInterfaceReference{ // { // ID: to.Ptr("/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/networkInterfaces/nsgExistingNic"), // Properties: &armcompute.NetworkInterfaceReferenceProperties{ // Primary: to.Ptr(true), // }, // }}, // }, // OSProfile: &armcompute.OSProfile{ // AdminUsername: to.Ptr("{your-username}"), // ComputerName: to.Ptr("myVM"), // Secrets: []*armcompute.VaultSecretGroup{ // }, // WindowsConfiguration: &armcompute.WindowsConfiguration{ // EnableAutomaticUpdates: to.Ptr(true), // ProvisionVMAgent: to.Ptr(true), // }, // }, // ProvisioningState: to.Ptr("Succeeded"), // StorageProfile: &armcompute.StorageProfile{ // DataDisks: []*armcompute.DataDisk{ // }, // ImageReference: &armcompute.ImageReference{ // Offer: to.Ptr("standard-data-science-vm"), // Publisher: to.Ptr("microsoft-ads"), // SKU: to.Ptr("standard-data-science-vm"), // Version: to.Ptr("latest"), // }, // OSDisk: &armcompute.OSDisk{ // Name: to.Ptr("myVMosdisk"), // Caching: to.Ptr(armcompute.CachingTypesReadOnly), // CreateOption: to.Ptr(armcompute.DiskCreateOptionTypesFromImage), // DiffDiskSettings: &armcompute.DiffDiskSettings{ // Option: to.Ptr(armcompute.DiffDiskOptionsLocal), // Placement: to.Ptr(armcompute.DiffDiskPlacementCacheDisk), // }, // ManagedDisk: &armcompute.ManagedDiskParameters{ // StorageAccountType: to.Ptr(armcompute.StorageAccountTypesStandardLRS), // }, // OSType: to.Ptr(armcompute.OperatingSystemTypesWindows), // }, // }, // VMID: to.Ptr("5c0d55a7-c407-4ed6-bf7d-ddb810267c85"), // }, // }
Output:
Example (CreateAVmWithEphemeralOsDiskProvisioningInNvmeDiskUsingPlacementProperty) ¶
Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/92de53a5f1e0e03c94b40475d2135d97148ed014/specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-03-01/examples/virtualMachineExamples/VirtualMachine_Create_WithADiffOsDiskUsingDiffDiskPlacementAsNvmeDisk.json
cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() clientFactory, err := armcompute.NewClientFactory("<subscription-id>", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } poller, err := clientFactory.NewVirtualMachinesClient().BeginCreateOrUpdate(ctx, "myResourceGroup", "myVM", armcompute.VirtualMachine{ Location: to.Ptr("westus"), Plan: &armcompute.Plan{ Name: to.Ptr("windows2016"), Product: to.Ptr("windows-data-science-vm"), Publisher: to.Ptr("microsoft-ads"), }, Properties: &armcompute.VirtualMachineProperties{ HardwareProfile: &armcompute.HardwareProfile{ VMSize: to.Ptr(armcompute.VirtualMachineSizeTypesStandardDS1V2), }, NetworkProfile: &armcompute.NetworkProfile{ NetworkInterfaces: []*armcompute.NetworkInterfaceReference{ { ID: to.Ptr("/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/networkInterfaces/{existing-nic-name}"), Properties: &armcompute.NetworkInterfaceReferenceProperties{ Primary: to.Ptr(true), }, }}, }, OSProfile: &armcompute.OSProfile{ AdminPassword: to.Ptr("{your-password}"), AdminUsername: to.Ptr("{your-username}"), ComputerName: to.Ptr("myVM"), }, StorageProfile: &armcompute.StorageProfile{ ImageReference: &armcompute.ImageReference{ Offer: to.Ptr("windows-data-science-vm"), Publisher: to.Ptr("microsoft-ads"), SKU: to.Ptr("windows2016"), Version: to.Ptr("latest"), }, OSDisk: &armcompute.OSDisk{ Name: to.Ptr("myVMosdisk"), Caching: to.Ptr(armcompute.CachingTypesReadOnly), CreateOption: to.Ptr(armcompute.DiskCreateOptionTypesFromImage), DiffDiskSettings: &armcompute.DiffDiskSettings{ Option: to.Ptr(armcompute.DiffDiskOptionsLocal), Placement: to.Ptr(armcompute.DiffDiskPlacementNvmeDisk), }, ManagedDisk: &armcompute.ManagedDiskParameters{ StorageAccountType: to.Ptr(armcompute.StorageAccountTypesStandardLRS), }, }, }, }, }, &armcompute.VirtualMachinesClientBeginCreateOrUpdateOptions{IfMatch: nil, IfNoneMatch: nil, }) if err != nil { log.Fatalf("failed to finish the request: %v", err) } res, err := poller.PollUntilDone(ctx, nil) if err != nil { log.Fatalf("failed to pull the result: %v", err) } // You could use response here. We use blank identifier for just demo purposes. _ = res // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. // res.VirtualMachine = armcompute.VirtualMachine{ // Name: to.Ptr("myVM"), // Type: to.Ptr("Microsoft.Compute/virtualMachines"), // ID: to.Ptr("/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/virtualMachines/myVM"), // Location: to.Ptr("westus"), // Plan: &armcompute.Plan{ // Name: to.Ptr("standard-data-science-vm"), // Product: to.Ptr("standard-data-science-vm"), // Publisher: to.Ptr("microsoft-ads"), // }, // Properties: &armcompute.VirtualMachineProperties{ // HardwareProfile: &armcompute.HardwareProfile{ // VMSize: to.Ptr(armcompute.VirtualMachineSizeTypesStandardDS1V2), // }, // NetworkProfile: &armcompute.NetworkProfile{ // NetworkInterfaces: []*armcompute.NetworkInterfaceReference{ // { // ID: to.Ptr("/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/networkInterfaces/nsgExistingNic"), // Properties: &armcompute.NetworkInterfaceReferenceProperties{ // Primary: to.Ptr(true), // }, // }}, // }, // OSProfile: &armcompute.OSProfile{ // AdminUsername: to.Ptr("{your-username}"), // ComputerName: to.Ptr("myVM"), // Secrets: []*armcompute.VaultSecretGroup{ // }, // WindowsConfiguration: &armcompute.WindowsConfiguration{ // EnableAutomaticUpdates: to.Ptr(true), // ProvisionVMAgent: to.Ptr(true), // }, // }, // ProvisioningState: to.Ptr("Succeeded"), // StorageProfile: &armcompute.StorageProfile{ // DataDisks: []*armcompute.DataDisk{ // }, // ImageReference: &armcompute.ImageReference{ // Offer: to.Ptr("standard-data-science-vm"), // Publisher: to.Ptr("microsoft-ads"), // SKU: to.Ptr("standard-data-science-vm"), // Version: to.Ptr("latest"), // }, // OSDisk: &armcompute.OSDisk{ // Name: to.Ptr("myVMosdisk"), // Caching: to.Ptr(armcompute.CachingTypesReadOnly), // CreateOption: to.Ptr(armcompute.DiskCreateOptionTypesFromImage), // DiffDiskSettings: &armcompute.DiffDiskSettings{ // Option: to.Ptr(armcompute.DiffDiskOptionsLocal), // Placement: to.Ptr(armcompute.DiffDiskPlacementNvmeDisk), // }, // ManagedDisk: &armcompute.ManagedDiskParameters{ // StorageAccountType: to.Ptr(armcompute.StorageAccountTypesStandardLRS), // }, // OSType: to.Ptr(armcompute.OperatingSystemTypesWindows), // }, // }, // VMID: to.Ptr("5c0d55a7-c407-4ed6-bf7d-ddb810267c85"), // }, // }
Output:
Example (CreateAVmWithEphemeralOsDiskProvisioningInResourceDiskUsingPlacementProperty) ¶
Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/92de53a5f1e0e03c94b40475d2135d97148ed014/specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-03-01/examples/virtualMachineExamples/VirtualMachine_Create_WithADiffOsDiskUsingDiffDiskPlacementAsResourceDisk.json
cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() clientFactory, err := armcompute.NewClientFactory("<subscription-id>", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } poller, err := clientFactory.NewVirtualMachinesClient().BeginCreateOrUpdate(ctx, "myResourceGroup", "myVM", armcompute.VirtualMachine{ Location: to.Ptr("westus"), Plan: &armcompute.Plan{ Name: to.Ptr("windows2016"), Product: to.Ptr("windows-data-science-vm"), Publisher: to.Ptr("microsoft-ads"), }, Properties: &armcompute.VirtualMachineProperties{ HardwareProfile: &armcompute.HardwareProfile{ VMSize: to.Ptr(armcompute.VirtualMachineSizeTypesStandardDS1V2), }, NetworkProfile: &armcompute.NetworkProfile{ NetworkInterfaces: []*armcompute.NetworkInterfaceReference{ { ID: to.Ptr("/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/networkInterfaces/{existing-nic-name}"), Properties: &armcompute.NetworkInterfaceReferenceProperties{ Primary: to.Ptr(true), }, }}, }, OSProfile: &armcompute.OSProfile{ AdminPassword: to.Ptr("{your-password}"), AdminUsername: to.Ptr("{your-username}"), ComputerName: to.Ptr("myVM"), }, StorageProfile: &armcompute.StorageProfile{ ImageReference: &armcompute.ImageReference{ Offer: to.Ptr("windows-data-science-vm"), Publisher: to.Ptr("microsoft-ads"), SKU: to.Ptr("windows2016"), Version: to.Ptr("latest"), }, OSDisk: &armcompute.OSDisk{ Name: to.Ptr("myVMosdisk"), Caching: to.Ptr(armcompute.CachingTypesReadOnly), CreateOption: to.Ptr(armcompute.DiskCreateOptionTypesFromImage), DiffDiskSettings: &armcompute.DiffDiskSettings{ Option: to.Ptr(armcompute.DiffDiskOptionsLocal), Placement: to.Ptr(armcompute.DiffDiskPlacementResourceDisk), }, ManagedDisk: &armcompute.ManagedDiskParameters{ StorageAccountType: to.Ptr(armcompute.StorageAccountTypesStandardLRS), }, }, }, }, }, &armcompute.VirtualMachinesClientBeginCreateOrUpdateOptions{IfMatch: nil, IfNoneMatch: nil, }) if err != nil { log.Fatalf("failed to finish the request: %v", err) } res, err := poller.PollUntilDone(ctx, nil) if err != nil { log.Fatalf("failed to pull the result: %v", err) } // You could use response here. We use blank identifier for just demo purposes. _ = res // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. // res.VirtualMachine = armcompute.VirtualMachine{ // Name: to.Ptr("myVM"), // Type: to.Ptr("Microsoft.Compute/virtualMachines"), // ID: to.Ptr("/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/virtualMachines/myVM"), // Location: to.Ptr("westus"), // Plan: &armcompute.Plan{ // Name: to.Ptr("standard-data-science-vm"), // Product: to.Ptr("standard-data-science-vm"), // Publisher: to.Ptr("microsoft-ads"), // }, // Properties: &armcompute.VirtualMachineProperties{ // HardwareProfile: &armcompute.HardwareProfile{ // VMSize: to.Ptr(armcompute.VirtualMachineSizeTypesStandardDS1V2), // }, // NetworkProfile: &armcompute.NetworkProfile{ // NetworkInterfaces: []*armcompute.NetworkInterfaceReference{ // { // ID: to.Ptr("/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/networkInterfaces/nsgExistingNic"), // Properties: &armcompute.NetworkInterfaceReferenceProperties{ // Primary: to.Ptr(true), // }, // }}, // }, // OSProfile: &armcompute.OSProfile{ // AdminUsername: to.Ptr("{your-username}"), // ComputerName: to.Ptr("myVM"), // Secrets: []*armcompute.VaultSecretGroup{ // }, // WindowsConfiguration: &armcompute.WindowsConfiguration{ // EnableAutomaticUpdates: to.Ptr(true), // ProvisionVMAgent: to.Ptr(true), // }, // }, // ProvisioningState: to.Ptr("Succeeded"), // StorageProfile: &armcompute.StorageProfile{ // DataDisks: []*armcompute.DataDisk{ // }, // ImageReference: &armcompute.ImageReference{ // Offer: to.Ptr("standard-data-science-vm"), // Publisher: to.Ptr("microsoft-ads"), // SKU: to.Ptr("standard-data-science-vm"), // Version: to.Ptr("latest"), // }, // OSDisk: &armcompute.OSDisk{ // Name: to.Ptr("myVMosdisk"), // Caching: to.Ptr(armcompute.CachingTypesReadOnly), // CreateOption: to.Ptr(armcompute.DiskCreateOptionTypesFromImage), // DiffDiskSettings: &armcompute.DiffDiskSettings{ // Option: to.Ptr(armcompute.DiffDiskOptionsLocal), // Placement: to.Ptr(armcompute.DiffDiskPlacementResourceDisk), // }, // ManagedDisk: &armcompute.ManagedDiskParameters{ // StorageAccountType: to.Ptr(armcompute.StorageAccountTypesStandardLRS), // }, // OSType: to.Ptr(armcompute.OperatingSystemTypesWindows), // }, // }, // VMID: to.Ptr("5c0d55a7-c407-4ed6-bf7d-ddb810267c85"), // }, // }
Output:
Example (CreateAVmWithHibernationEnabled) ¶
Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/92de53a5f1e0e03c94b40475d2135d97148ed014/specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-03-01/examples/virtualMachineExamples/VirtualMachine_Create_WithHibernationEnabled.json
cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() clientFactory, err := armcompute.NewClientFactory("<subscription-id>", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } poller, err := clientFactory.NewVirtualMachinesClient().BeginCreateOrUpdate(ctx, "myResourceGroup", "{vm-name}", armcompute.VirtualMachine{ Location: to.Ptr("eastus2euap"), Properties: &armcompute.VirtualMachineProperties{ AdditionalCapabilities: &armcompute.AdditionalCapabilities{ HibernationEnabled: to.Ptr(true), }, DiagnosticsProfile: &armcompute.DiagnosticsProfile{ BootDiagnostics: &armcompute.BootDiagnostics{ Enabled: to.Ptr(true), StorageURI: to.Ptr("http://{existing-storage-account-name}.blob.core.windows.net"), }, }, HardwareProfile: &armcompute.HardwareProfile{ VMSize: to.Ptr(armcompute.VirtualMachineSizeTypesStandardD2SV3), }, NetworkProfile: &armcompute.NetworkProfile{ NetworkInterfaces: []*armcompute.NetworkInterfaceReference{ { ID: to.Ptr("/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/networkInterfaces/{existing-nic-name}"), Properties: &armcompute.NetworkInterfaceReferenceProperties{ Primary: to.Ptr(true), }, }}, }, OSProfile: &armcompute.OSProfile{ AdminPassword: to.Ptr("{your-password}"), AdminUsername: to.Ptr("{your-username}"), ComputerName: to.Ptr("{vm-name}"), }, StorageProfile: &armcompute.StorageProfile{ ImageReference: &armcompute.ImageReference{ Offer: to.Ptr("WindowsServer"), Publisher: to.Ptr("MicrosoftWindowsServer"), SKU: to.Ptr("2019-Datacenter"), Version: to.Ptr("latest"), }, OSDisk: &armcompute.OSDisk{ Name: to.Ptr("vmOSdisk"), Caching: to.Ptr(armcompute.CachingTypesReadWrite), CreateOption: to.Ptr(armcompute.DiskCreateOptionTypesFromImage), ManagedDisk: &armcompute.ManagedDiskParameters{ StorageAccountType: to.Ptr(armcompute.StorageAccountTypesStandardLRS), }, }, }, }, }, &armcompute.VirtualMachinesClientBeginCreateOrUpdateOptions{IfMatch: nil, IfNoneMatch: nil, }) if err != nil { log.Fatalf("failed to finish the request: %v", err) } res, err := poller.PollUntilDone(ctx, nil) if err != nil { log.Fatalf("failed to pull the result: %v", err) } // You could use response here. We use blank identifier for just demo purposes. _ = res // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. // res.VirtualMachine = armcompute.VirtualMachine{ // Name: to.Ptr("{vm-name}"), // Type: to.Ptr("Microsoft.Compute/virtualMachines"), // ID: to.Ptr("/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/virtualMachines/{vm-name}"), // Location: to.Ptr("eastus2euap"), // Properties: &armcompute.VirtualMachineProperties{ // AdditionalCapabilities: &armcompute.AdditionalCapabilities{ // HibernationEnabled: to.Ptr(true), // }, // DiagnosticsProfile: &armcompute.DiagnosticsProfile{ // BootDiagnostics: &armcompute.BootDiagnostics{ // Enabled: to.Ptr(true), // StorageURI: to.Ptr("http://nsgdiagnostic.blob.core.windows.net"), // }, // }, // HardwareProfile: &armcompute.HardwareProfile{ // VMSize: to.Ptr(armcompute.VirtualMachineSizeTypesStandardD2SV3), // }, // NetworkProfile: &armcompute.NetworkProfile{ // NetworkInterfaces: []*armcompute.NetworkInterfaceReference{ // { // ID: to.Ptr("/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/networkInterfaces/nsgExistingNic"), // Properties: &armcompute.NetworkInterfaceReferenceProperties{ // Primary: to.Ptr(true), // }, // }}, // }, // OSProfile: &armcompute.OSProfile{ // AdminUsername: to.Ptr("{your-username}"), // ComputerName: to.Ptr("{vm-name}"), // Secrets: []*armcompute.VaultSecretGroup{ // }, // WindowsConfiguration: &armcompute.WindowsConfiguration{ // EnableAutomaticUpdates: to.Ptr(true), // ProvisionVMAgent: to.Ptr(true), // }, // }, // ProvisioningState: to.Ptr("Succeeded"), // StorageProfile: &armcompute.StorageProfile{ // DataDisks: []*armcompute.DataDisk{ // }, // ImageReference: &armcompute.ImageReference{ // Offer: to.Ptr("WindowsServer"), // Publisher: to.Ptr("MicrosoftWindowsServer"), // SKU: to.Ptr("2019-Datacenter"), // Version: to.Ptr("latest"), // }, // OSDisk: &armcompute.OSDisk{ // Name: to.Ptr("vmOSdisk"), // Caching: to.Ptr(armcompute.CachingTypesReadWrite), // CreateOption: to.Ptr(armcompute.DiskCreateOptionTypesFromImage), // ManagedDisk: &armcompute.ManagedDiskParameters{ // StorageAccountType: to.Ptr(armcompute.StorageAccountTypesStandardLRS), // }, // OSType: to.Ptr(armcompute.OperatingSystemTypesWindows), // }, // }, // VMID: to.Ptr("676420ba-7a24-4bfe-80bd-9c841ee184fa"), // }, // }
Output:
Example (CreateAVmWithHostEncryptionUsingEncryptionAtHostProperty) ¶
Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/92de53a5f1e0e03c94b40475d2135d97148ed014/specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-03-01/examples/virtualMachineExamples/VirtualMachine_Create_WithEncryptionAtHost.json
cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() clientFactory, err := armcompute.NewClientFactory("<subscription-id>", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } poller, err := clientFactory.NewVirtualMachinesClient().BeginCreateOrUpdate(ctx, "myResourceGroup", "myVM", armcompute.VirtualMachine{ Location: to.Ptr("westus"), Plan: &armcompute.Plan{ Name: to.Ptr("windows2016"), Product: to.Ptr("windows-data-science-vm"), Publisher: to.Ptr("microsoft-ads"), }, Properties: &armcompute.VirtualMachineProperties{ HardwareProfile: &armcompute.HardwareProfile{ VMSize: to.Ptr(armcompute.VirtualMachineSizeTypesStandardDS1V2), }, NetworkProfile: &armcompute.NetworkProfile{ NetworkInterfaces: []*armcompute.NetworkInterfaceReference{ { ID: to.Ptr("/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/networkInterfaces/{existing-nic-name}"), Properties: &armcompute.NetworkInterfaceReferenceProperties{ Primary: to.Ptr(true), }, }}, }, OSProfile: &armcompute.OSProfile{ AdminPassword: to.Ptr("{your-password}"), AdminUsername: to.Ptr("{your-username}"), ComputerName: to.Ptr("myVM"), }, SecurityProfile: &armcompute.SecurityProfile{ EncryptionAtHost: to.Ptr(true), }, StorageProfile: &armcompute.StorageProfile{ ImageReference: &armcompute.ImageReference{ Offer: to.Ptr("windows-data-science-vm"), Publisher: to.Ptr("microsoft-ads"), SKU: to.Ptr("windows2016"), Version: to.Ptr("latest"), }, OSDisk: &armcompute.OSDisk{ Name: to.Ptr("myVMosdisk"), Caching: to.Ptr(armcompute.CachingTypesReadOnly), CreateOption: to.Ptr(armcompute.DiskCreateOptionTypesFromImage), ManagedDisk: &armcompute.ManagedDiskParameters{ StorageAccountType: to.Ptr(armcompute.StorageAccountTypesStandardLRS), }, }, }, }, }, &armcompute.VirtualMachinesClientBeginCreateOrUpdateOptions{IfMatch: nil, IfNoneMatch: nil, }) if err != nil { log.Fatalf("failed to finish the request: %v", err) } res, err := poller.PollUntilDone(ctx, nil) if err != nil { log.Fatalf("failed to pull the result: %v", err) } // You could use response here. We use blank identifier for just demo purposes. _ = res // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. // res.VirtualMachine = armcompute.VirtualMachine{ // Name: to.Ptr("myVM"), // Type: to.Ptr("Microsoft.Compute/virtualMachines"), // ID: to.Ptr("/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/virtualMachines/myVM"), // Location: to.Ptr("westus"), // Plan: &armcompute.Plan{ // Name: to.Ptr("standard-data-science-vm"), // Product: to.Ptr("standard-data-science-vm"), // Publisher: to.Ptr("microsoft-ads"), // }, // Properties: &armcompute.VirtualMachineProperties{ // HardwareProfile: &armcompute.HardwareProfile{ // VMSize: to.Ptr(armcompute.VirtualMachineSizeTypesStandardDS1V2), // }, // NetworkProfile: &armcompute.NetworkProfile{ // NetworkInterfaces: []*armcompute.NetworkInterfaceReference{ // { // ID: to.Ptr("/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/networkInterfaces/nsgExistingNic"), // Properties: &armcompute.NetworkInterfaceReferenceProperties{ // Primary: to.Ptr(true), // }, // }}, // }, // OSProfile: &armcompute.OSProfile{ // AdminUsername: to.Ptr("{your-username}"), // ComputerName: to.Ptr("myVM"), // Secrets: []*armcompute.VaultSecretGroup{ // }, // WindowsConfiguration: &armcompute.WindowsConfiguration{ // EnableAutomaticUpdates: to.Ptr(true), // ProvisionVMAgent: to.Ptr(true), // }, // }, // ProvisioningState: to.Ptr("Succeeded"), // SecurityProfile: &armcompute.SecurityProfile{ // EncryptionAtHost: to.Ptr(true), // }, // StorageProfile: &armcompute.StorageProfile{ // DataDisks: []*armcompute.DataDisk{ // }, // ImageReference: &armcompute.ImageReference{ // Offer: to.Ptr("standard-data-science-vm"), // Publisher: to.Ptr("microsoft-ads"), // SKU: to.Ptr("standard-data-science-vm"), // Version: to.Ptr("latest"), // }, // OSDisk: &armcompute.OSDisk{ // Name: to.Ptr("myVMosdisk"), // Caching: to.Ptr(armcompute.CachingTypesReadOnly), // CreateOption: to.Ptr(armcompute.DiskCreateOptionTypesFromImage), // ManagedDisk: &armcompute.ManagedDiskParameters{ // StorageAccountType: to.Ptr(armcompute.StorageAccountTypesStandardLRS), // }, // OSType: to.Ptr(armcompute.OperatingSystemTypesWindows), // }, // }, // VMID: to.Ptr("5c0d55a7-c407-4ed6-bf7d-ddb810267c85"), // }, // }
Output:
Example (CreateAVmWithManagedBootDiagnostics) ¶
Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/92de53a5f1e0e03c94b40475d2135d97148ed014/specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-03-01/examples/virtualMachineExamples/VirtualMachine_Create_WithManagedBootDiagnostics.json
cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() clientFactory, err := armcompute.NewClientFactory("<subscription-id>", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } poller, err := clientFactory.NewVirtualMachinesClient().BeginCreateOrUpdate(ctx, "myResourceGroup", "myVM", armcompute.VirtualMachine{ Location: to.Ptr("westus"), Properties: &armcompute.VirtualMachineProperties{ DiagnosticsProfile: &armcompute.DiagnosticsProfile{ BootDiagnostics: &armcompute.BootDiagnostics{ Enabled: to.Ptr(true), }, }, HardwareProfile: &armcompute.HardwareProfile{ VMSize: to.Ptr(armcompute.VirtualMachineSizeTypesStandardD1V2), }, NetworkProfile: &armcompute.NetworkProfile{ NetworkInterfaces: []*armcompute.NetworkInterfaceReference{ { ID: to.Ptr("/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/networkInterfaces/{existing-nic-name}"), Properties: &armcompute.NetworkInterfaceReferenceProperties{ Primary: to.Ptr(true), }, }}, }, OSProfile: &armcompute.OSProfile{ AdminPassword: to.Ptr("{your-password}"), AdminUsername: to.Ptr("{your-username}"), ComputerName: to.Ptr("myVM"), }, StorageProfile: &armcompute.StorageProfile{ ImageReference: &armcompute.ImageReference{ Offer: to.Ptr("WindowsServer"), Publisher: to.Ptr("MicrosoftWindowsServer"), SKU: to.Ptr("2016-Datacenter"), Version: to.Ptr("latest"), }, OSDisk: &armcompute.OSDisk{ Name: to.Ptr("myVMosdisk"), Caching: to.Ptr(armcompute.CachingTypesReadWrite), CreateOption: to.Ptr(armcompute.DiskCreateOptionTypesFromImage), ManagedDisk: &armcompute.ManagedDiskParameters{ StorageAccountType: to.Ptr(armcompute.StorageAccountTypesStandardLRS), }, }, }, }, }, &armcompute.VirtualMachinesClientBeginCreateOrUpdateOptions{IfMatch: nil, IfNoneMatch: nil, }) if err != nil { log.Fatalf("failed to finish the request: %v", err) } res, err := poller.PollUntilDone(ctx, nil) if err != nil { log.Fatalf("failed to pull the result: %v", err) } // You could use response here. We use blank identifier for just demo purposes. _ = res // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. // res.VirtualMachine = armcompute.VirtualMachine{ // Name: to.Ptr("myVM"), // Type: to.Ptr("Microsoft.Compute/virtualMachines"), // ID: to.Ptr("/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/virtualMachines/myVM"), // Location: to.Ptr("westus"), // Properties: &armcompute.VirtualMachineProperties{ // DiagnosticsProfile: &armcompute.DiagnosticsProfile{ // BootDiagnostics: &armcompute.BootDiagnostics{ // Enabled: to.Ptr(true), // }, // }, // HardwareProfile: &armcompute.HardwareProfile{ // VMSize: to.Ptr(armcompute.VirtualMachineSizeTypesStandardD1V2), // }, // NetworkProfile: &armcompute.NetworkProfile{ // NetworkInterfaces: []*armcompute.NetworkInterfaceReference{ // { // ID: to.Ptr("/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/networkInterfaces/nsgExistingNic"), // Properties: &armcompute.NetworkInterfaceReferenceProperties{ // Primary: to.Ptr(true), // }, // }}, // }, // OSProfile: &armcompute.OSProfile{ // AdminUsername: to.Ptr("{your-username}"), // ComputerName: to.Ptr("myVM"), // Secrets: []*armcompute.VaultSecretGroup{ // }, // WindowsConfiguration: &armcompute.WindowsConfiguration{ // EnableAutomaticUpdates: to.Ptr(true), // ProvisionVMAgent: to.Ptr(true), // }, // }, // ProvisioningState: to.Ptr("Succeeded"), // StorageProfile: &armcompute.StorageProfile{ // DataDisks: []*armcompute.DataDisk{ // }, // ImageReference: &armcompute.ImageReference{ // Offer: to.Ptr("WindowsServer"), // Publisher: to.Ptr("MicrosoftWindowsServer"), // SKU: to.Ptr("2016-Datacenter"), // Version: to.Ptr("latest"), // }, // OSDisk: &armcompute.OSDisk{ // Name: to.Ptr("myVMosdisk"), // Caching: to.Ptr(armcompute.CachingTypesReadWrite), // CreateOption: to.Ptr(armcompute.DiskCreateOptionTypesFromImage), // ManagedDisk: &armcompute.ManagedDiskParameters{ // StorageAccountType: to.Ptr(armcompute.StorageAccountTypesStandardLRS), // }, // OSType: to.Ptr(armcompute.OperatingSystemTypesWindows), // }, // }, // VMID: to.Ptr("676420ba-7a24-4bfe-80bd-9c841ee184fa"), // }, // }
Output:
Example (CreateAVmWithNetworkInterfaceConfiguration) ¶
Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/92de53a5f1e0e03c94b40475d2135d97148ed014/specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-03-01/examples/virtualMachineExamples/VirtualMachine_Create_WithNetworkInterfaceConfiguration.json
cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() clientFactory, err := armcompute.NewClientFactory("<subscription-id>", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } poller, err := clientFactory.NewVirtualMachinesClient().BeginCreateOrUpdate(ctx, "myResourceGroup", "myVM", armcompute.VirtualMachine{ Location: to.Ptr("westus"), Properties: &armcompute.VirtualMachineProperties{ HardwareProfile: &armcompute.HardwareProfile{ VMSize: to.Ptr(armcompute.VirtualMachineSizeTypesStandardD1V2), }, NetworkProfile: &armcompute.NetworkProfile{ NetworkAPIVersion: to.Ptr(armcompute.NetworkAPIVersionTwoThousandTwenty1101), NetworkInterfaceConfigurations: []*armcompute.VirtualMachineNetworkInterfaceConfiguration{ { Name: to.Ptr("{nic-config-name}"), Properties: &armcompute.VirtualMachineNetworkInterfaceConfigurationProperties{ DeleteOption: to.Ptr(armcompute.DeleteOptionsDelete), IPConfigurations: []*armcompute.VirtualMachineNetworkInterfaceIPConfiguration{ { Name: to.Ptr("{ip-config-name}"), Properties: &armcompute.VirtualMachineNetworkInterfaceIPConfigurationProperties{ Primary: to.Ptr(true), PublicIPAddressConfiguration: &armcompute.VirtualMachinePublicIPAddressConfiguration{ Name: to.Ptr("{publicIP-config-name}"), Properties: &armcompute.VirtualMachinePublicIPAddressConfigurationProperties{ DeleteOption: to.Ptr(armcompute.DeleteOptionsDetach), PublicIPAllocationMethod: to.Ptr(armcompute.PublicIPAllocationMethodStatic), }, SKU: &armcompute.PublicIPAddressSKU{ Name: to.Ptr(armcompute.PublicIPAddressSKUNameBasic), Tier: to.Ptr(armcompute.PublicIPAddressSKUTierGlobal), }, }, }, }}, Primary: to.Ptr(true), }, }}, }, OSProfile: &armcompute.OSProfile{ AdminPassword: to.Ptr("{your-password}"), AdminUsername: to.Ptr("{your-username}"), ComputerName: to.Ptr("myVM"), }, StorageProfile: &armcompute.StorageProfile{ ImageReference: &armcompute.ImageReference{ Offer: to.Ptr("WindowsServer"), Publisher: to.Ptr("MicrosoftWindowsServer"), SKU: to.Ptr("2016-Datacenter"), Version: to.Ptr("latest"), }, OSDisk: &armcompute.OSDisk{ Name: to.Ptr("myVMosdisk"), Caching: to.Ptr(armcompute.CachingTypesReadWrite), CreateOption: to.Ptr(armcompute.DiskCreateOptionTypesFromImage), ManagedDisk: &armcompute.ManagedDiskParameters{ StorageAccountType: to.Ptr(armcompute.StorageAccountTypesStandardLRS), }, }, }, }, }, &armcompute.VirtualMachinesClientBeginCreateOrUpdateOptions{IfMatch: nil, IfNoneMatch: nil, }) if err != nil { log.Fatalf("failed to finish the request: %v", err) } res, err := poller.PollUntilDone(ctx, nil) if err != nil { log.Fatalf("failed to pull the result: %v", err) } // You could use response here. We use blank identifier for just demo purposes. _ = res // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. // res.VirtualMachine = armcompute.VirtualMachine{ // Name: to.Ptr("myVM"), // Type: to.Ptr("Microsoft.Compute/virtualMachines"), // ID: to.Ptr("/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/virtualMachines/myVM"), // Location: to.Ptr("westus"), // Properties: &armcompute.VirtualMachineProperties{ // HardwareProfile: &armcompute.HardwareProfile{ // VMSize: to.Ptr(armcompute.VirtualMachineSizeTypesStandardD1V2), // }, // NetworkProfile: &armcompute.NetworkProfile{ // NetworkInterfaces: []*armcompute.NetworkInterfaceReference{ // { // ID: to.Ptr("/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/networkInterfaces/toBeCreatedNetworkInterface"), // Properties: &armcompute.NetworkInterfaceReferenceProperties{ // Primary: to.Ptr(true), // }, // }}, // }, // OSProfile: &armcompute.OSProfile{ // AdminUsername: to.Ptr("{your-username}"), // ComputerName: to.Ptr("myVM"), // Secrets: []*armcompute.VaultSecretGroup{ // }, // WindowsConfiguration: &armcompute.WindowsConfiguration{ // EnableAutomaticUpdates: to.Ptr(true), // ProvisionVMAgent: to.Ptr(true), // }, // }, // ProvisioningState: to.Ptr("Succeeded"), // StorageProfile: &armcompute.StorageProfile{ // DataDisks: []*armcompute.DataDisk{ // }, // ImageReference: &armcompute.ImageReference{ // Offer: to.Ptr("WindowsServer"), // Publisher: to.Ptr("MicrosoftWindowsServer"), // SKU: to.Ptr("2016-Datacenter"), // Version: to.Ptr("latest"), // }, // OSDisk: &armcompute.OSDisk{ // Name: to.Ptr("myVMosdisk"), // Caching: to.Ptr(armcompute.CachingTypesReadWrite), // CreateOption: to.Ptr(armcompute.DiskCreateOptionTypesFromImage), // ManagedDisk: &armcompute.ManagedDiskParameters{ // StorageAccountType: to.Ptr(armcompute.StorageAccountTypesStandardLRS), // }, // OSType: to.Ptr(armcompute.OperatingSystemTypesWindows), // }, // }, // VMID: to.Ptr("b7a098cc-b0b8-46e8-a205-62f301a62a8f"), // }, // }
Output:
Example (CreateAVmWithNetworkInterfaceConfigurationWithPublicIpAddressDnsSettings) ¶
Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/92de53a5f1e0e03c94b40475d2135d97148ed014/specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-03-01/examples/virtualMachineExamples/VirtualMachine_Create_WithNetworkInterfaceConfigurationDnsSettings.json
cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() clientFactory, err := armcompute.NewClientFactory("<subscription-id>", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } poller, err := clientFactory.NewVirtualMachinesClient().BeginCreateOrUpdate(ctx, "myResourceGroup", "myVM", armcompute.VirtualMachine{ Location: to.Ptr("westus"), Properties: &armcompute.VirtualMachineProperties{ HardwareProfile: &armcompute.HardwareProfile{ VMSize: to.Ptr(armcompute.VirtualMachineSizeTypesStandardD1V2), }, NetworkProfile: &armcompute.NetworkProfile{ NetworkAPIVersion: to.Ptr(armcompute.NetworkAPIVersionTwoThousandTwenty1101), NetworkInterfaceConfigurations: []*armcompute.VirtualMachineNetworkInterfaceConfiguration{ { Name: to.Ptr("{nic-config-name}"), Properties: &armcompute.VirtualMachineNetworkInterfaceConfigurationProperties{ DeleteOption: to.Ptr(armcompute.DeleteOptionsDelete), IPConfigurations: []*armcompute.VirtualMachineNetworkInterfaceIPConfiguration{ { Name: to.Ptr("{ip-config-name}"), Properties: &armcompute.VirtualMachineNetworkInterfaceIPConfigurationProperties{ Primary: to.Ptr(true), PublicIPAddressConfiguration: &armcompute.VirtualMachinePublicIPAddressConfiguration{ Name: to.Ptr("{publicIP-config-name}"), Properties: &armcompute.VirtualMachinePublicIPAddressConfigurationProperties{ DeleteOption: to.Ptr(armcompute.DeleteOptionsDetach), DNSSettings: &armcompute.VirtualMachinePublicIPAddressDNSSettingsConfiguration{ DomainNameLabel: to.Ptr("aaaaa"), DomainNameLabelScope: to.Ptr(armcompute.DomainNameLabelScopeTypesTenantReuse), }, PublicIPAllocationMethod: to.Ptr(armcompute.PublicIPAllocationMethodStatic), }, SKU: &armcompute.PublicIPAddressSKU{ Name: to.Ptr(armcompute.PublicIPAddressSKUNameBasic), Tier: to.Ptr(armcompute.PublicIPAddressSKUTierGlobal), }, }, }, }}, Primary: to.Ptr(true), }, }}, }, OSProfile: &armcompute.OSProfile{ AdminPassword: to.Ptr("{your-password}"), AdminUsername: to.Ptr("{your-username}"), ComputerName: to.Ptr("myVM"), }, StorageProfile: &armcompute.StorageProfile{ ImageReference: &armcompute.ImageReference{ Offer: to.Ptr("WindowsServer"), Publisher: to.Ptr("MicrosoftWindowsServer"), SKU: to.Ptr("2016-Datacenter"), Version: to.Ptr("latest"), }, OSDisk: &armcompute.OSDisk{ Name: to.Ptr("myVMosdisk"), Caching: to.Ptr(armcompute.CachingTypesReadWrite), CreateOption: to.Ptr(armcompute.DiskCreateOptionTypesFromImage), ManagedDisk: &armcompute.ManagedDiskParameters{ StorageAccountType: to.Ptr(armcompute.StorageAccountTypesStandardLRS), }, }, }, }, }, &armcompute.VirtualMachinesClientBeginCreateOrUpdateOptions{IfMatch: nil, IfNoneMatch: nil, }) if err != nil { log.Fatalf("failed to finish the request: %v", err) } res, err := poller.PollUntilDone(ctx, nil) if err != nil { log.Fatalf("failed to pull the result: %v", err) } // You could use response here. We use blank identifier for just demo purposes. _ = res // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. // res.VirtualMachine = armcompute.VirtualMachine{ // Name: to.Ptr("myVM"), // Type: to.Ptr("Microsoft.Compute/virtualMachines"), // ID: to.Ptr("/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/virtualMachines/myVM"), // Location: to.Ptr("westus"), // Properties: &armcompute.VirtualMachineProperties{ // HardwareProfile: &armcompute.HardwareProfile{ // VMSize: to.Ptr(armcompute.VirtualMachineSizeTypesStandardD1V2), // }, // NetworkProfile: &armcompute.NetworkProfile{ // NetworkInterfaces: []*armcompute.NetworkInterfaceReference{ // { // ID: to.Ptr("/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/networkInterfaces/toBeCreatedNetworkInterface"), // Properties: &armcompute.NetworkInterfaceReferenceProperties{ // Primary: to.Ptr(true), // }, // }}, // }, // OSProfile: &armcompute.OSProfile{ // AdminUsername: to.Ptr("{your-username}"), // ComputerName: to.Ptr("myVM"), // Secrets: []*armcompute.VaultSecretGroup{ // }, // WindowsConfiguration: &armcompute.WindowsConfiguration{ // EnableAutomaticUpdates: to.Ptr(true), // ProvisionVMAgent: to.Ptr(true), // }, // }, // ProvisioningState: to.Ptr("Succeeded"), // StorageProfile: &armcompute.StorageProfile{ // DataDisks: []*armcompute.DataDisk{ // }, // ImageReference: &armcompute.ImageReference{ // Offer: to.Ptr("WindowsServer"), // Publisher: to.Ptr("MicrosoftWindowsServer"), // SKU: to.Ptr("2016-Datacenter"), // Version: to.Ptr("latest"), // }, // OSDisk: &armcompute.OSDisk{ // Name: to.Ptr("myVMosdisk"), // Caching: to.Ptr(armcompute.CachingTypesReadWrite), // CreateOption: to.Ptr(armcompute.DiskCreateOptionTypesFromImage), // ManagedDisk: &armcompute.ManagedDiskParameters{ // StorageAccountType: to.Ptr(armcompute.StorageAccountTypesStandardLRS), // }, // OSType: to.Ptr(armcompute.OperatingSystemTypesWindows), // }, // }, // VMID: to.Ptr("b7a098cc-b0b8-46e8-a205-62f301a62a8f"), // }, // }
Output:
Example (CreateAVmWithPasswordAuthentication) ¶
Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/92de53a5f1e0e03c94b40475d2135d97148ed014/specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-03-01/examples/virtualMachineExamples/VirtualMachine_Create_WithPasswordAuthentication.json
cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() clientFactory, err := armcompute.NewClientFactory("<subscription-id>", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } poller, err := clientFactory.NewVirtualMachinesClient().BeginCreateOrUpdate(ctx, "myResourceGroup", "myVM", armcompute.VirtualMachine{ Location: to.Ptr("westus"), Properties: &armcompute.VirtualMachineProperties{ HardwareProfile: &armcompute.HardwareProfile{ VMSize: to.Ptr(armcompute.VirtualMachineSizeTypesStandardD1V2), }, NetworkProfile: &armcompute.NetworkProfile{ NetworkInterfaces: []*armcompute.NetworkInterfaceReference{ { ID: to.Ptr("/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/networkInterfaces/{existing-nic-name}"), Properties: &armcompute.NetworkInterfaceReferenceProperties{ Primary: to.Ptr(true), }, }}, }, OSProfile: &armcompute.OSProfile{ AdminPassword: to.Ptr("{your-password}"), AdminUsername: to.Ptr("{your-username}"), ComputerName: to.Ptr("myVM"), }, StorageProfile: &armcompute.StorageProfile{ ImageReference: &armcompute.ImageReference{ Offer: to.Ptr("WindowsServer"), Publisher: to.Ptr("MicrosoftWindowsServer"), SKU: to.Ptr("2016-Datacenter"), Version: to.Ptr("latest"), }, OSDisk: &armcompute.OSDisk{ Name: to.Ptr("myVMosdisk"), Caching: to.Ptr(armcompute.CachingTypesReadWrite), CreateOption: to.Ptr(armcompute.DiskCreateOptionTypesFromImage), ManagedDisk: &armcompute.ManagedDiskParameters{ StorageAccountType: to.Ptr(armcompute.StorageAccountTypesStandardLRS), }, }, }, }, }, &armcompute.VirtualMachinesClientBeginCreateOrUpdateOptions{IfMatch: nil, IfNoneMatch: nil, }) if err != nil { log.Fatalf("failed to finish the request: %v", err) } res, err := poller.PollUntilDone(ctx, nil) if err != nil { log.Fatalf("failed to pull the result: %v", err) } // You could use response here. We use blank identifier for just demo purposes. _ = res // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. // res.VirtualMachine = armcompute.VirtualMachine{ // Name: to.Ptr("myVM"), // Type: to.Ptr("Microsoft.Compute/virtualMachines"), // ID: to.Ptr("/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/virtualMachines/myVM"), // Location: to.Ptr("westus"), // Properties: &armcompute.VirtualMachineProperties{ // HardwareProfile: &armcompute.HardwareProfile{ // VMSize: to.Ptr(armcompute.VirtualMachineSizeTypesStandardD1V2), // }, // NetworkProfile: &armcompute.NetworkProfile{ // NetworkInterfaces: []*armcompute.NetworkInterfaceReference{ // { // ID: to.Ptr("/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/networkInterfaces/nsgExistingNic"), // Properties: &armcompute.NetworkInterfaceReferenceProperties{ // Primary: to.Ptr(true), // }, // }}, // }, // OSProfile: &armcompute.OSProfile{ // AdminUsername: to.Ptr("{your-username}"), // ComputerName: to.Ptr("myVM"), // Secrets: []*armcompute.VaultSecretGroup{ // }, // WindowsConfiguration: &armcompute.WindowsConfiguration{ // EnableAutomaticUpdates: to.Ptr(true), // ProvisionVMAgent: to.Ptr(true), // }, // }, // ProvisioningState: to.Ptr("Succeeded"), // StorageProfile: &armcompute.StorageProfile{ // DataDisks: []*armcompute.DataDisk{ // }, // ImageReference: &armcompute.ImageReference{ // Offer: to.Ptr("WindowsServer"), // Publisher: to.Ptr("MicrosoftWindowsServer"), // SKU: to.Ptr("2016-Datacenter"), // Version: to.Ptr("latest"), // }, // OSDisk: &armcompute.OSDisk{ // Name: to.Ptr("myVMosdisk"), // Caching: to.Ptr(armcompute.CachingTypesReadWrite), // CreateOption: to.Ptr(armcompute.DiskCreateOptionTypesFromImage), // ManagedDisk: &armcompute.ManagedDiskParameters{ // StorageAccountType: to.Ptr(armcompute.StorageAccountTypesStandardLRS), // }, // OSType: to.Ptr(armcompute.OperatingSystemTypesWindows), // }, // }, // VMID: to.Ptr("b248db33-62ba-4d2d-b791-811e075ee0f5"), // }, // }
Output:
Example (CreateAVmWithPremiumStorage) ¶
Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/92de53a5f1e0e03c94b40475d2135d97148ed014/specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-03-01/examples/virtualMachineExamples/VirtualMachine_Create_WithPremiumStorage.json
cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() clientFactory, err := armcompute.NewClientFactory("<subscription-id>", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } poller, err := clientFactory.NewVirtualMachinesClient().BeginCreateOrUpdate(ctx, "myResourceGroup", "myVM", armcompute.VirtualMachine{ Location: to.Ptr("westus"), Properties: &armcompute.VirtualMachineProperties{ HardwareProfile: &armcompute.HardwareProfile{ VMSize: to.Ptr(armcompute.VirtualMachineSizeTypesStandardD1V2), }, NetworkProfile: &armcompute.NetworkProfile{ NetworkInterfaces: []*armcompute.NetworkInterfaceReference{ { ID: to.Ptr("/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/networkInterfaces/{existing-nic-name}"), Properties: &armcompute.NetworkInterfaceReferenceProperties{ Primary: to.Ptr(true), }, }}, }, OSProfile: &armcompute.OSProfile{ AdminPassword: to.Ptr("{your-password}"), AdminUsername: to.Ptr("{your-username}"), ComputerName: to.Ptr("myVM"), }, StorageProfile: &armcompute.StorageProfile{ ImageReference: &armcompute.ImageReference{ Offer: to.Ptr("WindowsServer"), Publisher: to.Ptr("MicrosoftWindowsServer"), SKU: to.Ptr("2016-Datacenter"), Version: to.Ptr("latest"), }, OSDisk: &armcompute.OSDisk{ Name: to.Ptr("myVMosdisk"), Caching: to.Ptr(armcompute.CachingTypesReadWrite), CreateOption: to.Ptr(armcompute.DiskCreateOptionTypesFromImage), ManagedDisk: &armcompute.ManagedDiskParameters{ StorageAccountType: to.Ptr(armcompute.StorageAccountTypesPremiumLRS), }, }, }, }, }, &armcompute.VirtualMachinesClientBeginCreateOrUpdateOptions{IfMatch: nil, IfNoneMatch: nil, }) if err != nil { log.Fatalf("failed to finish the request: %v", err) } res, err := poller.PollUntilDone(ctx, nil) if err != nil { log.Fatalf("failed to pull the result: %v", err) } // You could use response here. We use blank identifier for just demo purposes. _ = res // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. // res.VirtualMachine = armcompute.VirtualMachine{ // Name: to.Ptr("myVM"), // Type: to.Ptr("Microsoft.Compute/virtualMachines"), // ID: to.Ptr("/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/virtualMachines/myVM"), // Location: to.Ptr("westus"), // Properties: &armcompute.VirtualMachineProperties{ // HardwareProfile: &armcompute.HardwareProfile{ // VMSize: to.Ptr(armcompute.VirtualMachineSizeTypesStandardDS1V2), // }, // NetworkProfile: &armcompute.NetworkProfile{ // NetworkInterfaces: []*armcompute.NetworkInterfaceReference{ // { // ID: to.Ptr("/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/networkInterfaces/nsgExistingNic"), // Properties: &armcompute.NetworkInterfaceReferenceProperties{ // Primary: to.Ptr(true), // }, // }}, // }, // OSProfile: &armcompute.OSProfile{ // AdminUsername: to.Ptr("{your-username}"), // ComputerName: to.Ptr("myVM"), // Secrets: []*armcompute.VaultSecretGroup{ // }, // WindowsConfiguration: &armcompute.WindowsConfiguration{ // EnableAutomaticUpdates: to.Ptr(true), // ProvisionVMAgent: to.Ptr(true), // }, // }, // ProvisioningState: to.Ptr("Succeeded"), // StorageProfile: &armcompute.StorageProfile{ // DataDisks: []*armcompute.DataDisk{ // }, // ImageReference: &armcompute.ImageReference{ // Offer: to.Ptr("WindowsServer"), // Publisher: to.Ptr("MicrosoftWindowsServer"), // SKU: to.Ptr("2016-Datacenter"), // Version: to.Ptr("latest"), // }, // OSDisk: &armcompute.OSDisk{ // Name: to.Ptr("myVMosdisk"), // Caching: to.Ptr(armcompute.CachingTypesReadWrite), // CreateOption: to.Ptr(armcompute.DiskCreateOptionTypesFromImage), // ManagedDisk: &armcompute.ManagedDiskParameters{ // StorageAccountType: to.Ptr(armcompute.StorageAccountTypesPremiumLRS), // }, // OSType: to.Ptr(armcompute.OperatingSystemTypesWindows), // }, // }, // VMID: to.Ptr("a149cd25-409f-41af-8088-275f5486bc93"), // }, // }
Output:
Example (CreateAVmWithProxyAgentSettingsOfEnabledAndMode) ¶
Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/92de53a5f1e0e03c94b40475d2135d97148ed014/specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-03-01/examples/virtualMachineExamples/VirtualMachine_Create_WithProxyAgentSettings.json
cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() clientFactory, err := armcompute.NewClientFactory("<subscription-id>", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } poller, err := clientFactory.NewVirtualMachinesClient().BeginCreateOrUpdate(ctx, "myResourceGroup", "myVM", armcompute.VirtualMachine{ Location: to.Ptr("westus"), Properties: &armcompute.VirtualMachineProperties{ HardwareProfile: &armcompute.HardwareProfile{ VMSize: to.Ptr(armcompute.VirtualMachineSizeTypesStandardD2SV3), }, NetworkProfile: &armcompute.NetworkProfile{ NetworkInterfaces: []*armcompute.NetworkInterfaceReference{ { ID: to.Ptr("/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/networkInterfaces/{existing-nic-name}"), Properties: &armcompute.NetworkInterfaceReferenceProperties{ Primary: to.Ptr(true), }, }}, }, OSProfile: &armcompute.OSProfile{ AdminPassword: to.Ptr("{your-password}"), AdminUsername: to.Ptr("{your-username}"), ComputerName: to.Ptr("myVM"), }, SecurityProfile: &armcompute.SecurityProfile{ ProxyAgentSettings: &armcompute.ProxyAgentSettings{ Enabled: to.Ptr(true), Mode: to.Ptr(armcompute.ModeEnforce), }, }, StorageProfile: &armcompute.StorageProfile{ ImageReference: &armcompute.ImageReference{ Offer: to.Ptr("WindowsServer"), Publisher: to.Ptr("MicrosoftWindowsServer"), SKU: to.Ptr("2019-Datacenter"), Version: to.Ptr("latest"), }, OSDisk: &armcompute.OSDisk{ Name: to.Ptr("myVMosdisk"), Caching: to.Ptr(armcompute.CachingTypesReadOnly), CreateOption: to.Ptr(armcompute.DiskCreateOptionTypesFromImage), ManagedDisk: &armcompute.ManagedDiskParameters{ StorageAccountType: to.Ptr(armcompute.StorageAccountTypesStandardSSDLRS), }, }, }, }, }, &armcompute.VirtualMachinesClientBeginCreateOrUpdateOptions{IfMatch: nil, IfNoneMatch: nil, }) if err != nil { log.Fatalf("failed to finish the request: %v", err) } res, err := poller.PollUntilDone(ctx, nil) if err != nil { log.Fatalf("failed to pull the result: %v", err) } // You could use response here. We use blank identifier for just demo purposes. _ = res // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. // res.VirtualMachine = armcompute.VirtualMachine{ // Name: to.Ptr("myVM"), // Type: to.Ptr("Microsoft.Compute/virtualMachines"), // ID: to.Ptr("/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/virtualMachines/myVM"), // Location: to.Ptr("westus"), // Properties: &armcompute.VirtualMachineProperties{ // HardwareProfile: &armcompute.HardwareProfile{ // VMSize: to.Ptr(armcompute.VirtualMachineSizeTypesStandardD2SV3), // }, // NetworkProfile: &armcompute.NetworkProfile{ // NetworkInterfaces: []*armcompute.NetworkInterfaceReference{ // { // ID: to.Ptr("/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/networkInterfaces/nsgExistingNic"), // Properties: &armcompute.NetworkInterfaceReferenceProperties{ // Primary: to.Ptr(true), // }, // }}, // }, // OSProfile: &armcompute.OSProfile{ // AdminUsername: to.Ptr("{your-username}"), // ComputerName: to.Ptr("myVM"), // Secrets: []*armcompute.VaultSecretGroup{ // }, // WindowsConfiguration: &armcompute.WindowsConfiguration{ // EnableAutomaticUpdates: to.Ptr(true), // ProvisionVMAgent: to.Ptr(true), // }, // }, // ProvisioningState: to.Ptr("Succeeded"), // SecurityProfile: &armcompute.SecurityProfile{ // ProxyAgentSettings: &armcompute.ProxyAgentSettings{ // Enabled: to.Ptr(true), // Mode: to.Ptr(armcompute.ModeEnforce), // }, // }, // StorageProfile: &armcompute.StorageProfile{ // DataDisks: []*armcompute.DataDisk{ // }, // ImageReference: &armcompute.ImageReference{ // Offer: to.Ptr("WindowsServer"), // Publisher: to.Ptr("MicrosoftWindowsServer"), // SKU: to.Ptr("2019-Datacenter"), // Version: to.Ptr("latest"), // }, // OSDisk: &armcompute.OSDisk{ // Name: to.Ptr("myVMosdisk"), // Caching: to.Ptr(armcompute.CachingTypesReadOnly), // CreateOption: to.Ptr(armcompute.DiskCreateOptionTypesFromImage), // ManagedDisk: &armcompute.ManagedDiskParameters{ // StorageAccountType: to.Ptr(armcompute.StorageAccountTypesStandardSSDLRS), // }, // OSType: to.Ptr(armcompute.OperatingSystemTypesWindows), // }, // }, // VMID: to.Ptr("5c0d55a7-c407-4ed6-bf7d-ddb810267c85"), // }, // }
Output:
Example (CreateAVmWithScheduledEventsProfile) ¶
Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/92de53a5f1e0e03c94b40475d2135d97148ed014/specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-03-01/examples/virtualMachineExamples/VirtualMachine_Create_WithScheduledEventsProfile.json
cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() clientFactory, err := armcompute.NewClientFactory("<subscription-id>", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } poller, err := clientFactory.NewVirtualMachinesClient().BeginCreateOrUpdate(ctx, "myResourceGroup", "myVM", armcompute.VirtualMachine{ Location: to.Ptr("westus"), Properties: &armcompute.VirtualMachineProperties{ DiagnosticsProfile: &armcompute.DiagnosticsProfile{ BootDiagnostics: &armcompute.BootDiagnostics{ Enabled: to.Ptr(true), StorageURI: to.Ptr("http://{existing-storage-account-name}.blob.core.windows.net"), }, }, HardwareProfile: &armcompute.HardwareProfile{ VMSize: to.Ptr(armcompute.VirtualMachineSizeTypesStandardD1V2), }, NetworkProfile: &armcompute.NetworkProfile{ NetworkInterfaces: []*armcompute.NetworkInterfaceReference{ { ID: to.Ptr("/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/networkInterfaces/{existing-nic-name}"), Properties: &armcompute.NetworkInterfaceReferenceProperties{ Primary: to.Ptr(true), }, }}, }, OSProfile: &armcompute.OSProfile{ AdminPassword: to.Ptr("{your-password}"), AdminUsername: to.Ptr("{your-username}"), ComputerName: to.Ptr("myVM"), }, ScheduledEventsPolicy: &armcompute.ScheduledEventsPolicy{ ScheduledEventsAdditionalPublishingTargets: &armcompute.ScheduledEventsAdditionalPublishingTargets{ EventGridAndResourceGraph: &armcompute.EventGridAndResourceGraph{ Enable: to.Ptr(true), }, }, UserInitiatedReboot: &armcompute.UserInitiatedReboot{ AutomaticallyApprove: to.Ptr(true), }, UserInitiatedRedeploy: &armcompute.UserInitiatedRedeploy{ AutomaticallyApprove: to.Ptr(true), }, }, ScheduledEventsProfile: &armcompute.ScheduledEventsProfile{ OSImageNotificationProfile: &armcompute.OSImageNotificationProfile{ Enable: to.Ptr(true), NotBeforeTimeout: to.Ptr("PT15M"), }, TerminateNotificationProfile: &armcompute.TerminateNotificationProfile{ Enable: to.Ptr(true), NotBeforeTimeout: to.Ptr("PT10M"), }, }, StorageProfile: &armcompute.StorageProfile{ ImageReference: &armcompute.ImageReference{ Offer: to.Ptr("WindowsServer"), Publisher: to.Ptr("MicrosoftWindowsServer"), SKU: to.Ptr("2016-Datacenter"), Version: to.Ptr("latest"), }, OSDisk: &armcompute.OSDisk{ Name: to.Ptr("myVMosdisk"), Caching: to.Ptr(armcompute.CachingTypesReadWrite), CreateOption: to.Ptr(armcompute.DiskCreateOptionTypesFromImage), ManagedDisk: &armcompute.ManagedDiskParameters{ StorageAccountType: to.Ptr(armcompute.StorageAccountTypesStandardLRS), }, }, }, }, }, &armcompute.VirtualMachinesClientBeginCreateOrUpdateOptions{IfMatch: nil, IfNoneMatch: nil, }) if err != nil { log.Fatalf("failed to finish the request: %v", err) } res, err := poller.PollUntilDone(ctx, nil) if err != nil { log.Fatalf("failed to pull the result: %v", err) } // You could use response here. We use blank identifier for just demo purposes. _ = res // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. // res.VirtualMachine = armcompute.VirtualMachine{ // Name: to.Ptr("myVM"), // Type: to.Ptr("Microsoft.Compute/virtualMachines"), // ID: to.Ptr("/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/virtualMachines/myVM"), // Location: to.Ptr("westus"), // Properties: &armcompute.VirtualMachineProperties{ // DiagnosticsProfile: &armcompute.DiagnosticsProfile{ // BootDiagnostics: &armcompute.BootDiagnostics{ // Enabled: to.Ptr(true), // StorageURI: to.Ptr("http://nsgdiagnostic.blob.core.windows.net"), // }, // }, // HardwareProfile: &armcompute.HardwareProfile{ // VMSize: to.Ptr(armcompute.VirtualMachineSizeTypesStandardD1V2), // }, // NetworkProfile: &armcompute.NetworkProfile{ // NetworkInterfaces: []*armcompute.NetworkInterfaceReference{ // { // ID: to.Ptr("/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/networkInterfaces/nsgExistingNic"), // Properties: &armcompute.NetworkInterfaceReferenceProperties{ // Primary: to.Ptr(true), // }, // }}, // }, // OSProfile: &armcompute.OSProfile{ // AdminUsername: to.Ptr("{your-username}"), // ComputerName: to.Ptr("myVM"), // Secrets: []*armcompute.VaultSecretGroup{ // }, // WindowsConfiguration: &armcompute.WindowsConfiguration{ // EnableAutomaticUpdates: to.Ptr(true), // ProvisionVMAgent: to.Ptr(true), // }, // }, // ProvisioningState: to.Ptr("Succeeded"), // ScheduledEventsPolicy: &armcompute.ScheduledEventsPolicy{ // ScheduledEventsAdditionalPublishingTargets: &armcompute.ScheduledEventsAdditionalPublishingTargets{ // EventGridAndResourceGraph: &armcompute.EventGridAndResourceGraph{ // Enable: to.Ptr(true), // }, // }, // UserInitiatedReboot: &armcompute.UserInitiatedReboot{ // AutomaticallyApprove: to.Ptr(true), // }, // UserInitiatedRedeploy: &armcompute.UserInitiatedRedeploy{ // AutomaticallyApprove: to.Ptr(true), // }, // }, // ScheduledEventsProfile: &armcompute.ScheduledEventsProfile{ // OSImageNotificationProfile: &armcompute.OSImageNotificationProfile{ // Enable: to.Ptr(true), // NotBeforeTimeout: to.Ptr("PT15M"), // }, // TerminateNotificationProfile: &armcompute.TerminateNotificationProfile{ // Enable: to.Ptr(true), // NotBeforeTimeout: to.Ptr("PT10M"), // }, // }, // StorageProfile: &armcompute.StorageProfile{ // DataDisks: []*armcompute.DataDisk{ // }, // ImageReference: &armcompute.ImageReference{ // Offer: to.Ptr("WindowsServer"), // Publisher: to.Ptr("MicrosoftWindowsServer"), // SKU: to.Ptr("2016-Datacenter"), // Version: to.Ptr("latest"), // }, // OSDisk: &armcompute.OSDisk{ // Name: to.Ptr("myVMosdisk"), // Caching: to.Ptr(armcompute.CachingTypesReadWrite), // CreateOption: to.Ptr(armcompute.DiskCreateOptionTypesFromImage), // ManagedDisk: &armcompute.ManagedDiskParameters{ // StorageAccountType: to.Ptr(armcompute.StorageAccountTypesStandardLRS), // }, // OSType: to.Ptr(armcompute.OperatingSystemTypesWindows), // }, // }, // VMID: to.Ptr("676420ba-7a24-4bfe-80bd-9c841ee184fa"), // }, // }
Output:
Example (CreateAVmWithSecurityTypeConfidentialVmWithCustomerManagedKeys) ¶
Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/92de53a5f1e0e03c94b40475d2135d97148ed014/specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-03-01/examples/virtualMachineExamples/VirtualMachine_Create_WithSecurityTypeConfidentialVMWithCustomerManagedKeys.json
cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() clientFactory, err := armcompute.NewClientFactory("<subscription-id>", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } poller, err := clientFactory.NewVirtualMachinesClient().BeginCreateOrUpdate(ctx, "myResourceGroup", "myVM", armcompute.VirtualMachine{ Location: to.Ptr("westus"), Properties: &armcompute.VirtualMachineProperties{ HardwareProfile: &armcompute.HardwareProfile{ VMSize: to.Ptr(armcompute.VirtualMachineSizeTypes("Standard_DC2as_v5")), }, NetworkProfile: &armcompute.NetworkProfile{ NetworkInterfaces: []*armcompute.NetworkInterfaceReference{ { ID: to.Ptr("/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/networkInterfaces/{existing-nic-name}"), Properties: &armcompute.NetworkInterfaceReferenceProperties{ Primary: to.Ptr(true), }, }}, }, OSProfile: &armcompute.OSProfile{ AdminPassword: to.Ptr("{your-password}"), AdminUsername: to.Ptr("{your-username}"), ComputerName: to.Ptr("myVM"), }, SecurityProfile: &armcompute.SecurityProfile{ SecurityType: to.Ptr(armcompute.SecurityTypesConfidentialVM), UefiSettings: &armcompute.UefiSettings{ SecureBootEnabled: to.Ptr(true), VTpmEnabled: to.Ptr(true), }, }, StorageProfile: &armcompute.StorageProfile{ ImageReference: &armcompute.ImageReference{ Offer: to.Ptr("2019-datacenter-cvm"), Publisher: to.Ptr("MicrosoftWindowsServer"), SKU: to.Ptr("windows-cvm"), Version: to.Ptr("17763.2183.2109130127"), }, OSDisk: &armcompute.OSDisk{ Name: to.Ptr("myVMosdisk"), Caching: to.Ptr(armcompute.CachingTypesReadOnly), CreateOption: to.Ptr(armcompute.DiskCreateOptionTypesFromImage), ManagedDisk: &armcompute.ManagedDiskParameters{ SecurityProfile: &armcompute.VMDiskSecurityProfile{ DiskEncryptionSet: &armcompute.DiskEncryptionSetParameters{ ID: to.Ptr("/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/diskEncryptionSets/{existing-diskEncryptionSet-name}"), }, SecurityEncryptionType: to.Ptr(armcompute.SecurityEncryptionTypesDiskWithVMGuestState), }, StorageAccountType: to.Ptr(armcompute.StorageAccountTypesStandardSSDLRS), }, }, }, }, }, &armcompute.VirtualMachinesClientBeginCreateOrUpdateOptions{IfMatch: nil, IfNoneMatch: nil, }) if err != nil { log.Fatalf("failed to finish the request: %v", err) } res, err := poller.PollUntilDone(ctx, nil) if err != nil { log.Fatalf("failed to pull the result: %v", err) } // You could use response here. We use blank identifier for just demo purposes. _ = res // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. // res.VirtualMachine = armcompute.VirtualMachine{ // Name: to.Ptr("myVM"), // Type: to.Ptr("Microsoft.Compute/virtualMachines"), // ID: to.Ptr("/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/virtualMachines/myVM"), // Location: to.Ptr("westus"), // Properties: &armcompute.VirtualMachineProperties{ // HardwareProfile: &armcompute.HardwareProfile{ // VMSize: to.Ptr(armcompute.VirtualMachineSizeTypes("Standard_DC2as_v5")), // }, // NetworkProfile: &armcompute.NetworkProfile{ // NetworkInterfaces: []*armcompute.NetworkInterfaceReference{ // { // ID: to.Ptr("/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/networkInterfaces/nsgExistingNic"), // Properties: &armcompute.NetworkInterfaceReferenceProperties{ // Primary: to.Ptr(true), // }, // }}, // }, // OSProfile: &armcompute.OSProfile{ // AdminUsername: to.Ptr("{your-username}"), // ComputerName: to.Ptr("myVM"), // Secrets: []*armcompute.VaultSecretGroup{ // }, // WindowsConfiguration: &armcompute.WindowsConfiguration{ // EnableAutomaticUpdates: to.Ptr(true), // ProvisionVMAgent: to.Ptr(true), // }, // }, // ProvisioningState: to.Ptr("Succeeded"), // SecurityProfile: &armcompute.SecurityProfile{ // SecurityType: to.Ptr(armcompute.SecurityTypesConfidentialVM), // UefiSettings: &armcompute.UefiSettings{ // SecureBootEnabled: to.Ptr(true), // VTpmEnabled: to.Ptr(true), // }, // }, // StorageProfile: &armcompute.StorageProfile{ // DataDisks: []*armcompute.DataDisk{ // }, // ImageReference: &armcompute.ImageReference{ // Offer: to.Ptr("2019-datacenter-cvm"), // Publisher: to.Ptr("MicrosoftWindowsServer"), // SKU: to.Ptr("windows-cvm"), // Version: to.Ptr("17763.2183.2109130127"), // }, // OSDisk: &armcompute.OSDisk{ // Name: to.Ptr("myVMosdisk"), // Caching: to.Ptr(armcompute.CachingTypesReadOnly), // CreateOption: to.Ptr(armcompute.DiskCreateOptionTypesFromImage), // ManagedDisk: &armcompute.ManagedDiskParameters{ // SecurityProfile: &armcompute.VMDiskSecurityProfile{ // DiskEncryptionSet: &armcompute.DiskEncryptionSetParameters{ // ID: to.Ptr("/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/diskEncryptionSets/{existing-diskEncryptionSet-name}"), // }, // SecurityEncryptionType: to.Ptr(armcompute.SecurityEncryptionTypesDiskWithVMGuestState), // }, // StorageAccountType: to.Ptr(armcompute.StorageAccountTypesStandardSSDLRS), // }, // }, // }, // VMID: to.Ptr("5c0d55a7-c407-4ed6-bf7d-ddb810267c85"), // }, // }
Output:
Example (CreateAVmWithSecurityTypeConfidentialVmWithNonPersistedTpmSecurityEncryptionType) ¶
Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/92de53a5f1e0e03c94b40475d2135d97148ed014/specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-03-01/examples/virtualMachineExamples/VirtualMachine_Create_WithSecurityTypeConfidentialVMWithNonPersistedTPM.json
cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() clientFactory, err := armcompute.NewClientFactory("<subscription-id>", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } poller, err := clientFactory.NewVirtualMachinesClient().BeginCreateOrUpdate(ctx, "myResourceGroup", "myVM", armcompute.VirtualMachine{ Location: to.Ptr("westus"), Properties: &armcompute.VirtualMachineProperties{ HardwareProfile: &armcompute.HardwareProfile{ VMSize: to.Ptr(armcompute.VirtualMachineSizeTypes("Standard_DC2es_v5")), }, NetworkProfile: &armcompute.NetworkProfile{ NetworkInterfaces: []*armcompute.NetworkInterfaceReference{ { ID: to.Ptr("/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/networkInterfaces/{existing-nic-name}"), Properties: &armcompute.NetworkInterfaceReferenceProperties{ Primary: to.Ptr(true), }, }}, }, OSProfile: &armcompute.OSProfile{ AdminPassword: to.Ptr("{your-password}"), AdminUsername: to.Ptr("{your-username}"), ComputerName: to.Ptr("myVM"), }, SecurityProfile: &armcompute.SecurityProfile{ SecurityType: to.Ptr(armcompute.SecurityTypesConfidentialVM), UefiSettings: &armcompute.UefiSettings{ SecureBootEnabled: to.Ptr(false), VTpmEnabled: to.Ptr(true), }, }, StorageProfile: &armcompute.StorageProfile{ ImageReference: &armcompute.ImageReference{ Offer: to.Ptr("2022-datacenter-cvm"), Publisher: to.Ptr("UbuntuServer"), SKU: to.Ptr("linux-cvm"), Version: to.Ptr("17763.2183.2109130127"), }, OSDisk: &armcompute.OSDisk{ Name: to.Ptr("myVMosdisk"), Caching: to.Ptr(armcompute.CachingTypesReadOnly), CreateOption: to.Ptr(armcompute.DiskCreateOptionTypesFromImage), ManagedDisk: &armcompute.ManagedDiskParameters{ SecurityProfile: &armcompute.VMDiskSecurityProfile{ SecurityEncryptionType: to.Ptr(armcompute.SecurityEncryptionTypesNonPersistedTPM), }, StorageAccountType: to.Ptr(armcompute.StorageAccountTypesStandardSSDLRS), }, }, }, }, }, &armcompute.VirtualMachinesClientBeginCreateOrUpdateOptions{IfMatch: nil, IfNoneMatch: nil, }) if err != nil { log.Fatalf("failed to finish the request: %v", err) } res, err := poller.PollUntilDone(ctx, nil) if err != nil { log.Fatalf("failed to pull the result: %v", err) } // You could use response here. We use blank identifier for just demo purposes. _ = res // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. // res.VirtualMachine = armcompute.VirtualMachine{ // Name: to.Ptr("myVM"), // Type: to.Ptr("Microsoft.Compute/virtualMachines"), // ID: to.Ptr("/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/virtualMachines/myVM"), // Location: to.Ptr("westus"), // Properties: &armcompute.VirtualMachineProperties{ // HardwareProfile: &armcompute.HardwareProfile{ // VMSize: to.Ptr(armcompute.VirtualMachineSizeTypes("Standard_DC2es_v5")), // }, // NetworkProfile: &armcompute.NetworkProfile{ // NetworkInterfaces: []*armcompute.NetworkInterfaceReference{ // { // ID: to.Ptr("/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/networkInterfaces/nsgExistingNic"), // Properties: &armcompute.NetworkInterfaceReferenceProperties{ // Primary: to.Ptr(true), // }, // }}, // }, // OSProfile: &armcompute.OSProfile{ // AdminUsername: to.Ptr("{your-username}"), // ComputerName: to.Ptr("myVM"), // Secrets: []*armcompute.VaultSecretGroup{ // }, // WindowsConfiguration: &armcompute.WindowsConfiguration{ // EnableAutomaticUpdates: to.Ptr(true), // ProvisionVMAgent: to.Ptr(true), // }, // }, // ProvisioningState: to.Ptr("Succeeded"), // SecurityProfile: &armcompute.SecurityProfile{ // SecurityType: to.Ptr(armcompute.SecurityTypesConfidentialVM), // UefiSettings: &armcompute.UefiSettings{ // SecureBootEnabled: to.Ptr(false), // VTpmEnabled: to.Ptr(true), // }, // }, // StorageProfile: &armcompute.StorageProfile{ // DataDisks: []*armcompute.DataDisk{ // }, // ImageReference: &armcompute.ImageReference{ // Offer: to.Ptr("2022-datacenter-cvm"), // Publisher: to.Ptr("UbuntuServer"), // SKU: to.Ptr("linux-cvm"), // Version: to.Ptr("17763.2183.2109130127"), // }, // OSDisk: &armcompute.OSDisk{ // Name: to.Ptr("myVMosdisk"), // Caching: to.Ptr(armcompute.CachingTypesReadOnly), // CreateOption: to.Ptr(armcompute.DiskCreateOptionTypesFromImage), // ManagedDisk: &armcompute.ManagedDiskParameters{ // SecurityProfile: &armcompute.VMDiskSecurityProfile{ // SecurityEncryptionType: to.Ptr(armcompute.SecurityEncryptionTypesNonPersistedTPM), // }, // StorageAccountType: to.Ptr(armcompute.StorageAccountTypesStandardSSDLRS), // }, // }, // }, // VMID: to.Ptr("5c0d55a7-c407-4ed6-bf7d-ddb810267c85"), // }, // }
Output:
Example (CreateAVmWithSecurityTypeConfidentialVmWithPlatformManagedKeys) ¶
Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/92de53a5f1e0e03c94b40475d2135d97148ed014/specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-03-01/examples/virtualMachineExamples/VirtualMachine_Create_WithSecurityTypeConfidentialVM.json
cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() clientFactory, err := armcompute.NewClientFactory("<subscription-id>", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } poller, err := clientFactory.NewVirtualMachinesClient().BeginCreateOrUpdate(ctx, "myResourceGroup", "myVM", armcompute.VirtualMachine{ Location: to.Ptr("westus"), Properties: &armcompute.VirtualMachineProperties{ HardwareProfile: &armcompute.HardwareProfile{ VMSize: to.Ptr(armcompute.VirtualMachineSizeTypes("Standard_DC2as_v5")), }, NetworkProfile: &armcompute.NetworkProfile{ NetworkInterfaces: []*armcompute.NetworkInterfaceReference{ { ID: to.Ptr("/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/networkInterfaces/{existing-nic-name}"), Properties: &armcompute.NetworkInterfaceReferenceProperties{ Primary: to.Ptr(true), }, }}, }, OSProfile: &armcompute.OSProfile{ AdminPassword: to.Ptr("{your-password}"), AdminUsername: to.Ptr("{your-username}"), ComputerName: to.Ptr("myVM"), }, SecurityProfile: &armcompute.SecurityProfile{ SecurityType: to.Ptr(armcompute.SecurityTypesConfidentialVM), UefiSettings: &armcompute.UefiSettings{ SecureBootEnabled: to.Ptr(true), VTpmEnabled: to.Ptr(true), }, }, StorageProfile: &armcompute.StorageProfile{ ImageReference: &armcompute.ImageReference{ Offer: to.Ptr("2019-datacenter-cvm"), Publisher: to.Ptr("MicrosoftWindowsServer"), SKU: to.Ptr("windows-cvm"), Version: to.Ptr("17763.2183.2109130127"), }, OSDisk: &armcompute.OSDisk{ Name: to.Ptr("myVMosdisk"), Caching: to.Ptr(armcompute.CachingTypesReadOnly), CreateOption: to.Ptr(armcompute.DiskCreateOptionTypesFromImage), ManagedDisk: &armcompute.ManagedDiskParameters{ SecurityProfile: &armcompute.VMDiskSecurityProfile{ SecurityEncryptionType: to.Ptr(armcompute.SecurityEncryptionTypesDiskWithVMGuestState), }, StorageAccountType: to.Ptr(armcompute.StorageAccountTypesStandardSSDLRS), }, }, }, }, }, &armcompute.VirtualMachinesClientBeginCreateOrUpdateOptions{IfMatch: nil, IfNoneMatch: nil, }) if err != nil { log.Fatalf("failed to finish the request: %v", err) } res, err := poller.PollUntilDone(ctx, nil) if err != nil { log.Fatalf("failed to pull the result: %v", err) } // You could use response here. We use blank identifier for just demo purposes. _ = res // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. // res.VirtualMachine = armcompute.VirtualMachine{ // Name: to.Ptr("myVM"), // Type: to.Ptr("Microsoft.Compute/virtualMachines"), // ID: to.Ptr("/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/virtualMachines/myVM"), // Location: to.Ptr("westus"), // Properties: &armcompute.VirtualMachineProperties{ // HardwareProfile: &armcompute.HardwareProfile{ // VMSize: to.Ptr(armcompute.VirtualMachineSizeTypes("Standard_DC2as_v5")), // }, // NetworkProfile: &armcompute.NetworkProfile{ // NetworkInterfaces: []*armcompute.NetworkInterfaceReference{ // { // ID: to.Ptr("/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/networkInterfaces/nsgExistingNic"), // Properties: &armcompute.NetworkInterfaceReferenceProperties{ // Primary: to.Ptr(true), // }, // }}, // }, // OSProfile: &armcompute.OSProfile{ // AdminUsername: to.Ptr("{your-username}"), // ComputerName: to.Ptr("myVM"), // Secrets: []*armcompute.VaultSecretGroup{ // }, // WindowsConfiguration: &armcompute.WindowsConfiguration{ // EnableAutomaticUpdates: to.Ptr(true), // ProvisionVMAgent: to.Ptr(true), // }, // }, // ProvisioningState: to.Ptr("Succeeded"), // SecurityProfile: &armcompute.SecurityProfile{ // SecurityType: to.Ptr(armcompute.SecurityTypesConfidentialVM), // UefiSettings: &armcompute.UefiSettings{ // SecureBootEnabled: to.Ptr(true), // VTpmEnabled: to.Ptr(true), // }, // }, // StorageProfile: &armcompute.StorageProfile{ // DataDisks: []*armcompute.DataDisk{ // }, // ImageReference: &armcompute.ImageReference{ // Offer: to.Ptr("2019-datacenter-cvm"), // Publisher: to.Ptr("MicrosoftWindowsServer"), // SKU: to.Ptr("windows-cvm"), // Version: to.Ptr("17763.2183.2109130127"), // }, // OSDisk: &armcompute.OSDisk{ // Name: to.Ptr("myVMosdisk"), // Caching: to.Ptr(armcompute.CachingTypesReadOnly), // CreateOption: to.Ptr(armcompute.DiskCreateOptionTypesFromImage), // ManagedDisk: &armcompute.ManagedDiskParameters{ // SecurityProfile: &armcompute.VMDiskSecurityProfile{ // SecurityEncryptionType: to.Ptr(armcompute.SecurityEncryptionTypesDiskWithVMGuestState), // }, // StorageAccountType: to.Ptr(armcompute.StorageAccountTypesStandardSSDLRS), // }, // }, // }, // VMID: to.Ptr("5c0d55a7-c407-4ed6-bf7d-ddb810267c85"), // }, // }
Output:
Example (CreateAVmWithSshAuthentication) ¶
Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/92de53a5f1e0e03c94b40475d2135d97148ed014/specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-03-01/examples/virtualMachineExamples/VirtualMachine_Create_WithSshAuthentication.json
cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() clientFactory, err := armcompute.NewClientFactory("<subscription-id>", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } poller, err := clientFactory.NewVirtualMachinesClient().BeginCreateOrUpdate(ctx, "myResourceGroup", "myVM", armcompute.VirtualMachine{ Location: to.Ptr("westus"), Properties: &armcompute.VirtualMachineProperties{ HardwareProfile: &armcompute.HardwareProfile{ VMSize: to.Ptr(armcompute.VirtualMachineSizeTypesStandardD1V2), }, NetworkProfile: &armcompute.NetworkProfile{ NetworkInterfaces: []*armcompute.NetworkInterfaceReference{ { ID: to.Ptr("/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/networkInterfaces/{existing-nic-name}"), Properties: &armcompute.NetworkInterfaceReferenceProperties{ Primary: to.Ptr(true), }, }}, }, OSProfile: &armcompute.OSProfile{ AdminUsername: to.Ptr("{your-username}"), ComputerName: to.Ptr("myVM"), LinuxConfiguration: &armcompute.LinuxConfiguration{ DisablePasswordAuthentication: to.Ptr(true), SSH: &armcompute.SSHConfiguration{ PublicKeys: []*armcompute.SSHPublicKey{ { Path: to.Ptr("/home/{your-username}/.ssh/authorized_keys"), KeyData: to.Ptr("ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQCeClRAk2ipUs/l5voIsDC5q9RI+YSRd1Bvd/O+axgY4WiBzG+4FwJWZm/mLLe5DoOdHQwmU2FrKXZSW4w2sYE70KeWnrFViCOX5MTVvJgPE8ClugNl8RWth/tU849DvM9sT7vFgfVSHcAS2yDRyDlueii+8nF2ym8XWAPltFVCyLHRsyBp5YPqK8JFYIa1eybKsY3hEAxRCA+/7bq8et+Gj3coOsuRmrehav7rE6N12Pb80I6ofa6SM5XNYq4Xk0iYNx7R3kdz0Jj9XgZYWjAHjJmT0gTRoOnt6upOuxK7xI/ykWrllgpXrCPu3Ymz+c+ujaqcxDopnAl2lmf69/J1"), }}, }, }, }, StorageProfile: &armcompute.StorageProfile{ ImageReference: &armcompute.ImageReference{ Offer: to.Ptr("{image_offer}"), Publisher: to.Ptr("{image_publisher}"), SKU: to.Ptr("{image_sku}"), Version: to.Ptr("latest"), }, OSDisk: &armcompute.OSDisk{ Name: to.Ptr("myVMosdisk"), Caching: to.Ptr(armcompute.CachingTypesReadWrite), CreateOption: to.Ptr(armcompute.DiskCreateOptionTypesFromImage), ManagedDisk: &armcompute.ManagedDiskParameters{ StorageAccountType: to.Ptr(armcompute.StorageAccountTypesStandardLRS), }, }, }, }, }, &armcompute.VirtualMachinesClientBeginCreateOrUpdateOptions{IfMatch: nil, IfNoneMatch: nil, }) if err != nil { log.Fatalf("failed to finish the request: %v", err) } res, err := poller.PollUntilDone(ctx, nil) if err != nil { log.Fatalf("failed to pull the result: %v", err) } // You could use response here. We use blank identifier for just demo purposes. _ = res // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. // res.VirtualMachine = armcompute.VirtualMachine{ // Name: to.Ptr("myVM"), // Type: to.Ptr("Microsoft.Compute/virtualMachines"), // ID: to.Ptr("/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/virtualMachines/myVM"), // Location: to.Ptr("westus"), // Properties: &armcompute.VirtualMachineProperties{ // HardwareProfile: &armcompute.HardwareProfile{ // VMSize: to.Ptr(armcompute.VirtualMachineSizeTypesStandardD1V2), // }, // NetworkProfile: &armcompute.NetworkProfile{ // NetworkInterfaces: []*armcompute.NetworkInterfaceReference{ // { // ID: to.Ptr("/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/networkInterfaces/nsgExistingNic"), // Properties: &armcompute.NetworkInterfaceReferenceProperties{ // Primary: to.Ptr(true), // }, // }}, // }, // OSProfile: &armcompute.OSProfile{ // AdminUsername: to.Ptr("{your-username}"), // ComputerName: to.Ptr("myVM"), // LinuxConfiguration: &armcompute.LinuxConfiguration{ // DisablePasswordAuthentication: to.Ptr(true), // SSH: &armcompute.SSHConfiguration{ // PublicKeys: []*armcompute.SSHPublicKey{ // { // Path: to.Ptr("/home/{your-username}/.ssh/authorized_keys"), // KeyData: to.Ptr("ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQCeClRAk2ipUs/l5voIsDC5q9RI+YSRd1Bvd/O+axgY4WiBzG+4FwJWZm/mLLe5DoOdHQwmU2FrKXZSW4w2sYE70KeWnrFViCOX5MTVvJgPE8ClugNl8RWth/tU849DvM9sT7vFgfVSHcAS2yDRyDlueii+8nF2ym8XWAPltFVCyLHRsyBp5YPqK8JFYIa1eybKsY3hEAxRCA+/7bq8et+Gj3coOsuRmrehav7rE6N12Pb80I6ofa6SM5XNYq4Xk0iYNx7R3kdz0Jj9XgZYWjAHjJmT0gTRoOnt6upOuxK7xI/ykWrllgpXrCPu3Ymz+c+ujaqcxDopnAl2lmf69/J1"), // }}, // }, // }, // Secrets: []*armcompute.VaultSecretGroup{ // }, // }, // ProvisioningState: to.Ptr("Succeeded"), // StorageProfile: &armcompute.StorageProfile{ // DataDisks: []*armcompute.DataDisk{ // }, // ImageReference: &armcompute.ImageReference{ // Offer: to.Ptr("UbuntuServer"), // Publisher: to.Ptr("Canonical"), // SKU: to.Ptr("16.04-LTS"), // Version: to.Ptr("latest"), // }, // OSDisk: &armcompute.OSDisk{ // Name: to.Ptr("myVMosdisk"), // Caching: to.Ptr(armcompute.CachingTypesReadWrite), // CreateOption: to.Ptr(armcompute.DiskCreateOptionTypesFromImage), // ManagedDisk: &armcompute.ManagedDiskParameters{ // StorageAccountType: to.Ptr(armcompute.StorageAccountTypesStandardLRS), // }, // OSType: to.Ptr(armcompute.OperatingSystemTypesLinux), // }, // }, // VMID: to.Ptr("e0de9b84-a506-4b95-9623-00a425d05c90"), // }, // }
Output:
Example (CreateAVmWithUefiSettingsOfSecureBootAndVTpm) ¶
Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/92de53a5f1e0e03c94b40475d2135d97148ed014/specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-03-01/examples/virtualMachineExamples/VirtualMachine_Create_WithUefiSettings.json
cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() clientFactory, err := armcompute.NewClientFactory("<subscription-id>", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } poller, err := clientFactory.NewVirtualMachinesClient().BeginCreateOrUpdate(ctx, "myResourceGroup", "myVM", armcompute.VirtualMachine{ Location: to.Ptr("westus"), Properties: &armcompute.VirtualMachineProperties{ HardwareProfile: &armcompute.HardwareProfile{ VMSize: to.Ptr(armcompute.VirtualMachineSizeTypesStandardD2SV3), }, NetworkProfile: &armcompute.NetworkProfile{ NetworkInterfaces: []*armcompute.NetworkInterfaceReference{ { ID: to.Ptr("/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/networkInterfaces/{existing-nic-name}"), Properties: &armcompute.NetworkInterfaceReferenceProperties{ Primary: to.Ptr(true), }, }}, }, OSProfile: &armcompute.OSProfile{ AdminPassword: to.Ptr("{your-password}"), AdminUsername: to.Ptr("{your-username}"), ComputerName: to.Ptr("myVM"), }, SecurityProfile: &armcompute.SecurityProfile{ SecurityType: to.Ptr(armcompute.SecurityTypesTrustedLaunch), UefiSettings: &armcompute.UefiSettings{ SecureBootEnabled: to.Ptr(true), VTpmEnabled: to.Ptr(true), }, }, StorageProfile: &armcompute.StorageProfile{ ImageReference: &armcompute.ImageReference{ Offer: to.Ptr("windowsserver-gen2preview-preview"), Publisher: to.Ptr("MicrosoftWindowsServer"), SKU: to.Ptr("windows10-tvm"), Version: to.Ptr("18363.592.2001092016"), }, OSDisk: &armcompute.OSDisk{ Name: to.Ptr("myVMosdisk"), Caching: to.Ptr(armcompute.CachingTypesReadOnly), CreateOption: to.Ptr(armcompute.DiskCreateOptionTypesFromImage), ManagedDisk: &armcompute.ManagedDiskParameters{ StorageAccountType: to.Ptr(armcompute.StorageAccountTypesStandardSSDLRS), }, }, }, }, }, &armcompute.VirtualMachinesClientBeginCreateOrUpdateOptions{IfMatch: nil, IfNoneMatch: nil, }) if err != nil { log.Fatalf("failed to finish the request: %v", err) } res, err := poller.PollUntilDone(ctx, nil) if err != nil { log.Fatalf("failed to pull the result: %v", err) } // You could use response here. We use blank identifier for just demo purposes. _ = res // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. // res.VirtualMachine = armcompute.VirtualMachine{ // Name: to.Ptr("myVM"), // Type: to.Ptr("Microsoft.Compute/virtualMachines"), // ID: to.Ptr("/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/virtualMachines/myVM"), // Location: to.Ptr("westus"), // Properties: &armcompute.VirtualMachineProperties{ // HardwareProfile: &armcompute.HardwareProfile{ // VMSize: to.Ptr(armcompute.VirtualMachineSizeTypesStandardD2SV3), // }, // NetworkProfile: &armcompute.NetworkProfile{ // NetworkInterfaces: []*armcompute.NetworkInterfaceReference{ // { // ID: to.Ptr("/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/networkInterfaces/nsgExistingNic"), // Properties: &armcompute.NetworkInterfaceReferenceProperties{ // Primary: to.Ptr(true), // }, // }}, // }, // OSProfile: &armcompute.OSProfile{ // AdminUsername: to.Ptr("{your-username}"), // ComputerName: to.Ptr("myVM"), // Secrets: []*armcompute.VaultSecretGroup{ // }, // WindowsConfiguration: &armcompute.WindowsConfiguration{ // EnableAutomaticUpdates: to.Ptr(true), // ProvisionVMAgent: to.Ptr(true), // }, // }, // ProvisioningState: to.Ptr("Succeeded"), // SecurityProfile: &armcompute.SecurityProfile{ // SecurityType: to.Ptr(armcompute.SecurityTypesTrustedLaunch), // UefiSettings: &armcompute.UefiSettings{ // SecureBootEnabled: to.Ptr(true), // VTpmEnabled: to.Ptr(true), // }, // }, // StorageProfile: &armcompute.StorageProfile{ // DataDisks: []*armcompute.DataDisk{ // }, // ImageReference: &armcompute.ImageReference{ // Offer: to.Ptr("windowsserver-gen2preview-preview"), // Publisher: to.Ptr("MicrosoftWindowsServer"), // SKU: to.Ptr("windows10-tvm"), // Version: to.Ptr("18363.592.2001092016"), // }, // OSDisk: &armcompute.OSDisk{ // Name: to.Ptr("myVMosdisk"), // Caching: to.Ptr(armcompute.CachingTypesReadOnly), // CreateOption: to.Ptr(armcompute.DiskCreateOptionTypesFromImage), // ManagedDisk: &armcompute.ManagedDiskParameters{ // StorageAccountType: to.Ptr(armcompute.StorageAccountTypesStandardSSDLRS), // }, // OSType: to.Ptr(armcompute.OperatingSystemTypesWindows), // }, // }, // VMID: to.Ptr("5c0d55a7-c407-4ed6-bf7d-ddb810267c85"), // }, // }
Output:
Example (CreateAVmWithUserData) ¶
Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/92de53a5f1e0e03c94b40475d2135d97148ed014/specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-03-01/examples/virtualMachineExamples/VirtualMachine_Create_WithUserData.json
cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() clientFactory, err := armcompute.NewClientFactory("<subscription-id>", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } poller, err := clientFactory.NewVirtualMachinesClient().BeginCreateOrUpdate(ctx, "myResourceGroup", "{vm-name}", armcompute.VirtualMachine{ Location: to.Ptr("westus"), Properties: &armcompute.VirtualMachineProperties{ DiagnosticsProfile: &armcompute.DiagnosticsProfile{ BootDiagnostics: &armcompute.BootDiagnostics{ Enabled: to.Ptr(true), StorageURI: to.Ptr("http://{existing-storage-account-name}.blob.core.windows.net"), }, }, HardwareProfile: &armcompute.HardwareProfile{ VMSize: to.Ptr(armcompute.VirtualMachineSizeTypesStandardD1V2), }, NetworkProfile: &armcompute.NetworkProfile{ NetworkInterfaces: []*armcompute.NetworkInterfaceReference{ { ID: to.Ptr("/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/networkInterfaces/{existing-nic-name}"), Properties: &armcompute.NetworkInterfaceReferenceProperties{ Primary: to.Ptr(true), }, }}, }, OSProfile: &armcompute.OSProfile{ AdminPassword: to.Ptr("{your-password}"), AdminUsername: to.Ptr("{your-username}"), ComputerName: to.Ptr("{vm-name}"), }, StorageProfile: &armcompute.StorageProfile{ ImageReference: &armcompute.ImageReference{ Offer: to.Ptr("WindowsServer"), Publisher: to.Ptr("MicrosoftWindowsServer"), SKU: to.Ptr("2016-Datacenter"), Version: to.Ptr("latest"), }, OSDisk: &armcompute.OSDisk{ Name: to.Ptr("vmOSdisk"), Caching: to.Ptr(armcompute.CachingTypesReadWrite), CreateOption: to.Ptr(armcompute.DiskCreateOptionTypesFromImage), ManagedDisk: &armcompute.ManagedDiskParameters{ StorageAccountType: to.Ptr(armcompute.StorageAccountTypesStandardLRS), }, }, }, UserData: to.Ptr("RXhhbXBsZSBVc2VyRGF0YQ=="), }, }, &armcompute.VirtualMachinesClientBeginCreateOrUpdateOptions{IfMatch: nil, IfNoneMatch: nil, }) if err != nil { log.Fatalf("failed to finish the request: %v", err) } res, err := poller.PollUntilDone(ctx, nil) if err != nil { log.Fatalf("failed to pull the result: %v", err) } // You could use response here. We use blank identifier for just demo purposes. _ = res // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. // res.VirtualMachine = armcompute.VirtualMachine{ // Name: to.Ptr("{vm-name}"), // Type: to.Ptr("Microsoft.Compute/virtualMachines"), // ID: to.Ptr("/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/virtualMachines/{vm-name}"), // Location: to.Ptr("westus"), // Properties: &armcompute.VirtualMachineProperties{ // DiagnosticsProfile: &armcompute.DiagnosticsProfile{ // BootDiagnostics: &armcompute.BootDiagnostics{ // Enabled: to.Ptr(true), // StorageURI: to.Ptr("http://nsgdiagnostic.blob.core.windows.net"), // }, // }, // HardwareProfile: &armcompute.HardwareProfile{ // VMSize: to.Ptr(armcompute.VirtualMachineSizeTypesStandardD1V2), // }, // NetworkProfile: &armcompute.NetworkProfile{ // NetworkInterfaces: []*armcompute.NetworkInterfaceReference{ // { // ID: to.Ptr("/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/networkInterfaces/nsgExistingNic"), // Properties: &armcompute.NetworkInterfaceReferenceProperties{ // Primary: to.Ptr(true), // }, // }}, // }, // OSProfile: &armcompute.OSProfile{ // AdminUsername: to.Ptr("{your-username}"), // ComputerName: to.Ptr("{vm-name}"), // Secrets: []*armcompute.VaultSecretGroup{ // }, // WindowsConfiguration: &armcompute.WindowsConfiguration{ // EnableAutomaticUpdates: to.Ptr(true), // ProvisionVMAgent: to.Ptr(true), // }, // }, // ProvisioningState: to.Ptr("Succeeded"), // StorageProfile: &armcompute.StorageProfile{ // DataDisks: []*armcompute.DataDisk{ // }, // ImageReference: &armcompute.ImageReference{ // Offer: to.Ptr("WindowsServer"), // Publisher: to.Ptr("MicrosoftWindowsServer"), // SKU: to.Ptr("2016-Datacenter"), // Version: to.Ptr("latest"), // }, // OSDisk: &armcompute.OSDisk{ // Name: to.Ptr("vmOSdisk"), // Caching: to.Ptr(armcompute.CachingTypesReadWrite), // CreateOption: to.Ptr(armcompute.DiskCreateOptionTypesFromImage), // ManagedDisk: &armcompute.ManagedDiskParameters{ // StorageAccountType: to.Ptr(armcompute.StorageAccountTypesStandardLRS), // }, // OSType: to.Ptr(armcompute.OperatingSystemTypesWindows), // }, // }, // VMID: to.Ptr("676420ba-7a24-4bfe-80bd-9c841ee184fa"), // }, // }
Output:
Example (CreateAVmWithVmSizeProperties) ¶
Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/92de53a5f1e0e03c94b40475d2135d97148ed014/specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-03-01/examples/virtualMachineExamples/VirtualMachine_Create_WithVMSizeProperties.json
cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() clientFactory, err := armcompute.NewClientFactory("<subscription-id>", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } poller, err := clientFactory.NewVirtualMachinesClient().BeginCreateOrUpdate(ctx, "myResourceGroup", "myVM", armcompute.VirtualMachine{ Location: to.Ptr("westus"), Properties: &armcompute.VirtualMachineProperties{ DiagnosticsProfile: &armcompute.DiagnosticsProfile{ BootDiagnostics: &armcompute.BootDiagnostics{ Enabled: to.Ptr(true), StorageURI: to.Ptr("http://{existing-storage-account-name}.blob.core.windows.net"), }, }, HardwareProfile: &armcompute.HardwareProfile{ VMSize: to.Ptr(armcompute.VirtualMachineSizeTypesStandardD4V3), VMSizeProperties: &armcompute.VMSizeProperties{ VCPUsAvailable: to.Ptr[int32](1), VCPUsPerCore: to.Ptr[int32](1), }, }, NetworkProfile: &armcompute.NetworkProfile{ NetworkInterfaces: []*armcompute.NetworkInterfaceReference{ { ID: to.Ptr("/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/networkInterfaces/{existing-nic-name}"), Properties: &armcompute.NetworkInterfaceReferenceProperties{ Primary: to.Ptr(true), }, }}, }, OSProfile: &armcompute.OSProfile{ AdminPassword: to.Ptr("{your-password}"), AdminUsername: to.Ptr("{your-username}"), ComputerName: to.Ptr("myVM"), }, StorageProfile: &armcompute.StorageProfile{ ImageReference: &armcompute.ImageReference{ Offer: to.Ptr("WindowsServer"), Publisher: to.Ptr("MicrosoftWindowsServer"), SKU: to.Ptr("2016-Datacenter"), Version: to.Ptr("latest"), }, OSDisk: &armcompute.OSDisk{ Name: to.Ptr("myVMosdisk"), Caching: to.Ptr(armcompute.CachingTypesReadWrite), CreateOption: to.Ptr(armcompute.DiskCreateOptionTypesFromImage), ManagedDisk: &armcompute.ManagedDiskParameters{ StorageAccountType: to.Ptr(armcompute.StorageAccountTypesStandardLRS), }, }, }, UserData: to.Ptr("U29tZSBDdXN0b20gRGF0YQ=="), }, }, &armcompute.VirtualMachinesClientBeginCreateOrUpdateOptions{IfMatch: nil, IfNoneMatch: nil, }) if err != nil { log.Fatalf("failed to finish the request: %v", err) } res, err := poller.PollUntilDone(ctx, nil) if err != nil { log.Fatalf("failed to pull the result: %v", err) } // You could use response here. We use blank identifier for just demo purposes. _ = res // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. // res.VirtualMachine = armcompute.VirtualMachine{ // Name: to.Ptr("myVM"), // Type: to.Ptr("Microsoft.Compute/virtualMachines"), // ID: to.Ptr("/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/virtualMachines/myVM"), // Location: to.Ptr("westus"), // Properties: &armcompute.VirtualMachineProperties{ // DiagnosticsProfile: &armcompute.DiagnosticsProfile{ // BootDiagnostics: &armcompute.BootDiagnostics{ // Enabled: to.Ptr(true), // StorageURI: to.Ptr("http://nsgdiagnostic.blob.core.windows.net"), // }, // }, // HardwareProfile: &armcompute.HardwareProfile{ // VMSize: to.Ptr(armcompute.VirtualMachineSizeTypesStandardD4V3), // VMSizeProperties: &armcompute.VMSizeProperties{ // VCPUsAvailable: to.Ptr[int32](1), // VCPUsPerCore: to.Ptr[int32](1), // }, // }, // NetworkProfile: &armcompute.NetworkProfile{ // NetworkInterfaces: []*armcompute.NetworkInterfaceReference{ // { // ID: to.Ptr("/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/networkInterfaces/nsgExistingNic"), // Properties: &armcompute.NetworkInterfaceReferenceProperties{ // Primary: to.Ptr(true), // }, // }}, // }, // OSProfile: &armcompute.OSProfile{ // AdminUsername: to.Ptr("{your-username}"), // ComputerName: to.Ptr("myVM"), // Secrets: []*armcompute.VaultSecretGroup{ // }, // WindowsConfiguration: &armcompute.WindowsConfiguration{ // EnableAutomaticUpdates: to.Ptr(true), // ProvisionVMAgent: to.Ptr(true), // }, // }, // ProvisioningState: to.Ptr("Succeeded"), // StorageProfile: &armcompute.StorageProfile{ // DataDisks: []*armcompute.DataDisk{ // }, // ImageReference: &armcompute.ImageReference{ // Offer: to.Ptr("WindowsServer"), // Publisher: to.Ptr("MicrosoftWindowsServer"), // SKU: to.Ptr("2016-Datacenter"), // Version: to.Ptr("latest"), // }, // OSDisk: &armcompute.OSDisk{ // Name: to.Ptr("myVMosdisk"), // Caching: to.Ptr(armcompute.CachingTypesReadWrite), // CreateOption: to.Ptr(armcompute.DiskCreateOptionTypesFromImage), // ManagedDisk: &armcompute.ManagedDiskParameters{ // StorageAccountType: to.Ptr(armcompute.StorageAccountTypesStandardLRS), // }, // OSType: to.Ptr(armcompute.OperatingSystemTypesWindows), // }, // }, // VMID: to.Ptr("676420ba-7a24-4bfe-80bd-9c841ee184fa"), // }, // }
Output:
Example (CreateAWindowsVmWithAPatchSettingAssessmentModeOfImageDefault) ¶
Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/92de53a5f1e0e03c94b40475d2135d97148ed014/specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-03-01/examples/virtualMachineExamples/VirtualMachine_Create_WindowsVmWithPatchSettingAssessmentModeOfImageDefault.json
cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() clientFactory, err := armcompute.NewClientFactory("<subscription-id>", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } poller, err := clientFactory.NewVirtualMachinesClient().BeginCreateOrUpdate(ctx, "myResourceGroup", "myVM", armcompute.VirtualMachine{ Location: to.Ptr("westus"), Properties: &armcompute.VirtualMachineProperties{ HardwareProfile: &armcompute.HardwareProfile{ VMSize: to.Ptr(armcompute.VirtualMachineSizeTypesStandardD1V2), }, NetworkProfile: &armcompute.NetworkProfile{ NetworkInterfaces: []*armcompute.NetworkInterfaceReference{ { ID: to.Ptr("/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/networkInterfaces/{existing-nic-name}"), Properties: &armcompute.NetworkInterfaceReferenceProperties{ Primary: to.Ptr(true), }, }}, }, OSProfile: &armcompute.OSProfile{ AdminPassword: to.Ptr("{your-password}"), AdminUsername: to.Ptr("{your-username}"), ComputerName: to.Ptr("myVM"), WindowsConfiguration: &armcompute.WindowsConfiguration{ EnableAutomaticUpdates: to.Ptr(true), PatchSettings: &armcompute.PatchSettings{ AssessmentMode: to.Ptr(armcompute.WindowsPatchAssessmentModeImageDefault), }, ProvisionVMAgent: to.Ptr(true), }, }, StorageProfile: &armcompute.StorageProfile{ ImageReference: &armcompute.ImageReference{ Offer: to.Ptr("WindowsServer"), Publisher: to.Ptr("MicrosoftWindowsServer"), SKU: to.Ptr("2016-Datacenter"), Version: to.Ptr("latest"), }, OSDisk: &armcompute.OSDisk{ Name: to.Ptr("myVMosdisk"), Caching: to.Ptr(armcompute.CachingTypesReadWrite), CreateOption: to.Ptr(armcompute.DiskCreateOptionTypesFromImage), ManagedDisk: &armcompute.ManagedDiskParameters{ StorageAccountType: to.Ptr(armcompute.StorageAccountTypesPremiumLRS), }, }, }, }, }, &armcompute.VirtualMachinesClientBeginCreateOrUpdateOptions{IfMatch: nil, IfNoneMatch: nil, }) if err != nil { log.Fatalf("failed to finish the request: %v", err) } res, err := poller.PollUntilDone(ctx, nil) if err != nil { log.Fatalf("failed to pull the result: %v", err) } // You could use response here. We use blank identifier for just demo purposes. _ = res // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. // res.VirtualMachine = armcompute.VirtualMachine{ // Name: to.Ptr("myVM"), // Type: to.Ptr("Microsoft.Compute/virtualMachines"), // ID: to.Ptr("/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/virtualMachines/myVM"), // Location: to.Ptr("westus"), // Properties: &armcompute.VirtualMachineProperties{ // HardwareProfile: &armcompute.HardwareProfile{ // VMSize: to.Ptr(armcompute.VirtualMachineSizeTypesStandardDS1V2), // }, // NetworkProfile: &armcompute.NetworkProfile{ // NetworkInterfaces: []*armcompute.NetworkInterfaceReference{ // { // ID: to.Ptr("/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/networkInterfaces/nsgExistingNic"), // Properties: &armcompute.NetworkInterfaceReferenceProperties{ // Primary: to.Ptr(true), // }, // }}, // }, // OSProfile: &armcompute.OSProfile{ // AdminUsername: to.Ptr("{your-username}"), // ComputerName: to.Ptr("myVM"), // Secrets: []*armcompute.VaultSecretGroup{ // }, // WindowsConfiguration: &armcompute.WindowsConfiguration{ // EnableAutomaticUpdates: to.Ptr(true), // PatchSettings: &armcompute.PatchSettings{ // AssessmentMode: to.Ptr(armcompute.WindowsPatchAssessmentModeImageDefault), // }, // ProvisionVMAgent: to.Ptr(true), // }, // }, // ProvisioningState: to.Ptr("Succeeded"), // StorageProfile: &armcompute.StorageProfile{ // DataDisks: []*armcompute.DataDisk{ // }, // ImageReference: &armcompute.ImageReference{ // Offer: to.Ptr("WindowsServer"), // Publisher: to.Ptr("MicrosoftWindowsServer"), // SKU: to.Ptr("2016-Datacenter"), // Version: to.Ptr("latest"), // }, // OSDisk: &armcompute.OSDisk{ // Name: to.Ptr("myVMosdisk"), // Caching: to.Ptr(armcompute.CachingTypesReadWrite), // CreateOption: to.Ptr(armcompute.DiskCreateOptionTypesFromImage), // ManagedDisk: &armcompute.ManagedDiskParameters{ // StorageAccountType: to.Ptr(armcompute.StorageAccountTypesPremiumLRS), // }, // OSType: to.Ptr(armcompute.OperatingSystemTypesWindows), // }, // }, // VMID: to.Ptr("a149cd25-409f-41af-8088-275f5486bc93"), // }, // }
Output:
Example (CreateAWindowsVmWithAPatchSettingPatchModeOfAutomaticByOs) ¶
Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/92de53a5f1e0e03c94b40475d2135d97148ed014/specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-03-01/examples/virtualMachineExamples/VirtualMachine_Create_WindowsVmWithPatchSettingModeOfAutomaticByOS.json
cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() clientFactory, err := armcompute.NewClientFactory("<subscription-id>", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } poller, err := clientFactory.NewVirtualMachinesClient().BeginCreateOrUpdate(ctx, "myResourceGroup", "myVM", armcompute.VirtualMachine{ Location: to.Ptr("westus"), Properties: &armcompute.VirtualMachineProperties{ HardwareProfile: &armcompute.HardwareProfile{ VMSize: to.Ptr(armcompute.VirtualMachineSizeTypesStandardD1V2), }, NetworkProfile: &armcompute.NetworkProfile{ NetworkInterfaces: []*armcompute.NetworkInterfaceReference{ { ID: to.Ptr("/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/networkInterfaces/nsgExistingNic"), Properties: &armcompute.NetworkInterfaceReferenceProperties{ Primary: to.Ptr(true), }, }}, }, OSProfile: &armcompute.OSProfile{ AdminPassword: to.Ptr("{your-password}"), AdminUsername: to.Ptr("{your-username}"), ComputerName: to.Ptr("myVM"), WindowsConfiguration: &armcompute.WindowsConfiguration{ EnableAutomaticUpdates: to.Ptr(true), PatchSettings: &armcompute.PatchSettings{ PatchMode: to.Ptr(armcompute.WindowsVMGuestPatchModeAutomaticByOS), }, ProvisionVMAgent: to.Ptr(true), }, }, StorageProfile: &armcompute.StorageProfile{ ImageReference: &armcompute.ImageReference{ Offer: to.Ptr("WindowsServer"), Publisher: to.Ptr("MicrosoftWindowsServer"), SKU: to.Ptr("2016-Datacenter"), Version: to.Ptr("latest"), }, OSDisk: &armcompute.OSDisk{ Name: to.Ptr("myVMosdisk"), Caching: to.Ptr(armcompute.CachingTypesReadWrite), CreateOption: to.Ptr(armcompute.DiskCreateOptionTypesFromImage), ManagedDisk: &armcompute.ManagedDiskParameters{ StorageAccountType: to.Ptr(armcompute.StorageAccountTypesPremiumLRS), }, }, }, }, }, &armcompute.VirtualMachinesClientBeginCreateOrUpdateOptions{IfMatch: nil, IfNoneMatch: nil, }) if err != nil { log.Fatalf("failed to finish the request: %v", err) } res, err := poller.PollUntilDone(ctx, nil) if err != nil { log.Fatalf("failed to pull the result: %v", err) } // You could use response here. We use blank identifier for just demo purposes. _ = res // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. // res.VirtualMachine = armcompute.VirtualMachine{ // Name: to.Ptr("myVM"), // Type: to.Ptr("Microsoft.Compute/virtualMachines"), // ID: to.Ptr("/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/virtualMachines/myVM"), // Location: to.Ptr("westus"), // Properties: &armcompute.VirtualMachineProperties{ // HardwareProfile: &armcompute.HardwareProfile{ // VMSize: to.Ptr(armcompute.VirtualMachineSizeTypesStandardDS1V2), // }, // NetworkProfile: &armcompute.NetworkProfile{ // NetworkInterfaces: []*armcompute.NetworkInterfaceReference{ // { // ID: to.Ptr("/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/networkInterfaces/nsgExistingNic"), // Properties: &armcompute.NetworkInterfaceReferenceProperties{ // Primary: to.Ptr(true), // }, // }}, // }, // OSProfile: &armcompute.OSProfile{ // AdminUsername: to.Ptr("{your-username}"), // ComputerName: to.Ptr("myVM"), // Secrets: []*armcompute.VaultSecretGroup{ // }, // WindowsConfiguration: &armcompute.WindowsConfiguration{ // EnableAutomaticUpdates: to.Ptr(true), // PatchSettings: &armcompute.PatchSettings{ // PatchMode: to.Ptr(armcompute.WindowsVMGuestPatchModeAutomaticByOS), // }, // ProvisionVMAgent: to.Ptr(true), // }, // }, // ProvisioningState: to.Ptr("Succeeded"), // StorageProfile: &armcompute.StorageProfile{ // DataDisks: []*armcompute.DataDisk{ // }, // ImageReference: &armcompute.ImageReference{ // Offer: to.Ptr("WindowsServer"), // Publisher: to.Ptr("MicrosoftWindowsServer"), // SKU: to.Ptr("2016-Datacenter"), // Version: to.Ptr("latest"), // }, // OSDisk: &armcompute.OSDisk{ // Name: to.Ptr("myVMosdisk"), // Caching: to.Ptr(armcompute.CachingTypesReadWrite), // CreateOption: to.Ptr(armcompute.DiskCreateOptionTypesFromImage), // ManagedDisk: &armcompute.ManagedDiskParameters{ // StorageAccountType: to.Ptr(armcompute.StorageAccountTypesPremiumLRS), // }, // OSType: to.Ptr(armcompute.OperatingSystemTypesWindows), // }, // }, // VMID: to.Ptr("a149cd25-409f-41af-8088-275f5486bc93"), // }, // }
Output:
Example (CreateAWindowsVmWithAPatchSettingPatchModeOfAutomaticByPlatformAndAutomaticByPlatformSettings) ¶
Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/92de53a5f1e0e03c94b40475d2135d97148ed014/specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-03-01/examples/virtualMachineExamples/VirtualMachine_Create_WindowsVmWithAutomaticByPlatformSettings.json
cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() clientFactory, err := armcompute.NewClientFactory("<subscription-id>", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } poller, err := clientFactory.NewVirtualMachinesClient().BeginCreateOrUpdate(ctx, "myResourceGroup", "myVM", armcompute.VirtualMachine{ Location: to.Ptr("westus"), Properties: &armcompute.VirtualMachineProperties{ HardwareProfile: &armcompute.HardwareProfile{ VMSize: to.Ptr(armcompute.VirtualMachineSizeTypesStandardD1V2), }, NetworkProfile: &armcompute.NetworkProfile{ NetworkInterfaces: []*armcompute.NetworkInterfaceReference{ { ID: to.Ptr("/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/networkInterfaces/{existing-nic-name}"), Properties: &armcompute.NetworkInterfaceReferenceProperties{ Primary: to.Ptr(true), }, }}, }, OSProfile: &armcompute.OSProfile{ AdminPassword: to.Ptr("{your-password}"), AdminUsername: to.Ptr("{your-username}"), ComputerName: to.Ptr("myVM"), WindowsConfiguration: &armcompute.WindowsConfiguration{ EnableAutomaticUpdates: to.Ptr(true), PatchSettings: &armcompute.PatchSettings{ AssessmentMode: to.Ptr(armcompute.WindowsPatchAssessmentModeAutomaticByPlatform), AutomaticByPlatformSettings: &armcompute.WindowsVMGuestPatchAutomaticByPlatformSettings{ BypassPlatformSafetyChecksOnUserSchedule: to.Ptr(false), RebootSetting: to.Ptr(armcompute.WindowsVMGuestPatchAutomaticByPlatformRebootSettingNever), }, PatchMode: to.Ptr(armcompute.WindowsVMGuestPatchModeAutomaticByPlatform), }, ProvisionVMAgent: to.Ptr(true), }, }, StorageProfile: &armcompute.StorageProfile{ ImageReference: &armcompute.ImageReference{ Offer: to.Ptr("WindowsServer"), Publisher: to.Ptr("MicrosoftWindowsServer"), SKU: to.Ptr("2016-Datacenter"), Version: to.Ptr("latest"), }, OSDisk: &armcompute.OSDisk{ Name: to.Ptr("myVMosdisk"), Caching: to.Ptr(armcompute.CachingTypesReadWrite), CreateOption: to.Ptr(armcompute.DiskCreateOptionTypesFromImage), ManagedDisk: &armcompute.ManagedDiskParameters{ StorageAccountType: to.Ptr(armcompute.StorageAccountTypesPremiumLRS), }, }, }, }, }, &armcompute.VirtualMachinesClientBeginCreateOrUpdateOptions{IfMatch: nil, IfNoneMatch: nil, }) if err != nil { log.Fatalf("failed to finish the request: %v", err) } res, err := poller.PollUntilDone(ctx, nil) if err != nil { log.Fatalf("failed to pull the result: %v", err) } // You could use response here. We use blank identifier for just demo purposes. _ = res // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. // res.VirtualMachine = armcompute.VirtualMachine{ // Name: to.Ptr("myVM"), // Type: to.Ptr("Microsoft.Compute/virtualMachines"), // ID: to.Ptr("/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/virtualMachines/myVM"), // Location: to.Ptr("westus"), // Properties: &armcompute.VirtualMachineProperties{ // HardwareProfile: &armcompute.HardwareProfile{ // VMSize: to.Ptr(armcompute.VirtualMachineSizeTypesStandardDS1V2), // }, // NetworkProfile: &armcompute.NetworkProfile{ // NetworkInterfaces: []*armcompute.NetworkInterfaceReference{ // { // ID: to.Ptr("/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/networkInterfaces/nsgExistingNic"), // Properties: &armcompute.NetworkInterfaceReferenceProperties{ // Primary: to.Ptr(true), // }, // }}, // }, // OSProfile: &armcompute.OSProfile{ // AdminUsername: to.Ptr("{your-username}"), // ComputerName: to.Ptr("myVM"), // Secrets: []*armcompute.VaultSecretGroup{ // }, // WindowsConfiguration: &armcompute.WindowsConfiguration{ // EnableAutomaticUpdates: to.Ptr(true), // PatchSettings: &armcompute.PatchSettings{ // AssessmentMode: to.Ptr(armcompute.WindowsPatchAssessmentModeAutomaticByPlatform), // AutomaticByPlatformSettings: &armcompute.WindowsVMGuestPatchAutomaticByPlatformSettings{ // BypassPlatformSafetyChecksOnUserSchedule: to.Ptr(false), // RebootSetting: to.Ptr(armcompute.WindowsVMGuestPatchAutomaticByPlatformRebootSettingNever), // }, // PatchMode: to.Ptr(armcompute.WindowsVMGuestPatchModeAutomaticByPlatform), // }, // ProvisionVMAgent: to.Ptr(true), // }, // }, // ProvisioningState: to.Ptr("Succeeded"), // StorageProfile: &armcompute.StorageProfile{ // DataDisks: []*armcompute.DataDisk{ // }, // ImageReference: &armcompute.ImageReference{ // Offer: to.Ptr("WindowsServer"), // Publisher: to.Ptr("MicrosoftWindowsServer"), // SKU: to.Ptr("2016-Datacenter"), // Version: to.Ptr("latest"), // }, // OSDisk: &armcompute.OSDisk{ // Name: to.Ptr("myVMosdisk"), // Caching: to.Ptr(armcompute.CachingTypesReadWrite), // CreateOption: to.Ptr(armcompute.DiskCreateOptionTypesFromImage), // ManagedDisk: &armcompute.ManagedDiskParameters{ // StorageAccountType: to.Ptr(armcompute.StorageAccountTypesPremiumLRS), // }, // OSType: to.Ptr(armcompute.OperatingSystemTypesWindows), // }, // }, // VMID: to.Ptr("a149cd25-409f-41af-8088-275f5486bc93"), // }, // }
Output:
Example (CreateAWindowsVmWithAPatchSettingPatchModeOfAutomaticByPlatformAndEnableHotpatchingSetToTrue) ¶
Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/92de53a5f1e0e03c94b40475d2135d97148ed014/specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-03-01/examples/virtualMachineExamples/VirtualMachine_Create_WindowsVmWithPatchSettingModeOfAutomaticByPlatformAndEnableHotPatchingTrue.json
cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() clientFactory, err := armcompute.NewClientFactory("<subscription-id>", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } poller, err := clientFactory.NewVirtualMachinesClient().BeginCreateOrUpdate(ctx, "myResourceGroup", "myVM", armcompute.VirtualMachine{ Location: to.Ptr("westus"), Properties: &armcompute.VirtualMachineProperties{ HardwareProfile: &armcompute.HardwareProfile{ VMSize: to.Ptr(armcompute.VirtualMachineSizeTypesStandardD1V2), }, NetworkProfile: &armcompute.NetworkProfile{ NetworkInterfaces: []*armcompute.NetworkInterfaceReference{ { ID: to.Ptr("/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/networkInterfaces/{existing-nic-name}"), Properties: &armcompute.NetworkInterfaceReferenceProperties{ Primary: to.Ptr(true), }, }}, }, OSProfile: &armcompute.OSProfile{ AdminPassword: to.Ptr("{your-password}"), AdminUsername: to.Ptr("{your-username}"), ComputerName: to.Ptr("myVM"), WindowsConfiguration: &armcompute.WindowsConfiguration{ EnableAutomaticUpdates: to.Ptr(true), PatchSettings: &armcompute.PatchSettings{ EnableHotpatching: to.Ptr(true), PatchMode: to.Ptr(armcompute.WindowsVMGuestPatchModeAutomaticByPlatform), }, ProvisionVMAgent: to.Ptr(true), }, }, StorageProfile: &armcompute.StorageProfile{ ImageReference: &armcompute.ImageReference{ Offer: to.Ptr("WindowsServer"), Publisher: to.Ptr("MicrosoftWindowsServer"), SKU: to.Ptr("2016-Datacenter"), Version: to.Ptr("latest"), }, OSDisk: &armcompute.OSDisk{ Name: to.Ptr("myVMosdisk"), Caching: to.Ptr(armcompute.CachingTypesReadWrite), CreateOption: to.Ptr(armcompute.DiskCreateOptionTypesFromImage), ManagedDisk: &armcompute.ManagedDiskParameters{ StorageAccountType: to.Ptr(armcompute.StorageAccountTypesPremiumLRS), }, }, }, }, }, &armcompute.VirtualMachinesClientBeginCreateOrUpdateOptions{IfMatch: nil, IfNoneMatch: nil, }) if err != nil { log.Fatalf("failed to finish the request: %v", err) } res, err := poller.PollUntilDone(ctx, nil) if err != nil { log.Fatalf("failed to pull the result: %v", err) } // You could use response here. We use blank identifier for just demo purposes. _ = res // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. // res.VirtualMachine = armcompute.VirtualMachine{ // Name: to.Ptr("myVM"), // Type: to.Ptr("Microsoft.Compute/virtualMachines"), // ID: to.Ptr("/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/virtualMachines/myVM"), // Location: to.Ptr("westus"), // Properties: &armcompute.VirtualMachineProperties{ // HardwareProfile: &armcompute.HardwareProfile{ // VMSize: to.Ptr(armcompute.VirtualMachineSizeTypesStandardDS1V2), // }, // NetworkProfile: &armcompute.NetworkProfile{ // NetworkInterfaces: []*armcompute.NetworkInterfaceReference{ // { // ID: to.Ptr("/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/networkInterfaces/nsgExistingNic"), // Properties: &armcompute.NetworkInterfaceReferenceProperties{ // Primary: to.Ptr(true), // }, // }}, // }, // OSProfile: &armcompute.OSProfile{ // AdminUsername: to.Ptr("{your-username}"), // ComputerName: to.Ptr("myVM"), // Secrets: []*armcompute.VaultSecretGroup{ // }, // WindowsConfiguration: &armcompute.WindowsConfiguration{ // EnableAutomaticUpdates: to.Ptr(true), // PatchSettings: &armcompute.PatchSettings{ // EnableHotpatching: to.Ptr(true), // PatchMode: to.Ptr(armcompute.WindowsVMGuestPatchModeAutomaticByPlatform), // }, // ProvisionVMAgent: to.Ptr(true), // }, // }, // ProvisioningState: to.Ptr("Succeeded"), // StorageProfile: &armcompute.StorageProfile{ // DataDisks: []*armcompute.DataDisk{ // }, // ImageReference: &armcompute.ImageReference{ // Offer: to.Ptr("WindowsServer"), // Publisher: to.Ptr("MicrosoftWindowsServer"), // SKU: to.Ptr("2016-Datacenter"), // Version: to.Ptr("latest"), // }, // OSDisk: &armcompute.OSDisk{ // Name: to.Ptr("myVMosdisk"), // Caching: to.Ptr(armcompute.CachingTypesReadWrite), // CreateOption: to.Ptr(armcompute.DiskCreateOptionTypesFromImage), // ManagedDisk: &armcompute.ManagedDiskParameters{ // StorageAccountType: to.Ptr(armcompute.StorageAccountTypesPremiumLRS), // }, // OSType: to.Ptr(armcompute.OperatingSystemTypesWindows), // }, // }, // VMID: to.Ptr("a149cd25-409f-41af-8088-275f5486bc93"), // }, // }
Output:
Example (CreateAWindowsVmWithAPatchSettingPatchModeOfManual) ¶
Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/92de53a5f1e0e03c94b40475d2135d97148ed014/specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-03-01/examples/virtualMachineExamples/VirtualMachine_Create_WindowsVmWithPatchSettingModeOfManual.json
cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() clientFactory, err := armcompute.NewClientFactory("<subscription-id>", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } poller, err := clientFactory.NewVirtualMachinesClient().BeginCreateOrUpdate(ctx, "myResourceGroup", "myVM", armcompute.VirtualMachine{ Location: to.Ptr("westus"), Properties: &armcompute.VirtualMachineProperties{ HardwareProfile: &armcompute.HardwareProfile{ VMSize: to.Ptr(armcompute.VirtualMachineSizeTypesStandardD1V2), }, NetworkProfile: &armcompute.NetworkProfile{ NetworkInterfaces: []*armcompute.NetworkInterfaceReference{ { ID: to.Ptr("/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/networkInterfaces/{existing-nic-name}"), Properties: &armcompute.NetworkInterfaceReferenceProperties{ Primary: to.Ptr(true), }, }}, }, OSProfile: &armcompute.OSProfile{ AdminPassword: to.Ptr("{your-password}"), AdminUsername: to.Ptr("{your-username}"), ComputerName: to.Ptr("myVM"), WindowsConfiguration: &armcompute.WindowsConfiguration{ EnableAutomaticUpdates: to.Ptr(true), PatchSettings: &armcompute.PatchSettings{ PatchMode: to.Ptr(armcompute.WindowsVMGuestPatchModeManual), }, ProvisionVMAgent: to.Ptr(true), }, }, StorageProfile: &armcompute.StorageProfile{ ImageReference: &armcompute.ImageReference{ Offer: to.Ptr("WindowsServer"), Publisher: to.Ptr("MicrosoftWindowsServer"), SKU: to.Ptr("2016-Datacenter"), Version: to.Ptr("latest"), }, OSDisk: &armcompute.OSDisk{ Name: to.Ptr("myVMosdisk"), Caching: to.Ptr(armcompute.CachingTypesReadWrite), CreateOption: to.Ptr(armcompute.DiskCreateOptionTypesFromImage), ManagedDisk: &armcompute.ManagedDiskParameters{ StorageAccountType: to.Ptr(armcompute.StorageAccountTypesPremiumLRS), }, }, }, }, }, &armcompute.VirtualMachinesClientBeginCreateOrUpdateOptions{IfMatch: nil, IfNoneMatch: nil, }) if err != nil { log.Fatalf("failed to finish the request: %v", err) } res, err := poller.PollUntilDone(ctx, nil) if err != nil { log.Fatalf("failed to pull the result: %v", err) } // You could use response here. We use blank identifier for just demo purposes. _ = res // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. // res.VirtualMachine = armcompute.VirtualMachine{ // Name: to.Ptr("myVM"), // Type: to.Ptr("Microsoft.Compute/virtualMachines"), // ID: to.Ptr("/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/virtualMachines/myVM"), // Location: to.Ptr("westus"), // Properties: &armcompute.VirtualMachineProperties{ // HardwareProfile: &armcompute.HardwareProfile{ // VMSize: to.Ptr(armcompute.VirtualMachineSizeTypesStandardDS1V2), // }, // NetworkProfile: &armcompute.NetworkProfile{ // NetworkInterfaces: []*armcompute.NetworkInterfaceReference{ // { // ID: to.Ptr("/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/networkInterfaces/nsgExistingNic"), // Properties: &armcompute.NetworkInterfaceReferenceProperties{ // Primary: to.Ptr(true), // }, // }}, // }, // OSProfile: &armcompute.OSProfile{ // AdminUsername: to.Ptr("{your-username}"), // ComputerName: to.Ptr("myVM"), // Secrets: []*armcompute.VaultSecretGroup{ // }, // WindowsConfiguration: &armcompute.WindowsConfiguration{ // EnableAutomaticUpdates: to.Ptr(true), // PatchSettings: &armcompute.PatchSettings{ // PatchMode: to.Ptr(armcompute.WindowsVMGuestPatchModeManual), // }, // ProvisionVMAgent: to.Ptr(true), // }, // }, // ProvisioningState: to.Ptr("Succeeded"), // StorageProfile: &armcompute.StorageProfile{ // DataDisks: []*armcompute.DataDisk{ // }, // ImageReference: &armcompute.ImageReference{ // Offer: to.Ptr("WindowsServer"), // Publisher: to.Ptr("MicrosoftWindowsServer"), // SKU: to.Ptr("2016-Datacenter"), // Version: to.Ptr("latest"), // }, // OSDisk: &armcompute.OSDisk{ // Name: to.Ptr("myVMosdisk"), // Caching: to.Ptr(armcompute.CachingTypesReadWrite), // CreateOption: to.Ptr(armcompute.DiskCreateOptionTypesFromImage), // ManagedDisk: &armcompute.ManagedDiskParameters{ // StorageAccountType: to.Ptr(armcompute.StorageAccountTypesPremiumLRS), // }, // OSType: to.Ptr(armcompute.OperatingSystemTypesWindows), // }, // }, // VMID: to.Ptr("a149cd25-409f-41af-8088-275f5486bc93"), // }, // }
Output:
Example (CreateAWindowsVmWithPatchSettingsPatchModeAndAssessmentModeSetToAutomaticByPlatform) ¶
Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/92de53a5f1e0e03c94b40475d2135d97148ed014/specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-03-01/examples/virtualMachineExamples/VirtualMachine_Create_WindowsVmWithPatchSettingModesOfAutomaticByPlatform.json
cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() clientFactory, err := armcompute.NewClientFactory("<subscription-id>", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } poller, err := clientFactory.NewVirtualMachinesClient().BeginCreateOrUpdate(ctx, "myResourceGroup", "myVM", armcompute.VirtualMachine{ Location: to.Ptr("westus"), Properties: &armcompute.VirtualMachineProperties{ HardwareProfile: &armcompute.HardwareProfile{ VMSize: to.Ptr(armcompute.VirtualMachineSizeTypesStandardD1V2), }, NetworkProfile: &armcompute.NetworkProfile{ NetworkInterfaces: []*armcompute.NetworkInterfaceReference{ { ID: to.Ptr("/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/networkInterfaces/{existing-nic-name}"), Properties: &armcompute.NetworkInterfaceReferenceProperties{ Primary: to.Ptr(true), }, }}, }, OSProfile: &armcompute.OSProfile{ AdminPassword: to.Ptr("{your-password}"), AdminUsername: to.Ptr("{your-username}"), ComputerName: to.Ptr("myVM"), WindowsConfiguration: &armcompute.WindowsConfiguration{ EnableAutomaticUpdates: to.Ptr(true), PatchSettings: &armcompute.PatchSettings{ AssessmentMode: to.Ptr(armcompute.WindowsPatchAssessmentModeAutomaticByPlatform), PatchMode: to.Ptr(armcompute.WindowsVMGuestPatchModeAutomaticByPlatform), }, ProvisionVMAgent: to.Ptr(true), }, }, StorageProfile: &armcompute.StorageProfile{ ImageReference: &armcompute.ImageReference{ Offer: to.Ptr("WindowsServer"), Publisher: to.Ptr("MicrosoftWindowsServer"), SKU: to.Ptr("2016-Datacenter"), Version: to.Ptr("latest"), }, OSDisk: &armcompute.OSDisk{ Name: to.Ptr("myVMosdisk"), Caching: to.Ptr(armcompute.CachingTypesReadWrite), CreateOption: to.Ptr(armcompute.DiskCreateOptionTypesFromImage), ManagedDisk: &armcompute.ManagedDiskParameters{ StorageAccountType: to.Ptr(armcompute.StorageAccountTypesPremiumLRS), }, }, }, }, }, &armcompute.VirtualMachinesClientBeginCreateOrUpdateOptions{IfMatch: nil, IfNoneMatch: nil, }) if err != nil { log.Fatalf("failed to finish the request: %v", err) } res, err := poller.PollUntilDone(ctx, nil) if err != nil { log.Fatalf("failed to pull the result: %v", err) } // You could use response here. We use blank identifier for just demo purposes. _ = res // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. // res.VirtualMachine = armcompute.VirtualMachine{ // Name: to.Ptr("myVM"), // Type: to.Ptr("Microsoft.Compute/virtualMachines"), // ID: to.Ptr("/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/virtualMachines/myVM"), // Location: to.Ptr("westus"), // Properties: &armcompute.VirtualMachineProperties{ // HardwareProfile: &armcompute.HardwareProfile{ // VMSize: to.Ptr(armcompute.VirtualMachineSizeTypesStandardDS1V2), // }, // NetworkProfile: &armcompute.NetworkProfile{ // NetworkInterfaces: []*armcompute.NetworkInterfaceReference{ // { // ID: to.Ptr("/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/networkInterfaces/nsgExistingNic"), // Properties: &armcompute.NetworkInterfaceReferenceProperties{ // Primary: to.Ptr(true), // }, // }}, // }, // OSProfile: &armcompute.OSProfile{ // AdminUsername: to.Ptr("{your-username}"), // ComputerName: to.Ptr("myVM"), // Secrets: []*armcompute.VaultSecretGroup{ // }, // WindowsConfiguration: &armcompute.WindowsConfiguration{ // EnableAutomaticUpdates: to.Ptr(true), // PatchSettings: &armcompute.PatchSettings{ // AssessmentMode: to.Ptr(armcompute.WindowsPatchAssessmentModeAutomaticByPlatform), // PatchMode: to.Ptr(armcompute.WindowsVMGuestPatchModeAutomaticByPlatform), // }, // ProvisionVMAgent: to.Ptr(true), // }, // }, // ProvisioningState: to.Ptr("Succeeded"), // StorageProfile: &armcompute.StorageProfile{ // DataDisks: []*armcompute.DataDisk{ // }, // ImageReference: &armcompute.ImageReference{ // Offer: to.Ptr("WindowsServer"), // Publisher: to.Ptr("MicrosoftWindowsServer"), // SKU: to.Ptr("2016-Datacenter"), // Version: to.Ptr("latest"), // }, // OSDisk: &armcompute.OSDisk{ // Name: to.Ptr("myVMosdisk"), // Caching: to.Ptr(armcompute.CachingTypesReadWrite), // CreateOption: to.Ptr(armcompute.DiskCreateOptionTypesFromImage), // ManagedDisk: &armcompute.ManagedDiskParameters{ // StorageAccountType: to.Ptr(armcompute.StorageAccountTypesPremiumLRS), // }, // OSType: to.Ptr(armcompute.OperatingSystemTypesWindows), // }, // }, // VMID: to.Ptr("a149cd25-409f-41af-8088-275f5486bc93"), // }, // }
Output:
Example (CreateOrUpdateAVmWithCapacityReservation) ¶
Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/92de53a5f1e0e03c94b40475d2135d97148ed014/specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-03-01/examples/virtualMachineExamples/VirtualMachine_Create_WithCapacityReservation.json
cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() clientFactory, err := armcompute.NewClientFactory("<subscription-id>", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } poller, err := clientFactory.NewVirtualMachinesClient().BeginCreateOrUpdate(ctx, "myResourceGroup", "myVM", armcompute.VirtualMachine{ Location: to.Ptr("westus"), Plan: &armcompute.Plan{ Name: to.Ptr("windows2016"), Product: to.Ptr("windows-data-science-vm"), Publisher: to.Ptr("microsoft-ads"), }, Properties: &armcompute.VirtualMachineProperties{ CapacityReservation: &armcompute.CapacityReservationProfile{ CapacityReservationGroup: &armcompute.SubResource{ ID: to.Ptr("/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/CapacityReservationGroups/{crgName}"), }, }, HardwareProfile: &armcompute.HardwareProfile{ VMSize: to.Ptr(armcompute.VirtualMachineSizeTypesStandardDS1V2), }, NetworkProfile: &armcompute.NetworkProfile{ NetworkInterfaces: []*armcompute.NetworkInterfaceReference{ { ID: to.Ptr("/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/networkInterfaces/{existing-nic-name}"), Properties: &armcompute.NetworkInterfaceReferenceProperties{ Primary: to.Ptr(true), }, }}, }, OSProfile: &armcompute.OSProfile{ AdminPassword: to.Ptr("{your-password}"), AdminUsername: to.Ptr("{your-username}"), ComputerName: to.Ptr("myVM"), }, StorageProfile: &armcompute.StorageProfile{ ImageReference: &armcompute.ImageReference{ Offer: to.Ptr("windows-data-science-vm"), Publisher: to.Ptr("microsoft-ads"), SKU: to.Ptr("windows2016"), Version: to.Ptr("latest"), }, OSDisk: &armcompute.OSDisk{ Name: to.Ptr("myVMosdisk"), Caching: to.Ptr(armcompute.CachingTypesReadOnly), CreateOption: to.Ptr(armcompute.DiskCreateOptionTypesFromImage), ManagedDisk: &armcompute.ManagedDiskParameters{ StorageAccountType: to.Ptr(armcompute.StorageAccountTypesStandardLRS), }, }, }, }, }, &armcompute.VirtualMachinesClientBeginCreateOrUpdateOptions{IfMatch: nil, IfNoneMatch: nil, }) if err != nil { log.Fatalf("failed to finish the request: %v", err) } res, err := poller.PollUntilDone(ctx, nil) if err != nil { log.Fatalf("failed to pull the result: %v", err) } // You could use response here. We use blank identifier for just demo purposes. _ = res // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. // res.VirtualMachine = armcompute.VirtualMachine{ // Name: to.Ptr("myVM"), // Type: to.Ptr("Microsoft.Compute/virtualMachines"), // ID: to.Ptr("/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/virtualMachines/myVM"), // Location: to.Ptr("westus"), // Plan: &armcompute.Plan{ // Name: to.Ptr("standard-data-science-vm"), // Product: to.Ptr("standard-data-science-vm"), // Publisher: to.Ptr("microsoft-ads"), // }, // Properties: &armcompute.VirtualMachineProperties{ // CapacityReservation: &armcompute.CapacityReservationProfile{ // CapacityReservationGroup: &armcompute.SubResource{ // ID: to.Ptr("/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/CapacityReservationGroups/{crgName}"), // }, // }, // HardwareProfile: &armcompute.HardwareProfile{ // VMSize: to.Ptr(armcompute.VirtualMachineSizeTypesStandardDS1V2), // }, // NetworkProfile: &armcompute.NetworkProfile{ // NetworkInterfaces: []*armcompute.NetworkInterfaceReference{ // { // ID: to.Ptr("/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/networkInterfaces/nsgExistingNic"), // Properties: &armcompute.NetworkInterfaceReferenceProperties{ // Primary: to.Ptr(true), // }, // }}, // }, // OSProfile: &armcompute.OSProfile{ // AdminUsername: to.Ptr("{your-username}"), // ComputerName: to.Ptr("myVM"), // Secrets: []*armcompute.VaultSecretGroup{ // }, // WindowsConfiguration: &armcompute.WindowsConfiguration{ // EnableAutomaticUpdates: to.Ptr(true), // ProvisionVMAgent: to.Ptr(true), // }, // }, // ProvisioningState: to.Ptr("Succeeded"), // StorageProfile: &armcompute.StorageProfile{ // DataDisks: []*armcompute.DataDisk{ // }, // ImageReference: &armcompute.ImageReference{ // Offer: to.Ptr("standard-data-science-vm"), // Publisher: to.Ptr("microsoft-ads"), // SKU: to.Ptr("standard-data-science-vm"), // Version: to.Ptr("latest"), // }, // OSDisk: &armcompute.OSDisk{ // Name: to.Ptr("myVMosdisk"), // Caching: to.Ptr(armcompute.CachingTypesReadOnly), // CreateOption: to.Ptr(armcompute.DiskCreateOptionTypesFromImage), // ManagedDisk: &armcompute.ManagedDiskParameters{ // StorageAccountType: to.Ptr(armcompute.StorageAccountTypesStandardLRS), // }, // OSType: to.Ptr(armcompute.OperatingSystemTypesWindows), // }, // }, // VMID: to.Ptr("5c0d55a7-c407-4ed6-bf7d-ddb810267c85"), // }, // }
Output:
func (*VirtualMachinesClient) BeginDeallocate ¶
func (client *VirtualMachinesClient) BeginDeallocate(ctx context.Context, resourceGroupName string, vmName string, options *VirtualMachinesClientBeginDeallocateOptions) (*runtime.Poller[VirtualMachinesClientDeallocateResponse], error)
BeginDeallocate - Shuts down the virtual machine and releases the compute resources. You are not billed for the compute resources that this virtual machine uses. If the operation fails it returns an *azcore.ResponseError type.
Generated from API version 2024-03-01
- resourceGroupName - The name of the resource group.
- vmName - The name of the virtual machine.
- options - VirtualMachinesClientBeginDeallocateOptions contains the optional parameters for the VirtualMachinesClient.BeginDeallocate method.
Example (VirtualMachineDeallocateMaximumSetGen) ¶
Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/92de53a5f1e0e03c94b40475d2135d97148ed014/specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-03-01/examples/virtualMachineExamples/VirtualMachine_Deallocate_MaximumSet_Gen.json
cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() clientFactory, err := armcompute.NewClientFactory("<subscription-id>", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } poller, err := clientFactory.NewVirtualMachinesClient().BeginDeallocate(ctx, "rgcompute", "aaaaaaaaaa", &armcompute.VirtualMachinesClientBeginDeallocateOptions{Hibernate: to.Ptr(true)}) if err != nil { log.Fatalf("failed to finish the request: %v", err) } _, err = poller.PollUntilDone(ctx, nil) if err != nil { log.Fatalf("failed to pull the result: %v", err) }
Output:
Example (VirtualMachineDeallocateMinimumSetGen) ¶
Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/92de53a5f1e0e03c94b40475d2135d97148ed014/specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-03-01/examples/virtualMachineExamples/VirtualMachine_Deallocate_MinimumSet_Gen.json
cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() clientFactory, err := armcompute.NewClientFactory("<subscription-id>", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } poller, err := clientFactory.NewVirtualMachinesClient().BeginDeallocate(ctx, "rgcompute", "aaaaaaaaaaaaaaaa", &armcompute.VirtualMachinesClientBeginDeallocateOptions{Hibernate: nil}) if err != nil { log.Fatalf("failed to finish the request: %v", err) } _, err = poller.PollUntilDone(ctx, nil) if err != nil { log.Fatalf("failed to pull the result: %v", err) }
Output:
func (*VirtualMachinesClient) BeginDelete ¶
func (client *VirtualMachinesClient) BeginDelete(ctx context.Context, resourceGroupName string, vmName string, options *VirtualMachinesClientBeginDeleteOptions) (*runtime.Poller[VirtualMachinesClientDeleteResponse], error)
BeginDelete - The operation to delete a virtual machine. If the operation fails it returns an *azcore.ResponseError type.
Generated from API version 2024-03-01
- resourceGroupName - The name of the resource group.
- vmName - The name of the virtual machine.
- options - VirtualMachinesClientBeginDeleteOptions contains the optional parameters for the VirtualMachinesClient.BeginDelete method.
Example ¶
Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/92de53a5f1e0e03c94b40475d2135d97148ed014/specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-03-01/examples/virtualMachineExamples/VirtualMachine_Delete_Force.json
cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() clientFactory, err := armcompute.NewClientFactory("<subscription-id>", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } poller, err := clientFactory.NewVirtualMachinesClient().BeginDelete(ctx, "myResourceGroup", "myVM", &armcompute.VirtualMachinesClientBeginDeleteOptions{ForceDeletion: to.Ptr(true)}) if err != nil { log.Fatalf("failed to finish the request: %v", err) } _, err = poller.PollUntilDone(ctx, nil) if err != nil { log.Fatalf("failed to pull the result: %v", err) }
Output:
func (*VirtualMachinesClient) BeginInstallPatches ¶
func (client *VirtualMachinesClient) BeginInstallPatches(ctx context.Context, resourceGroupName string, vmName string, installPatchesInput VirtualMachineInstallPatchesParameters, options *VirtualMachinesClientBeginInstallPatchesOptions) (*runtime.Poller[VirtualMachinesClientInstallPatchesResponse], error)
BeginInstallPatches - Installs patches on the VM. If the operation fails it returns an *azcore.ResponseError type.
Generated from API version 2024-03-01
- resourceGroupName - The name of the resource group.
- vmName - The name of the virtual machine.
- installPatchesInput - Input for InstallPatches as directly received by the API
- options - VirtualMachinesClientBeginInstallPatchesOptions contains the optional parameters for the VirtualMachinesClient.BeginInstallPatches method.
Example ¶
Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/92de53a5f1e0e03c94b40475d2135d97148ed014/specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-03-01/examples/virtualMachineExamples/VirtualMachine_InstallPatches.json
cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() clientFactory, err := armcompute.NewClientFactory("<subscription-id>", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } poller, err := clientFactory.NewVirtualMachinesClient().BeginInstallPatches(ctx, "myResourceGroupName", "myVMName", armcompute.VirtualMachineInstallPatchesParameters{ MaximumDuration: to.Ptr("PT4H"), RebootSetting: to.Ptr(armcompute.VMGuestPatchRebootSettingIfRequired), WindowsParameters: &armcompute.WindowsParameters{ ClassificationsToInclude: []*armcompute.VMGuestPatchClassificationWindows{ to.Ptr(armcompute.VMGuestPatchClassificationWindowsCritical), to.Ptr(armcompute.VMGuestPatchClassificationWindowsSecurity)}, MaxPatchPublishDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-11-19T02:36:43.053Z"); return t }()), }, }, nil) if err != nil { log.Fatalf("failed to finish the request: %v", err) } res, err := poller.PollUntilDone(ctx, nil) if err != nil { log.Fatalf("failed to pull the result: %v", err) } // You could use response here. We use blank identifier for just demo purposes. _ = res // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. // res.VirtualMachineInstallPatchesResult = armcompute.VirtualMachineInstallPatchesResult{ // ExcludedPatchCount: to.Ptr[int32](0), // FailedPatchCount: to.Ptr[int32](0), // InstallationActivityID: to.Ptr("68f8b292-dfc2-4646-9781-33cc88631968"), // InstalledPatchCount: to.Ptr[int32](3), // MaintenanceWindowExceeded: to.Ptr(false), // NotSelectedPatchCount: to.Ptr[int32](0), // Patches: []*armcompute.PatchInstallationDetail{ // { // Name: to.Ptr("Definition Update for Windows Defender Antivirus - KB2267602 (Definition 1.279.1373.0)"), // Classifications: []*string{ // to.Ptr("Definition Updates")}, // InstallationState: to.Ptr(armcompute.PatchInstallationStateInstalled), // KbID: to.Ptr("2267602"), // PatchID: to.Ptr("35428702-5784-4ba4-a6e0-5222258b5411"), // Version: to.Ptr(""), // }, // { // Name: to.Ptr("Windows Malicious Software Removal Tool x64 - October 2018 (KB890830)"), // Classifications: []*string{ // to.Ptr("Update Rollups")}, // InstallationState: to.Ptr(armcompute.PatchInstallationStatePending), // KbID: to.Ptr("890830"), // PatchID: to.Ptr("39f9cdd1-795c-4d0e-8c0a-73ab3f31746d"), // Version: to.Ptr(""), // }}, // PendingPatchCount: to.Ptr[int32](2), // RebootStatus: to.Ptr(armcompute.VMGuestPatchRebootStatusCompleted), // StartDateTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-04-24T21:02:04.255Z"); return t}()), // Status: to.Ptr(armcompute.PatchOperationStatusSucceeded), // }
Output:
func (*VirtualMachinesClient) BeginPerformMaintenance ¶
func (client *VirtualMachinesClient) BeginPerformMaintenance(ctx context.Context, resourceGroupName string, vmName string, options *VirtualMachinesClientBeginPerformMaintenanceOptions) (*runtime.Poller[VirtualMachinesClientPerformMaintenanceResponse], error)
BeginPerformMaintenance - The operation to perform maintenance on a virtual machine. If the operation fails it returns an *azcore.ResponseError type.
Generated from API version 2024-03-01
- resourceGroupName - The name of the resource group.
- vmName - The name of the virtual machine.
- options - VirtualMachinesClientBeginPerformMaintenanceOptions contains the optional parameters for the VirtualMachinesClient.BeginPerformMaintenance method.
Example (VirtualMachinePerformMaintenanceMaximumSetGen) ¶
Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/92de53a5f1e0e03c94b40475d2135d97148ed014/specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-03-01/examples/virtualMachineExamples/VirtualMachine_PerformMaintenance_MaximumSet_Gen.json
cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() clientFactory, err := armcompute.NewClientFactory("<subscription-id>", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } poller, err := clientFactory.NewVirtualMachinesClient().BeginPerformMaintenance(ctx, "rgcompute", "aaaaaaa", nil) if err != nil { log.Fatalf("failed to finish the request: %v", err) } _, err = poller.PollUntilDone(ctx, nil) if err != nil { log.Fatalf("failed to pull the result: %v", err) }
Output:
Example (VirtualMachinePerformMaintenanceMinimumSetGen) ¶
Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/92de53a5f1e0e03c94b40475d2135d97148ed014/specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-03-01/examples/virtualMachineExamples/VirtualMachine_PerformMaintenance_MinimumSet_Gen.json
cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() clientFactory, err := armcompute.NewClientFactory("<subscription-id>", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } poller, err := clientFactory.NewVirtualMachinesClient().BeginPerformMaintenance(ctx, "rgcompute", "aaaaaaaaaa", nil) if err != nil { log.Fatalf("failed to finish the request: %v", err) } _, err = poller.PollUntilDone(ctx, nil) if err != nil { log.Fatalf("failed to pull the result: %v", err) }
Output:
func (*VirtualMachinesClient) BeginPowerOff ¶
func (client *VirtualMachinesClient) BeginPowerOff(ctx context.Context, resourceGroupName string, vmName string, options *VirtualMachinesClientBeginPowerOffOptions) (*runtime.Poller[VirtualMachinesClientPowerOffResponse], error)
BeginPowerOff - The operation to power off (stop) a virtual machine. The virtual machine can be restarted with the same provisioned resources. You are still charged for this virtual machine. If the operation fails it returns an *azcore.ResponseError type.
Generated from API version 2024-03-01
- resourceGroupName - The name of the resource group.
- vmName - The name of the virtual machine.
- options - VirtualMachinesClientBeginPowerOffOptions contains the optional parameters for the VirtualMachinesClient.BeginPowerOff method.
Example (VirtualMachinePowerOffMaximumSetGen) ¶
Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/92de53a5f1e0e03c94b40475d2135d97148ed014/specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-03-01/examples/virtualMachineExamples/VirtualMachine_PowerOff_MaximumSet_Gen.json
cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() clientFactory, err := armcompute.NewClientFactory("<subscription-id>", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } poller, err := clientFactory.NewVirtualMachinesClient().BeginPowerOff(ctx, "rgcompute", "aaaaaaaaaaaaaaaaaaaaaaaaaaa", &armcompute.VirtualMachinesClientBeginPowerOffOptions{SkipShutdown: to.Ptr(true)}) if err != nil { log.Fatalf("failed to finish the request: %v", err) } _, err = poller.PollUntilDone(ctx, nil) if err != nil { log.Fatalf("failed to pull the result: %v", err) }
Output:
Example (VirtualMachinePowerOffMinimumSetGen) ¶
Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/92de53a5f1e0e03c94b40475d2135d97148ed014/specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-03-01/examples/virtualMachineExamples/VirtualMachine_PowerOff_MinimumSet_Gen.json
cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() clientFactory, err := armcompute.NewClientFactory("<subscription-id>", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } poller, err := clientFactory.NewVirtualMachinesClient().BeginPowerOff(ctx, "rgcompute", "aaaaaaaaaaaaaaaaaa", &armcompute.VirtualMachinesClientBeginPowerOffOptions{SkipShutdown: nil}) if err != nil { log.Fatalf("failed to finish the request: %v", err) } _, err = poller.PollUntilDone(ctx, nil) if err != nil { log.Fatalf("failed to pull the result: %v", err) }
Output:
func (*VirtualMachinesClient) BeginReapply ¶
func (client *VirtualMachinesClient) BeginReapply(ctx context.Context, resourceGroupName string, vmName string, options *VirtualMachinesClientBeginReapplyOptions) (*runtime.Poller[VirtualMachinesClientReapplyResponse], error)
BeginReapply - The operation to reapply a virtual machine's state. If the operation fails it returns an *azcore.ResponseError type.
Generated from API version 2024-03-01
- resourceGroupName - The name of the resource group.
- vmName - The name of the virtual machine.
- options - VirtualMachinesClientBeginReapplyOptions contains the optional parameters for the VirtualMachinesClient.BeginReapply method.
Example ¶
Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/92de53a5f1e0e03c94b40475d2135d97148ed014/specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-03-01/examples/virtualMachineExamples/VirtualMachine_Reapply.json
cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() clientFactory, err := armcompute.NewClientFactory("<subscription-id>", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } poller, err := clientFactory.NewVirtualMachinesClient().BeginReapply(ctx, "ResourceGroup", "VMName", nil) if err != nil { log.Fatalf("failed to finish the request: %v", err) } _, err = poller.PollUntilDone(ctx, nil) if err != nil { log.Fatalf("failed to pull the result: %v", err) }
Output:
func (*VirtualMachinesClient) BeginRedeploy ¶
func (client *VirtualMachinesClient) BeginRedeploy(ctx context.Context, resourceGroupName string, vmName string, options *VirtualMachinesClientBeginRedeployOptions) (*runtime.Poller[VirtualMachinesClientRedeployResponse], error)
BeginRedeploy - Shuts down the virtual machine, moves it to a new node, and powers it back on. If the operation fails it returns an *azcore.ResponseError type.
Generated from API version 2024-03-01
- resourceGroupName - The name of the resource group.
- vmName - The name of the virtual machine.
- options - VirtualMachinesClientBeginRedeployOptions contains the optional parameters for the VirtualMachinesClient.BeginRedeploy method.
Example (VirtualMachineRedeployMaximumSetGen) ¶
Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/92de53a5f1e0e03c94b40475d2135d97148ed014/specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-03-01/examples/virtualMachineExamples/VirtualMachine_Redeploy_MaximumSet_Gen.json
cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() clientFactory, err := armcompute.NewClientFactory("<subscription-id>", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } poller, err := clientFactory.NewVirtualMachinesClient().BeginRedeploy(ctx, "rgcompute", "a", nil) if err != nil { log.Fatalf("failed to finish the request: %v", err) } _, err = poller.PollUntilDone(ctx, nil) if err != nil { log.Fatalf("failed to pull the result: %v", err) }
Output:
Example (VirtualMachineRedeployMinimumSetGen) ¶
Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/92de53a5f1e0e03c94b40475d2135d97148ed014/specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-03-01/examples/virtualMachineExamples/VirtualMachine_Redeploy_MinimumSet_Gen.json
cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() clientFactory, err := armcompute.NewClientFactory("<subscription-id>", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } poller, err := clientFactory.NewVirtualMachinesClient().BeginRedeploy(ctx, "rgcompute", "aaaaaaaaaaaaaaa", nil) if err != nil { log.Fatalf("failed to finish the request: %v", err) } _, err = poller.PollUntilDone(ctx, nil) if err != nil { log.Fatalf("failed to pull the result: %v", err) }
Output:
func (*VirtualMachinesClient) BeginReimage ¶
func (client *VirtualMachinesClient) BeginReimage(ctx context.Context, resourceGroupName string, vmName string, options *VirtualMachinesClientBeginReimageOptions) (*runtime.Poller[VirtualMachinesClientReimageResponse], error)
BeginReimage - Reimages (upgrade the operating system) a virtual machine which don't have a ephemeral OS disk, for virtual machines who have a ephemeral OS disk the virtual machine is reset to initial state. NOTE: The retaining of old OS disk depends on the value of deleteOption of OS disk. If deleteOption is detach, the old OS disk will be preserved after reimage. If deleteOption is delete, the old OS disk will be deleted after reimage. The deleteOption of the OS disk should be updated accordingly before performing the reimage. If the operation fails it returns an *azcore.ResponseError type.
Generated from API version 2024-03-01
- resourceGroupName - The name of the resource group.
- vmName - The name of the virtual machine.
- options - VirtualMachinesClientBeginReimageOptions contains the optional parameters for the VirtualMachinesClient.BeginReimage method.
Example (ReimageANonEphemeralVirtualMachine) ¶
Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/92de53a5f1e0e03c94b40475d2135d97148ed014/specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-03-01/examples/virtualMachineExamples/VirtualMachine_Reimage_NonEphemeralVMs.json
cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() clientFactory, err := armcompute.NewClientFactory("<subscription-id>", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } poller, err := clientFactory.NewVirtualMachinesClient().BeginReimage(ctx, "myResourceGroup", "myVMName", &armcompute.VirtualMachinesClientBeginReimageOptions{Parameters: &armcompute.VirtualMachineReimageParameters{ ExactVersion: to.Ptr("aaaaaa"), OSProfile: &armcompute.OSProfileProvisioningData{ AdminPassword: to.Ptr("{your-password}"), CustomData: to.Ptr("{your-custom-data}"), }, TempDisk: to.Ptr(true), }, }) if err != nil { log.Fatalf("failed to finish the request: %v", err) } _, err = poller.PollUntilDone(ctx, nil) if err != nil { log.Fatalf("failed to pull the result: %v", err) }
Output:
Example (ReimageAVirtualMachine) ¶
Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/92de53a5f1e0e03c94b40475d2135d97148ed014/specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-03-01/examples/virtualMachineExamples/VirtualMachine_Reimage.json
cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() clientFactory, err := armcompute.NewClientFactory("<subscription-id>", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } poller, err := clientFactory.NewVirtualMachinesClient().BeginReimage(ctx, "myResourceGroup", "myVMName", &armcompute.VirtualMachinesClientBeginReimageOptions{Parameters: &armcompute.VirtualMachineReimageParameters{ TempDisk: to.Ptr(true), }, }) if err != nil { log.Fatalf("failed to finish the request: %v", err) } _, err = poller.PollUntilDone(ctx, nil) if err != nil { log.Fatalf("failed to pull the result: %v", err) }
Output:
func (*VirtualMachinesClient) BeginRestart ¶
func (client *VirtualMachinesClient) BeginRestart(ctx context.Context, resourceGroupName string, vmName string, options *VirtualMachinesClientBeginRestartOptions) (*runtime.Poller[VirtualMachinesClientRestartResponse], error)
BeginRestart - The operation to restart a virtual machine. If the operation fails it returns an *azcore.ResponseError type.
Generated from API version 2024-03-01
- resourceGroupName - The name of the resource group.
- vmName - The name of the virtual machine.
- options - VirtualMachinesClientBeginRestartOptions contains the optional parameters for the VirtualMachinesClient.BeginRestart method.
Example (VirtualMachineRestartMaximumSetGen) ¶
Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/92de53a5f1e0e03c94b40475d2135d97148ed014/specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-03-01/examples/virtualMachineExamples/VirtualMachine_Restart_MaximumSet_Gen.json
cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() clientFactory, err := armcompute.NewClientFactory("<subscription-id>", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } poller, err := clientFactory.NewVirtualMachinesClient().BeginRestart(ctx, "rgcompute", "aaaaaaaaaaaaaaaaaaaa", nil) if err != nil { log.Fatalf("failed to finish the request: %v", err) } _, err = poller.PollUntilDone(ctx, nil) if err != nil { log.Fatalf("failed to pull the result: %v", err) }
Output:
Example (VirtualMachineRestartMinimumSetGen) ¶
Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/92de53a5f1e0e03c94b40475d2135d97148ed014/specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-03-01/examples/virtualMachineExamples/VirtualMachine_Restart_MinimumSet_Gen.json
cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() clientFactory, err := armcompute.NewClientFactory("<subscription-id>", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } poller, err := clientFactory.NewVirtualMachinesClient().BeginRestart(ctx, "rgcompute", "aaa", nil) if err != nil { log.Fatalf("failed to finish the request: %v", err) } _, err = poller.PollUntilDone(ctx, nil) if err != nil { log.Fatalf("failed to pull the result: %v", err) }
Output:
func (*VirtualMachinesClient) BeginRunCommand ¶
func (client *VirtualMachinesClient) BeginRunCommand(ctx context.Context, resourceGroupName string, vmName string, parameters RunCommandInput, options *VirtualMachinesClientBeginRunCommandOptions) (*runtime.Poller[VirtualMachinesClientRunCommandResponse], error)
BeginRunCommand - Run command on the VM. If the operation fails it returns an *azcore.ResponseError type.
Generated from API version 2024-03-01
- resourceGroupName - The name of the resource group.
- vmName - The name of the virtual machine.
- parameters - Parameters supplied to the Run command operation.
- options - VirtualMachinesClientBeginRunCommandOptions contains the optional parameters for the VirtualMachinesClient.BeginRunCommand method.
Example ¶
Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/92de53a5f1e0e03c94b40475d2135d97148ed014/specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-03-01/examples/runCommandExamples/VirtualMachineRunCommand.json
cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() clientFactory, err := armcompute.NewClientFactory("<subscription-id>", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } poller, err := clientFactory.NewVirtualMachinesClient().BeginRunCommand(ctx, "crptestar98131", "vm3036", armcompute.RunCommandInput{ CommandID: to.Ptr("RunPowerShellScript"), }, nil) if err != nil { log.Fatalf("failed to finish the request: %v", err) } res, err := poller.PollUntilDone(ctx, nil) if err != nil { log.Fatalf("failed to pull the result: %v", err) } // You could use response here. We use blank identifier for just demo purposes. _ = res // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. // res.RunCommandResult = armcompute.RunCommandResult{ // Value: []*armcompute.InstanceViewStatus{ // { // Code: to.Ptr("ComponentStatus/StdOut/succeeded"), // DisplayStatus: to.Ptr("Provisioning succeeded"), // Level: to.Ptr(armcompute.StatusLevelTypesInfo), // Message: to.Ptr("This is a sample script with parameters value1 value2"), // }, // { // Code: to.Ptr("ComponentStatus/StdErr/succeeded"), // DisplayStatus: to.Ptr("Provisioning succeeded"), // Level: to.Ptr(armcompute.StatusLevelTypesInfo), // Message: to.Ptr(""), // }}, // }
Output:
func (*VirtualMachinesClient) BeginStart ¶
func (client *VirtualMachinesClient) BeginStart(ctx context.Context, resourceGroupName string, vmName string, options *VirtualMachinesClientBeginStartOptions) (*runtime.Poller[VirtualMachinesClientStartResponse], error)
BeginStart - The operation to start a virtual machine. If the operation fails it returns an *azcore.ResponseError type.
Generated from API version 2024-03-01
- resourceGroupName - The name of the resource group.
- vmName - The name of the virtual machine.
- options - VirtualMachinesClientBeginStartOptions contains the optional parameters for the VirtualMachinesClient.BeginStart method.
Example (VirtualMachineStartMaximumSetGen) ¶
Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/92de53a5f1e0e03c94b40475d2135d97148ed014/specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-03-01/examples/virtualMachineExamples/VirtualMachine_Start_MaximumSet_Gen.json
cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() clientFactory, err := armcompute.NewClientFactory("<subscription-id>", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } poller, err := clientFactory.NewVirtualMachinesClient().BeginStart(ctx, "rgcompute", "aaaaaaaaaaaaaaaaaaaa", nil) if err != nil { log.Fatalf("failed to finish the request: %v", err) } _, err = poller.PollUntilDone(ctx, nil) if err != nil { log.Fatalf("failed to pull the result: %v", err) }
Output:
Example (VirtualMachineStartMinimumSetGen) ¶
Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/92de53a5f1e0e03c94b40475d2135d97148ed014/specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-03-01/examples/virtualMachineExamples/VirtualMachine_Start_MinimumSet_Gen.json
cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() clientFactory, err := armcompute.NewClientFactory("<subscription-id>", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } poller, err := clientFactory.NewVirtualMachinesClient().BeginStart(ctx, "rgcompute", "aaaaa", nil) if err != nil { log.Fatalf("failed to finish the request: %v", err) } _, err = poller.PollUntilDone(ctx, nil) if err != nil { log.Fatalf("failed to pull the result: %v", err) }
Output:
func (*VirtualMachinesClient) BeginUpdate ¶
func (client *VirtualMachinesClient) BeginUpdate(ctx context.Context, resourceGroupName string, vmName string, parameters VirtualMachineUpdate, options *VirtualMachinesClientBeginUpdateOptions) (*runtime.Poller[VirtualMachinesClientUpdateResponse], error)
BeginUpdate - The operation to update a virtual machine. If the operation fails it returns an *azcore.ResponseError type.
Generated from API version 2024-03-01
- resourceGroupName - The name of the resource group.
- vmName - The name of the virtual machine.
- parameters - Parameters supplied to the Update Virtual Machine operation.
- options - VirtualMachinesClientBeginUpdateOptions contains the optional parameters for the VirtualMachinesClient.BeginUpdate method.
Example (UpdateAVmByDetachingDataDisk) ¶
Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/92de53a5f1e0e03c94b40475d2135d97148ed014/specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-03-01/examples/virtualMachineExamples/VirtualMachine_Update_DetachDataDiskUsingToBeDetachedProperty.json
cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() clientFactory, err := armcompute.NewClientFactory("<subscription-id>", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } poller, err := clientFactory.NewVirtualMachinesClient().BeginUpdate(ctx, "myResourceGroup", "myVM", armcompute.VirtualMachineUpdate{ Properties: &armcompute.VirtualMachineProperties{ HardwareProfile: &armcompute.HardwareProfile{ VMSize: to.Ptr(armcompute.VirtualMachineSizeTypesStandardD2V2), }, NetworkProfile: &armcompute.NetworkProfile{ NetworkInterfaces: []*armcompute.NetworkInterfaceReference{ { ID: to.Ptr("/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/networkInterfaces/{existing-nic-name}"), Properties: &armcompute.NetworkInterfaceReferenceProperties{ Primary: to.Ptr(true), }, }}, }, OSProfile: &armcompute.OSProfile{ AdminPassword: to.Ptr("{your-password}"), AdminUsername: to.Ptr("{your-username}"), ComputerName: to.Ptr("myVM"), }, StorageProfile: &armcompute.StorageProfile{ DataDisks: []*armcompute.DataDisk{ { CreateOption: to.Ptr(armcompute.DiskCreateOptionTypesEmpty), DiskSizeGB: to.Ptr[int32](1023), Lun: to.Ptr[int32](0), ToBeDetached: to.Ptr(true), }, { CreateOption: to.Ptr(armcompute.DiskCreateOptionTypesEmpty), DiskSizeGB: to.Ptr[int32](1023), Lun: to.Ptr[int32](1), ToBeDetached: to.Ptr(false), }}, ImageReference: &armcompute.ImageReference{ Offer: to.Ptr("WindowsServer"), Publisher: to.Ptr("MicrosoftWindowsServer"), SKU: to.Ptr("2016-Datacenter"), Version: to.Ptr("latest"), }, OSDisk: &armcompute.OSDisk{ Name: to.Ptr("myVMosdisk"), Caching: to.Ptr(armcompute.CachingTypesReadWrite), CreateOption: to.Ptr(armcompute.DiskCreateOptionTypesFromImage), ManagedDisk: &armcompute.ManagedDiskParameters{ StorageAccountType: to.Ptr(armcompute.StorageAccountTypesStandardLRS), }, }, }, }, }, &armcompute.VirtualMachinesClientBeginUpdateOptions{IfMatch: nil, IfNoneMatch: nil, }) if err != nil { log.Fatalf("failed to finish the request: %v", err) } res, err := poller.PollUntilDone(ctx, nil) if err != nil { log.Fatalf("failed to pull the result: %v", err) } // You could use response here. We use blank identifier for just demo purposes. _ = res // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. // res.VirtualMachine = armcompute.VirtualMachine{ // Name: to.Ptr("myVM"), // Type: to.Ptr("Microsoft.Compute/virtualMachines"), // ID: to.Ptr("/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/virtualMachines/myVM"), // Location: to.Ptr("westus"), // Properties: &armcompute.VirtualMachineProperties{ // HardwareProfile: &armcompute.HardwareProfile{ // VMSize: to.Ptr(armcompute.VirtualMachineSizeTypesStandardD2V2), // }, // NetworkProfile: &armcompute.NetworkProfile{ // NetworkInterfaces: []*armcompute.NetworkInterfaceReference{ // { // ID: to.Ptr("/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/networkInterfaces/nsgExistingNic"), // Properties: &armcompute.NetworkInterfaceReferenceProperties{ // Primary: to.Ptr(true), // }, // }}, // }, // OSProfile: &armcompute.OSProfile{ // AdminUsername: to.Ptr("{your-username}"), // ComputerName: to.Ptr("myVM"), // Secrets: []*armcompute.VaultSecretGroup{ // }, // WindowsConfiguration: &armcompute.WindowsConfiguration{ // EnableAutomaticUpdates: to.Ptr(true), // ProvisionVMAgent: to.Ptr(true), // }, // }, // ProvisioningState: to.Ptr("Succeeded"), // StorageProfile: &armcompute.StorageProfile{ // DataDisks: []*armcompute.DataDisk{ // { // Caching: to.Ptr(armcompute.CachingTypesNone), // CreateOption: to.Ptr(armcompute.DiskCreateOptionTypesEmpty), // DiskSizeGB: to.Ptr[int32](1023), // Lun: to.Ptr[int32](0), // ManagedDisk: &armcompute.ManagedDiskParameters{ // StorageAccountType: to.Ptr(armcompute.StorageAccountTypesStandardLRS), // }, // ToBeDetached: to.Ptr(true), // }, // { // Caching: to.Ptr(armcompute.CachingTypesNone), // CreateOption: to.Ptr(armcompute.DiskCreateOptionTypesEmpty), // DiskSizeGB: to.Ptr[int32](1023), // Lun: to.Ptr[int32](1), // ManagedDisk: &armcompute.ManagedDiskParameters{ // StorageAccountType: to.Ptr(armcompute.StorageAccountTypesStandardLRS), // }, // ToBeDetached: to.Ptr(false), // }}, // ImageReference: &armcompute.ImageReference{ // Offer: to.Ptr("WindowsServer"), // Publisher: to.Ptr("MicrosoftWindowsServer"), // SKU: to.Ptr("2016-Datacenter"), // Version: to.Ptr("latest"), // }, // OSDisk: &armcompute.OSDisk{ // Name: to.Ptr("myVMosdisk"), // Caching: to.Ptr(armcompute.CachingTypesReadWrite), // CreateOption: to.Ptr(armcompute.DiskCreateOptionTypesFromImage), // ManagedDisk: &armcompute.ManagedDiskParameters{ // StorageAccountType: to.Ptr(armcompute.StorageAccountTypesStandardLRS), // }, // OSType: to.Ptr(armcompute.OperatingSystemTypesWindows), // }, // }, // VMID: to.Ptr("3906fef9-a1e5-4b83-a8a8-540858b41df0"), // }, // }
Output:
Example (UpdateAVmByForceDetachingDataDisk) ¶
Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/92de53a5f1e0e03c94b40475d2135d97148ed014/specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-03-01/examples/virtualMachineExamples/VirtualMachine_Update_ForceDetachDataDisk.json
cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() clientFactory, err := armcompute.NewClientFactory("<subscription-id>", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } poller, err := clientFactory.NewVirtualMachinesClient().BeginUpdate(ctx, "myResourceGroup", "myVM", armcompute.VirtualMachineUpdate{ Properties: &armcompute.VirtualMachineProperties{ HardwareProfile: &armcompute.HardwareProfile{ VMSize: to.Ptr(armcompute.VirtualMachineSizeTypesStandardD2V2), }, NetworkProfile: &armcompute.NetworkProfile{ NetworkInterfaces: []*armcompute.NetworkInterfaceReference{ { ID: to.Ptr("/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/networkInterfaces/{existing-nic-name}"), Properties: &armcompute.NetworkInterfaceReferenceProperties{ Primary: to.Ptr(true), }, }}, }, OSProfile: &armcompute.OSProfile{ AdminPassword: to.Ptr("{your-password}"), AdminUsername: to.Ptr("{your-username}"), ComputerName: to.Ptr("myVM"), }, StorageProfile: &armcompute.StorageProfile{ DataDisks: []*armcompute.DataDisk{ { CreateOption: to.Ptr(armcompute.DiskCreateOptionTypesEmpty), DetachOption: to.Ptr(armcompute.DiskDetachOptionTypesForceDetach), DiskSizeGB: to.Ptr[int32](1023), Lun: to.Ptr[int32](0), ToBeDetached: to.Ptr(true), }, { CreateOption: to.Ptr(armcompute.DiskCreateOptionTypesEmpty), DiskSizeGB: to.Ptr[int32](1023), Lun: to.Ptr[int32](1), ToBeDetached: to.Ptr(false), }}, ImageReference: &armcompute.ImageReference{ Offer: to.Ptr("WindowsServer"), Publisher: to.Ptr("MicrosoftWindowsServer"), SKU: to.Ptr("2016-Datacenter"), Version: to.Ptr("latest"), }, OSDisk: &armcompute.OSDisk{ Name: to.Ptr("myVMosdisk"), Caching: to.Ptr(armcompute.CachingTypesReadWrite), CreateOption: to.Ptr(armcompute.DiskCreateOptionTypesFromImage), ManagedDisk: &armcompute.ManagedDiskParameters{ StorageAccountType: to.Ptr(armcompute.StorageAccountTypesStandardLRS), }, }, }, }, }, &armcompute.VirtualMachinesClientBeginUpdateOptions{IfMatch: nil, IfNoneMatch: nil, }) if err != nil { log.Fatalf("failed to finish the request: %v", err) } res, err := poller.PollUntilDone(ctx, nil) if err != nil { log.Fatalf("failed to pull the result: %v", err) } // You could use response here. We use blank identifier for just demo purposes. _ = res // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. // res.VirtualMachine = armcompute.VirtualMachine{ // Name: to.Ptr("myVM"), // Type: to.Ptr("Microsoft.Compute/virtualMachines"), // ID: to.Ptr("/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/virtualMachines/myVM"), // Location: to.Ptr("westus"), // Properties: &armcompute.VirtualMachineProperties{ // HardwareProfile: &armcompute.HardwareProfile{ // VMSize: to.Ptr(armcompute.VirtualMachineSizeTypesStandardD2V2), // }, // NetworkProfile: &armcompute.NetworkProfile{ // NetworkInterfaces: []*armcompute.NetworkInterfaceReference{ // { // ID: to.Ptr("/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/networkInterfaces/nsgExistingNic"), // Properties: &armcompute.NetworkInterfaceReferenceProperties{ // Primary: to.Ptr(true), // }, // }}, // }, // OSProfile: &armcompute.OSProfile{ // AdminUsername: to.Ptr("{your-username}"), // ComputerName: to.Ptr("myVM"), // Secrets: []*armcompute.VaultSecretGroup{ // }, // WindowsConfiguration: &armcompute.WindowsConfiguration{ // EnableAutomaticUpdates: to.Ptr(true), // ProvisionVMAgent: to.Ptr(true), // }, // }, // ProvisioningState: to.Ptr("Succeeded"), // StorageProfile: &armcompute.StorageProfile{ // DataDisks: []*armcompute.DataDisk{ // { // Caching: to.Ptr(armcompute.CachingTypesNone), // CreateOption: to.Ptr(armcompute.DiskCreateOptionTypesEmpty), // DetachOption: to.Ptr(armcompute.DiskDetachOptionTypesForceDetach), // DiskSizeGB: to.Ptr[int32](1023), // Lun: to.Ptr[int32](0), // ManagedDisk: &armcompute.ManagedDiskParameters{ // StorageAccountType: to.Ptr(armcompute.StorageAccountTypesStandardLRS), // }, // ToBeDetached: to.Ptr(true), // }, // { // Caching: to.Ptr(armcompute.CachingTypesNone), // CreateOption: to.Ptr(armcompute.DiskCreateOptionTypesEmpty), // DiskSizeGB: to.Ptr[int32](1023), // Lun: to.Ptr[int32](1), // ManagedDisk: &armcompute.ManagedDiskParameters{ // StorageAccountType: to.Ptr(armcompute.StorageAccountTypesStandardLRS), // }, // ToBeDetached: to.Ptr(false), // }}, // ImageReference: &armcompute.ImageReference{ // Offer: to.Ptr("WindowsServer"), // Publisher: to.Ptr("MicrosoftWindowsServer"), // SKU: to.Ptr("2016-Datacenter"), // Version: to.Ptr("latest"), // }, // OSDisk: &armcompute.OSDisk{ // Name: to.Ptr("myVMosdisk"), // Caching: to.Ptr(armcompute.CachingTypesReadWrite), // CreateOption: to.Ptr(armcompute.DiskCreateOptionTypesFromImage), // ManagedDisk: &armcompute.ManagedDiskParameters{ // StorageAccountType: to.Ptr(armcompute.StorageAccountTypesStandardLRS), // }, // OSType: to.Ptr(armcompute.OperatingSystemTypesWindows), // }, // }, // VMID: to.Ptr("3906fef9-a1e5-4b83-a8a8-540858b41df0"), // }, // }
Output:
func (*VirtualMachinesClient) Generalize ¶
func (client *VirtualMachinesClient) Generalize(ctx context.Context, resourceGroupName string, vmName string, options *VirtualMachinesClientGeneralizeOptions) (VirtualMachinesClientGeneralizeResponse, error)
Generalize - Sets the OS state of the virtual machine to generalized. It is recommended to sysprep the virtual machine before performing this operation. For Windows, please refer to Create a managed image of a generalized VM in Azure [https://docs.microsoft.com/azure/virtual-machines/windows/capture-image-resource]. For Linux, please refer to How to create an image of a virtual machine or VHD [https://docs.microsoft.com/azure/virtual-machines/linux/capture-image]. If the operation fails it returns an *azcore.ResponseError type.
Generated from API version 2024-03-01
- resourceGroupName - The name of the resource group.
- vmName - The name of the virtual machine.
- options - VirtualMachinesClientGeneralizeOptions contains the optional parameters for the VirtualMachinesClient.Generalize method.
Example ¶
Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/92de53a5f1e0e03c94b40475d2135d97148ed014/specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-03-01/examples/virtualMachineExamples/VirtualMachine_Generalize.json
cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() clientFactory, err := armcompute.NewClientFactory("<subscription-id>", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } _, err = clientFactory.NewVirtualMachinesClient().Generalize(ctx, "myResourceGroup", "myVMName", nil) if err != nil { log.Fatalf("failed to finish the request: %v", err) }
Output:
func (*VirtualMachinesClient) Get ¶
func (client *VirtualMachinesClient) Get(ctx context.Context, resourceGroupName string, vmName string, options *VirtualMachinesClientGetOptions) (VirtualMachinesClientGetResponse, error)
Get - Retrieves information about the model view or the instance view of a virtual machine. If the operation fails it returns an *azcore.ResponseError type.
Generated from API version 2024-03-01
- resourceGroupName - The name of the resource group.
- vmName - The name of the virtual machine.
- options - VirtualMachinesClientGetOptions contains the optional parameters for the VirtualMachinesClient.Get method.
Example (GetAVirtualMachine) ¶
Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/92de53a5f1e0e03c94b40475d2135d97148ed014/specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-03-01/examples/virtualMachineExamples/VirtualMachine_Get.json
cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() clientFactory, err := armcompute.NewClientFactory("<subscription-id>", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } res, err := clientFactory.NewVirtualMachinesClient().Get(ctx, "myResourceGroup", "myVM", &armcompute.VirtualMachinesClientGetOptions{Expand: to.Ptr(armcompute.InstanceViewTypesUserData)}) if err != nil { log.Fatalf("failed to finish the request: %v", err) } // You could use response here. We use blank identifier for just demo purposes. _ = res // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. // res.VirtualMachine = armcompute.VirtualMachine{ // Name: to.Ptr("myVM"), // Type: to.Ptr("Microsoft.Compute/virtualMachines"), // ID: to.Ptr("/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/virtualMachines/myVM"), // Location: to.Ptr("West US"), // Tags: map[string]*string{ // "myTag1": to.Ptr("tagValue1"), // }, // Etag: to.Ptr("\"1\""), // ManagedBy: to.Ptr("/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/virtualMachineScaleSets/{MyVmss}"), // Properties: &armcompute.VirtualMachineProperties{ // ApplicationProfile: &armcompute.ApplicationProfile{ // GalleryApplications: []*armcompute.VMGalleryApplication{ // { // ConfigurationReference: to.Ptr("https://mystorageaccount.blob.core.windows.net/configurations/settings.config"), // Order: to.Ptr[int32](1), // PackageReferenceID: to.Ptr("/subscriptions/32c17a9e-aa7b-4ba5-a45b-e324116b6fdb/resourceGroups/myresourceGroupName2/providers/Microsoft.Compute/galleries/myGallery1/applications/MyApplication1/versions/1.0"), // Tags: to.Ptr("myTag1"), // }, // { // PackageReferenceID: to.Ptr("/subscriptions/32c17a9e-aa7b-4ba5-a45b-e324116b6fdg/resourceGroups/myresourceGroupName3/providers/Microsoft.Compute/galleries/myGallery2/applications/MyApplication2/versions/1.1"), // }}, // }, // AvailabilitySet: &armcompute.SubResource{ // ID: to.Ptr("/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/availabilitySets/my-AvailabilitySet"), // }, // DiagnosticsProfile: &armcompute.DiagnosticsProfile{ // BootDiagnostics: &armcompute.BootDiagnostics{ // Enabled: to.Ptr(true), // StorageURI: to.Ptr("http://{myStorageAccount}.blob.core.windows.net"), // }, // }, // ExtensionsTimeBudget: to.Ptr("PT50M"), // HardwareProfile: &armcompute.HardwareProfile{ // VMSize: to.Ptr(armcompute.VirtualMachineSizeTypesStandardDS3V2), // }, // NetworkProfile: &armcompute.NetworkProfile{ // NetworkInterfaces: []*armcompute.NetworkInterfaceReference{ // { // ID: to.Ptr("/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/networkInterfaces/{myNIC}"), // }}, // }, // OSProfile: &armcompute.OSProfile{ // AdminUsername: to.Ptr("admin"), // ComputerName: to.Ptr("myVM"), // Secrets: []*armcompute.VaultSecretGroup{ // }, // WindowsConfiguration: &armcompute.WindowsConfiguration{ // EnableAutomaticUpdates: to.Ptr(false), // ProvisionVMAgent: to.Ptr(true), // }, // }, // ProvisioningState: to.Ptr("Succeeded"), // ProximityPlacementGroup: &armcompute.SubResource{ // ID: to.Ptr("/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/proximityPlacementGroups/my-ppg01"), // }, // StorageProfile: &armcompute.StorageProfile{ // DataDisks: []*armcompute.DataDisk{ // { // Name: to.Ptr("myDataDisk0"), // Caching: to.Ptr(armcompute.CachingTypesReadWrite), // CreateOption: to.Ptr(armcompute.DiskCreateOptionTypesEmpty), // DiskSizeGB: to.Ptr[int32](30), // Lun: to.Ptr[int32](0), // ManagedDisk: &armcompute.ManagedDiskParameters{ // ID: to.Ptr("/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/disks/myDataDisk0"), // StorageAccountType: to.Ptr(armcompute.StorageAccountTypesPremiumLRS), // }, // }, // { // Name: to.Ptr("myDataDisk1"), // Caching: to.Ptr(armcompute.CachingTypesReadWrite), // CreateOption: to.Ptr(armcompute.DiskCreateOptionTypesAttach), // DiskSizeGB: to.Ptr[int32](100), // Lun: to.Ptr[int32](1), // ManagedDisk: &armcompute.ManagedDiskParameters{ // ID: to.Ptr("/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/disks/myDataDisk1"), // StorageAccountType: to.Ptr(armcompute.StorageAccountTypesPremiumLRS), // }, // }}, // ImageReference: &armcompute.ImageReference{ // Offer: to.Ptr("WindowsServer"), // Publisher: to.Ptr("MicrosoftWindowsServer"), // SKU: to.Ptr("2016-Datacenter"), // Version: to.Ptr("latest"), // }, // OSDisk: &armcompute.OSDisk{ // Name: to.Ptr("myOsDisk"), // Caching: to.Ptr(armcompute.CachingTypesReadWrite), // CreateOption: to.Ptr(armcompute.DiskCreateOptionTypesFromImage), // DiskSizeGB: to.Ptr[int32](30), // ManagedDisk: &armcompute.ManagedDiskParameters{ // ID: to.Ptr("/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/disks/myOsDisk"), // StorageAccountType: to.Ptr(armcompute.StorageAccountTypesPremiumLRS), // }, // OSType: to.Ptr(armcompute.OperatingSystemTypesWindows), // }, // }, // TimeCreated: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-06-27T01:02:38.313Z"); return t}()), // UserData: to.Ptr("RXhhbXBsZSBVc2VyRGF0YQ=="), // VMID: to.Ptr("0f47b100-583c-48e3-a4c0-aefc2c9bbcc1"), // }, // Resources: []*armcompute.VirtualMachineExtension{ // { // Name: to.Ptr("CustomScriptExtension-DSC"), // Type: to.Ptr("Microsoft.Compute/virtualMachines/extensions"), // ID: to.Ptr("/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/virtualMachines/myVM/extensions/CustomScriptExtension-DSC"), // Location: to.Ptr("west us"), // Tags: map[string]*string{ // "displayName": to.Ptr("CustomScriptExtension-DSC"), // }, // Properties: &armcompute.VirtualMachineExtensionProperties{ // Type: to.Ptr("CustomScriptExtension"), // AutoUpgradeMinorVersion: to.Ptr(true), // ProvisioningState: to.Ptr("Succeeded"), // Publisher: to.Ptr("Microsoft.Compute"), // Settings: map[string]any{ // }, // TypeHandlerVersion: to.Ptr("1.9"), // }, // }}, // }
Output:
Example (GetAVirtualMachinePlacedOnADedicatedHostGroupThroughAutomaticPlacement) ¶
Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/92de53a5f1e0e03c94b40475d2135d97148ed014/specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-03-01/examples/virtualMachineExamples/VirtualMachine_Get_AutoPlacedOnDedicatedHostGroup.json
cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() clientFactory, err := armcompute.NewClientFactory("<subscription-id>", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } res, err := clientFactory.NewVirtualMachinesClient().Get(ctx, "myResourceGroup", "myVM", &armcompute.VirtualMachinesClientGetOptions{Expand: nil}) if err != nil { log.Fatalf("failed to finish the request: %v", err) } // You could use response here. We use blank identifier for just demo purposes. _ = res // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. // res.VirtualMachine = armcompute.VirtualMachine{ // Name: to.Ptr("myVM"), // Type: to.Ptr("Microsoft.Compute/virtualMachines"), // ID: to.Ptr("/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/virtualMachines/myVM"), // Location: to.Ptr("West US"), // Tags: map[string]*string{ // "myTag1": to.Ptr("tagValue1"), // }, // Properties: &armcompute.VirtualMachineProperties{ // HardwareProfile: &armcompute.HardwareProfile{ // VMSize: to.Ptr(armcompute.VirtualMachineSizeTypesStandardD2SV3), // }, // HostGroup: &armcompute.SubResource{ // ID: to.Ptr("/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/hostGroups/myHostGroup"), // }, // NetworkProfile: &armcompute.NetworkProfile{ // NetworkInterfaces: []*armcompute.NetworkInterfaceReference{ // { // ID: to.Ptr("/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/networkInterfaces/{myNIC}"), // }}, // }, // OSProfile: &armcompute.OSProfile{ // AdminUsername: to.Ptr("admin"), // ComputerName: to.Ptr("myVM"), // Secrets: []*armcompute.VaultSecretGroup{ // }, // WindowsConfiguration: &armcompute.WindowsConfiguration{ // EnableAutomaticUpdates: to.Ptr(false), // ProvisionVMAgent: to.Ptr(true), // }, // }, // ProvisioningState: to.Ptr("Succeeded"), // StorageProfile: &armcompute.StorageProfile{ // DataDisks: []*armcompute.DataDisk{ // }, // ImageReference: &armcompute.ImageReference{ // Offer: to.Ptr("WindowsServer"), // Publisher: to.Ptr("MicrosoftWindowsServer"), // SKU: to.Ptr("2016-Datacenter"), // Version: to.Ptr("latest"), // }, // OSDisk: &armcompute.OSDisk{ // Name: to.Ptr("myOsDisk"), // Caching: to.Ptr(armcompute.CachingTypesReadWrite), // CreateOption: to.Ptr(armcompute.DiskCreateOptionTypesFromImage), // DiskSizeGB: to.Ptr[int32](30), // ManagedDisk: &armcompute.ManagedDiskParameters{ // ID: to.Ptr("/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/disks/myOsDisk"), // StorageAccountType: to.Ptr(armcompute.StorageAccountTypesPremiumLRS), // }, // OSType: to.Ptr(armcompute.OperatingSystemTypesWindows), // }, // }, // VMID: to.Ptr("0f47b100-583c-48e3-a4c0-aefc2c9bbcc1"), // }, // }
Output:
Example (GetAVirtualMachineWithDiskControllerTypeProperties) ¶
Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/92de53a5f1e0e03c94b40475d2135d97148ed014/specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-03-01/examples/virtualMachineExamples/VirtualMachine_Get_WithDiskControllerType.json
cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() clientFactory, err := armcompute.NewClientFactory("<subscription-id>", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } res, err := clientFactory.NewVirtualMachinesClient().Get(ctx, "myResourceGroup", "myVM", &armcompute.VirtualMachinesClientGetOptions{Expand: to.Ptr(armcompute.InstanceViewTypesUserData)}) if err != nil { log.Fatalf("failed to finish the request: %v", err) } // You could use response here. We use blank identifier for just demo purposes. _ = res // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. // res.VirtualMachine = armcompute.VirtualMachine{ // Name: to.Ptr("myVM"), // Type: to.Ptr("Microsoft.Compute/virtualMachines"), // ID: to.Ptr("/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/virtualMachines/myVM"), // Location: to.Ptr("West US"), // Tags: map[string]*string{ // "myTag1": to.Ptr("tagValue1"), // }, // Properties: &armcompute.VirtualMachineProperties{ // ApplicationProfile: &armcompute.ApplicationProfile{ // GalleryApplications: []*armcompute.VMGalleryApplication{ // { // ConfigurationReference: to.Ptr("https://mystorageaccount.blob.core.windows.net/configurations/settings.config"), // Order: to.Ptr[int32](1), // PackageReferenceID: to.Ptr("/subscriptions/32c17a9e-aa7b-4ba5-a45b-e324116b6fdb/resourceGroups/myresourceGroupName2/providers/Microsoft.Compute/galleries/myGallery1/applications/MyApplication1/versions/1.0"), // Tags: to.Ptr("myTag1"), // }, // { // PackageReferenceID: to.Ptr("/subscriptions/32c17a9e-aa7b-4ba5-a45b-e324116b6fdg/resourceGroups/myresourceGroupName3/providers/Microsoft.Compute/galleries/myGallery2/applications/MyApplication2/versions/1.1"), // }}, // }, // AvailabilitySet: &armcompute.SubResource{ // ID: to.Ptr("/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/availabilitySets/my-AvailabilitySet"), // }, // DiagnosticsProfile: &armcompute.DiagnosticsProfile{ // BootDiagnostics: &armcompute.BootDiagnostics{ // Enabled: to.Ptr(true), // StorageURI: to.Ptr("http://{myStorageAccount}.blob.core.windows.net"), // }, // }, // ExtensionsTimeBudget: to.Ptr("PT50M"), // HardwareProfile: &armcompute.HardwareProfile{ // VMSize: to.Ptr(armcompute.VirtualMachineSizeTypesStandardDS3V2), // VMSizeProperties: &armcompute.VMSizeProperties{ // VCPUsAvailable: to.Ptr[int32](1), // VCPUsPerCore: to.Ptr[int32](1), // }, // }, // NetworkProfile: &armcompute.NetworkProfile{ // NetworkInterfaces: []*armcompute.NetworkInterfaceReference{ // { // ID: to.Ptr("/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/networkInterfaces/{myNIC}"), // }}, // }, // OSProfile: &armcompute.OSProfile{ // AdminUsername: to.Ptr("admin"), // ComputerName: to.Ptr("myVM"), // Secrets: []*armcompute.VaultSecretGroup{ // }, // WindowsConfiguration: &armcompute.WindowsConfiguration{ // EnableAutomaticUpdates: to.Ptr(false), // ProvisionVMAgent: to.Ptr(true), // }, // }, // ProvisioningState: to.Ptr("Succeeded"), // StorageProfile: &armcompute.StorageProfile{ // DataDisks: []*armcompute.DataDisk{ // { // Name: to.Ptr("myDataDisk0"), // Caching: to.Ptr(armcompute.CachingTypesReadWrite), // CreateOption: to.Ptr(armcompute.DiskCreateOptionTypesEmpty), // DiskSizeGB: to.Ptr[int32](30), // Lun: to.Ptr[int32](0), // ManagedDisk: &armcompute.ManagedDiskParameters{ // ID: to.Ptr("/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/disks/myDataDisk0"), // StorageAccountType: to.Ptr(armcompute.StorageAccountTypesPremiumLRS), // }, // }, // { // Name: to.Ptr("myDataDisk1"), // Caching: to.Ptr(armcompute.CachingTypesReadWrite), // CreateOption: to.Ptr(armcompute.DiskCreateOptionTypesAttach), // DiskSizeGB: to.Ptr[int32](100), // Lun: to.Ptr[int32](1), // ManagedDisk: &armcompute.ManagedDiskParameters{ // ID: to.Ptr("/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/disks/myDataDisk1"), // StorageAccountType: to.Ptr(armcompute.StorageAccountTypesPremiumLRS), // }, // }}, // DiskControllerType: to.Ptr(armcompute.DiskControllerTypesNVMe), // ImageReference: &armcompute.ImageReference{ // Offer: to.Ptr("WindowsServer"), // Publisher: to.Ptr("MicrosoftWindowsServer"), // SKU: to.Ptr("2016-Datacenter"), // Version: to.Ptr("latest"), // }, // OSDisk: &armcompute.OSDisk{ // Name: to.Ptr("myOsDisk"), // Caching: to.Ptr(armcompute.CachingTypesReadWrite), // CreateOption: to.Ptr(armcompute.DiskCreateOptionTypesFromImage), // DiskSizeGB: to.Ptr[int32](30), // ManagedDisk: &armcompute.ManagedDiskParameters{ // ID: to.Ptr("/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/disks/myOsDisk"), // StorageAccountType: to.Ptr(armcompute.StorageAccountTypesPremiumLRS), // }, // OSType: to.Ptr(armcompute.OperatingSystemTypesWindows), // }, // }, // UserData: to.Ptr("RXhhbXBsZSBVc2VyRGF0YQ=="), // VMID: to.Ptr("0f47b100-583c-48e3-a4c0-aefc2c9bbcc1"), // }, // Resources: []*armcompute.VirtualMachineExtension{ // { // Name: to.Ptr("CustomScriptExtension-DSC"), // Type: to.Ptr("Microsoft.Compute/virtualMachines/extensions"), // ID: to.Ptr("/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/virtualMachines/myVM/extensions/CustomScriptExtension-DSC"), // Location: to.Ptr("west us"), // Tags: map[string]*string{ // "displayName": to.Ptr("CustomScriptExtension-DSC"), // }, // Properties: &armcompute.VirtualMachineExtensionProperties{ // Type: to.Ptr("CustomScriptExtension"), // AutoUpgradeMinorVersion: to.Ptr(true), // ProvisioningState: to.Ptr("Succeeded"), // Publisher: to.Ptr("Microsoft.Compute"), // Settings: map[string]any{ // }, // TypeHandlerVersion: to.Ptr("1.9"), // }, // }}, // }
Output:
Example (GetAVirtualMachineWithVmSizeProperties) ¶
Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/92de53a5f1e0e03c94b40475d2135d97148ed014/specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-03-01/examples/virtualMachineExamples/VirtualMachine_Get_WithVMSizeProperties.json
cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() clientFactory, err := armcompute.NewClientFactory("<subscription-id>", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } res, err := clientFactory.NewVirtualMachinesClient().Get(ctx, "myResourceGroup", "myVM", &armcompute.VirtualMachinesClientGetOptions{Expand: nil}) if err != nil { log.Fatalf("failed to finish the request: %v", err) } // You could use response here. We use blank identifier for just demo purposes. _ = res // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. // res.VirtualMachine = armcompute.VirtualMachine{ // Name: to.Ptr("myVM"), // Type: to.Ptr("Microsoft.Compute/virtualMachines"), // ID: to.Ptr("/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/virtualMachines/myVM"), // Location: to.Ptr("West US"), // Tags: map[string]*string{ // "myTag1": to.Ptr("tagValue1"), // }, // Properties: &armcompute.VirtualMachineProperties{ // ApplicationProfile: &armcompute.ApplicationProfile{ // GalleryApplications: []*armcompute.VMGalleryApplication{ // { // ConfigurationReference: to.Ptr("https://mystorageaccount.blob.core.windows.net/configurations/settings.config"), // Order: to.Ptr[int32](1), // PackageReferenceID: to.Ptr("/subscriptions/32c17a9e-aa7b-4ba5-a45b-e324116b6fdb/resourceGroups/myresourceGroupName2/providers/Microsoft.Compute/galleries/myGallery1/applications/MyApplication1/versions/1.0"), // Tags: to.Ptr("myTag1"), // }, // { // PackageReferenceID: to.Ptr("/subscriptions/32c17a9e-aa7b-4ba5-a45b-e324116b6fdg/resourceGroups/myresourceGroupName3/providers/Microsoft.Compute/galleries/myGallery2/applications/MyApplication2/versions/1.1"), // }}, // }, // AvailabilitySet: &armcompute.SubResource{ // ID: to.Ptr("/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/availabilitySets/my-AvailabilitySet"), // }, // DiagnosticsProfile: &armcompute.DiagnosticsProfile{ // BootDiagnostics: &armcompute.BootDiagnostics{ // Enabled: to.Ptr(true), // StorageURI: to.Ptr("http://{myStorageAccount}.blob.core.windows.net"), // }, // }, // ExtensionsTimeBudget: to.Ptr("PT50M"), // HardwareProfile: &armcompute.HardwareProfile{ // VMSize: to.Ptr(armcompute.VirtualMachineSizeTypesStandardDS3V2), // VMSizeProperties: &armcompute.VMSizeProperties{ // VCPUsAvailable: to.Ptr[int32](1), // VCPUsPerCore: to.Ptr[int32](1), // }, // }, // NetworkProfile: &armcompute.NetworkProfile{ // NetworkInterfaces: []*armcompute.NetworkInterfaceReference{ // { // ID: to.Ptr("/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/networkInterfaces/{myNIC}"), // }}, // }, // OSProfile: &armcompute.OSProfile{ // AdminUsername: to.Ptr("admin"), // ComputerName: to.Ptr("myVM"), // Secrets: []*armcompute.VaultSecretGroup{ // }, // WindowsConfiguration: &armcompute.WindowsConfiguration{ // EnableAutomaticUpdates: to.Ptr(false), // ProvisionVMAgent: to.Ptr(true), // }, // }, // ProvisioningState: to.Ptr("Succeeded"), // StorageProfile: &armcompute.StorageProfile{ // DataDisks: []*armcompute.DataDisk{ // { // Name: to.Ptr("myDataDisk0"), // Caching: to.Ptr(armcompute.CachingTypesReadWrite), // CreateOption: to.Ptr(armcompute.DiskCreateOptionTypesEmpty), // DiskSizeGB: to.Ptr[int32](30), // Lun: to.Ptr[int32](0), // ManagedDisk: &armcompute.ManagedDiskParameters{ // ID: to.Ptr("/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/disks/myDataDisk0"), // StorageAccountType: to.Ptr(armcompute.StorageAccountTypesPremiumLRS), // }, // }, // { // Name: to.Ptr("myDataDisk1"), // Caching: to.Ptr(armcompute.CachingTypesReadWrite), // CreateOption: to.Ptr(armcompute.DiskCreateOptionTypesAttach), // DiskSizeGB: to.Ptr[int32](100), // Lun: to.Ptr[int32](1), // ManagedDisk: &armcompute.ManagedDiskParameters{ // ID: to.Ptr("/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/disks/myDataDisk1"), // StorageAccountType: to.Ptr(armcompute.StorageAccountTypesPremiumLRS), // }, // }}, // ImageReference: &armcompute.ImageReference{ // Offer: to.Ptr("WindowsServer"), // Publisher: to.Ptr("MicrosoftWindowsServer"), // SKU: to.Ptr("2016-Datacenter"), // Version: to.Ptr("latest"), // }, // OSDisk: &armcompute.OSDisk{ // Name: to.Ptr("myOsDisk"), // Caching: to.Ptr(armcompute.CachingTypesReadWrite), // CreateOption: to.Ptr(armcompute.DiskCreateOptionTypesFromImage), // DiskSizeGB: to.Ptr[int32](30), // ManagedDisk: &armcompute.ManagedDiskParameters{ // ID: to.Ptr("/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/disks/myOsDisk"), // StorageAccountType: to.Ptr(armcompute.StorageAccountTypesPremiumLRS), // }, // OSType: to.Ptr(armcompute.OperatingSystemTypesWindows), // }, // }, // UserData: to.Ptr("RXhhbXBsZSBVc2VyRGF0YQ=="), // VMID: to.Ptr("0f47b100-583c-48e3-a4c0-aefc2c9bbcc1"), // }, // Resources: []*armcompute.VirtualMachineExtension{ // { // Name: to.Ptr("CustomScriptExtension-DSC"), // Type: to.Ptr("Microsoft.Compute/virtualMachines/extensions"), // ID: to.Ptr("/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/virtualMachines/myVM/extensions/CustomScriptExtension-DSC"), // Location: to.Ptr("west us"), // Tags: map[string]*string{ // "displayName": to.Ptr("CustomScriptExtension-DSC"), // }, // Properties: &armcompute.VirtualMachineExtensionProperties{ // Type: to.Ptr("CustomScriptExtension"), // AutoUpgradeMinorVersion: to.Ptr(true), // ProvisioningState: to.Ptr("Succeeded"), // Publisher: to.Ptr("Microsoft.Compute"), // Settings: map[string]any{ // }, // TypeHandlerVersion: to.Ptr("1.9"), // }, // }}, // }
Output:
func (*VirtualMachinesClient) InstanceView ¶
func (client *VirtualMachinesClient) InstanceView(ctx context.Context, resourceGroupName string, vmName string, options *VirtualMachinesClientInstanceViewOptions) (VirtualMachinesClientInstanceViewResponse, error)
InstanceView - Retrieves information about the run-time state of a virtual machine. If the operation fails it returns an *azcore.ResponseError type.
Generated from API version 2024-03-01
- resourceGroupName - The name of the resource group.
- vmName - The name of the virtual machine.
- options - VirtualMachinesClientInstanceViewOptions contains the optional parameters for the VirtualMachinesClient.InstanceView method.
Example (GetInstanceViewOfAVirtualMachinePlacedOnADedicatedHostGroupThroughAutomaticPlacement) ¶
Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/92de53a5f1e0e03c94b40475d2135d97148ed014/specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-03-01/examples/virtualMachineExamples/VirtualMachine_Get_InstanceViewAutoPlacedOnDedicatedHostGroup.json
cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() clientFactory, err := armcompute.NewClientFactory("<subscription-id>", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } res, err := clientFactory.NewVirtualMachinesClient().InstanceView(ctx, "myResourceGroup", "myVM", nil) if err != nil { log.Fatalf("failed to finish the request: %v", err) } // You could use response here. We use blank identifier for just demo purposes. _ = res // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. // res.VirtualMachineInstanceView = armcompute.VirtualMachineInstanceView{ // AssignedHost: to.Ptr("/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/hostGroups/myHostGroup/hosts/myHost"), // ComputerName: to.Ptr("myVM"), // Disks: []*armcompute.DiskInstanceView{ // { // Name: to.Ptr("myOsDisk"), // Statuses: []*armcompute.InstanceViewStatus{ // { // Code: to.Ptr("ProvisioningState/succeeded"), // DisplayStatus: to.Ptr("Provisioning succeeded"), // Level: to.Ptr(armcompute.StatusLevelTypesInfo), // Time: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2024-03-01T21:29:47.477Z"); return t}()), // }}, // }}, // HyperVGeneration: to.Ptr(armcompute.HyperVGenerationTypeV1), // OSName: to.Ptr("Windows Server 2016 Datacenter"), // OSVersion: to.Ptr("Microsoft Windows NT 10.0.14393.0"), // Statuses: []*armcompute.InstanceViewStatus{ // { // Code: to.Ptr("ProvisioningState/succeeded"), // DisplayStatus: to.Ptr("Provisioning succeeded"), // Level: to.Ptr(armcompute.StatusLevelTypesInfo), // Time: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2024-03-01T21:30:12.805Z"); return t}()), // }, // { // Code: to.Ptr("PowerState/running"), // DisplayStatus: to.Ptr("VM running"), // Level: to.Ptr(armcompute.StatusLevelTypesInfo), // }}, // VMAgent: &armcompute.VirtualMachineAgentInstanceView{ // Statuses: []*armcompute.InstanceViewStatus{ // { // Code: to.Ptr("ProvisioningState/succeeded"), // DisplayStatus: to.Ptr("Ready"), // Level: to.Ptr(armcompute.StatusLevelTypesInfo), // Message: to.Ptr("GuestAgent is running and accepting new configurations."), // Time: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2024-03-01T23:11:22.000Z"); return t}()), // }}, // VMAgentVersion: to.Ptr("2.7.41491.949"), // }, // }
Output:
Example (GetVirtualMachineInstanceView) ¶
Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/92de53a5f1e0e03c94b40475d2135d97148ed014/specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-03-01/examples/virtualMachineExamples/VirtualMachine_Get_InstanceView.json
cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() clientFactory, err := armcompute.NewClientFactory("<subscription-id>", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } res, err := clientFactory.NewVirtualMachinesClient().InstanceView(ctx, "myResourceGroup", "myVM", nil) if err != nil { log.Fatalf("failed to finish the request: %v", err) } // You could use response here. We use blank identifier for just demo purposes. _ = res // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. // res.VirtualMachineInstanceView = armcompute.VirtualMachineInstanceView{ // BootDiagnostics: &armcompute.BootDiagnosticsInstanceView{ // ConsoleScreenshotBlobURI: to.Ptr("https://{myStorageAccount}.blob.core.windows.net/bootdiagnostics-myOsDisk/myOsDisk.screenshot.bmp"), // SerialConsoleLogBlobURI: to.Ptr("https://{myStorageAccount}.blob.core.windows.net/bootdiagnostics-myOsDisk/myOsDisk.serialconsole.log"), // }, // ComputerName: to.Ptr("myVM"), // Disks: []*armcompute.DiskInstanceView{ // { // Name: to.Ptr("myOsDisk"), // Statuses: []*armcompute.InstanceViewStatus{ // { // Code: to.Ptr("ProvisioningState/succeeded"), // DisplayStatus: to.Ptr("Provisioning succeeded"), // Level: to.Ptr(armcompute.StatusLevelTypesInfo), // Time: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2019-10-14T21:29:47.477Z"); return t}()), // }}, // }, // { // Name: to.Ptr("myDataDisk0"), // Statuses: []*armcompute.InstanceViewStatus{ // { // Code: to.Ptr("ProvisioningState/succeeded"), // DisplayStatus: to.Ptr("Provisioning succeeded"), // Level: to.Ptr(armcompute.StatusLevelTypesInfo), // Time: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2019-10-14T21:29:47.461Z"); return t}()), // }}, // }}, // HyperVGeneration: to.Ptr(armcompute.HyperVGenerationTypeV1), // IsVMInStandbyPool: to.Ptr(false), // OSName: to.Ptr("Windows Server 2016 Datacenter"), // OSVersion: to.Ptr("Microsoft Windows NT 10.0.14393.0"), // PatchStatus: &armcompute.VirtualMachinePatchStatus{ // AvailablePatchSummary: &armcompute.AvailablePatchSummary{ // AssessmentActivityID: to.Ptr("68f8b292-dfc2-4646-9781-33cc88631968"), // CriticalAndSecurityPatchCount: to.Ptr[int32](1), // LastModifiedTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-04-24T21:02:04.255Z"); return t}()), // OtherPatchCount: to.Ptr[int32](2), // RebootPending: to.Ptr(true), // StartTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-04-24T21:02:04.255Z"); return t}()), // Status: to.Ptr(armcompute.PatchOperationStatusSucceeded), // }, // ConfigurationStatuses: []*armcompute.InstanceViewStatus{ // { // Code: to.Ptr("PatchModeConfigurationState/Ready"), // DisplayStatus: to.Ptr("Status_PatchModeConfigurationState_Ready"), // Level: to.Ptr(armcompute.StatusLevelTypesInfo), // Time: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-04-24T21:02:04.255Z"); return t}()), // }, // { // Code: to.Ptr("AssessmentModeConfigurationState/Pending"), // DisplayStatus: to.Ptr("Status_AssessmentModeConfigurationState_Pending"), // Level: to.Ptr(armcompute.StatusLevelTypesInfo), // Time: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-04-24T21:02:04.255Z"); return t}()), // }}, // LastPatchInstallationSummary: &armcompute.LastPatchInstallationSummary{ // ExcludedPatchCount: to.Ptr[int32](1), // FailedPatchCount: to.Ptr[int32](1), // InstallationActivityID: to.Ptr("68f8b292-dfc2-4646-9981-33cc88631968"), // InstalledPatchCount: to.Ptr[int32](1), // LastModifiedTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-04-24T21:02:04.255Z"); return t}()), // MaintenanceWindowExceeded: to.Ptr(false), // NotSelectedPatchCount: to.Ptr[int32](1), // PendingPatchCount: to.Ptr[int32](1), // StartTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-04-24T21:02:04.255Z"); return t}()), // Status: to.Ptr(armcompute.PatchOperationStatusSucceeded), // }, // }, // PlatformFaultDomain: to.Ptr[int32](1), // PlatformUpdateDomain: to.Ptr[int32](1), // Statuses: []*armcompute.InstanceViewStatus{ // { // Code: to.Ptr("ProvisioningState/succeeded"), // DisplayStatus: to.Ptr("Provisioning succeeded"), // Level: to.Ptr(armcompute.StatusLevelTypesInfo), // Time: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2019-10-14T21:30:12.805Z"); return t}()), // }, // { // Code: to.Ptr("PowerState/running"), // DisplayStatus: to.Ptr("VM running"), // Level: to.Ptr(armcompute.StatusLevelTypesInfo), // }}, // VMAgent: &armcompute.VirtualMachineAgentInstanceView{ // ExtensionHandlers: []*armcompute.VirtualMachineExtensionHandlerInstanceView{ // { // Type: to.Ptr("Microsoft.Azure.Security.IaaSAntimalware"), // Status: &armcompute.InstanceViewStatus{ // Code: to.Ptr("ProvisioningState/succeeded"), // DisplayStatus: to.Ptr("Ready"), // Level: to.Ptr(armcompute.StatusLevelTypesInfo), // }, // TypeHandlerVersion: to.Ptr("1.5.5.9"), // }}, // Statuses: []*armcompute.InstanceViewStatus{ // { // Code: to.Ptr("ProvisioningState/succeeded"), // DisplayStatus: to.Ptr("Ready"), // Level: to.Ptr(armcompute.StatusLevelTypesInfo), // Message: to.Ptr("GuestAgent is running and accepting new configurations."), // Time: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2019-10-14T23:11:22.000Z"); return t}()), // }}, // VMAgentVersion: to.Ptr("2.7.41491.949"), // }, // Extensions: []*armcompute.VirtualMachineExtensionInstanceView{ // { // Name: to.Ptr("IaaSAntiMalware-ext0"), // Type: to.Ptr("Microsoft.Azure.Security.IaaSAntimalware"), // Statuses: []*armcompute.InstanceViewStatus{ // { // Code: to.Ptr("ProvisioningState/succeeded"), // DisplayStatus: to.Ptr("Provisioning succeeded"), // Level: to.Ptr(armcompute.StatusLevelTypesInfo), // Message: to.Ptr("Microsoft Antimalware enabled"), // }}, // TypeHandlerVersion: to.Ptr("1.5.5.9"), // }}, // }
Output:
func (*VirtualMachinesClient) NewListAllPager ¶
func (client *VirtualMachinesClient) NewListAllPager(options *VirtualMachinesClientListAllOptions) *runtime.Pager[VirtualMachinesClientListAllResponse]
NewListAllPager - Lists all of the virtual machines in the specified subscription. Use the nextLink property in the response to get the next page of virtual machines.
Generated from API version 2024-03-01
- options - VirtualMachinesClientListAllOptions contains the optional parameters for the VirtualMachinesClient.NewListAllPager method.
Example (VirtualMachineListAllMaximumSetGen) ¶
Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/92de53a5f1e0e03c94b40475d2135d97148ed014/specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-03-01/examples/virtualMachineExamples/VirtualMachine_ListAll_MaximumSet_Gen.json
cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() clientFactory, err := armcompute.NewClientFactory("<subscription-id>", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } pager := clientFactory.NewVirtualMachinesClient().NewListAllPager(&armcompute.VirtualMachinesClientListAllOptions{StatusOnly: to.Ptr("aaaaaa"), Filter: to.Ptr("aaaaaaaaaaaaaaaaaaaaaaaaaaaa"), Expand: nil, }) for pager.More() { page, err := pager.NextPage(ctx) if err != nil { log.Fatalf("failed to advance page: %v", err) } for _, v := range page.Value { // You could use page here. We use blank identifier for just demo purposes. _ = v } // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. // page.VirtualMachineListResult = armcompute.VirtualMachineListResult{ // Value: []*armcompute.VirtualMachine{ // { // Name: to.Ptr("{virtualMachineName}"), // Type: to.Ptr("Microsoft.Compute/virtualMachines"), // ID: to.Ptr("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachines/{virtualMachineName}"), // Location: to.Ptr("eastus"), // Tags: map[string]*string{ // }, // ExtendedLocation: &armcompute.ExtendedLocation{ // Name: to.Ptr("aaaa"), // Type: to.Ptr(armcompute.ExtendedLocationTypesEdgeZone), // }, // Identity: &armcompute.VirtualMachineIdentity{ // Type: to.Ptr(armcompute.ResourceIdentityTypeSystemAssigned), // PrincipalID: to.Ptr("aaaaaaaaaaaaaaaa"), // TenantID: to.Ptr("aaaaa"), // UserAssignedIdentities: map[string]*armcompute.UserAssignedIdentitiesValue{ // "key5688": &armcompute.UserAssignedIdentitiesValue{ // ClientID: to.Ptr("aaaaaaaaaaa"), // PrincipalID: to.Ptr("aaaaaaaaaaaaaaa"), // }, // }, // }, // Plan: &armcompute.Plan{ // Name: to.Ptr("aaaaaaaaaaaaaaaaaa"), // Product: to.Ptr("aaaaaaaaaaaaaaaaaaaaaa"), // PromotionCode: to.Ptr("aaaaaaaaaaaaaa"), // Publisher: to.Ptr("aaaaaaaaaaaaaaaaa"), // }, // Properties: &armcompute.VirtualMachineProperties{ // AdditionalCapabilities: &armcompute.AdditionalCapabilities{ // HibernationEnabled: to.Ptr(true), // UltraSSDEnabled: to.Ptr(true), // }, // ApplicationProfile: &armcompute.ApplicationProfile{ // GalleryApplications: []*armcompute.VMGalleryApplication{ // { // ConfigurationReference: to.Ptr("aaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"), // Order: to.Ptr[int32](4), // PackageReferenceID: to.Ptr("aaaaaaaaaaaaaaaaaaaaaa"), // Tags: to.Ptr("aaaaa"), // }}, // }, // AvailabilitySet: &armcompute.SubResource{ // ID: to.Ptr("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/availabilitySets/{availabilitySetName}"), // }, // BillingProfile: &armcompute.BillingProfile{ // MaxPrice: to.Ptr[float64](26), // }, // CapacityReservation: &armcompute.CapacityReservationProfile{ // CapacityReservationGroup: &armcompute.SubResource{ // ID: to.Ptr("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/availabilitySets/{availabilitySetName}"), // }, // }, // DiagnosticsProfile: &armcompute.DiagnosticsProfile{ // BootDiagnostics: &armcompute.BootDiagnostics{ // Enabled: to.Ptr(true), // StorageURI: to.Ptr("aaaaaaaaaaaaaaaaaaaaa"), // }, // }, // EvictionPolicy: to.Ptr(armcompute.VirtualMachineEvictionPolicyTypesDeallocate), // ExtensionsTimeBudget: to.Ptr("aaaaaaaaaaaaaaaaaaaaaaaaaaaa"), // HardwareProfile: &armcompute.HardwareProfile{ // VMSize: to.Ptr(armcompute.VirtualMachineSizeTypesStandardA0), // VMSizeProperties: &armcompute.VMSizeProperties{ // VCPUsAvailable: to.Ptr[int32](7), // VCPUsPerCore: to.Ptr[int32](14), // }, // }, // Host: &armcompute.SubResource{ // ID: to.Ptr("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/availabilitySets/{availabilitySetName}"), // }, // HostGroup: &armcompute.SubResource{ // ID: to.Ptr("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/availabilitySets/{availabilitySetName}"), // }, // LicenseType: to.Ptr("aaaaaaaaaaaaaaa"), // NetworkProfile: &armcompute.NetworkProfile{ // NetworkAPIVersion: to.Ptr(armcompute.NetworkAPIVersion("2022-05-01")), // NetworkInterfaceConfigurations: []*armcompute.VirtualMachineNetworkInterfaceConfiguration{ // { // Name: to.Ptr("aaaaaaaa"), // Properties: &armcompute.VirtualMachineNetworkInterfaceConfigurationProperties{ // DeleteOption: to.Ptr(armcompute.DeleteOptionsDelete), // DisableTCPStateTracking: to.Ptr(true), // DNSSettings: &armcompute.VirtualMachineNetworkInterfaceDNSSettingsConfiguration{ // DNSServers: []*string{ // to.Ptr("aaaaaaaaaaaaaaaaaaaaaaaa")}, // }, // DscpConfiguration: &armcompute.SubResource{ // ID: to.Ptr("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/availabilitySets/{availabilitySetName}"), // }, // EnableAcceleratedNetworking: to.Ptr(true), // EnableFpga: to.Ptr(true), // EnableIPForwarding: to.Ptr(true), // IPConfigurations: []*armcompute.VirtualMachineNetworkInterfaceIPConfiguration{ // { // Name: to.Ptr("aaaaaaaa"), // Properties: &armcompute.VirtualMachineNetworkInterfaceIPConfigurationProperties{ // ApplicationGatewayBackendAddressPools: []*armcompute.SubResource{ // { // ID: to.Ptr("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/availabilitySets/{availabilitySetName}"), // }}, // ApplicationSecurityGroups: []*armcompute.SubResource{ // { // ID: to.Ptr("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/availabilitySets/{availabilitySetName}"), // }}, // LoadBalancerBackendAddressPools: []*armcompute.SubResource{ // { // ID: to.Ptr("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/availabilitySets/{availabilitySetName}"), // }}, // Primary: to.Ptr(true), // PrivateIPAddressVersion: to.Ptr(armcompute.IPVersionsIPv4), // PublicIPAddressConfiguration: &armcompute.VirtualMachinePublicIPAddressConfiguration{ // Name: to.Ptr("aaaaaaaaaaaaaaaaaa"), // Properties: &armcompute.VirtualMachinePublicIPAddressConfigurationProperties{ // DeleteOption: to.Ptr(armcompute.DeleteOptionsDelete), // DNSSettings: &armcompute.VirtualMachinePublicIPAddressDNSSettingsConfiguration{ // DomainNameLabel: to.Ptr("aaaaa"), // DomainNameLabelScope: to.Ptr(armcompute.DomainNameLabelScopeTypesTenantReuse), // }, // IdleTimeoutInMinutes: to.Ptr[int32](23), // IPTags: []*armcompute.VirtualMachineIPTag{ // { // IPTagType: to.Ptr("aaaaa"), // Tag: to.Ptr("aaaaaaaaaaaaaaaaaaaaaaaaaaa"), // }}, // PublicIPAddressVersion: to.Ptr(armcompute.IPVersionsIPv4), // PublicIPAllocationMethod: to.Ptr(armcompute.PublicIPAllocationMethodDynamic), // PublicIPPrefix: &armcompute.SubResource{ // ID: to.Ptr("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/availabilitySets/{availabilitySetName}"), // }, // }, // SKU: &armcompute.PublicIPAddressSKU{ // Name: to.Ptr(armcompute.PublicIPAddressSKUNameBasic), // Tier: to.Ptr(armcompute.PublicIPAddressSKUTierRegional), // }, // }, // Subnet: &armcompute.SubResource{ // ID: to.Ptr("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/availabilitySets/{availabilitySetName}"), // }, // }, // }}, // NetworkSecurityGroup: &armcompute.SubResource{ // ID: to.Ptr("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/availabilitySets/{availabilitySetName}"), // }, // Primary: to.Ptr(true), // }, // }}, // NetworkInterfaces: []*armcompute.NetworkInterfaceReference{ // { // ID: to.Ptr("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkInterfaces/{networkInterfaceName}"), // Properties: &armcompute.NetworkInterfaceReferenceProperties{ // DeleteOption: to.Ptr(armcompute.DeleteOptionsDelete), // Primary: to.Ptr(true), // }, // }}, // }, // OSProfile: &armcompute.OSProfile{ // AdminUsername: to.Ptr("Foo12"), // AllowExtensionOperations: to.Ptr(true), // ComputerName: to.Ptr("Test"), // CustomData: to.Ptr("aaaa"), // LinuxConfiguration: &armcompute.LinuxConfiguration{ // DisablePasswordAuthentication: to.Ptr(true), // PatchSettings: &armcompute.LinuxPatchSettings{ // AssessmentMode: to.Ptr(armcompute.LinuxPatchAssessmentModeImageDefault), // PatchMode: to.Ptr(armcompute.LinuxVMGuestPatchModeImageDefault), // }, // ProvisionVMAgent: to.Ptr(true), // SSH: &armcompute.SSHConfiguration{ // PublicKeys: []*armcompute.SSHPublicKey{ // { // Path: to.Ptr("aaaaaaaaaaaaaaaaaaaaaa"), // KeyData: to.Ptr("aaa"), // }}, // }, // }, // RequireGuestProvisionSignal: to.Ptr(true), // Secrets: []*armcompute.VaultSecretGroup{ // }, // WindowsConfiguration: &armcompute.WindowsConfiguration{ // AdditionalUnattendContent: []*armcompute.AdditionalUnattendContent{ // { // ComponentName: to.Ptr("Microsoft-Windows-Shell-Setup"), // Content: to.Ptr("aaaaaaaaaaaaaaaaaaaaaaaaaa"), // PassName: to.Ptr("OobeSystem"), // SettingName: to.Ptr(armcompute.SettingNamesAutoLogon), // }}, // EnableAutomaticUpdates: to.Ptr(true), // PatchSettings: &armcompute.PatchSettings{ // AssessmentMode: to.Ptr(armcompute.WindowsPatchAssessmentModeImageDefault), // EnableHotpatching: to.Ptr(true), // PatchMode: to.Ptr(armcompute.WindowsVMGuestPatchModeManual), // }, // ProvisionVMAgent: to.Ptr(true), // TimeZone: to.Ptr("aaaaaaaaaaaaaaaaaaaaaa"), // WinRM: &armcompute.WinRMConfiguration{ // Listeners: []*armcompute.WinRMListener{ // { // CertificateURL: to.Ptr("aaaaaaaaaaaaaaaaaaaaa"), // Protocol: to.Ptr(armcompute.ProtocolTypesHTTP), // }}, // }, // }, // }, // PlatformFaultDomain: to.Ptr[int32](8), // Priority: to.Ptr(armcompute.VirtualMachinePriorityTypesRegular), // ProvisioningState: to.Ptr("Succeeded"), // ProximityPlacementGroup: &armcompute.SubResource{ // ID: to.Ptr("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/availabilitySets/{availabilitySetName}"), // }, // ScheduledEventsProfile: &armcompute.ScheduledEventsProfile{ // OSImageNotificationProfile: &armcompute.OSImageNotificationProfile{ // Enable: to.Ptr(true), // NotBeforeTimeout: to.Ptr("PT15M"), // }, // TerminateNotificationProfile: &armcompute.TerminateNotificationProfile{ // Enable: to.Ptr(true), // NotBeforeTimeout: to.Ptr("PT10M"), // }, // }, // SecurityProfile: &armcompute.SecurityProfile{ // EncryptionAtHost: to.Ptr(true), // SecurityType: to.Ptr(armcompute.SecurityTypesTrustedLaunch), // UefiSettings: &armcompute.UefiSettings{ // SecureBootEnabled: to.Ptr(true), // VTpmEnabled: to.Ptr(true), // }, // }, // StorageProfile: &armcompute.StorageProfile{ // DataDisks: []*armcompute.DataDisk{ // }, // ImageReference: &armcompute.ImageReference{ // ID: to.Ptr("aaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"), // CommunityGalleryImageID: to.Ptr("aaaa"), // ExactVersion: to.Ptr("aaaaaaaaaaaaa"), // Offer: to.Ptr("WindowsServer"), // Publisher: to.Ptr("MicrosoftWindowsServer"), // SharedGalleryImageID: to.Ptr("aaaaaaaaaaaaaaa"), // SKU: to.Ptr("2012-R2-Datacenter"), // Version: to.Ptr("4.127.20170406"), // }, // OSDisk: &armcompute.OSDisk{ // Name: to.Ptr("test"), // Caching: to.Ptr(armcompute.CachingTypesNone), // CreateOption: to.Ptr(armcompute.DiskCreateOptionTypesFromImage), // DeleteOption: to.Ptr(armcompute.DiskDeleteOptionTypesDelete), // DiffDiskSettings: &armcompute.DiffDiskSettings{ // Option: to.Ptr(armcompute.DiffDiskOptionsLocal), // Placement: to.Ptr(armcompute.DiffDiskPlacementCacheDisk), // }, // DiskSizeGB: to.Ptr[int32](127), // EncryptionSettings: &armcompute.DiskEncryptionSettings{ // DiskEncryptionKey: &armcompute.KeyVaultSecretReference{ // SecretURL: to.Ptr("aaaaaaaaa"), // SourceVault: &armcompute.SubResource{ // ID: to.Ptr("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/availabilitySets/{availabilitySetName}"), // }, // }, // Enabled: to.Ptr(true), // KeyEncryptionKey: &armcompute.KeyVaultKeyReference{ // KeyURL: to.Ptr("aaaaaaaaaaaaa"), // SourceVault: &armcompute.SubResource{ // ID: to.Ptr("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/availabilitySets/{availabilitySetName}"), // }, // }, // }, // Image: &armcompute.VirtualHardDisk{ // URI: to.Ptr("https://{storageAccountName}.blob.core.windows.net/{containerName}/{vhdName}.vhd"), // }, // ManagedDisk: &armcompute.ManagedDiskParameters{ // ID: to.Ptr("/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/disks/testingexcludedisk_OsDisk_1_74cdaedcea50483d9833c96adefa100f"), // DiskEncryptionSet: &armcompute.DiskEncryptionSetParameters{ // ID: to.Ptr("aaaaaaaaaaaaaaaaaaaaaaaaaaaa"), // }, // SecurityProfile: &armcompute.VMDiskSecurityProfile{ // DiskEncryptionSet: &armcompute.DiskEncryptionSetParameters{ // ID: to.Ptr("aaaaaaaaaaaaaaaaaaaaaaaaaaaa"), // }, // SecurityEncryptionType: to.Ptr(armcompute.SecurityEncryptionTypesVMGuestStateOnly), // }, // StorageAccountType: to.Ptr(armcompute.StorageAccountTypesStandardLRS), // }, // OSType: to.Ptr(armcompute.OperatingSystemTypesWindows), // Vhd: &armcompute.VirtualHardDisk{ // URI: to.Ptr("https://{storageAccountName}.blob.core.windows.net/{containerName}/{vhdName}.vhd"), // }, // WriteAcceleratorEnabled: to.Ptr(true), // }, // }, // TimeCreated: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2022-01-14T16:43:41.683Z"); return t}()), // UserData: to.Ptr("aaa"), // VirtualMachineScaleSet: &armcompute.SubResource{ // ID: to.Ptr("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/availabilitySets/{availabilitySetName}"), // }, // VMID: to.Ptr("{vmId}"), // }, // Resources: []*armcompute.VirtualMachineExtension{ // { // Name: to.Ptr("aaaaaaaaaaaaa"), // Type: to.Ptr("aaaaaaaaaaaaaaaaaaaaaaaaaaa"), // ID: to.Ptr("aaaaaaaaaaaaaaaaaaaaaaaaaaaaa"), // Location: to.Ptr("aaaaaaaaaaaaaaaa"), // Tags: map[string]*string{ // "key9428": to.Ptr("aaaaaaa"), // }, // Properties: &armcompute.VirtualMachineExtensionProperties{ // Type: to.Ptr("aaaaaaaa"), // AutoUpgradeMinorVersion: to.Ptr(true), // EnableAutomaticUpgrade: to.Ptr(true), // ForceUpdateTag: to.Ptr("aaaaaaaaaaaaaaa"), // ProtectedSettings: map[string]any{ // }, // ProtectedSettingsFromKeyVault: &armcompute.KeyVaultSecretReference{ // SecretURL: to.Ptr("https://kvName.vault.azure.net/secrets/secretName/79b88b3a6f5440ffb2e73e44a0db712e"), // SourceVault: &armcompute.SubResource{ // ID: to.Ptr("/subscriptions/a53f7094-a16c-47af-abe4-b05c05d0d79a/resourceGroups/myResourceGroup/providers/Microsoft.KeyVault/vaults/kvName"), // }, // }, // ProvisioningState: to.Ptr("Succeeded"), // Publisher: to.Ptr("aaaaaaaaaaaaaaaa"), // Settings: map[string]any{ // }, // SuppressFailures: to.Ptr(true), // TypeHandlerVersion: to.Ptr("aaaaaaaaaaaa"), // }, // }}, // Zones: []*string{ // to.Ptr("aaaaaaaaaaaaaaaaaaaaaaaaaaa")}, // }, // { // Name: to.Ptr("{virtualMachineName}"), // Type: to.Ptr("Microsoft.Compute/virtualMachines"), // ID: to.Ptr("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachines/{virtualMachineName}"), // Location: to.Ptr("eastus"), // Tags: map[string]*string{ // }, // ExtendedLocation: &armcompute.ExtendedLocation{ // Name: to.Ptr("aaaa"), // Type: to.Ptr(armcompute.ExtendedLocationTypesEdgeZone), // }, // Identity: &armcompute.VirtualMachineIdentity{ // Type: to.Ptr(armcompute.ResourceIdentityTypeSystemAssigned), // PrincipalID: to.Ptr("aaaaaaaaaaaaaaaa"), // TenantID: to.Ptr("aaaaa"), // UserAssignedIdentities: map[string]*armcompute.UserAssignedIdentitiesValue{ // "key5688": &armcompute.UserAssignedIdentitiesValue{ // ClientID: to.Ptr("aaaaaaaaaaa"), // PrincipalID: to.Ptr("aaaaaaaaaaaaaaa"), // }, // }, // }, // Plan: &armcompute.Plan{ // Name: to.Ptr("aaaaaaaaaaaaaaaaaa"), // Product: to.Ptr("aaaaaaaaaaaaaaaaaaaaaa"), // PromotionCode: to.Ptr("aaaaaaaaaaaaaa"), // Publisher: to.Ptr("aaaaaaaaaaaaaaaaa"), // }, // Properties: &armcompute.VirtualMachineProperties{ // AdditionalCapabilities: &armcompute.AdditionalCapabilities{ // HibernationEnabled: to.Ptr(true), // UltraSSDEnabled: to.Ptr(true), // }, // ApplicationProfile: &armcompute.ApplicationProfile{ // GalleryApplications: []*armcompute.VMGalleryApplication{ // { // ConfigurationReference: to.Ptr("aaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"), // Order: to.Ptr[int32](4), // PackageReferenceID: to.Ptr("aaaaaaaaaaaaaaaaaaaaaa"), // Tags: to.Ptr("aaaaa"), // }}, // }, // AvailabilitySet: &armcompute.SubResource{ // ID: to.Ptr("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/availabilitySets/{availabilitySetName}"), // }, // BillingProfile: &armcompute.BillingProfile{ // MaxPrice: to.Ptr[float64](26), // }, // CapacityReservation: &armcompute.CapacityReservationProfile{ // CapacityReservationGroup: &armcompute.SubResource{ // ID: to.Ptr("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/availabilitySets/{availabilitySetName}"), // }, // }, // DiagnosticsProfile: &armcompute.DiagnosticsProfile{ // BootDiagnostics: &armcompute.BootDiagnostics{ // Enabled: to.Ptr(true), // StorageURI: to.Ptr("aaaaaaaaaaaaaaaaaaaaa"), // }, // }, // EvictionPolicy: to.Ptr(armcompute.VirtualMachineEvictionPolicyTypesDeallocate), // ExtensionsTimeBudget: to.Ptr("aaaaaaaaaaaaaaaaaaaaaa"), // HardwareProfile: &armcompute.HardwareProfile{ // VMSize: to.Ptr(armcompute.VirtualMachineSizeTypesStandardA0), // VMSizeProperties: &armcompute.VMSizeProperties{ // VCPUsAvailable: to.Ptr[int32](7), // VCPUsPerCore: to.Ptr[int32](14), // }, // }, // Host: &armcompute.SubResource{ // ID: to.Ptr("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/availabilitySets/{availabilitySetName}"), // }, // HostGroup: &armcompute.SubResource{ // ID: to.Ptr("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/availabilitySets/{availabilitySetName}"), // }, // LicenseType: to.Ptr("aaaaaaaaaaaaaa"), // NetworkProfile: &armcompute.NetworkProfile{ // NetworkAPIVersion: to.Ptr(armcompute.NetworkAPIVersion("2022-05-01")), // NetworkInterfaceConfigurations: []*armcompute.VirtualMachineNetworkInterfaceConfiguration{ // { // Name: to.Ptr("aaaaaaaa"), // Properties: &armcompute.VirtualMachineNetworkInterfaceConfigurationProperties{ // DeleteOption: to.Ptr(armcompute.DeleteOptionsDelete), // DisableTCPStateTracking: to.Ptr(true), // DNSSettings: &armcompute.VirtualMachineNetworkInterfaceDNSSettingsConfiguration{ // DNSServers: []*string{ // to.Ptr("aaaaaaaaaaaaaaaaaaaaaaaa")}, // }, // DscpConfiguration: &armcompute.SubResource{ // ID: to.Ptr("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/availabilitySets/{availabilitySetName}"), // }, // EnableAcceleratedNetworking: to.Ptr(true), // EnableFpga: to.Ptr(true), // EnableIPForwarding: to.Ptr(true), // IPConfigurations: []*armcompute.VirtualMachineNetworkInterfaceIPConfiguration{ // { // Name: to.Ptr("aaaaaaaa"), // Properties: &armcompute.VirtualMachineNetworkInterfaceIPConfigurationProperties{ // ApplicationGatewayBackendAddressPools: []*armcompute.SubResource{ // { // ID: to.Ptr("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/availabilitySets/{availabilitySetName}"), // }}, // ApplicationSecurityGroups: []*armcompute.SubResource{ // { // ID: to.Ptr("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/availabilitySets/{availabilitySetName}"), // }}, // LoadBalancerBackendAddressPools: []*armcompute.SubResource{ // { // ID: to.Ptr("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/availabilitySets/{availabilitySetName}"), // }}, // Primary: to.Ptr(true), // PrivateIPAddressVersion: to.Ptr(armcompute.IPVersionsIPv4), // PublicIPAddressConfiguration: &armcompute.VirtualMachinePublicIPAddressConfiguration{ // Name: to.Ptr("aaaaaaaaaaaaaaaaaa"), // Properties: &armcompute.VirtualMachinePublicIPAddressConfigurationProperties{ // DeleteOption: to.Ptr(armcompute.DeleteOptionsDelete), // DNSSettings: &armcompute.VirtualMachinePublicIPAddressDNSSettingsConfiguration{ // DomainNameLabel: to.Ptr("aaaaa"), // DomainNameLabelScope: to.Ptr(armcompute.DomainNameLabelScopeTypesSubscriptionReuse), // }, // IdleTimeoutInMinutes: to.Ptr[int32](23), // IPTags: []*armcompute.VirtualMachineIPTag{ // { // IPTagType: to.Ptr("aaaaa"), // Tag: to.Ptr("aaaaaaaaaaaaaaaaaaaaaaaaaaa"), // }}, // PublicIPAddressVersion: to.Ptr(armcompute.IPVersionsIPv4), // PublicIPAllocationMethod: to.Ptr(armcompute.PublicIPAllocationMethodDynamic), // PublicIPPrefix: &armcompute.SubResource{ // ID: to.Ptr("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/availabilitySets/{availabilitySetName}"), // }, // }, // SKU: &armcompute.PublicIPAddressSKU{ // Name: to.Ptr(armcompute.PublicIPAddressSKUNameBasic), // Tier: to.Ptr(armcompute.PublicIPAddressSKUTierRegional), // }, // }, // Subnet: &armcompute.SubResource{ // ID: to.Ptr("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/availabilitySets/{availabilitySetName}"), // }, // }, // }}, // NetworkSecurityGroup: &armcompute.SubResource{ // ID: to.Ptr("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/availabilitySets/{availabilitySetName}"), // }, // Primary: to.Ptr(true), // }, // }}, // NetworkInterfaces: []*armcompute.NetworkInterfaceReference{ // { // ID: to.Ptr("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkInterfaces/{networkInterfaceName}"), // Properties: &armcompute.NetworkInterfaceReferenceProperties{ // DeleteOption: to.Ptr(armcompute.DeleteOptionsDelete), // Primary: to.Ptr(true), // }, // }}, // }, // OSProfile: &armcompute.OSProfile{ // AdminUsername: to.Ptr("Foo12"), // AllowExtensionOperations: to.Ptr(true), // ComputerName: to.Ptr("Test"), // CustomData: to.Ptr("aaaaaaaaaaaaaaaaaaaaaaa"), // LinuxConfiguration: &armcompute.LinuxConfiguration{ // DisablePasswordAuthentication: to.Ptr(true), // PatchSettings: &armcompute.LinuxPatchSettings{ // AssessmentMode: to.Ptr(armcompute.LinuxPatchAssessmentModeImageDefault), // PatchMode: to.Ptr(armcompute.LinuxVMGuestPatchModeImageDefault), // }, // ProvisionVMAgent: to.Ptr(true), // SSH: &armcompute.SSHConfiguration{ // PublicKeys: []*armcompute.SSHPublicKey{ // { // Path: to.Ptr("aaaaaaaaaaaaaaaaaaaaaa"), // KeyData: to.Ptr("aaa"), // }}, // }, // }, // RequireGuestProvisionSignal: to.Ptr(true), // Secrets: []*armcompute.VaultSecretGroup{ // }, // WindowsConfiguration: &armcompute.WindowsConfiguration{ // AdditionalUnattendContent: []*armcompute.AdditionalUnattendContent{ // { // ComponentName: to.Ptr("Microsoft-Windows-Shell-Setup"), // Content: to.Ptr("aaaaaaaaaaaaaaaaaaaaaaaaaa"), // PassName: to.Ptr("OobeSystem"), // SettingName: to.Ptr(armcompute.SettingNamesAutoLogon), // }}, // EnableAutomaticUpdates: to.Ptr(true), // PatchSettings: &armcompute.PatchSettings{ // AssessmentMode: to.Ptr(armcompute.WindowsPatchAssessmentModeImageDefault), // EnableHotpatching: to.Ptr(true), // PatchMode: to.Ptr(armcompute.WindowsVMGuestPatchModeManual), // }, // ProvisionVMAgent: to.Ptr(true), // TimeZone: to.Ptr("aaaaaaaaaaaaaaaaaaaa"), // WinRM: &armcompute.WinRMConfiguration{ // Listeners: []*armcompute.WinRMListener{ // { // CertificateURL: to.Ptr("aaaaaaaaaaaaaaaaaaaaa"), // Protocol: to.Ptr(armcompute.ProtocolTypesHTTP), // }}, // }, // }, // }, // PlatformFaultDomain: to.Ptr[int32](11), // Priority: to.Ptr(armcompute.VirtualMachinePriorityTypesRegular), // ProvisioningState: to.Ptr("Succeeded"), // ProximityPlacementGroup: &armcompute.SubResource{ // ID: to.Ptr("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/availabilitySets/{availabilitySetName}"), // }, // ScheduledEventsProfile: &armcompute.ScheduledEventsProfile{ // OSImageNotificationProfile: &armcompute.OSImageNotificationProfile{ // Enable: to.Ptr(true), // NotBeforeTimeout: to.Ptr("PT15M"), // }, // TerminateNotificationProfile: &armcompute.TerminateNotificationProfile{ // Enable: to.Ptr(true), // NotBeforeTimeout: to.Ptr("PT10M"), // }, // }, // SecurityProfile: &armcompute.SecurityProfile{ // EncryptionAtHost: to.Ptr(true), // SecurityType: to.Ptr(armcompute.SecurityTypesTrustedLaunch), // UefiSettings: &armcompute.UefiSettings{ // SecureBootEnabled: to.Ptr(true), // VTpmEnabled: to.Ptr(true), // }, // }, // StorageProfile: &armcompute.StorageProfile{ // DataDisks: []*armcompute.DataDisk{ // }, // ImageReference: &armcompute.ImageReference{ // ID: to.Ptr("aaaaaaaa"), // CommunityGalleryImageID: to.Ptr("aaaaaaaaaaaaaaaaaaaaaaaaaaaa"), // ExactVersion: to.Ptr("aa"), // Offer: to.Ptr("WindowsServer"), // Publisher: to.Ptr("MicrosoftWindowsServer"), // SharedGalleryImageID: to.Ptr("aaaaaaaaaaaaaaaaaaaaaaaaa"), // SKU: to.Ptr("2012-R2-Datacenter"), // Version: to.Ptr("4.127.20170406"), // }, // OSDisk: &armcompute.OSDisk{ // Name: to.Ptr("test"), // Caching: to.Ptr(armcompute.CachingTypesNone), // CreateOption: to.Ptr(armcompute.DiskCreateOptionTypesFromImage), // DeleteOption: to.Ptr(armcompute.DiskDeleteOptionTypesDelete), // DiffDiskSettings: &armcompute.DiffDiskSettings{ // Option: to.Ptr(armcompute.DiffDiskOptionsLocal), // Placement: to.Ptr(armcompute.DiffDiskPlacementCacheDisk), // }, // DiskSizeGB: to.Ptr[int32](127), // EncryptionSettings: &armcompute.DiskEncryptionSettings{ // DiskEncryptionKey: &armcompute.KeyVaultSecretReference{ // SecretURL: to.Ptr("aaaaaaaaa"), // SourceVault: &armcompute.SubResource{ // ID: to.Ptr("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/availabilitySets/{availabilitySetName}"), // }, // }, // Enabled: to.Ptr(true), // KeyEncryptionKey: &armcompute.KeyVaultKeyReference{ // KeyURL: to.Ptr("aaaaaaaaaaaaa"), // SourceVault: &armcompute.SubResource{ // ID: to.Ptr("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/availabilitySets/{availabilitySetName}"), // }, // }, // }, // Image: &armcompute.VirtualHardDisk{ // URI: to.Ptr("https://{storageAccountName}.blob.core.windows.net/{containerName}/{vhdName}.vhd"), // }, // ManagedDisk: &armcompute.ManagedDiskParameters{ // ID: to.Ptr("/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/disks/testingexcludedisk_OsDisk_1_74cdaedcea50483d9833c96adefa100f"), // DiskEncryptionSet: &armcompute.DiskEncryptionSetParameters{ // ID: to.Ptr("aaaaaaaaaaaaaaaaaaaaaaaaaaaa"), // }, // SecurityProfile: &armcompute.VMDiskSecurityProfile{ // DiskEncryptionSet: &armcompute.DiskEncryptionSetParameters{ // ID: to.Ptr("aaaaaaaaaaaaaaaaaaaaaaaaaaaa"), // }, // SecurityEncryptionType: to.Ptr(armcompute.SecurityEncryptionTypesVMGuestStateOnly), // }, // StorageAccountType: to.Ptr(armcompute.StorageAccountTypesStandardLRS), // }, // OSType: to.Ptr(armcompute.OperatingSystemTypesWindows), // Vhd: &armcompute.VirtualHardDisk{ // URI: to.Ptr("https://{storageAccountName}.blob.core.windows.net/{containerName}/{vhdName}.vhd"), // }, // WriteAcceleratorEnabled: to.Ptr(true), // }, // }, // TimeCreated: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2022-01-14T16:43:41.685Z"); return t}()), // UserData: to.Ptr("aaaaaaaaaaaaaaaaaaa"), // VirtualMachineScaleSet: &armcompute.SubResource{ // ID: to.Ptr("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/availabilitySets/{availabilitySetName}"), // }, // VMID: to.Ptr("{vmId}"), // }, // Resources: []*armcompute.VirtualMachineExtension{ // { // Name: to.Ptr("aaaaaaaaaaaaa"), // Type: to.Ptr("aaaaaaaaaaaaaaaaaaaaaaaaaaa"), // ID: to.Ptr("aaaaaaaaaaaaaaaaaaaaaaaaaaaaa"), // Location: to.Ptr("aaaaaaaaaaaaaaaa"), // Tags: map[string]*string{ // "key9428": to.Ptr("aaaaaaa"), // }, // Properties: &armcompute.VirtualMachineExtensionProperties{ // Type: to.Ptr("aaaaaaaa"), // AutoUpgradeMinorVersion: to.Ptr(true), // EnableAutomaticUpgrade: to.Ptr(true), // ForceUpdateTag: to.Ptr("aaaaaaaaaaaaaaa"), // ProtectedSettings: map[string]any{ // }, // ProtectedSettingsFromKeyVault: &armcompute.KeyVaultSecretReference{ // SecretURL: to.Ptr("https://kvName.vault.azure.net/secrets/secretName/79b88b3a6f5440ffb2e73e44a0db712e"), // SourceVault: &armcompute.SubResource{ // ID: to.Ptr("/subscriptions/a53f7094-a16c-47af-abe4-b05c05d0d79a/resourceGroups/myResourceGroup/providers/Microsoft.KeyVault/vaults/kvName"), // }, // }, // ProvisioningState: to.Ptr("Succeeded"), // Publisher: to.Ptr("aaaaaaaaaaaaaaaa"), // Settings: map[string]any{ // }, // SuppressFailures: to.Ptr(true), // TypeHandlerVersion: to.Ptr("aaaaaaaaaaaa"), // }, // }}, // Zones: []*string{ // to.Ptr("aaaaaa")}, // }}, // } }
Output:
Example (VirtualMachineListAllMinimumSetGen) ¶
Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/92de53a5f1e0e03c94b40475d2135d97148ed014/specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-03-01/examples/virtualMachineExamples/VirtualMachine_ListAll_MinimumSet_Gen.json
cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() clientFactory, err := armcompute.NewClientFactory("<subscription-id>", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } pager := clientFactory.NewVirtualMachinesClient().NewListAllPager(&armcompute.VirtualMachinesClientListAllOptions{StatusOnly: nil, Filter: nil, Expand: nil, }) for pager.More() { page, err := pager.NextPage(ctx) if err != nil { log.Fatalf("failed to advance page: %v", err) } for _, v := range page.Value { // You could use page here. We use blank identifier for just demo purposes. _ = v } // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. // page.VirtualMachineListResult = armcompute.VirtualMachineListResult{ // Value: []*armcompute.VirtualMachine{ // { // ID: to.Ptr("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachines/{virtualMachineName}"), // Location: to.Ptr("eastus"), // }, // { // ID: to.Ptr("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachines/{virtualMachineName}"), // Location: to.Ptr("eastus"), // }}, // } }
Output:
func (*VirtualMachinesClient) NewListAvailableSizesPager ¶
func (client *VirtualMachinesClient) NewListAvailableSizesPager(resourceGroupName string, vmName string, options *VirtualMachinesClientListAvailableSizesOptions) *runtime.Pager[VirtualMachinesClientListAvailableSizesResponse]
NewListAvailableSizesPager - Lists all available virtual machine sizes to which the specified virtual machine can be resized.
Generated from API version 2024-03-01
- resourceGroupName - The name of the resource group.
- vmName - The name of the virtual machine.
- options - VirtualMachinesClientListAvailableSizesOptions contains the optional parameters for the VirtualMachinesClient.NewListAvailableSizesPager method.
Example ¶
Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/92de53a5f1e0e03c94b40475d2135d97148ed014/specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-03-01/examples/virtualMachineExamples/VirtualMachine_ListAvailableVmSizes.json
cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() clientFactory, err := armcompute.NewClientFactory("<subscription-id>", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } pager := clientFactory.NewVirtualMachinesClient().NewListAvailableSizesPager("myResourceGroup", "myVmName", nil) for pager.More() { page, err := pager.NextPage(ctx) if err != nil { log.Fatalf("failed to advance page: %v", err) } for _, v := range page.Value { // You could use page here. We use blank identifier for just demo purposes. _ = v } // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. // page.VirtualMachineSizeListResult = armcompute.VirtualMachineSizeListResult{ // Value: []*armcompute.VirtualMachineSize{ // { // Name: to.Ptr("Standard_A1_V2"), // MaxDataDiskCount: to.Ptr[int32](2), // MemoryInMB: to.Ptr[int32](2048), // NumberOfCores: to.Ptr[int32](1), // OSDiskSizeInMB: to.Ptr[int32](1047552), // ResourceDiskSizeInMB: to.Ptr[int32](10240), // }, // { // Name: to.Ptr("Standard_A2_V2"), // MaxDataDiskCount: to.Ptr[int32](4), // MemoryInMB: to.Ptr[int32](4096), // NumberOfCores: to.Ptr[int32](2), // OSDiskSizeInMB: to.Ptr[int32](1047552), // ResourceDiskSizeInMB: to.Ptr[int32](20480), // }}, // } }
Output:
func (*VirtualMachinesClient) NewListByLocationPager ¶
func (client *VirtualMachinesClient) NewListByLocationPager(location string, options *VirtualMachinesClientListByLocationOptions) *runtime.Pager[VirtualMachinesClientListByLocationResponse]
NewListByLocationPager - Gets all the virtual machines under the specified subscription for the specified location.
Generated from API version 2024-03-01
- location - The location for which virtual machines under the subscription are queried.
- options - VirtualMachinesClientListByLocationOptions contains the optional parameters for the VirtualMachinesClient.NewListByLocationPager method.
Example ¶
Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/92de53a5f1e0e03c94b40475d2135d97148ed014/specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-03-01/examples/virtualMachineExamples/VirtualMachine_ListBySubscription_ByLocation.json
cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() clientFactory, err := armcompute.NewClientFactory("<subscription-id>", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } pager := clientFactory.NewVirtualMachinesClient().NewListByLocationPager("eastus", nil) for pager.More() { page, err := pager.NextPage(ctx) if err != nil { log.Fatalf("failed to advance page: %v", err) } for _, v := range page.Value { // You could use page here. We use blank identifier for just demo purposes. _ = v } // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. // page.VirtualMachineListResult = armcompute.VirtualMachineListResult{ // Value: []*armcompute.VirtualMachine{ // { // Name: to.Ptr("{virtualMachineName}"), // Type: to.Ptr("Microsoft.Compute/virtualMachines"), // ID: to.Ptr("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachines/{virtualMachineName}"), // Location: to.Ptr("eastus"), // Tags: map[string]*string{ // "RG": to.Ptr("rg"), // "testTag": to.Ptr("1"), // }, // Properties: &armcompute.VirtualMachineProperties{ // AvailabilitySet: &armcompute.SubResource{ // ID: to.Ptr("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/availabilitySets/{availabilitySetName}"), // }, // HardwareProfile: &armcompute.HardwareProfile{ // VMSize: to.Ptr(armcompute.VirtualMachineSizeTypesStandardA0), // }, // NetworkProfile: &armcompute.NetworkProfile{ // NetworkInterfaces: []*armcompute.NetworkInterfaceReference{ // { // ID: to.Ptr("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkInterfaces/{networkInterfaceName}"), // }}, // }, // OSProfile: &armcompute.OSProfile{ // AdminUsername: to.Ptr("Foo12"), // AllowExtensionOperations: to.Ptr(true), // ComputerName: to.Ptr("Test"), // Secrets: []*armcompute.VaultSecretGroup{ // }, // WindowsConfiguration: &armcompute.WindowsConfiguration{ // EnableAutomaticUpdates: to.Ptr(true), // ProvisionVMAgent: to.Ptr(true), // }, // }, // ProvisioningState: to.Ptr("Succeeded"), // StorageProfile: &armcompute.StorageProfile{ // DataDisks: []*armcompute.DataDisk{ // }, // ImageReference: &armcompute.ImageReference{ // Offer: to.Ptr("WindowsServer"), // Publisher: to.Ptr("MicrosoftWindowsServer"), // SKU: to.Ptr("2012-R2-Datacenter"), // Version: to.Ptr("4.127.20170406"), // }, // OSDisk: &armcompute.OSDisk{ // Name: to.Ptr("test"), // Caching: to.Ptr(armcompute.CachingTypesNone), // CreateOption: to.Ptr(armcompute.DiskCreateOptionTypesFromImage), // DiskSizeGB: to.Ptr[int32](127), // OSType: to.Ptr(armcompute.OperatingSystemTypesWindows), // Vhd: &armcompute.VirtualHardDisk{ // URI: to.Ptr("https://{storageAccountName}.blob.core.windows.net/{containerName}/{vhdName}.vhd"), // }, // }, // }, // VMID: to.Ptr("{vmId}"), // }, // }, // { // Name: to.Ptr("{virtualMachineName}"), // Type: to.Ptr("Microsoft.Compute/virtualMachines"), // ID: to.Ptr("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachines/{virtualMachineName}"), // Location: to.Ptr("eastus"), // Tags: map[string]*string{ // "RG": to.Ptr("rg"), // "testTag": to.Ptr("1"), // }, // Properties: &armcompute.VirtualMachineProperties{ // AvailabilitySet: &armcompute.SubResource{ // ID: to.Ptr("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/availabilitySets/{availabilitySetName}"), // }, // HardwareProfile: &armcompute.HardwareProfile{ // VMSize: to.Ptr(armcompute.VirtualMachineSizeTypesStandardA0), // }, // NetworkProfile: &armcompute.NetworkProfile{ // NetworkInterfaces: []*armcompute.NetworkInterfaceReference{ // { // ID: to.Ptr("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkInterfaces/{networkInterfaceName}"), // }}, // }, // OSProfile: &armcompute.OSProfile{ // AdminUsername: to.Ptr("Foo12"), // AllowExtensionOperations: to.Ptr(true), // ComputerName: to.Ptr("Test"), // Secrets: []*armcompute.VaultSecretGroup{ // }, // WindowsConfiguration: &armcompute.WindowsConfiguration{ // EnableAutomaticUpdates: to.Ptr(true), // ProvisionVMAgent: to.Ptr(true), // }, // }, // ProvisioningState: to.Ptr("Succeeded"), // StorageProfile: &armcompute.StorageProfile{ // DataDisks: []*armcompute.DataDisk{ // }, // ImageReference: &armcompute.ImageReference{ // Offer: to.Ptr("WindowsServer"), // Publisher: to.Ptr("MicrosoftWindowsServer"), // SKU: to.Ptr("2012-R2-Datacenter"), // Version: to.Ptr("4.127.20170406"), // }, // OSDisk: &armcompute.OSDisk{ // Name: to.Ptr("test"), // Caching: to.Ptr(armcompute.CachingTypesNone), // CreateOption: to.Ptr(armcompute.DiskCreateOptionTypesFromImage), // DiskSizeGB: to.Ptr[int32](127), // OSType: to.Ptr(armcompute.OperatingSystemTypesWindows), // Vhd: &armcompute.VirtualHardDisk{ // URI: to.Ptr("https://{storageAccountName}.blob.core.windows.net/{containerName}/{vhdName}.vhd"), // }, // }, // }, // VMID: to.Ptr("{vmId}"), // }, // }}, // } }
Output:
func (*VirtualMachinesClient) NewListPager ¶
func (client *VirtualMachinesClient) NewListPager(resourceGroupName string, options *VirtualMachinesClientListOptions) *runtime.Pager[VirtualMachinesClientListResponse]
NewListPager - Lists all of the virtual machines in the specified resource group. Use the nextLink property in the response to get the next page of virtual machines.
Generated from API version 2024-03-01
- resourceGroupName - The name of the resource group.
- options - VirtualMachinesClientListOptions contains the optional parameters for the VirtualMachinesClient.NewListPager method.
Example (VirtualMachineListMaximumSetGen) ¶
Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/92de53a5f1e0e03c94b40475d2135d97148ed014/specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-03-01/examples/virtualMachineExamples/VirtualMachine_List_MaximumSet_Gen.json
cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() clientFactory, err := armcompute.NewClientFactory("<subscription-id>", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } pager := clientFactory.NewVirtualMachinesClient().NewListPager("rgcompute", &armcompute.VirtualMachinesClientListOptions{Filter: to.Ptr("aaaaaaaaaaaaaaaaaaaaaaa"), Expand: nil, }) for pager.More() { page, err := pager.NextPage(ctx) if err != nil { log.Fatalf("failed to advance page: %v", err) } for _, v := range page.Value { // You could use page here. We use blank identifier for just demo purposes. _ = v } // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. // page.VirtualMachineListResult = armcompute.VirtualMachineListResult{ // Value: []*armcompute.VirtualMachine{ // { // Name: to.Ptr("{virtualMachineName}"), // Type: to.Ptr("Microsoft.Compute/virtualMachines"), // ID: to.Ptr("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachines/{virtualMachineName}"), // Location: to.Ptr("eastus"), // Tags: map[string]*string{ // }, // ExtendedLocation: &armcompute.ExtendedLocation{ // Name: to.Ptr("aaaa"), // Type: to.Ptr(armcompute.ExtendedLocationTypesEdgeZone), // }, // Identity: &armcompute.VirtualMachineIdentity{ // Type: to.Ptr(armcompute.ResourceIdentityTypeSystemAssigned), // PrincipalID: to.Ptr("aaaaaaaaaaaaaaaa"), // TenantID: to.Ptr("aaaaa"), // UserAssignedIdentities: map[string]*armcompute.UserAssignedIdentitiesValue{ // "key5688": &armcompute.UserAssignedIdentitiesValue{ // ClientID: to.Ptr("aaaaaaaaaaa"), // PrincipalID: to.Ptr("aaaaaaaaaaaaaaa"), // }, // }, // }, // Plan: &armcompute.Plan{ // Name: to.Ptr("aaaaaaaaaaaaaaaaaa"), // Product: to.Ptr("aaaaaaaaaaaaaaaaaaaaaa"), // PromotionCode: to.Ptr("aaaaaaaaaaaaaa"), // Publisher: to.Ptr("aaaaaaaaaaaaaaaaa"), // }, // Properties: &armcompute.VirtualMachineProperties{ // AdditionalCapabilities: &armcompute.AdditionalCapabilities{ // HibernationEnabled: to.Ptr(true), // UltraSSDEnabled: to.Ptr(true), // }, // ApplicationProfile: &armcompute.ApplicationProfile{ // GalleryApplications: []*armcompute.VMGalleryApplication{ // { // ConfigurationReference: to.Ptr("aaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"), // Order: to.Ptr[int32](4), // PackageReferenceID: to.Ptr("aaaaaaaaaaaaaaaaaaaaaa"), // Tags: to.Ptr("aaaaa"), // }}, // }, // AvailabilitySet: &armcompute.SubResource{ // ID: to.Ptr("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/availabilitySets/{availabilitySetName}"), // }, // BillingProfile: &armcompute.BillingProfile{ // MaxPrice: to.Ptr[float64](26), // }, // CapacityReservation: &armcompute.CapacityReservationProfile{ // CapacityReservationGroup: &armcompute.SubResource{ // ID: to.Ptr("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/availabilitySets/{availabilitySetName}"), // }, // }, // DiagnosticsProfile: &armcompute.DiagnosticsProfile{ // BootDiagnostics: &armcompute.BootDiagnostics{ // Enabled: to.Ptr(true), // StorageURI: to.Ptr("aaaaaaaaaaaaaaaaaaaaa"), // }, // }, // EvictionPolicy: to.Ptr(armcompute.VirtualMachineEvictionPolicyTypesDeallocate), // ExtensionsTimeBudget: to.Ptr("aaaaaaaaaaaaaaaaaaaaaaaaaaaa"), // HardwareProfile: &armcompute.HardwareProfile{ // VMSize: to.Ptr(armcompute.VirtualMachineSizeTypesStandardA0), // VMSizeProperties: &armcompute.VMSizeProperties{ // VCPUsAvailable: to.Ptr[int32](7), // VCPUsPerCore: to.Ptr[int32](14), // }, // }, // Host: &armcompute.SubResource{ // ID: to.Ptr("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/availabilitySets/{availabilitySetName}"), // }, // HostGroup: &armcompute.SubResource{ // ID: to.Ptr("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/availabilitySets/{availabilitySetName}"), // }, // LicenseType: to.Ptr("aaaaaaaaaaaaaaa"), // NetworkProfile: &armcompute.NetworkProfile{ // NetworkAPIVersion: to.Ptr(armcompute.NetworkAPIVersion("2022-05-01")), // NetworkInterfaceConfigurations: []*armcompute.VirtualMachineNetworkInterfaceConfiguration{ // { // Name: to.Ptr("aaaaaaaa"), // Properties: &armcompute.VirtualMachineNetworkInterfaceConfigurationProperties{ // DeleteOption: to.Ptr(armcompute.DeleteOptionsDelete), // DisableTCPStateTracking: to.Ptr(true), // DNSSettings: &armcompute.VirtualMachineNetworkInterfaceDNSSettingsConfiguration{ // DNSServers: []*string{ // to.Ptr("aaaaaaaaaaaaaaaaaaaaaaaa")}, // }, // DscpConfiguration: &armcompute.SubResource{ // ID: to.Ptr("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/availabilitySets/{availabilitySetName}"), // }, // EnableAcceleratedNetworking: to.Ptr(true), // EnableFpga: to.Ptr(true), // EnableIPForwarding: to.Ptr(true), // IPConfigurations: []*armcompute.VirtualMachineNetworkInterfaceIPConfiguration{ // { // Name: to.Ptr("aaaaaaaa"), // Properties: &armcompute.VirtualMachineNetworkInterfaceIPConfigurationProperties{ // ApplicationGatewayBackendAddressPools: []*armcompute.SubResource{ // { // ID: to.Ptr("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/availabilitySets/{availabilitySetName}"), // }}, // ApplicationSecurityGroups: []*armcompute.SubResource{ // { // ID: to.Ptr("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/availabilitySets/{availabilitySetName}"), // }}, // LoadBalancerBackendAddressPools: []*armcompute.SubResource{ // { // ID: to.Ptr("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/availabilitySets/{availabilitySetName}"), // }}, // Primary: to.Ptr(true), // PrivateIPAddressVersion: to.Ptr(armcompute.IPVersionsIPv4), // PublicIPAddressConfiguration: &armcompute.VirtualMachinePublicIPAddressConfiguration{ // Name: to.Ptr("aaaaaaaaaaaaaaaaaa"), // Properties: &armcompute.VirtualMachinePublicIPAddressConfigurationProperties{ // DeleteOption: to.Ptr(armcompute.DeleteOptionsDelete), // DNSSettings: &armcompute.VirtualMachinePublicIPAddressDNSSettingsConfiguration{ // DomainNameLabel: to.Ptr("aaaaa"), // }, // IdleTimeoutInMinutes: to.Ptr[int32](23), // IPTags: []*armcompute.VirtualMachineIPTag{ // { // IPTagType: to.Ptr("aaaaa"), // Tag: to.Ptr("aaaaaaaaaaaaaaaaaaaaaaaaaaa"), // }}, // PublicIPAddressVersion: to.Ptr(armcompute.IPVersionsIPv4), // PublicIPAllocationMethod: to.Ptr(armcompute.PublicIPAllocationMethodDynamic), // PublicIPPrefix: &armcompute.SubResource{ // ID: to.Ptr("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/availabilitySets/{availabilitySetName}"), // }, // }, // SKU: &armcompute.PublicIPAddressSKU{ // Name: to.Ptr(armcompute.PublicIPAddressSKUNameBasic), // Tier: to.Ptr(armcompute.PublicIPAddressSKUTierRegional), // }, // }, // Subnet: &armcompute.SubResource{ // ID: to.Ptr("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/availabilitySets/{availabilitySetName}"), // }, // }, // }}, // NetworkSecurityGroup: &armcompute.SubResource{ // ID: to.Ptr("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/availabilitySets/{availabilitySetName}"), // }, // Primary: to.Ptr(true), // }, // }}, // NetworkInterfaces: []*armcompute.NetworkInterfaceReference{ // { // ID: to.Ptr("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkInterfaces/{networkInterfaceName}"), // Properties: &armcompute.NetworkInterfaceReferenceProperties{ // DeleteOption: to.Ptr(armcompute.DeleteOptionsDelete), // Primary: to.Ptr(true), // }, // }}, // }, // OSProfile: &armcompute.OSProfile{ // AdminUsername: to.Ptr("Foo12"), // AllowExtensionOperations: to.Ptr(true), // ComputerName: to.Ptr("Test"), // CustomData: to.Ptr("aaaa"), // LinuxConfiguration: &armcompute.LinuxConfiguration{ // DisablePasswordAuthentication: to.Ptr(true), // PatchSettings: &armcompute.LinuxPatchSettings{ // AssessmentMode: to.Ptr(armcompute.LinuxPatchAssessmentModeImageDefault), // PatchMode: to.Ptr(armcompute.LinuxVMGuestPatchModeImageDefault), // }, // ProvisionVMAgent: to.Ptr(true), // SSH: &armcompute.SSHConfiguration{ // PublicKeys: []*armcompute.SSHPublicKey{ // { // Path: to.Ptr("aaaaaaaaaaaaaaaaaaaaaa"), // KeyData: to.Ptr("aaa"), // }}, // }, // }, // RequireGuestProvisionSignal: to.Ptr(true), // Secrets: []*armcompute.VaultSecretGroup{ // }, // WindowsConfiguration: &armcompute.WindowsConfiguration{ // AdditionalUnattendContent: []*armcompute.AdditionalUnattendContent{ // { // ComponentName: to.Ptr("Microsoft-Windows-Shell-Setup"), // Content: to.Ptr("aaaaaaaaaaaaaaaaaaaaaaaaaa"), // PassName: to.Ptr("OobeSystem"), // SettingName: to.Ptr(armcompute.SettingNamesAutoLogon), // }}, // EnableAutomaticUpdates: to.Ptr(true), // PatchSettings: &armcompute.PatchSettings{ // AssessmentMode: to.Ptr(armcompute.WindowsPatchAssessmentModeImageDefault), // EnableHotpatching: to.Ptr(true), // PatchMode: to.Ptr(armcompute.WindowsVMGuestPatchModeManual), // }, // ProvisionVMAgent: to.Ptr(true), // TimeZone: to.Ptr("aaaaaaaaaaaaaaaaaaaaaa"), // WinRM: &armcompute.WinRMConfiguration{ // Listeners: []*armcompute.WinRMListener{ // { // CertificateURL: to.Ptr("aaaaaaaaaaaaaaaaaaaaa"), // Protocol: to.Ptr(armcompute.ProtocolTypesHTTP), // }}, // }, // }, // }, // PlatformFaultDomain: to.Ptr[int32](8), // Priority: to.Ptr(armcompute.VirtualMachinePriorityTypesRegular), // ProvisioningState: to.Ptr("Succeeded"), // ProximityPlacementGroup: &armcompute.SubResource{ // ID: to.Ptr("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/availabilitySets/{availabilitySetName}"), // }, // ScheduledEventsProfile: &armcompute.ScheduledEventsProfile{ // OSImageNotificationProfile: &armcompute.OSImageNotificationProfile{ // Enable: to.Ptr(true), // NotBeforeTimeout: to.Ptr("PT15M"), // }, // TerminateNotificationProfile: &armcompute.TerminateNotificationProfile{ // Enable: to.Ptr(true), // NotBeforeTimeout: to.Ptr("PT10M"), // }, // }, // SecurityProfile: &armcompute.SecurityProfile{ // EncryptionAtHost: to.Ptr(true), // SecurityType: to.Ptr(armcompute.SecurityTypesTrustedLaunch), // UefiSettings: &armcompute.UefiSettings{ // SecureBootEnabled: to.Ptr(true), // VTpmEnabled: to.Ptr(true), // }, // }, // StorageProfile: &armcompute.StorageProfile{ // DataDisks: []*armcompute.DataDisk{ // }, // ImageReference: &armcompute.ImageReference{ // ID: to.Ptr("aaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"), // CommunityGalleryImageID: to.Ptr("aaaa"), // ExactVersion: to.Ptr("aaaaaaaaaaaaa"), // Offer: to.Ptr("WindowsServer"), // Publisher: to.Ptr("MicrosoftWindowsServer"), // SharedGalleryImageID: to.Ptr("aaaaaaaaaaaaaaa"), // SKU: to.Ptr("2012-R2-Datacenter"), // Version: to.Ptr("4.127.20170406"), // }, // OSDisk: &armcompute.OSDisk{ // Name: to.Ptr("test"), // Caching: to.Ptr(armcompute.CachingTypesNone), // CreateOption: to.Ptr(armcompute.DiskCreateOptionTypesFromImage), // DeleteOption: to.Ptr(armcompute.DiskDeleteOptionTypesDelete), // DiffDiskSettings: &armcompute.DiffDiskSettings{ // Option: to.Ptr(armcompute.DiffDiskOptionsLocal), // Placement: to.Ptr(armcompute.DiffDiskPlacementCacheDisk), // }, // DiskSizeGB: to.Ptr[int32](127), // EncryptionSettings: &armcompute.DiskEncryptionSettings{ // DiskEncryptionKey: &armcompute.KeyVaultSecretReference{ // SecretURL: to.Ptr("aaaaaaaaa"), // SourceVault: &armcompute.SubResource{ // ID: to.Ptr("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/availabilitySets/{availabilitySetName}"), // }, // }, // Enabled: to.Ptr(true), // KeyEncryptionKey: &armcompute.KeyVaultKeyReference{ // KeyURL: to.Ptr("aaaaaaaaaaaaa"), // SourceVault: &armcompute.SubResource{ // ID: to.Ptr("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/availabilitySets/{availabilitySetName}"), // }, // }, // }, // Image: &armcompute.VirtualHardDisk{ // URI: to.Ptr("https://{storageAccountName}.blob.core.windows.net/{containerName}/{vhdName}.vhd"), // }, // ManagedDisk: &armcompute.ManagedDiskParameters{ // ID: to.Ptr("/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/disks/testingexcludedisk_OsDisk_1_74cdaedcea50483d9833c96adefa100f"), // DiskEncryptionSet: &armcompute.DiskEncryptionSetParameters{ // ID: to.Ptr("aaaaaaaaaaaaaaaaaaaaaaaaaaaa"), // }, // SecurityProfile: &armcompute.VMDiskSecurityProfile{ // DiskEncryptionSet: &armcompute.DiskEncryptionSetParameters{ // ID: to.Ptr("aaaaaaaaaaaaaaaaaaaaaaaaaaaa"), // }, // SecurityEncryptionType: to.Ptr(armcompute.SecurityEncryptionTypesVMGuestStateOnly), // }, // StorageAccountType: to.Ptr(armcompute.StorageAccountTypesStandardLRS), // }, // OSType: to.Ptr(armcompute.OperatingSystemTypesWindows), // Vhd: &armcompute.VirtualHardDisk{ // URI: to.Ptr("https://{storageAccountName}.blob.core.windows.net/{containerName}/{vhdName}.vhd"), // }, // WriteAcceleratorEnabled: to.Ptr(true), // }, // }, // TimeCreated: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2022-01-14T16:43:41.683Z"); return t}()), // UserData: to.Ptr("aaa"), // VirtualMachineScaleSet: &armcompute.SubResource{ // ID: to.Ptr("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/availabilitySets/{availabilitySetName}"), // }, // VMID: to.Ptr("{vmId}"), // }, // Resources: []*armcompute.VirtualMachineExtension{ // { // Name: to.Ptr("aaaaaaaaaaaaa"), // Type: to.Ptr("aaaaaaaaaaaaaaaaaaaaaaaaaaa"), // ID: to.Ptr("aaaaaaaaaaaaaaaaaaaaaaaaaaaaa"), // Location: to.Ptr("aaaaaaaaaaaaaaaa"), // Tags: map[string]*string{ // "key9428": to.Ptr("aaaaaaa"), // }, // Properties: &armcompute.VirtualMachineExtensionProperties{ // Type: to.Ptr("aaaaaaaa"), // AutoUpgradeMinorVersion: to.Ptr(true), // EnableAutomaticUpgrade: to.Ptr(true), // ForceUpdateTag: to.Ptr("aaaaaaaaaaaaaaa"), // InstanceView: &armcompute.VirtualMachineExtensionInstanceView{ // Name: to.Ptr("aaaaaaaaaaaaaaaaaaaaaaaa"), // Type: to.Ptr("aaaaaaaaaaaaaaaaaaaaaaaa"), // Statuses: []*armcompute.InstanceViewStatus{ // { // Code: to.Ptr("aaa"), // DisplayStatus: to.Ptr("aaaaaaaaaaaaaaaaaaaaaaaa"), // Level: to.Ptr(armcompute.StatusLevelTypesInfo), // Message: to.Ptr("aaaaaaaaaaaaaaaaaaa"), // Time: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2022-01-14T16:43:41.657Z"); return t}()), // }}, // Substatuses: []*armcompute.InstanceViewStatus{ // { // Code: to.Ptr("aaa"), // DisplayStatus: to.Ptr("aaaaaaaaaaaaaaaaaaaaaaaa"), // Level: to.Ptr(armcompute.StatusLevelTypesInfo), // Message: to.Ptr("aaaaaaaaaaaaaaaaaaa"), // Time: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2022-01-14T16:43:41.657Z"); return t}()), // }}, // TypeHandlerVersion: to.Ptr("aaaaaa"), // }, // ProtectedSettings: map[string]any{ // }, // ProtectedSettingsFromKeyVault: &armcompute.KeyVaultSecretReference{ // SecretURL: to.Ptr("https://kvName.vault.azure.net/secrets/secretName/79b88b3a6f5440ffb2e73e44a0db712e"), // SourceVault: &armcompute.SubResource{ // ID: to.Ptr("/subscriptions/a53f7094-a16c-47af-abe4-b05c05d0d79a/resourceGroups/myResourceGroup/providers/Microsoft.KeyVault/vaults/kvName"), // }, // }, // ProvisioningState: to.Ptr("Succeeded"), // Publisher: to.Ptr("aaaaaaaaaaaaaaaa"), // Settings: map[string]any{ // }, // SuppressFailures: to.Ptr(true), // TypeHandlerVersion: to.Ptr("aaaaaaaaaaaa"), // }, // }}, // Zones: []*string{ // to.Ptr("aaaaaaaaaaaaaaaaaaaaaaaaaaa")}, // }, // { // Name: to.Ptr("{virtualMachineName}"), // Type: to.Ptr("Microsoft.Compute/virtualMachines"), // ID: to.Ptr("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachines/{virtualMachineName}"), // Location: to.Ptr("eastus"), // Tags: map[string]*string{ // }, // ExtendedLocation: &armcompute.ExtendedLocation{ // Name: to.Ptr("aaaa"), // Type: to.Ptr(armcompute.ExtendedLocationTypesEdgeZone), // }, // Identity: &armcompute.VirtualMachineIdentity{ // Type: to.Ptr(armcompute.ResourceIdentityTypeSystemAssigned), // PrincipalID: to.Ptr("aaaaaaaaaaaaaaaa"), // TenantID: to.Ptr("aaaaa"), // UserAssignedIdentities: map[string]*armcompute.UserAssignedIdentitiesValue{ // "key5688": &armcompute.UserAssignedIdentitiesValue{ // ClientID: to.Ptr("aaaaaaaaaaa"), // PrincipalID: to.Ptr("aaaaaaaaaaaaaaa"), // }, // }, // }, // Plan: &armcompute.Plan{ // Name: to.Ptr("aaaaaaaaaaaaaaaaaa"), // Product: to.Ptr("aaaaaaaaaaaaaaaaaaaaaa"), // PromotionCode: to.Ptr("aaaaaaaaaaaaaa"), // Publisher: to.Ptr("aaaaaaaaaaaaaaaaa"), // }, // Properties: &armcompute.VirtualMachineProperties{ // AdditionalCapabilities: &armcompute.AdditionalCapabilities{ // HibernationEnabled: to.Ptr(true), // UltraSSDEnabled: to.Ptr(true), // }, // ApplicationProfile: &armcompute.ApplicationProfile{ // GalleryApplications: []*armcompute.VMGalleryApplication{ // { // ConfigurationReference: to.Ptr("aaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"), // Order: to.Ptr[int32](4), // PackageReferenceID: to.Ptr("aaaaaaaaaaaaaaaaaaaaaa"), // Tags: to.Ptr("aaaaa"), // }}, // }, // AvailabilitySet: &armcompute.SubResource{ // ID: to.Ptr("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/availabilitySets/{availabilitySetName}"), // }, // BillingProfile: &armcompute.BillingProfile{ // MaxPrice: to.Ptr[float64](26), // }, // CapacityReservation: &armcompute.CapacityReservationProfile{ // CapacityReservationGroup: &armcompute.SubResource{ // ID: to.Ptr("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/availabilitySets/{availabilitySetName}"), // }, // }, // DiagnosticsProfile: &armcompute.DiagnosticsProfile{ // BootDiagnostics: &armcompute.BootDiagnostics{ // Enabled: to.Ptr(true), // StorageURI: to.Ptr("aaaaaaaaaaaaaaaaaaaaa"), // }, // }, // EvictionPolicy: to.Ptr(armcompute.VirtualMachineEvictionPolicyTypesDeallocate), // ExtensionsTimeBudget: to.Ptr("aaaaaaaaaaaaaaaaaaaaaa"), // HardwareProfile: &armcompute.HardwareProfile{ // VMSize: to.Ptr(armcompute.VirtualMachineSizeTypesStandardA0), // VMSizeProperties: &armcompute.VMSizeProperties{ // VCPUsAvailable: to.Ptr[int32](7), // VCPUsPerCore: to.Ptr[int32](14), // }, // }, // Host: &armcompute.SubResource{ // ID: to.Ptr("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/availabilitySets/{availabilitySetName}"), // }, // HostGroup: &armcompute.SubResource{ // ID: to.Ptr("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/availabilitySets/{availabilitySetName}"), // }, // InstanceView: &armcompute.VirtualMachineInstanceView{ // AssignedHost: to.Ptr("aaaaaaaaaaaaaaaaaaaaaaaaaaaaa"), // BootDiagnostics: &armcompute.BootDiagnosticsInstanceView{ // ConsoleScreenshotBlobURI: to.Ptr("aaaaaaaaaaaaaaaaaaaaaaa"), // SerialConsoleLogBlobURI: to.Ptr("aaaaaaaaaaaaaaaaaaa"), // Status: &armcompute.InstanceViewStatus{ // Code: to.Ptr("aaa"), // DisplayStatus: to.Ptr("aaaaaaaaaaaaaaaaaaaaaaaa"), // Level: to.Ptr(armcompute.StatusLevelTypesInfo), // Message: to.Ptr("aaaaaaaaaaaaaaaaaaa"), // Time: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2022-01-14T16:43:41.657Z"); return t}()), // }, // }, // ComputerName: to.Ptr("aaaaaaaaaaaaaaaaaaaaaaaaaaaaa"), // Disks: []*armcompute.DiskInstanceView{ // { // Name: to.Ptr("a"), // EncryptionSettings: []*armcompute.DiskEncryptionSettings{ // { // DiskEncryptionKey: &armcompute.KeyVaultSecretReference{ // SecretURL: to.Ptr("aaaaaaaaa"), // SourceVault: &armcompute.SubResource{ // ID: to.Ptr("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/availabilitySets/{availabilitySetName}"), // }, // }, // Enabled: to.Ptr(true), // KeyEncryptionKey: &armcompute.KeyVaultKeyReference{ // KeyURL: to.Ptr("aaaaaaaaaaaaa"), // SourceVault: &armcompute.SubResource{ // ID: to.Ptr("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/availabilitySets/{availabilitySetName}"), // }, // }, // }}, // Statuses: []*armcompute.InstanceViewStatus{ // { // Code: to.Ptr("aaa"), // DisplayStatus: to.Ptr("aaaaaaaaaaaaaaaaaaaaaaaa"), // Level: to.Ptr(armcompute.StatusLevelTypesInfo), // Message: to.Ptr("aaaaaaaaaaaaaaaaaaa"), // Time: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2022-01-14T16:43:41.657Z"); return t}()), // }}, // }}, // HyperVGeneration: to.Ptr(armcompute.HyperVGenerationTypeV1), // IsVMInStandbyPool: to.Ptr(false), // MaintenanceRedeployStatus: &armcompute.MaintenanceRedeployStatus{ // IsCustomerInitiatedMaintenanceAllowed: to.Ptr(true), // LastOperationMessage: to.Ptr("aa"), // LastOperationResultCode: to.Ptr(armcompute.MaintenanceOperationResultCodeTypesNone), // MaintenanceWindowEndTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2022-01-14T16:43:41.682Z"); return t}()), // MaintenanceWindowStartTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2022-01-14T16:43:41.682Z"); return t}()), // PreMaintenanceWindowEndTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2022-01-14T16:43:41.682Z"); return t}()), // PreMaintenanceWindowStartTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2022-01-14T16:43:41.682Z"); return t}()), // }, // OSName: to.Ptr("aaaaaaaaaaa"), // OSVersion: to.Ptr("aaaaaaaaaaaaaa"), // PatchStatus: &armcompute.VirtualMachinePatchStatus{ // AvailablePatchSummary: &armcompute.AvailablePatchSummary{ // AssessmentActivityID: to.Ptr("aaaaaaaaaaaaaaaaaaa"), // CriticalAndSecurityPatchCount: to.Ptr[int32](22), // Error: &armcompute.APIError{ // Code: to.Ptr("aaaaaa"), // Innererror: &armcompute.InnerError{ // Errordetail: to.Ptr("aaaaaaaaaaaaaaaaaaaaaaaaaaaa"), // Exceptiontype: to.Ptr("aaaaaaaaaaaaaaaaaaaaaaaaaaaaa"), // }, // Message: to.Ptr("aaa"), // Target: to.Ptr("aaaaaaaaa"), // Details: []*armcompute.APIErrorBase{ // { // Code: to.Ptr("aaaaaaaaaaaaaaaaaaaaa"), // Message: to.Ptr("aaaaaaaaaaaaa"), // Target: to.Ptr("aaaaaa"), // }}, // }, // LastModifiedTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2022-01-14T16:43:41.683Z"); return t}()), // OtherPatchCount: to.Ptr[int32](25), // RebootPending: to.Ptr(true), // StartTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2022-01-14T16:43:41.682Z"); return t}()), // Status: to.Ptr(armcompute.PatchOperationStatusUnknown), // }, // ConfigurationStatuses: []*armcompute.InstanceViewStatus{ // { // Code: to.Ptr("aaa"), // DisplayStatus: to.Ptr("aaaaaaaaaaaaaaaaaaaaaaaa"), // Level: to.Ptr(armcompute.StatusLevelTypesInfo), // Message: to.Ptr("aaaaaaaaaaaaaaaaaaa"), // Time: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2022-01-14T16:43:41.657Z"); return t}()), // }}, // LastPatchInstallationSummary: &armcompute.LastPatchInstallationSummary{ // Error: &armcompute.APIError{ // Code: to.Ptr("aaaaaa"), // Innererror: &armcompute.InnerError{ // Errordetail: to.Ptr("aaaaaaaaaaaaaaaaaaaaaaaaaaaa"), // Exceptiontype: to.Ptr("aaaaaaaaaaaaaaaaaaaaaaaaaaaaa"), // }, // Message: to.Ptr("aaa"), // Target: to.Ptr("aaaaaaaaa"), // Details: []*armcompute.APIErrorBase{ // { // Code: to.Ptr("aaaaaaaaaaaaaaaaaaaaa"), // Message: to.Ptr("aaaaaaaaaaaaa"), // Target: to.Ptr("aaaaaa"), // }}, // }, // ExcludedPatchCount: to.Ptr[int32](1), // FailedPatchCount: to.Ptr[int32](30), // InstallationActivityID: to.Ptr("aaaaaa"), // InstalledPatchCount: to.Ptr[int32](28), // LastModifiedTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2022-01-14T16:43:41.683Z"); return t}()), // MaintenanceWindowExceeded: to.Ptr(true), // NotSelectedPatchCount: to.Ptr[int32](20), // PendingPatchCount: to.Ptr[int32](2), // StartTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2022-01-14T16:43:41.683Z"); return t}()), // Status: to.Ptr(armcompute.PatchOperationStatusUnknown), // }, // }, // PlatformFaultDomain: to.Ptr[int32](29), // PlatformUpdateDomain: to.Ptr[int32](1), // RdpThumbPrint: to.Ptr("aaaaaaaaaaaaaaaaaaaaaaa"), // Statuses: []*armcompute.InstanceViewStatus{ // { // Code: to.Ptr("aaa"), // DisplayStatus: to.Ptr("aaaaaaaaaaaaaaaaaaaaaaaa"), // Level: to.Ptr(armcompute.StatusLevelTypesInfo), // Message: to.Ptr("aaaaaaaaaaaaaaaaaaa"), // Time: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2022-01-14T16:43:41.657Z"); return t}()), // }}, // VMAgent: &armcompute.VirtualMachineAgentInstanceView{ // ExtensionHandlers: []*armcompute.VirtualMachineExtensionHandlerInstanceView{ // { // Type: to.Ptr("aaaaa"), // Status: &armcompute.InstanceViewStatus{ // Code: to.Ptr("aaa"), // DisplayStatus: to.Ptr("aaaaaaaaaaaaaaaaaaaaaaaa"), // Level: to.Ptr(armcompute.StatusLevelTypesInfo), // Message: to.Ptr("aaaaaaaaaaaaaaaaaaa"), // Time: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2022-01-14T16:43:41.657Z"); return t}()), // }, // TypeHandlerVersion: to.Ptr("aaaaaaaaaaaaaaaaaaa"), // }}, // Statuses: []*armcompute.InstanceViewStatus{ // { // Code: to.Ptr("aaa"), // DisplayStatus: to.Ptr("aaaaaaaaaaaaaaaaaaaaaaaa"), // Level: to.Ptr(armcompute.StatusLevelTypesInfo), // Message: to.Ptr("aaaaaaaaaaaaaaaaaaa"), // Time: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2022-01-14T16:43:41.657Z"); return t}()), // }}, // VMAgentVersion: to.Ptr("aaaaaaaaaaaaaaaaaaaaaaaaaaaaa"), // }, // VMHealth: &armcompute.VirtualMachineHealthStatus{ // Status: &armcompute.InstanceViewStatus{ // Code: to.Ptr("aaa"), // DisplayStatus: to.Ptr("aaaaaaaaaaaaaaaaaaaaaaaa"), // Level: to.Ptr(armcompute.StatusLevelTypesInfo), // Message: to.Ptr("aaaaaaaaaaaaaaaaaaa"), // Time: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2022-01-14T16:43:41.657Z"); return t}()), // }, // }, // Extensions: []*armcompute.VirtualMachineExtensionInstanceView{ // { // Name: to.Ptr("aaaaaaaaaaaaaaaaaaaaaaaa"), // Type: to.Ptr("aaaaaaaaaaaaaaaaaaaaaaaa"), // Statuses: []*armcompute.InstanceViewStatus{ // { // Code: to.Ptr("aaa"), // DisplayStatus: to.Ptr("aaaaaaaaaaaaaaaaaaaaaaaa"), // Level: to.Ptr(armcompute.StatusLevelTypesInfo), // Message: to.Ptr("aaaaaaaaaaaaaaaaaaa"), // Time: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2022-01-14T16:43:41.657Z"); return t}()), // }}, // Substatuses: []*armcompute.InstanceViewStatus{ // { // Code: to.Ptr("aaa"), // DisplayStatus: to.Ptr("aaaaaaaaaaaaaaaaaaaaaaaa"), // Level: to.Ptr(armcompute.StatusLevelTypesInfo), // Message: to.Ptr("aaaaaaaaaaaaaaaaaaa"), // Time: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2022-01-14T16:43:41.657Z"); return t}()), // }}, // TypeHandlerVersion: to.Ptr("aaaaaa"), // }}, // }, // LicenseType: to.Ptr("aaaaaaaaaaaaaa"), // NetworkProfile: &armcompute.NetworkProfile{ // NetworkAPIVersion: to.Ptr(armcompute.NetworkAPIVersion("2022-05-01")), // NetworkInterfaceConfigurations: []*armcompute.VirtualMachineNetworkInterfaceConfiguration{ // { // Name: to.Ptr("aaaaaaaa"), // Properties: &armcompute.VirtualMachineNetworkInterfaceConfigurationProperties{ // DeleteOption: to.Ptr(armcompute.DeleteOptionsDelete), // DisableTCPStateTracking: to.Ptr(true), // DNSSettings: &armcompute.VirtualMachineNetworkInterfaceDNSSettingsConfiguration{ // DNSServers: []*string{ // to.Ptr("aaaaaaaaaaaaaaaaaaaaaaaa")}, // }, // DscpConfiguration: &armcompute.SubResource{ // ID: to.Ptr("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/availabilitySets/{availabilitySetName}"), // }, // EnableAcceleratedNetworking: to.Ptr(true), // EnableFpga: to.Ptr(true), // EnableIPForwarding: to.Ptr(true), // IPConfigurations: []*armcompute.VirtualMachineNetworkInterfaceIPConfiguration{ // { // Name: to.Ptr("aaaaaaaa"), // Properties: &armcompute.VirtualMachineNetworkInterfaceIPConfigurationProperties{ // ApplicationGatewayBackendAddressPools: []*armcompute.SubResource{ // { // ID: to.Ptr("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/availabilitySets/{availabilitySetName}"), // }}, // ApplicationSecurityGroups: []*armcompute.SubResource{ // { // ID: to.Ptr("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/availabilitySets/{availabilitySetName}"), // }}, // LoadBalancerBackendAddressPools: []*armcompute.SubResource{ // { // ID: to.Ptr("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/availabilitySets/{availabilitySetName}"), // }}, // Primary: to.Ptr(true), // PrivateIPAddressVersion: to.Ptr(armcompute.IPVersionsIPv4), // PublicIPAddressConfiguration: &armcompute.VirtualMachinePublicIPAddressConfiguration{ // Name: to.Ptr("aaaaaaaaaaaaaaaaaa"), // Properties: &armcompute.VirtualMachinePublicIPAddressConfigurationProperties{ // DeleteOption: to.Ptr(armcompute.DeleteOptionsDelete), // DNSSettings: &armcompute.VirtualMachinePublicIPAddressDNSSettingsConfiguration{ // DomainNameLabel: to.Ptr("aaaaa"), // }, // IdleTimeoutInMinutes: to.Ptr[int32](23), // IPTags: []*armcompute.VirtualMachineIPTag{ // { // IPTagType: to.Ptr("aaaaa"), // Tag: to.Ptr("aaaaaaaaaaaaaaaaaaaaaaaaaaa"), // }}, // PublicIPAddressVersion: to.Ptr(armcompute.IPVersionsIPv4), // PublicIPAllocationMethod: to.Ptr(armcompute.PublicIPAllocationMethodDynamic), // PublicIPPrefix: &armcompute.SubResource{ // ID: to.Ptr("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/availabilitySets/{availabilitySetName}"), // }, // }, // SKU: &armcompute.PublicIPAddressSKU{ // Name: to.Ptr(armcompute.PublicIPAddressSKUNameBasic), // Tier: to.Ptr(armcompute.PublicIPAddressSKUTierRegional), // }, // }, // Subnet: &armcompute.SubResource{ // ID: to.Ptr("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/availabilitySets/{availabilitySetName}"), // }, // }, // }}, // NetworkSecurityGroup: &armcompute.SubResource{ // ID: to.Ptr("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/availabilitySets/{availabilitySetName}"), // }, // Primary: to.Ptr(true), // }, // }}, // NetworkInterfaces: []*armcompute.NetworkInterfaceReference{ // { // ID: to.Ptr("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkInterfaces/{networkInterfaceName}"), // Properties: &armcompute.NetworkInterfaceReferenceProperties{ // DeleteOption: to.Ptr(armcompute.DeleteOptionsDelete), // Primary: to.Ptr(true), // }, // }}, // }, // OSProfile: &armcompute.OSProfile{ // AdminUsername: to.Ptr("Foo12"), // AllowExtensionOperations: to.Ptr(true), // ComputerName: to.Ptr("Test"), // CustomData: to.Ptr("aaaaaaaaaaaaaaaaaaaaaaa"), // LinuxConfiguration: &armcompute.LinuxConfiguration{ // DisablePasswordAuthentication: to.Ptr(true), // PatchSettings: &armcompute.LinuxPatchSettings{ // AssessmentMode: to.Ptr(armcompute.LinuxPatchAssessmentModeImageDefault), // PatchMode: to.Ptr(armcompute.LinuxVMGuestPatchModeImageDefault), // }, // ProvisionVMAgent: to.Ptr(true), // SSH: &armcompute.SSHConfiguration{ // PublicKeys: []*armcompute.SSHPublicKey{ // { // Path: to.Ptr("aaaaaaaaaaaaaaaaaaaaaa"), // KeyData: to.Ptr("aaa"), // }}, // }, // }, // RequireGuestProvisionSignal: to.Ptr(true), // Secrets: []*armcompute.VaultSecretGroup{ // }, // WindowsConfiguration: &armcompute.WindowsConfiguration{ // AdditionalUnattendContent: []*armcompute.AdditionalUnattendContent{ // { // ComponentName: to.Ptr("Microsoft-Windows-Shell-Setup"), // Content: to.Ptr("aaaaaaaaaaaaaaaaaaaaaaaaaa"), // PassName: to.Ptr("OobeSystem"), // SettingName: to.Ptr(armcompute.SettingNamesAutoLogon), // }}, // EnableAutomaticUpdates: to.Ptr(true), // PatchSettings: &armcompute.PatchSettings{ // AssessmentMode: to.Ptr(armcompute.WindowsPatchAssessmentModeImageDefault), // EnableHotpatching: to.Ptr(true), // PatchMode: to.Ptr(armcompute.WindowsVMGuestPatchModeManual), // }, // ProvisionVMAgent: to.Ptr(true), // TimeZone: to.Ptr("aaaaaaaaaaaaaaaaaaaa"), // WinRM: &armcompute.WinRMConfiguration{ // Listeners: []*armcompute.WinRMListener{ // { // CertificateURL: to.Ptr("aaaaaaaaaaaaaaaaaaaaa"), // Protocol: to.Ptr(armcompute.ProtocolTypesHTTP), // }}, // }, // }, // }, // PlatformFaultDomain: to.Ptr[int32](11), // Priority: to.Ptr(armcompute.VirtualMachinePriorityTypesRegular), // ProvisioningState: to.Ptr("Succeeded"), // ProximityPlacementGroup: &armcompute.SubResource{ // ID: to.Ptr("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/availabilitySets/{availabilitySetName}"), // }, // ScheduledEventsProfile: &armcompute.ScheduledEventsProfile{ // OSImageNotificationProfile: &armcompute.OSImageNotificationProfile{ // Enable: to.Ptr(true), // NotBeforeTimeout: to.Ptr("PT15M"), // }, // TerminateNotificationProfile: &armcompute.TerminateNotificationProfile{ // Enable: to.Ptr(true), // NotBeforeTimeout: to.Ptr("PT10M"), // }, // }, // SecurityProfile: &armcompute.SecurityProfile{ // EncryptionAtHost: to.Ptr(true), // SecurityType: to.Ptr(armcompute.SecurityTypesTrustedLaunch), // UefiSettings: &armcompute.UefiSettings{ // SecureBootEnabled: to.Ptr(true), // VTpmEnabled: to.Ptr(true), // }, // }, // StorageProfile: &armcompute.StorageProfile{ // DataDisks: []*armcompute.DataDisk{ // }, // ImageReference: &armcompute.ImageReference{ // ID: to.Ptr("aaaaaaaa"), // CommunityGalleryImageID: to.Ptr("aaaaaaaaaaaaaaaaaaaaaaaaaaaa"), // ExactVersion: to.Ptr("aa"), // Offer: to.Ptr("WindowsServer"), // Publisher: to.Ptr("MicrosoftWindowsServer"), // SharedGalleryImageID: to.Ptr("aaaaaaaaaaaaaaaaaaaaaaaaa"), // SKU: to.Ptr("2012-R2-Datacenter"), // Version: to.Ptr("4.127.20170406"), // }, // OSDisk: &armcompute.OSDisk{ // Name: to.Ptr("test"), // Caching: to.Ptr(armcompute.CachingTypesNone), // CreateOption: to.Ptr(armcompute.DiskCreateOptionTypesFromImage), // DeleteOption: to.Ptr(armcompute.DiskDeleteOptionTypesDelete), // DiffDiskSettings: &armcompute.DiffDiskSettings{ // Option: to.Ptr(armcompute.DiffDiskOptionsLocal), // Placement: to.Ptr(armcompute.DiffDiskPlacementCacheDisk), // }, // DiskSizeGB: to.Ptr[int32](127), // EncryptionSettings: &armcompute.DiskEncryptionSettings{ // DiskEncryptionKey: &armcompute.KeyVaultSecretReference{ // SecretURL: to.Ptr("aaaaaaaaa"), // SourceVault: &armcompute.SubResource{ // ID: to.Ptr("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/availabilitySets/{availabilitySetName}"), // }, // }, // Enabled: to.Ptr(true), // KeyEncryptionKey: &armcompute.KeyVaultKeyReference{ // KeyURL: to.Ptr("aaaaaaaaaaaaa"), // SourceVault: &armcompute.SubResource{ // ID: to.Ptr("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/availabilitySets/{availabilitySetName}"), // }, // }, // }, // Image: &armcompute.VirtualHardDisk{ // URI: to.Ptr("https://{storageAccountName}.blob.core.windows.net/{containerName}/{vhdName}.vhd"), // }, // ManagedDisk: &armcompute.ManagedDiskParameters{ // ID: to.Ptr("/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/disks/testingexcludedisk_OsDisk_1_74cdaedcea50483d9833c96adefa100f"), // DiskEncryptionSet: &armcompute.DiskEncryptionSetParameters{ // ID: to.Ptr("aaaaaaaaaaaaaaaaaaaaaaaaaaaa"), // }, // SecurityProfile: &armcompute.VMDiskSecurityProfile{ // DiskEncryptionSet: &armcompute.DiskEncryptionSetParameters{ // ID: to.Ptr("aaaaaaaaaaaaaaaaaaaaaaaaaaaa"), // }, // SecurityEncryptionType: to.Ptr(armcompute.SecurityEncryptionTypesVMGuestStateOnly), // }, // StorageAccountType: to.Ptr(armcompute.StorageAccountTypesStandardLRS), // }, // OSType: to.Ptr(armcompute.OperatingSystemTypesWindows), // Vhd: &armcompute.VirtualHardDisk{ // URI: to.Ptr("https://{storageAccountName}.blob.core.windows.net/{containerName}/{vhdName}.vhd"), // }, // WriteAcceleratorEnabled: to.Ptr(true), // }, // }, // TimeCreated: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2022-01-14T16:43:41.685Z"); return t}()), // UserData: to.Ptr("aaaaaaaaaaaaaaaaaaa"), // VirtualMachineScaleSet: &armcompute.SubResource{ // ID: to.Ptr("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/availabilitySets/{availabilitySetName}"), // }, // VMID: to.Ptr("{vmId}"), // }, // Resources: []*armcompute.VirtualMachineExtension{ // { // Name: to.Ptr("aaaaaaaaaaaaa"), // Type: to.Ptr("aaaaaaaaaaaaaaaaaaaaaaaaaaa"), // ID: to.Ptr("aaaaaaaaaaaaaaaaaaaaaaaaaaaaa"), // Location: to.Ptr("aaaaaaaaaaaaaaaa"), // Tags: map[string]*string{ // "key9428": to.Ptr("aaaaaaa"), // }, // Properties: &armcompute.VirtualMachineExtensionProperties{ // Type: to.Ptr("aaaaaaaa"), // AutoUpgradeMinorVersion: to.Ptr(true), // EnableAutomaticUpgrade: to.Ptr(true), // ForceUpdateTag: to.Ptr("aaaaaaaaaaaaaaa"), // InstanceView: &armcompute.VirtualMachineExtensionInstanceView{ // Name: to.Ptr("aaaaaaaaaaaaaaaaaaaaaaaa"), // Type: to.Ptr("aaaaaaaaaaaaaaaaaaaaaaaa"), // Statuses: []*armcompute.InstanceViewStatus{ // { // Code: to.Ptr("aaa"), // DisplayStatus: to.Ptr("aaaaaaaaaaaaaaaaaaaaaaaa"), // Level: to.Ptr(armcompute.StatusLevelTypesInfo), // Message: to.Ptr("aaaaaaaaaaaaaaaaaaa"), // Time: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2022-01-14T16:43:41.657Z"); return t}()), // }}, // Substatuses: []*armcompute.InstanceViewStatus{ // { // Code: to.Ptr("aaa"), // DisplayStatus: to.Ptr("aaaaaaaaaaaaaaaaaaaaaaaa"), // Level: to.Ptr(armcompute.StatusLevelTypesInfo), // Message: to.Ptr("aaaaaaaaaaaaaaaaaaa"), // Time: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2022-01-14T16:43:41.657Z"); return t}()), // }}, // TypeHandlerVersion: to.Ptr("aaaaaa"), // }, // ProtectedSettings: map[string]any{ // }, // ProtectedSettingsFromKeyVault: &armcompute.KeyVaultSecretReference{ // SecretURL: to.Ptr("https://kvName.vault.azure.net/secrets/secretName/79b88b3a6f5440ffb2e73e44a0db712e"), // SourceVault: &armcompute.SubResource{ // ID: to.Ptr("/subscriptions/a53f7094-a16c-47af-abe4-b05c05d0d79a/resourceGroups/myResourceGroup/providers/Microsoft.KeyVault/vaults/kvName"), // }, // }, // ProvisioningState: to.Ptr("Succeeded"), // Publisher: to.Ptr("aaaaaaaaaaaaaaaa"), // Settings: map[string]any{ // }, // SuppressFailures: to.Ptr(true), // TypeHandlerVersion: to.Ptr("aaaaaaaaaaaa"), // }, // }}, // Zones: []*string{ // to.Ptr("aaaaaa")}, // }}, // } }
Output:
Example (VirtualMachineListMinimumSetGen) ¶
Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/92de53a5f1e0e03c94b40475d2135d97148ed014/specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-03-01/examples/virtualMachineExamples/VirtualMachine_List_MinimumSet_Gen.json
cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() clientFactory, err := armcompute.NewClientFactory("<subscription-id>", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } pager := clientFactory.NewVirtualMachinesClient().NewListPager("rgcompute", &armcompute.VirtualMachinesClientListOptions{Filter: nil, Expand: nil, }) for pager.More() { page, err := pager.NextPage(ctx) if err != nil { log.Fatalf("failed to advance page: %v", err) } for _, v := range page.Value { // You could use page here. We use blank identifier for just demo purposes. _ = v } // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. // page.VirtualMachineListResult = armcompute.VirtualMachineListResult{ // Value: []*armcompute.VirtualMachine{ // { // ID: to.Ptr("/subscriptions/{subscriptionId}/resourceGroups/rgcompute/providers/Microsoft.Compute/virtualMachines/{virtualMachineName}"), // Location: to.Ptr("eastus"), // }, // { // ID: to.Ptr("/subscriptions/{subscriptionId}/resourceGroups/rgcompute/providers/Microsoft.Compute/virtualMachines/{virtualMachineName}"), // Location: to.Ptr("eastus"), // }}, // } }
Output:
func (*VirtualMachinesClient) RetrieveBootDiagnosticsData ¶
func (client *VirtualMachinesClient) RetrieveBootDiagnosticsData(ctx context.Context, resourceGroupName string, vmName string, options *VirtualMachinesClientRetrieveBootDiagnosticsDataOptions) (VirtualMachinesClientRetrieveBootDiagnosticsDataResponse, error)
RetrieveBootDiagnosticsData - The operation to retrieve SAS URIs for a virtual machine's boot diagnostic logs. If the operation fails it returns an *azcore.ResponseError type.
Generated from API version 2024-03-01
- resourceGroupName - The name of the resource group.
- vmName - The name of the virtual machine.
- options - VirtualMachinesClientRetrieveBootDiagnosticsDataOptions contains the optional parameters for the VirtualMachinesClient.RetrieveBootDiagnosticsData method.
Example ¶
Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/92de53a5f1e0e03c94b40475d2135d97148ed014/specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-03-01/examples/virtualMachineExamples/VirtualMachine_RetrieveBootDiagnosticsData.json
cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() clientFactory, err := armcompute.NewClientFactory("<subscription-id>", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } res, err := clientFactory.NewVirtualMachinesClient().RetrieveBootDiagnosticsData(ctx, "ResourceGroup", "VMName", &armcompute.VirtualMachinesClientRetrieveBootDiagnosticsDataOptions{SasURIExpirationTimeInMinutes: to.Ptr[int32](60)}) if err != nil { log.Fatalf("failed to finish the request: %v", err) } // You could use response here. We use blank identifier for just demo purposes. _ = res // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. // res.RetrieveBootDiagnosticsDataResult = armcompute.RetrieveBootDiagnosticsDataResult{ // ConsoleScreenshotBlobURI: to.Ptr("https://storageuri/vm.screenshot.bmp?{sasKey}"), // SerialConsoleLogBlobURI: to.Ptr("https://storageuri/vm.serialconsole.log?{sasKey}"), // }
Output:
func (*VirtualMachinesClient) SimulateEviction ¶
func (client *VirtualMachinesClient) SimulateEviction(ctx context.Context, resourceGroupName string, vmName string, options *VirtualMachinesClientSimulateEvictionOptions) (VirtualMachinesClientSimulateEvictionResponse, error)
SimulateEviction - The operation to simulate the eviction of spot virtual machine. If the operation fails it returns an *azcore.ResponseError type.
Generated from API version 2024-03-01
- resourceGroupName - The name of the resource group.
- vmName - The name of the virtual machine.
- options - VirtualMachinesClientSimulateEvictionOptions contains the optional parameters for the VirtualMachinesClient.SimulateEviction method.
Example ¶
Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/92de53a5f1e0e03c94b40475d2135d97148ed014/specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-03-01/examples/virtualMachineExamples/VirtualMachine_SimulateEviction.json
cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() clientFactory, err := armcompute.NewClientFactory("<subscription-id>", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } _, err = clientFactory.NewVirtualMachinesClient().SimulateEviction(ctx, "ResourceGroup", "VMName", nil) if err != nil { log.Fatalf("failed to finish the request: %v", err) }
Output:
type VirtualMachinesClientAssessPatchesResponse ¶
type VirtualMachinesClientAssessPatchesResponse struct { // Describes the properties of an AssessPatches result. VirtualMachineAssessPatchesResult }
VirtualMachinesClientAssessPatchesResponse contains the response from method VirtualMachinesClient.BeginAssessPatches.
type VirtualMachinesClientAttachDetachDataDisksResponse ¶ added in v5.4.0
type VirtualMachinesClientAttachDetachDataDisksResponse struct { // Specifies the storage settings for the virtual machine disks. StorageProfile }
VirtualMachinesClientAttachDetachDataDisksResponse contains the response from method VirtualMachinesClient.BeginAttachDetachDataDisks.
type VirtualMachinesClientBeginAssessPatchesOptions ¶
type VirtualMachinesClientBeginAssessPatchesOptions struct { // Resumes the LRO from the provided token. ResumeToken string }
VirtualMachinesClientBeginAssessPatchesOptions contains the optional parameters for the VirtualMachinesClient.BeginAssessPatches method.
type VirtualMachinesClientBeginAttachDetachDataDisksOptions ¶ added in v5.4.0
type VirtualMachinesClientBeginAttachDetachDataDisksOptions struct { // Resumes the LRO from the provided token. ResumeToken string }
VirtualMachinesClientBeginAttachDetachDataDisksOptions contains the optional parameters for the VirtualMachinesClient.BeginAttachDetachDataDisks method.
type VirtualMachinesClientBeginCaptureOptions ¶
type VirtualMachinesClientBeginCaptureOptions struct { // Resumes the LRO from the provided token. ResumeToken string }
VirtualMachinesClientBeginCaptureOptions contains the optional parameters for the VirtualMachinesClient.BeginCapture method.
type VirtualMachinesClientBeginConvertToManagedDisksOptions ¶
type VirtualMachinesClientBeginConvertToManagedDisksOptions struct { // Resumes the LRO from the provided token. ResumeToken string }
VirtualMachinesClientBeginConvertToManagedDisksOptions contains the optional parameters for the VirtualMachinesClient.BeginConvertToManagedDisks method.
type VirtualMachinesClientBeginCreateOrUpdateOptions ¶
type VirtualMachinesClientBeginCreateOrUpdateOptions struct { // The ETag of the transformation. Omit this value to always overwrite the current resource. Specify the last-seen ETag value // to prevent accidentally overwriting concurrent changes. IfMatch *string // Set to '*' to allow a new record set to be created, but to prevent updating an existing record set. Other values will result // in error from server as they are not supported. IfNoneMatch *string // Resumes the LRO from the provided token. ResumeToken string }
VirtualMachinesClientBeginCreateOrUpdateOptions contains the optional parameters for the VirtualMachinesClient.BeginCreateOrUpdate method.
type VirtualMachinesClientBeginDeallocateOptions ¶
type VirtualMachinesClientBeginDeallocateOptions struct { // Optional parameter to hibernate a virtual machine. (Feature in Preview) Hibernate *bool // Resumes the LRO from the provided token. ResumeToken string }
VirtualMachinesClientBeginDeallocateOptions contains the optional parameters for the VirtualMachinesClient.BeginDeallocate method.
type VirtualMachinesClientBeginDeleteOptions ¶
type VirtualMachinesClientBeginDeleteOptions struct { // Optional parameter to force delete virtual machines. ForceDeletion *bool // Resumes the LRO from the provided token. ResumeToken string }
VirtualMachinesClientBeginDeleteOptions contains the optional parameters for the VirtualMachinesClient.BeginDelete method.
type VirtualMachinesClientBeginInstallPatchesOptions ¶
type VirtualMachinesClientBeginInstallPatchesOptions struct { // Resumes the LRO from the provided token. ResumeToken string }
VirtualMachinesClientBeginInstallPatchesOptions contains the optional parameters for the VirtualMachinesClient.BeginInstallPatches method.
type VirtualMachinesClientBeginPerformMaintenanceOptions ¶
type VirtualMachinesClientBeginPerformMaintenanceOptions struct { // Resumes the LRO from the provided token. ResumeToken string }
VirtualMachinesClientBeginPerformMaintenanceOptions contains the optional parameters for the VirtualMachinesClient.BeginPerformMaintenance method.
type VirtualMachinesClientBeginPowerOffOptions ¶
type VirtualMachinesClientBeginPowerOffOptions struct { // Resumes the LRO from the provided token. ResumeToken string // The parameter to request non-graceful VM shutdown. True value for this flag indicates non-graceful shutdown whereas false // indicates otherwise. Default value for this flag is false if not specified SkipShutdown *bool }
VirtualMachinesClientBeginPowerOffOptions contains the optional parameters for the VirtualMachinesClient.BeginPowerOff method.
type VirtualMachinesClientBeginReapplyOptions ¶
type VirtualMachinesClientBeginReapplyOptions struct { // Resumes the LRO from the provided token. ResumeToken string }
VirtualMachinesClientBeginReapplyOptions contains the optional parameters for the VirtualMachinesClient.BeginReapply method.
type VirtualMachinesClientBeginRedeployOptions ¶
type VirtualMachinesClientBeginRedeployOptions struct { // Resumes the LRO from the provided token. ResumeToken string }
VirtualMachinesClientBeginRedeployOptions contains the optional parameters for the VirtualMachinesClient.BeginRedeploy method.
type VirtualMachinesClientBeginReimageOptions ¶
type VirtualMachinesClientBeginReimageOptions struct { // Parameters supplied to the Reimage Virtual Machine operation. Parameters *VirtualMachineReimageParameters // Resumes the LRO from the provided token. ResumeToken string }
VirtualMachinesClientBeginReimageOptions contains the optional parameters for the VirtualMachinesClient.BeginReimage method.
type VirtualMachinesClientBeginRestartOptions ¶
type VirtualMachinesClientBeginRestartOptions struct { // Resumes the LRO from the provided token. ResumeToken string }
VirtualMachinesClientBeginRestartOptions contains the optional parameters for the VirtualMachinesClient.BeginRestart method.
type VirtualMachinesClientBeginRunCommandOptions ¶
type VirtualMachinesClientBeginRunCommandOptions struct { // Resumes the LRO from the provided token. ResumeToken string }
VirtualMachinesClientBeginRunCommandOptions contains the optional parameters for the VirtualMachinesClient.BeginRunCommand method.
type VirtualMachinesClientBeginStartOptions ¶
type VirtualMachinesClientBeginStartOptions struct { // Resumes the LRO from the provided token. ResumeToken string }
VirtualMachinesClientBeginStartOptions contains the optional parameters for the VirtualMachinesClient.BeginStart method.
type VirtualMachinesClientBeginUpdateOptions ¶
type VirtualMachinesClientBeginUpdateOptions struct { // The ETag of the transformation. Omit this value to always overwrite the current resource. Specify the last-seen ETag value // to prevent accidentally overwriting concurrent changes. IfMatch *string // Set to '*' to allow a new record set to be created, but to prevent updating an existing record set. Other values will result // in error from server as they are not supported. IfNoneMatch *string // Resumes the LRO from the provided token. ResumeToken string }
VirtualMachinesClientBeginUpdateOptions contains the optional parameters for the VirtualMachinesClient.BeginUpdate method.
type VirtualMachinesClientCaptureResponse ¶
type VirtualMachinesClientCaptureResponse struct { // Output of virtual machine capture operation. VirtualMachineCaptureResult }
VirtualMachinesClientCaptureResponse contains the response from method VirtualMachinesClient.BeginCapture.
type VirtualMachinesClientConvertToManagedDisksResponse ¶
type VirtualMachinesClientConvertToManagedDisksResponse struct { }
VirtualMachinesClientConvertToManagedDisksResponse contains the response from method VirtualMachinesClient.BeginConvertToManagedDisks.
type VirtualMachinesClientCreateOrUpdateResponse ¶
type VirtualMachinesClientCreateOrUpdateResponse struct { // Describes a Virtual Machine. VirtualMachine }
VirtualMachinesClientCreateOrUpdateResponse contains the response from method VirtualMachinesClient.BeginCreateOrUpdate.
type VirtualMachinesClientDeallocateResponse ¶
type VirtualMachinesClientDeallocateResponse struct { }
VirtualMachinesClientDeallocateResponse contains the response from method VirtualMachinesClient.BeginDeallocate.
type VirtualMachinesClientDeleteResponse ¶
type VirtualMachinesClientDeleteResponse struct { }
VirtualMachinesClientDeleteResponse contains the response from method VirtualMachinesClient.BeginDelete.
type VirtualMachinesClientGeneralizeOptions ¶
type VirtualMachinesClientGeneralizeOptions struct { }
VirtualMachinesClientGeneralizeOptions contains the optional parameters for the VirtualMachinesClient.Generalize method.
type VirtualMachinesClientGeneralizeResponse ¶
type VirtualMachinesClientGeneralizeResponse struct { }
VirtualMachinesClientGeneralizeResponse contains the response from method VirtualMachinesClient.Generalize.
type VirtualMachinesClientGetOptions ¶
type VirtualMachinesClientGetOptions struct { // The expand expression to apply on the operation. 'InstanceView' retrieves a snapshot of the runtime properties of the virtual // machine that is managed by the platform and can change outside of control // plane operations. 'UserData' retrieves the UserData property as part of the VM model view that was provided by the user // during the VM Create/Update operation. Expand *InstanceViewTypes }
VirtualMachinesClientGetOptions contains the optional parameters for the VirtualMachinesClient.Get method.
type VirtualMachinesClientGetResponse ¶
type VirtualMachinesClientGetResponse struct { // Describes a Virtual Machine. VirtualMachine }
VirtualMachinesClientGetResponse contains the response from method VirtualMachinesClient.Get.
type VirtualMachinesClientInstallPatchesResponse ¶
type VirtualMachinesClientInstallPatchesResponse struct { // The result summary of an installation operation. VirtualMachineInstallPatchesResult }
VirtualMachinesClientInstallPatchesResponse contains the response from method VirtualMachinesClient.BeginInstallPatches.
type VirtualMachinesClientInstanceViewOptions ¶
type VirtualMachinesClientInstanceViewOptions struct { }
VirtualMachinesClientInstanceViewOptions contains the optional parameters for the VirtualMachinesClient.InstanceView method.
type VirtualMachinesClientInstanceViewResponse ¶
type VirtualMachinesClientInstanceViewResponse struct { // The instance view of a virtual machine. VirtualMachineInstanceView }
VirtualMachinesClientInstanceViewResponse contains the response from method VirtualMachinesClient.InstanceView.
type VirtualMachinesClientListAllOptions ¶
type VirtualMachinesClientListAllOptions struct { // The expand expression to apply on operation. 'instanceView' enables fetching run time status of all Virtual Machines, this // can only be specified if a valid $filter option is specified Expand *ExpandTypesForListVMs // The system query option to filter VMs returned in the response. Allowed value is 'virtualMachineScaleSet/id' eq // /subscriptions/{subId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{vmssName}' Filter *string // statusOnly=true enables fetching run time status of all Virtual Machines in the subscription. StatusOnly *string }
VirtualMachinesClientListAllOptions contains the optional parameters for the VirtualMachinesClient.NewListAllPager method.
type VirtualMachinesClientListAllResponse ¶
type VirtualMachinesClientListAllResponse struct { // The List Virtual Machine operation response. VirtualMachineListResult }
VirtualMachinesClientListAllResponse contains the response from method VirtualMachinesClient.NewListAllPager.
type VirtualMachinesClientListAvailableSizesOptions ¶
type VirtualMachinesClientListAvailableSizesOptions struct { }
VirtualMachinesClientListAvailableSizesOptions contains the optional parameters for the VirtualMachinesClient.NewListAvailableSizesPager method.
type VirtualMachinesClientListAvailableSizesResponse ¶
type VirtualMachinesClientListAvailableSizesResponse struct { // The List Virtual Machine operation response. VirtualMachineSizeListResult }
VirtualMachinesClientListAvailableSizesResponse contains the response from method VirtualMachinesClient.NewListAvailableSizesPager.
type VirtualMachinesClientListByLocationOptions ¶
type VirtualMachinesClientListByLocationOptions struct { }
VirtualMachinesClientListByLocationOptions contains the optional parameters for the VirtualMachinesClient.NewListByLocationPager method.
type VirtualMachinesClientListByLocationResponse ¶
type VirtualMachinesClientListByLocationResponse struct { // The List Virtual Machine operation response. VirtualMachineListResult }
VirtualMachinesClientListByLocationResponse contains the response from method VirtualMachinesClient.NewListByLocationPager.
type VirtualMachinesClientListOptions ¶
type VirtualMachinesClientListOptions struct { // The expand expression to apply on operation. 'instanceView' enables fetching run time status of all Virtual Machines, this // can only be specified if a valid $filter option is specified Expand *ExpandTypeForListVMs // The system query option to filter VMs returned in the response. Allowed value is 'virtualMachineScaleSet/id' eq // /subscriptions/{subId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{vmssName}' Filter *string }
VirtualMachinesClientListOptions contains the optional parameters for the VirtualMachinesClient.NewListPager method.
type VirtualMachinesClientListResponse ¶
type VirtualMachinesClientListResponse struct { // The List Virtual Machine operation response. VirtualMachineListResult }
VirtualMachinesClientListResponse contains the response from method VirtualMachinesClient.NewListPager.
type VirtualMachinesClientPerformMaintenanceResponse ¶
type VirtualMachinesClientPerformMaintenanceResponse struct { }
VirtualMachinesClientPerformMaintenanceResponse contains the response from method VirtualMachinesClient.BeginPerformMaintenance.
type VirtualMachinesClientPowerOffResponse ¶
type VirtualMachinesClientPowerOffResponse struct { }
VirtualMachinesClientPowerOffResponse contains the response from method VirtualMachinesClient.BeginPowerOff.
type VirtualMachinesClientReapplyResponse ¶
type VirtualMachinesClientReapplyResponse struct { }
VirtualMachinesClientReapplyResponse contains the response from method VirtualMachinesClient.BeginReapply.
type VirtualMachinesClientRedeployResponse ¶
type VirtualMachinesClientRedeployResponse struct { }
VirtualMachinesClientRedeployResponse contains the response from method VirtualMachinesClient.BeginRedeploy.
type VirtualMachinesClientReimageResponse ¶
type VirtualMachinesClientReimageResponse struct { }
VirtualMachinesClientReimageResponse contains the response from method VirtualMachinesClient.BeginReimage.
type VirtualMachinesClientRestartResponse ¶
type VirtualMachinesClientRestartResponse struct { }
VirtualMachinesClientRestartResponse contains the response from method VirtualMachinesClient.BeginRestart.
type VirtualMachinesClientRetrieveBootDiagnosticsDataOptions ¶
type VirtualMachinesClientRetrieveBootDiagnosticsDataOptions struct { // Expiration duration in minutes for the SAS URIs with a value between 1 to 1440 minutes. Note: If not specified, SAS URIs // will be generated with a default expiration duration of 120 minutes. SasURIExpirationTimeInMinutes *int32 }
VirtualMachinesClientRetrieveBootDiagnosticsDataOptions contains the optional parameters for the VirtualMachinesClient.RetrieveBootDiagnosticsData method.
type VirtualMachinesClientRetrieveBootDiagnosticsDataResponse ¶
type VirtualMachinesClientRetrieveBootDiagnosticsDataResponse struct { // The SAS URIs of the console screenshot and serial log blobs. RetrieveBootDiagnosticsDataResult }
VirtualMachinesClientRetrieveBootDiagnosticsDataResponse contains the response from method VirtualMachinesClient.RetrieveBootDiagnosticsData.
type VirtualMachinesClientRunCommandResponse ¶
type VirtualMachinesClientRunCommandResponse struct {
RunCommandResult
}
VirtualMachinesClientRunCommandResponse contains the response from method VirtualMachinesClient.BeginRunCommand.
type VirtualMachinesClientSimulateEvictionOptions ¶
type VirtualMachinesClientSimulateEvictionOptions struct { }
VirtualMachinesClientSimulateEvictionOptions contains the optional parameters for the VirtualMachinesClient.SimulateEviction method.
type VirtualMachinesClientSimulateEvictionResponse ¶
type VirtualMachinesClientSimulateEvictionResponse struct { }
VirtualMachinesClientSimulateEvictionResponse contains the response from method VirtualMachinesClient.SimulateEviction.
type VirtualMachinesClientStartResponse ¶
type VirtualMachinesClientStartResponse struct { }
VirtualMachinesClientStartResponse contains the response from method VirtualMachinesClient.BeginStart.
type VirtualMachinesClientUpdateResponse ¶
type VirtualMachinesClientUpdateResponse struct { // Describes a Virtual Machine. VirtualMachine }
VirtualMachinesClientUpdateResponse contains the response from method VirtualMachinesClient.BeginUpdate.
type WinRMConfiguration ¶
type WinRMConfiguration struct { // The list of Windows Remote Management listeners Listeners []*WinRMListener }
WinRMConfiguration - Describes Windows Remote Management configuration of the VM
func (WinRMConfiguration) MarshalJSON ¶
func (w WinRMConfiguration) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type WinRMConfiguration.
func (*WinRMConfiguration) UnmarshalJSON ¶
func (w *WinRMConfiguration) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type WinRMConfiguration.
type WinRMListener ¶
type WinRMListener struct { // This is the URL of a certificate that has been uploaded to Key Vault as a secret. For adding a secret to the Key Vault, // see Add a key or secret to the key vault // [https://docs.microsoft.com/azure/key-vault/key-vault-get-started/#add]. In this case, your certificate needs to be the // Base64 encoding of the following JSON Object which is encoded in UTF-8: // { // "data":"", // "dataType":"pfx", // "password":"" // } // To install certificates on a virtual machine it is recommended to use the Azure Key Vault virtual machine extension for // Linux // [https://docs.microsoft.com/azure/virtual-machines/extensions/key-vault-linux] or the Azure Key Vault virtual machine extension // for Windows // [https://docs.microsoft.com/azure/virtual-machines/extensions/key-vault-windows]. CertificateURL *string // Specifies the protocol of WinRM listener. Possible values are: http, https. Protocol *ProtocolTypes }
WinRMListener - Describes Protocol and thumbprint of Windows Remote Management listener
func (WinRMListener) MarshalJSON ¶
func (w WinRMListener) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type WinRMListener.
func (*WinRMListener) UnmarshalJSON ¶
func (w *WinRMListener) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type WinRMListener.
type WindowsConfiguration ¶
type WindowsConfiguration struct { // Specifies additional base-64 encoded XML formatted information that can be included in the Unattend.xml file, which is // used by Windows Setup. AdditionalUnattendContent []*AdditionalUnattendContent // Indicates whether Automatic Updates is enabled for the Windows virtual machine. Default value is true. For virtual machine // scale sets, this property can be updated and updates will take effect on OS // reprovisioning. EnableAutomaticUpdates *bool // Indicates whether VMAgent Platform Updates is enabled for the Windows virtual machine. Default value is false. EnableVMAgentPlatformUpdates *bool // [Preview Feature] Specifies settings related to VM Guest Patching on Windows. PatchSettings *PatchSettings // Indicates whether virtual machine agent should be provisioned on the virtual machine. When this property is not specified // in the request body, it is set to true by default. This will ensure that VM // Agent is installed on the VM so that extensions can be added to the VM later. ProvisionVMAgent *bool // Specifies the time zone of the virtual machine. e.g. "Pacific Standard Time". Possible values can be TimeZoneInfo.Id // [https://docs.microsoft.com/dotnet/api/system.timezoneinfo.id?#System_TimeZoneInfo_Id] value from time zones returned by // TimeZoneInfo.GetSystemTimeZones // [https://docs.microsoft.com/dotnet/api/system.timezoneinfo.getsystemtimezones]. TimeZone *string // Specifies the Windows Remote Management listeners. This enables remote Windows PowerShell. WinRM *WinRMConfiguration }
WindowsConfiguration - Specifies Windows operating system settings on the virtual machine.
func (WindowsConfiguration) MarshalJSON ¶
func (w WindowsConfiguration) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type WindowsConfiguration.
func (*WindowsConfiguration) UnmarshalJSON ¶
func (w *WindowsConfiguration) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type WindowsConfiguration.
type WindowsParameters ¶
type WindowsParameters struct { // The update classifications to select when installing patches for Windows. ClassificationsToInclude []*VMGuestPatchClassificationWindows // Filters out Kbs that don't have an InstallationRebootBehavior of 'NeverReboots' when this is set to true. ExcludeKbsRequiringReboot *bool // Kbs to exclude in the patch operation KbNumbersToExclude []*string // Kbs to include in the patch operation KbNumbersToInclude []*string // This is used to install patches that were published on or before this given max published date. MaxPatchPublishDate *time.Time }
WindowsParameters - Input for InstallPatches on a Windows VM, as directly received by the API
func (WindowsParameters) MarshalJSON ¶
func (w WindowsParameters) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type WindowsParameters.
func (*WindowsParameters) UnmarshalJSON ¶
func (w *WindowsParameters) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type WindowsParameters.
type WindowsPatchAssessmentMode ¶
type WindowsPatchAssessmentMode string
WindowsPatchAssessmentMode - Specifies the mode of VM Guest patch assessment for the IaaS virtual machine. Possible values are: ImageDefault - You control the timing of patch assessments on a virtual machine. AutomaticByPlatform - The platform will trigger periodic patch assessments. The property provisionVMAgent must be true.
const ( WindowsPatchAssessmentModeAutomaticByPlatform WindowsPatchAssessmentMode = "AutomaticByPlatform" WindowsPatchAssessmentModeImageDefault WindowsPatchAssessmentMode = "ImageDefault" )
func PossibleWindowsPatchAssessmentModeValues ¶
func PossibleWindowsPatchAssessmentModeValues() []WindowsPatchAssessmentMode
PossibleWindowsPatchAssessmentModeValues returns the possible values for the WindowsPatchAssessmentMode const type.
type WindowsVMGuestPatchAutomaticByPlatformRebootSetting ¶
type WindowsVMGuestPatchAutomaticByPlatformRebootSetting string
WindowsVMGuestPatchAutomaticByPlatformRebootSetting - Specifies the reboot setting for all AutomaticByPlatform patch installation operations.
const ( WindowsVMGuestPatchAutomaticByPlatformRebootSettingAlways WindowsVMGuestPatchAutomaticByPlatformRebootSetting = "Always" WindowsVMGuestPatchAutomaticByPlatformRebootSettingIfRequired WindowsVMGuestPatchAutomaticByPlatformRebootSetting = "IfRequired" WindowsVMGuestPatchAutomaticByPlatformRebootSettingNever WindowsVMGuestPatchAutomaticByPlatformRebootSetting = "Never" WindowsVMGuestPatchAutomaticByPlatformRebootSettingUnknown WindowsVMGuestPatchAutomaticByPlatformRebootSetting = "Unknown" )
func PossibleWindowsVMGuestPatchAutomaticByPlatformRebootSettingValues ¶
func PossibleWindowsVMGuestPatchAutomaticByPlatformRebootSettingValues() []WindowsVMGuestPatchAutomaticByPlatformRebootSetting
PossibleWindowsVMGuestPatchAutomaticByPlatformRebootSettingValues returns the possible values for the WindowsVMGuestPatchAutomaticByPlatformRebootSetting const type.
type WindowsVMGuestPatchAutomaticByPlatformSettings ¶
type WindowsVMGuestPatchAutomaticByPlatformSettings struct { // Enables customer to schedule patching without accidental upgrades BypassPlatformSafetyChecksOnUserSchedule *bool // Specifies the reboot setting for all AutomaticByPlatform patch installation operations. RebootSetting *WindowsVMGuestPatchAutomaticByPlatformRebootSetting }
WindowsVMGuestPatchAutomaticByPlatformSettings - Specifies additional settings to be applied when patch mode AutomaticByPlatform is selected in Windows patch settings.
func (WindowsVMGuestPatchAutomaticByPlatformSettings) MarshalJSON ¶
func (w WindowsVMGuestPatchAutomaticByPlatformSettings) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type WindowsVMGuestPatchAutomaticByPlatformSettings.
func (*WindowsVMGuestPatchAutomaticByPlatformSettings) UnmarshalJSON ¶
func (w *WindowsVMGuestPatchAutomaticByPlatformSettings) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type WindowsVMGuestPatchAutomaticByPlatformSettings.
type WindowsVMGuestPatchMode ¶
type WindowsVMGuestPatchMode string
WindowsVMGuestPatchMode - Specifies the mode of VM Guest Patching to IaaS virtual machine or virtual machines associated to virtual machine scale set with OrchestrationMode as Flexible. Possible values are: Manual - You control the application of patches to a virtual machine. You do this by applying patches manually inside the VM. In this mode, automatic updates are disabled; the property WindowsConfiguration.enableAutomaticUpdates must be false AutomaticByOS - The virtual machine will automatically be updated by the OS. The property WindowsConfiguration.enableAutomaticUpdates must be true. AutomaticByPlatform - the virtual machine will automatically updated by the platform. The properties provisionVMAgent and WindowsConfiguration.enableAutomaticUpdates must be true
const ( WindowsVMGuestPatchModeAutomaticByOS WindowsVMGuestPatchMode = "AutomaticByOS" WindowsVMGuestPatchModeAutomaticByPlatform WindowsVMGuestPatchMode = "AutomaticByPlatform" WindowsVMGuestPatchModeManual WindowsVMGuestPatchMode = "Manual" )
func PossibleWindowsVMGuestPatchModeValues ¶
func PossibleWindowsVMGuestPatchModeValues() []WindowsVMGuestPatchMode
PossibleWindowsVMGuestPatchModeValues returns the possible values for the WindowsVMGuestPatchMode const type.
Source Files ¶
- availabilitysets_client.go
- build.go
- capacityreservationgroups_client.go
- capacityreservations_client.go
- client_factory.go
- cloudserviceoperatingsystems_client.go
- cloudserviceroleinstances_client.go
- cloudserviceroles_client.go
- cloudservices_client.go
- cloudservicesupdatedomain_client.go
- communitygalleries_client.go
- communitygalleryimages_client.go
- communitygalleryimageversions_client.go
- constants.go
- dedicatedhostgroups_client.go
- dedicatedhosts_client.go
- diskaccesses_client.go
- diskencryptionsets_client.go
- diskrestorepoint_client.go
- disks_client.go
- galleries_client.go
- galleryapplications_client.go
- galleryapplicationversions_client.go
- galleryimages_client.go
- galleryimageversions_client.go
- gallerysharingprofile_client.go
- images_client.go
- loganalytics_client.go
- models.go
- models_serde.go
- operations_client.go
- options.go
- proximityplacementgroups_client.go
- resourceskus_client.go
- responses.go
- restorepointcollections_client.go
- restorepoints_client.go
- sharedgalleries_client.go
- sharedgalleryimages_client.go
- sharedgalleryimageversions_client.go
- snapshots_client.go
- sshpublickeys_client.go
- time_rfc3339.go
- usage_client.go
- virtualmachineextensionimages_client.go
- virtualmachineextensions_client.go
- virtualmachineimages_client.go
- virtualmachineimagesedgezone_client.go
- virtualmachineruncommands_client.go
- virtualmachines_client.go
- virtualmachinescalesetextensions_client.go
- virtualmachinescalesetrollingupgrades_client.go
- virtualmachinescalesets_client.go
- virtualmachinescalesetvmextensions_client.go
- virtualmachinescalesetvmruncommands_client.go
- virtualmachinescalesetvms_client.go
- virtualmachinesizes_client.go