armdevtestlabs

package module
v1.2.0 Latest Latest
Warning

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

Go to latest
Published: Nov 23, 2023 License: MIT Imports: 15 Imported by: 1

README

Azure Lab Services Module for Go

PkgGoDev

The armdevtestlabs module provides operations for working with Azure Lab Services.

Source code

Getting started

Prerequisites

  • an Azure subscription
  • Go 1.18 or above (You could download and install the latest version of Go from here. It will replace the existing Go on your machine. If you want to install multiple Go versions on the same machine, you could refer this doc.)

Install the package

This project uses Go modules for versioning and dependency management.

Install the Azure Lab Services module:

go get github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/devtestlabs/armdevtestlabs

Authorization

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

cred, err := azidentity.NewDefaultAzureCredential(nil)

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

Client Factory

Azure Lab Services module consists of one or more clients. We provide a client factory which could be used to create any client in this module.

clientFactory, err := armdevtestlabs.NewClientFactory(<subscription ID>, cred, nil)

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

options := arm.ClientOptions {
    ClientOptions: azcore.ClientOptions {
        Cloud: cloud.AzureChina,
    },
}
clientFactory, err := armdevtestlabs.NewClientFactory(<subscription ID>, cred, &options)

Clients

A client groups a set of related APIs, providing access to its functionality. Create one or more clients to access the APIs you require using client factory.

client := clientFactory.NewPolicySetsClient()

Fakes

The fake package contains types used for constructing in-memory fake servers used in unit tests. This allows writing tests to cover various success/error conditions without the need for connecting to a live service.

Please see https://github.com/Azure/azure-sdk-for-go/tree/main/sdk/samples/fakes for details and examples on how to use fakes.

Provide Feedback

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

Contributing

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

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

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

Documentation

Index

Examples

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ApplicableSchedule

type ApplicableSchedule struct {
	// REQUIRED; The properties of the resource.
	Properties *ApplicableScheduleProperties

	// The location of the resource.
	Location *string

	// The tags of the resource.
	Tags map[string]*string

	// READ-ONLY; The identifier of the resource.
	ID *string

	// READ-ONLY; The name of the resource.
	Name *string

	// READ-ONLY; The type of the resource.
	Type *string
}

ApplicableSchedule - Schedules applicable to a virtual machine. The schedules may have been defined on a VM or on lab level.

func (ApplicableSchedule) MarshalJSON

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

MarshalJSON implements the json.Marshaller interface for type ApplicableSchedule.

func (*ApplicableSchedule) UnmarshalJSON added in v1.1.0

func (a *ApplicableSchedule) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the json.Unmarshaller interface for type ApplicableSchedule.

type ApplicableScheduleFragment

type ApplicableScheduleFragment struct {
	// The tags of the resource.
	Tags map[string]*string
}

ApplicableScheduleFragment - Schedules applicable to a virtual machine. The schedules may have been defined on a VM or on lab level.

func (ApplicableScheduleFragment) MarshalJSON added in v0.2.0

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

MarshalJSON implements the json.Marshaller interface for type ApplicableScheduleFragment.

func (*ApplicableScheduleFragment) UnmarshalJSON added in v1.1.0

func (a *ApplicableScheduleFragment) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the json.Unmarshaller interface for type ApplicableScheduleFragment.

type ApplicableScheduleProperties

type ApplicableScheduleProperties struct {
	// The auto-shutdown schedule, if one has been set at the lab or lab resource level.
	LabVMsShutdown *Schedule

	// The auto-startup schedule, if one has been set at the lab or lab resource level.
	LabVMsStartup *Schedule
}

ApplicableScheduleProperties - Properties of a schedules applicable to a virtual machine.

func (ApplicableScheduleProperties) MarshalJSON added in v1.1.0

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

MarshalJSON implements the json.Marshaller interface for type ApplicableScheduleProperties.

func (*ApplicableScheduleProperties) UnmarshalJSON added in v1.1.0

func (a *ApplicableScheduleProperties) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the json.Unmarshaller interface for type ApplicableScheduleProperties.

type ApplyArtifactsRequest

type ApplyArtifactsRequest struct {
	// The list of artifacts to apply.
	Artifacts []*ArtifactInstallProperties
}

ApplyArtifactsRequest - Request body for applying artifacts to a virtual machine.

func (ApplyArtifactsRequest) MarshalJSON

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

MarshalJSON implements the json.Marshaller interface for type ApplyArtifactsRequest.

func (*ApplyArtifactsRequest) UnmarshalJSON added in v1.1.0

func (a *ApplyArtifactsRequest) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the json.Unmarshaller interface for type ApplyArtifactsRequest.

type ArmTemplate

type ArmTemplate struct {
	// REQUIRED; The properties of the resource.
	Properties *ArmTemplateProperties

	// The location of the resource.
	Location *string

	// The tags of the resource.
	Tags map[string]*string

	// READ-ONLY; The identifier of the resource.
	ID *string

	// READ-ONLY; The name of the resource.
	Name *string

	// READ-ONLY; The type of the resource.
	Type *string
}

ArmTemplate - An Azure Resource Manager template.

func (ArmTemplate) MarshalJSON

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

MarshalJSON implements the json.Marshaller interface for type ArmTemplate.

func (*ArmTemplate) UnmarshalJSON added in v1.1.0

func (a *ArmTemplate) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the json.Unmarshaller interface for type ArmTemplate.

type ArmTemplateInfo

type ArmTemplateInfo struct {
	// The parameters of the ARM template.
	Parameters any

	// The template's contents.
	Template any
}

ArmTemplateInfo - Information about a generated ARM template.

func (ArmTemplateInfo) MarshalJSON added in v1.1.0

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

MarshalJSON implements the json.Marshaller interface for type ArmTemplateInfo.

func (*ArmTemplateInfo) UnmarshalJSON added in v1.1.0

func (a *ArmTemplateInfo) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the json.Unmarshaller interface for type ArmTemplateInfo.

type ArmTemplateList

type ArmTemplateList struct {
	// Link for next set of results.
	NextLink *string

	// Results of the list operation.
	Value []*ArmTemplate
}

ArmTemplateList - The response of a list operation.

func (ArmTemplateList) MarshalJSON

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

MarshalJSON implements the json.Marshaller interface for type ArmTemplateList.

func (*ArmTemplateList) UnmarshalJSON added in v1.1.0

func (a *ArmTemplateList) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the json.Unmarshaller interface for type ArmTemplateList.

type ArmTemplateParameterProperties

type ArmTemplateParameterProperties struct {
	// The name of the template parameter.
	Name *string

	// The value of the template parameter.
	Value *string
}

ArmTemplateParameterProperties - Properties of an Azure Resource Manager template parameter.

func (ArmTemplateParameterProperties) MarshalJSON added in v1.1.0

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

MarshalJSON implements the json.Marshaller interface for type ArmTemplateParameterProperties.

func (*ArmTemplateParameterProperties) UnmarshalJSON added in v1.1.0

func (a *ArmTemplateParameterProperties) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the json.Unmarshaller interface for type ArmTemplateParameterProperties.

type ArmTemplateProperties

type ArmTemplateProperties struct {
	// READ-ONLY; The contents of the ARM template.
	Contents any

	// READ-ONLY; The creation date of the armTemplate.
	CreatedDate *time.Time

	// READ-ONLY; The description of the ARM template.
	Description *string

	// READ-ONLY; The display name of the ARM template.
	DisplayName *string

	// READ-ONLY; Whether or not ARM template is enabled for use by lab user.
	Enabled *bool

	// READ-ONLY; The URI to the icon of the ARM template.
	Icon *string

	// READ-ONLY; File name and parameter values information from all azuredeploy.*.parameters.json for the ARM template.
	ParametersValueFilesInfo []*ParametersValueFileInfo

	// READ-ONLY; The publisher of the ARM template.
	Publisher *string
}

ArmTemplateProperties - Properties of an Azure Resource Manager template.

func (ArmTemplateProperties) MarshalJSON

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

MarshalJSON implements the json.Marshaller interface for type ArmTemplateProperties.

func (*ArmTemplateProperties) UnmarshalJSON

func (a *ArmTemplateProperties) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the json.Unmarshaller interface for type ArmTemplateProperties.

type ArmTemplatesClient

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

ArmTemplatesClient contains the methods for the ArmTemplates group. Don't use this type directly, use NewArmTemplatesClient() instead.

func NewArmTemplatesClient

func NewArmTemplatesClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*ArmTemplatesClient, error)

NewArmTemplatesClient creates a new instance of ArmTemplatesClient with the specified values.

  • subscriptionID - The subscription ID.
  • credential - used to authorize requests. Usually a credential from azidentity.
  • options - pass nil to accept the default values.

func (*ArmTemplatesClient) Get

func (client *ArmTemplatesClient) Get(ctx context.Context, resourceGroupName string, labName string, artifactSourceName string, name string, options *ArmTemplatesClientGetOptions) (ArmTemplatesClientGetResponse, error)

Get - Get azure resource manager template. If the operation fails it returns an *azcore.ResponseError type.

Generated from API version 2018-09-15

  • resourceGroupName - The name of the resource group.
  • labName - The name of the lab.
  • artifactSourceName - The name of the artifact source.
  • name - The name of the azure resource manager template.
  • options - ArmTemplatesClientGetOptions contains the optional parameters for the ArmTemplatesClient.Get method.
Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/d55b8005f05b040b852c15e74a0f3e36494a15e1/specification/devtestlabs/resource-manager/Microsoft.DevTestLab/stable/2018-09-15/examples/ArmTemplates_Get.json

package main

import (
	"context"
	"log"

	"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
	"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/devtestlabs/armdevtestlabs"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armdevtestlabs.NewClientFactory("<subscription-id>", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	res, err := clientFactory.NewArmTemplatesClient().Get(ctx, "resourceGroupName", "{labName}", "{artifactSourceName}", "{armTemplateName}", &armdevtestlabs.ArmTemplatesClientGetOptions{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.ArmTemplate = armdevtestlabs.ArmTemplate{
	// 	Name: to.Ptr("Template1"),
	// 	Type: to.Ptr("Microsoft.DevTestLab/labs/artifactSources/armTemplates"),
	// 	ID: to.Ptr("/subscriptions/{subscriptionId}/resourceGroups/resourceGroupName/providers/Microsoft.DevTestLab/labs/{labName}/artifactSources/{artifactSourceName}/armTemplates/{armTemplateName}"),
	// 	Location: to.Ptr("{location}"),
	// 	Tags: map[string]*string{
	// 		"MyTag": to.Ptr("MyValue"),
	// 	},
	// 	Properties: &armdevtestlabs.ArmTemplateProperties{
	// 		Contents: map[string]any{
	// 			"$schema": "http://schema.management.azure.com/schemas/2014-04-01-preview/deploymentTemplate.json#",
	// 			"contentVersion": "1.0.0.0",
	// 			"parameters":map[string]any{
	// 			},
	// 			"resources":[]any{
	// 			},
	// 			"variables":map[string]any{
	// 				"hostingPlanName": "[toLower(concat(variables('resourceNamePrefix'), '-', take(uniqueString(resourceGroup().id), 6), '-sp'))]",
	// 				"resourceNamePrefix": "[take(uniqueString(resourceGroup().id), 3)]",
	// 				"siteName": "[toLower(concat(variables('resourceNamePrefix'), '-', take(uniqueString(resourceGroup().id), 6)))]",
	// 			},
	// 		},
	// 		DisplayName: to.Ptr("Template1"),
	// 		Enabled: to.Ptr(true),
	// 		ParametersValueFilesInfo: []*armdevtestlabs.ParametersValueFileInfo{
	// 		},
	// 		Publisher: to.Ptr("Microsoft"),
	// 	},
	// }
}
Output:

func (*ArmTemplatesClient) NewListPager added in v0.4.0

func (client *ArmTemplatesClient) NewListPager(resourceGroupName string, labName string, artifactSourceName string, options *ArmTemplatesClientListOptions) *runtime.Pager[ArmTemplatesClientListResponse]

NewListPager - List azure resource manager templates in a given artifact source.

Generated from API version 2018-09-15

  • resourceGroupName - The name of the resource group.
  • labName - The name of the lab.
  • artifactSourceName - The name of the artifact source.
  • options - ArmTemplatesClientListOptions contains the optional parameters for the ArmTemplatesClient.NewListPager method.
Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/d55b8005f05b040b852c15e74a0f3e36494a15e1/specification/devtestlabs/resource-manager/Microsoft.DevTestLab/stable/2018-09-15/examples/ArmTemplates_List.json

package main

import (
	"context"
	"log"

	"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
	"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/devtestlabs/armdevtestlabs"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armdevtestlabs.NewClientFactory("<subscription-id>", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	pager := clientFactory.NewArmTemplatesClient().NewListPager("resourceGroupName", "{labName}", "{artifactSourceName}", &armdevtestlabs.ArmTemplatesClientListOptions{Expand: nil,
		Filter:  nil,
		Top:     nil,
		Orderby: 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.ArmTemplateList = armdevtestlabs.ArmTemplateList{
		// 	Value: []*armdevtestlabs.ArmTemplate{
		// 		{
		// 			Name: to.Ptr("Template1"),
		// 			Type: to.Ptr("Microsoft.DevTestLab/labs/artifactSources/armTemplates"),
		// 			ID: to.Ptr("/subscriptions/{subscriptionId}/resourceGroups/resourceGroupName/providers/Microsoft.DevTestLab/labs/{labName}/artifactSources/{artifactSourceName}/armTemplates/{armTemplateName}"),
		// 			Location: to.Ptr("{location}"),
		// 			Tags: map[string]*string{
		// 				"MyTag": to.Ptr("MyValue"),
		// 			},
		// 			Properties: &armdevtestlabs.ArmTemplateProperties{
		// 				Contents: map[string]any{
		// 					"$schema": "http://schema.management.azure.com/schemas/2014-04-01-preview/deploymentTemplate.json#",
		// 					"contentVersion": "1.0.0.0",
		// 					"parameters":map[string]any{
		// 					},
		// 					"resources":[]any{
		// 					},
		// 					"variables":map[string]any{
		// 						"hostingPlanName": "[toLower(concat(variables('resourceNamePrefix'), '-', take(uniqueString(resourceGroup().id), 6), '-sp'))]",
		// 						"resourceNamePrefix": "[take(uniqueString(resourceGroup().id), 3)]",
		// 						"siteName": "[toLower(concat(variables('resourceNamePrefix'), '-', take(uniqueString(resourceGroup().id), 6)))]",
		// 					},
		// 				},
		// 				DisplayName: to.Ptr("Template1"),
		// 				Enabled: to.Ptr(true),
		// 				ParametersValueFilesInfo: []*armdevtestlabs.ParametersValueFileInfo{
		// 				},
		// 				Publisher: to.Ptr("Microsoft"),
		// 			},
		// 	}},
		// }
	}
}
Output:

type ArmTemplatesClientGetOptions added in v0.2.0

type ArmTemplatesClientGetOptions struct {
	// Specify the $expand query. Example: 'properties($select=displayName)'
	Expand *string
}

ArmTemplatesClientGetOptions contains the optional parameters for the ArmTemplatesClient.Get method.

type ArmTemplatesClientGetResponse added in v0.2.0

type ArmTemplatesClientGetResponse struct {
	// An Azure Resource Manager template.
	ArmTemplate
}

ArmTemplatesClientGetResponse contains the response from method ArmTemplatesClient.Get.

type ArmTemplatesClientListOptions added in v0.2.0

type ArmTemplatesClientListOptions struct {
	// Specify the $expand query. Example: 'properties($select=displayName)'
	Expand *string

	// The filter to apply to the operation. Example: '$filter=contains(name,'myName')
	Filter *string

	// The ordering expression for the results, using OData notation. Example: '$orderby=name desc'
	Orderby *string

	// The maximum number of resources to return from the operation. Example: '$top=10'
	Top *int32
}

ArmTemplatesClientListOptions contains the optional parameters for the ArmTemplatesClient.NewListPager method.

type ArmTemplatesClientListResponse added in v0.2.0

type ArmTemplatesClientListResponse struct {
	// The response of a list operation.
	ArmTemplateList
}

ArmTemplatesClientListResponse contains the response from method ArmTemplatesClient.NewListPager.

type Artifact

type Artifact struct {
	// REQUIRED; The properties of the resource.
	Properties *ArtifactProperties

	// The location of the resource.
	Location *string

	// The tags of the resource.
	Tags map[string]*string

	// READ-ONLY; The identifier of the resource.
	ID *string

	// READ-ONLY; The name of the resource.
	Name *string

	// READ-ONLY; The type of the resource.
	Type *string
}

Artifact - An artifact.

func (Artifact) MarshalJSON

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

MarshalJSON implements the json.Marshaller interface for type Artifact.

func (*Artifact) UnmarshalJSON added in v1.1.0

func (a *Artifact) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the json.Unmarshaller interface for type Artifact.

type ArtifactDeploymentStatusProperties

type ArtifactDeploymentStatusProperties struct {
	// The total count of the artifacts that were successfully applied.
	ArtifactsApplied *int32

	// The deployment status of the artifact.
	DeploymentStatus *string

	// The total count of the artifacts that were tentatively applied.
	TotalArtifacts *int32
}

ArtifactDeploymentStatusProperties - Properties of an artifact deployment.

func (ArtifactDeploymentStatusProperties) MarshalJSON added in v1.1.0

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

MarshalJSON implements the json.Marshaller interface for type ArtifactDeploymentStatusProperties.

func (*ArtifactDeploymentStatusProperties) UnmarshalJSON added in v1.1.0

func (a *ArtifactDeploymentStatusProperties) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the json.Unmarshaller interface for type ArtifactDeploymentStatusProperties.

type ArtifactInstallProperties

type ArtifactInstallProperties struct {
	// The artifact's identifier.
	ArtifactID *string

	// The artifact's title.
	ArtifactTitle *string

	// The status message from the deployment.
	DeploymentStatusMessage *string

	// The time that the artifact starts to install on the virtual machine.
	InstallTime *time.Time

	// The parameters of the artifact.
	Parameters []*ArtifactParameterProperties

	// The status of the artifact.
	Status *string

	// The status message from the virtual machine extension.
	VMExtensionStatusMessage *string
}

ArtifactInstallProperties - Properties of an artifact.

func (ArtifactInstallProperties) MarshalJSON

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

MarshalJSON implements the json.Marshaller interface for type ArtifactInstallProperties.

func (*ArtifactInstallProperties) UnmarshalJSON

func (a *ArtifactInstallProperties) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the json.Unmarshaller interface for type ArtifactInstallProperties.

type ArtifactList

type ArtifactList struct {
	// Link for next set of results.
	NextLink *string

	// Results of the list operation.
	Value []*Artifact
}

ArtifactList - The response of a list operation.

func (ArtifactList) MarshalJSON

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

MarshalJSON implements the json.Marshaller interface for type ArtifactList.

func (*ArtifactList) UnmarshalJSON added in v1.1.0

func (a *ArtifactList) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the json.Unmarshaller interface for type ArtifactList.

type ArtifactParameterProperties

type ArtifactParameterProperties struct {
	// The name of the artifact parameter.
	Name *string

	// The value of the artifact parameter.
	Value *string
}

ArtifactParameterProperties - Properties of an artifact parameter.

func (ArtifactParameterProperties) MarshalJSON added in v1.1.0

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

MarshalJSON implements the json.Marshaller interface for type ArtifactParameterProperties.

func (*ArtifactParameterProperties) UnmarshalJSON added in v1.1.0

func (a *ArtifactParameterProperties) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the json.Unmarshaller interface for type ArtifactParameterProperties.

type ArtifactProperties

type ArtifactProperties struct {
	// READ-ONLY; The artifact's creation date.
	CreatedDate *time.Time

	// READ-ONLY; The artifact's description.
	Description *string

	// READ-ONLY; The file path to the artifact.
	FilePath *string

	// READ-ONLY; The URI to the artifact icon.
	Icon *string

	// READ-ONLY; The artifact's parameters.
	Parameters any

	// READ-ONLY; The artifact's publisher.
	Publisher *string

	// READ-ONLY; The artifact's target OS.
	TargetOsType *string

	// READ-ONLY; The artifact's title.
	Title *string
}

ArtifactProperties - Properties of an artifact.

func (ArtifactProperties) MarshalJSON

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

MarshalJSON implements the json.Marshaller interface for type ArtifactProperties.

func (*ArtifactProperties) UnmarshalJSON

func (a *ArtifactProperties) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the json.Unmarshaller interface for type ArtifactProperties.

type ArtifactSource

type ArtifactSource struct {
	// REQUIRED; The properties of the resource.
	Properties *ArtifactSourceProperties

	// The location of the resource.
	Location *string

	// The tags of the resource.
	Tags map[string]*string

	// READ-ONLY; The identifier of the resource.
	ID *string

	// READ-ONLY; The name of the resource.
	Name *string

	// READ-ONLY; The type of the resource.
	Type *string
}

ArtifactSource - Properties of an artifact source.

func (ArtifactSource) MarshalJSON

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

MarshalJSON implements the json.Marshaller interface for type ArtifactSource.

func (*ArtifactSource) UnmarshalJSON added in v1.1.0

func (a *ArtifactSource) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the json.Unmarshaller interface for type ArtifactSource.

type ArtifactSourceFragment

type ArtifactSourceFragment struct {
	// The tags of the resource.
	Tags map[string]*string
}

ArtifactSourceFragment - Properties of an artifact source.

func (ArtifactSourceFragment) MarshalJSON added in v0.2.0

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

MarshalJSON implements the json.Marshaller interface for type ArtifactSourceFragment.

func (*ArtifactSourceFragment) UnmarshalJSON added in v1.1.0

func (a *ArtifactSourceFragment) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the json.Unmarshaller interface for type ArtifactSourceFragment.

type ArtifactSourceList

type ArtifactSourceList struct {
	// Link for next set of results.
	NextLink *string

	// Results of the list operation.
	Value []*ArtifactSource
}

ArtifactSourceList - The response of a list operation.

func (ArtifactSourceList) MarshalJSON

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

MarshalJSON implements the json.Marshaller interface for type ArtifactSourceList.

func (*ArtifactSourceList) UnmarshalJSON added in v1.1.0

func (a *ArtifactSourceList) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the json.Unmarshaller interface for type ArtifactSourceList.

type ArtifactSourceProperties

type ArtifactSourceProperties struct {
	// The folder containing Azure Resource Manager templates.
	ArmTemplateFolderPath *string

	// The artifact source's branch reference.
	BranchRef *string

	// The artifact source's display name.
	DisplayName *string

	// The folder containing artifacts.
	FolderPath *string

	// The security token to authenticate to the artifact source.
	SecurityToken *string

	// The artifact source's type.
	SourceType *SourceControlType

	// Indicates if the artifact source is enabled (values: Enabled, Disabled).
	Status *EnableStatus

	// The artifact source's URI.
	URI *string

	// READ-ONLY; The artifact source's creation date.
	CreatedDate *time.Time

	// READ-ONLY; The provisioning status of the resource.
	ProvisioningState *string

	// READ-ONLY; The unique immutable identifier of a resource (Guid).
	UniqueIdentifier *string
}

ArtifactSourceProperties - Properties of an artifact source.

func (ArtifactSourceProperties) MarshalJSON

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

MarshalJSON implements the json.Marshaller interface for type ArtifactSourceProperties.

func (*ArtifactSourceProperties) UnmarshalJSON

func (a *ArtifactSourceProperties) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the json.Unmarshaller interface for type ArtifactSourceProperties.

type ArtifactSourcesClient

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

ArtifactSourcesClient contains the methods for the ArtifactSources group. Don't use this type directly, use NewArtifactSourcesClient() instead.

func NewArtifactSourcesClient

func NewArtifactSourcesClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*ArtifactSourcesClient, error)

NewArtifactSourcesClient creates a new instance of ArtifactSourcesClient with the specified values.

  • subscriptionID - The subscription ID.
  • credential - used to authorize requests. Usually a credential from azidentity.
  • options - pass nil to accept the default values.

func (*ArtifactSourcesClient) CreateOrUpdate

func (client *ArtifactSourcesClient) CreateOrUpdate(ctx context.Context, resourceGroupName string, labName string, name string, artifactSource ArtifactSource, options *ArtifactSourcesClientCreateOrUpdateOptions) (ArtifactSourcesClientCreateOrUpdateResponse, error)

CreateOrUpdate - Create or replace an existing artifact source. If the operation fails it returns an *azcore.ResponseError type.

Generated from API version 2018-09-15

  • resourceGroupName - The name of the resource group.
  • labName - The name of the lab.
  • name - The name of the artifact source.
  • artifactSource - Properties of an artifact source.
  • options - ArtifactSourcesClientCreateOrUpdateOptions contains the optional parameters for the ArtifactSourcesClient.CreateOrUpdate method.
Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/d55b8005f05b040b852c15e74a0f3e36494a15e1/specification/devtestlabs/resource-manager/Microsoft.DevTestLab/stable/2018-09-15/examples/ArtifactSources_CreateOrUpdate.json

package main

import (
	"context"
	"log"

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

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armdevtestlabs.NewClientFactory("<subscription-id>", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	res, err := clientFactory.NewArtifactSourcesClient().CreateOrUpdate(ctx, "resourceGroupName", "{labName}", "{artifactSourceName}", armdevtestlabs.ArtifactSource{
		Tags: map[string]*string{
			"tagName1": to.Ptr("tagValue1"),
		},
		Properties: &armdevtestlabs.ArtifactSourceProperties{
			ArmTemplateFolderPath: to.Ptr("{armTemplateFolderPath}"),
			BranchRef:             to.Ptr("{branchRef}"),
			DisplayName:           to.Ptr("{displayName}"),
			FolderPath:            to.Ptr("{folderPath}"),
			SecurityToken:         to.Ptr("{securityToken}"),
			SourceType:            to.Ptr(armdevtestlabs.SourceControlType("{VsoGit|GitHub|StorageAccount}")),
			Status:                to.Ptr(armdevtestlabs.EnableStatus("{Enabled|Disabled}")),
			URI:                   to.Ptr("{artifactSourceUri}"),
		},
	}, 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.ArtifactSource = armdevtestlabs.ArtifactSource{
	// 	Name: to.Ptr("{artifactSourceName}"),
	// 	Type: to.Ptr("Microsoft.DevTestLab/labs/artifactsources"),
	// 	ID: to.Ptr("/subscriptions/{subscriptionId}/resourceGroups/resourceGroupName/providers/Microsoft.DevTestLab/labs/{labName}/artifactsources/{artifactSourceName}"),
	// 	Location: to.Ptr("{location}"),
	// 	Tags: map[string]*string{
	// 		"tagName1": to.Ptr("tagValue1"),
	// 	},
	// 	Properties: &armdevtestlabs.ArtifactSourceProperties{
	// 		ArmTemplateFolderPath: to.Ptr("{armTemplateFolderPath}"),
	// 		BranchRef: to.Ptr("{branchRef}"),
	// 		CreatedDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-12-16T23:53:02.483Z"); return t}()),
	// 		DisplayName: to.Ptr("{displayName}"),
	// 		FolderPath: to.Ptr("{folderPath}"),
	// 		ProvisioningState: to.Ptr("Succeeded"),
	// 		SecurityToken: to.Ptr("{securityToken}"),
	// 		SourceType: to.Ptr(armdevtestlabs.SourceControlType("{VsoGit|GitHub|StorageAccount}")),
	// 		Status: to.Ptr(armdevtestlabs.EnableStatus("{Enabled|Disabled}")),
	// 		UniqueIdentifier: to.Ptr("{uniqueIdentifier}"),
	// 		URI: to.Ptr("{artifactSourceUri}"),
	// 	},
	// }
}
Output:

func (*ArtifactSourcesClient) Delete

Delete - Delete artifact source. If the operation fails it returns an *azcore.ResponseError type.

Generated from API version 2018-09-15

  • resourceGroupName - The name of the resource group.
  • labName - The name of the lab.
  • name - The name of the artifact source.
  • options - ArtifactSourcesClientDeleteOptions contains the optional parameters for the ArtifactSourcesClient.Delete method.
Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/d55b8005f05b040b852c15e74a0f3e36494a15e1/specification/devtestlabs/resource-manager/Microsoft.DevTestLab/stable/2018-09-15/examples/ArtifactSources_Delete.json

package main

import (
	"context"
	"log"

	"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
	"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/devtestlabs/armdevtestlabs"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armdevtestlabs.NewClientFactory("<subscription-id>", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	_, err = clientFactory.NewArtifactSourcesClient().Delete(ctx, "resourceGroupName", "{labName}", "{artifactSourceName}", nil)
	if err != nil {
		log.Fatalf("failed to finish the request: %v", err)
	}
}
Output:

func (*ArtifactSourcesClient) Get

func (client *ArtifactSourcesClient) Get(ctx context.Context, resourceGroupName string, labName string, name string, options *ArtifactSourcesClientGetOptions) (ArtifactSourcesClientGetResponse, error)

Get - Get artifact source. If the operation fails it returns an *azcore.ResponseError type.

Generated from API version 2018-09-15

  • resourceGroupName - The name of the resource group.
  • labName - The name of the lab.
  • name - The name of the artifact source.
  • options - ArtifactSourcesClientGetOptions contains the optional parameters for the ArtifactSourcesClient.Get method.
Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/d55b8005f05b040b852c15e74a0f3e36494a15e1/specification/devtestlabs/resource-manager/Microsoft.DevTestLab/stable/2018-09-15/examples/ArtifactSources_Get.json

package main

import (
	"context"
	"log"

	"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
	"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/devtestlabs/armdevtestlabs"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armdevtestlabs.NewClientFactory("<subscription-id>", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	res, err := clientFactory.NewArtifactSourcesClient().Get(ctx, "resourceGroupName", "{labName}", "{artifactSourceName}", &armdevtestlabs.ArtifactSourcesClientGetOptions{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.ArtifactSource = armdevtestlabs.ArtifactSource{
	// 	Name: to.Ptr("{artifactSourceName}"),
	// 	Type: to.Ptr("Microsoft.DevTestLab/labs/artifactsources"),
	// 	ID: to.Ptr("/subscriptions/{subscriptionId}/resourceGroups/resourceGroupName/providers/Microsoft.DevTestLab/labs/{labName}/artifactsources/{artifactSourceName}"),
	// 	Location: to.Ptr("{location}"),
	// 	Tags: map[string]*string{
	// 		"tagName1": to.Ptr("tagValue1"),
	// 	},
	// 	Properties: &armdevtestlabs.ArtifactSourceProperties{
	// 		ArmTemplateFolderPath: to.Ptr("{armTemplateFolderPath}"),
	// 		BranchRef: to.Ptr("{branchRef}"),
	// 		CreatedDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-12-16T23:53:02.483Z"); return t}()),
	// 		DisplayName: to.Ptr("{displayName}"),
	// 		FolderPath: to.Ptr("{folderPath}"),
	// 		ProvisioningState: to.Ptr("Succeeded"),
	// 		SecurityToken: to.Ptr("{securityToken}"),
	// 		SourceType: to.Ptr(armdevtestlabs.SourceControlType("{VsoGit|GitHub|StorageAccount}")),
	// 		Status: to.Ptr(armdevtestlabs.EnableStatus("{Enabled|Disabled}")),
	// 		UniqueIdentifier: to.Ptr("{uniqueIdentifier}"),
	// 		URI: to.Ptr("{artifactSourceUri}"),
	// 	},
	// }
}
Output:

func (*ArtifactSourcesClient) NewListPager added in v0.4.0

func (client *ArtifactSourcesClient) NewListPager(resourceGroupName string, labName string, options *ArtifactSourcesClientListOptions) *runtime.Pager[ArtifactSourcesClientListResponse]

NewListPager - List artifact sources in a given lab.

Generated from API version 2018-09-15

  • resourceGroupName - The name of the resource group.
  • labName - The name of the lab.
  • options - ArtifactSourcesClientListOptions contains the optional parameters for the ArtifactSourcesClient.NewListPager method.
Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/d55b8005f05b040b852c15e74a0f3e36494a15e1/specification/devtestlabs/resource-manager/Microsoft.DevTestLab/stable/2018-09-15/examples/ArtifactSources_List.json

package main

import (
	"context"
	"log"

	"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
	"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/devtestlabs/armdevtestlabs"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armdevtestlabs.NewClientFactory("<subscription-id>", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	pager := clientFactory.NewArtifactSourcesClient().NewListPager("resourceGroupName", "{labName}", &armdevtestlabs.ArtifactSourcesClientListOptions{Expand: nil,
		Filter:  nil,
		Top:     nil,
		Orderby: 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.ArtifactSourceList = armdevtestlabs.ArtifactSourceList{
		// 	Value: []*armdevtestlabs.ArtifactSource{
		// 		{
		// 			Name: to.Ptr("{artifactSourceName}"),
		// 			Type: to.Ptr("Microsoft.DevTestLab/labs/artifactsources"),
		// 			ID: to.Ptr("/subscriptions/{subscriptionId}/resourceGroups/resourceGroupName/providers/Microsoft.DevTestLab/labs/{labName}/artifactsources/{artifactSourceName}"),
		// 			Location: to.Ptr("{location}"),
		// 			Tags: map[string]*string{
		// 				"tagName1": to.Ptr("tagValue1"),
		// 			},
		// 			Properties: &armdevtestlabs.ArtifactSourceProperties{
		// 				ArmTemplateFolderPath: to.Ptr("{armTemplateFolderPath}"),
		// 				BranchRef: to.Ptr("{branchRef}"),
		// 				CreatedDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-12-16T23:53:02.483Z"); return t}()),
		// 				DisplayName: to.Ptr("{displayName}"),
		// 				FolderPath: to.Ptr("{folderPath}"),
		// 				ProvisioningState: to.Ptr("Succeeded"),
		// 				SecurityToken: to.Ptr("{securityToken}"),
		// 				SourceType: to.Ptr(armdevtestlabs.SourceControlType("{VsoGit|GitHub|StorageAccount}")),
		// 				Status: to.Ptr(armdevtestlabs.EnableStatus("{Enabled|Disabled}")),
		// 				UniqueIdentifier: to.Ptr("{uniqueIdentifier}"),
		// 				URI: to.Ptr("{artifactSourceUri}"),
		// 			},
		// 	}},
		// }
	}
}
Output:

func (*ArtifactSourcesClient) Update

func (client *ArtifactSourcesClient) Update(ctx context.Context, resourceGroupName string, labName string, name string, artifactSource ArtifactSourceFragment, options *ArtifactSourcesClientUpdateOptions) (ArtifactSourcesClientUpdateResponse, error)

Update - Allows modifying tags of artifact sources. All other properties will be ignored. If the operation fails it returns an *azcore.ResponseError type.

Generated from API version 2018-09-15

  • resourceGroupName - The name of the resource group.
  • labName - The name of the lab.
  • name - The name of the artifact source.
  • artifactSource - Properties of an artifact source.
  • options - ArtifactSourcesClientUpdateOptions contains the optional parameters for the ArtifactSourcesClient.Update method.
Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/d55b8005f05b040b852c15e74a0f3e36494a15e1/specification/devtestlabs/resource-manager/Microsoft.DevTestLab/stable/2018-09-15/examples/ArtifactSources_Update.json

package main

import (
	"context"
	"log"

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

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armdevtestlabs.NewClientFactory("<subscription-id>", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	res, err := clientFactory.NewArtifactSourcesClient().Update(ctx, "resourceGroupName", "{labName}", "{artifactSourceName}", armdevtestlabs.ArtifactSourceFragment{
		Tags: map[string]*string{
			"tagName1": to.Ptr("tagValue1"),
		},
	}, 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.ArtifactSource = armdevtestlabs.ArtifactSource{
	// 	Name: to.Ptr("{artifactSourceName}"),
	// 	Type: to.Ptr("Microsoft.DevTestLab/labs/artifactsources"),
	// 	ID: to.Ptr("/subscriptions/{subscriptionId}/resourceGroups/resourceGroupName/providers/Microsoft.DevTestLab/labs/{labName}/artifactsources/{artifactSourceName}"),
	// 	Location: to.Ptr("{location}"),
	// 	Tags: map[string]*string{
	// 		"tagName1": to.Ptr("tagValue1"),
	// 	},
	// 	Properties: &armdevtestlabs.ArtifactSourceProperties{
	// 		ArmTemplateFolderPath: to.Ptr("{armTemplateFolderPath}"),
	// 		BranchRef: to.Ptr("{branchRef}"),
	// 		CreatedDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-12-16T23:53:02.483Z"); return t}()),
	// 		DisplayName: to.Ptr("{displayName}"),
	// 		FolderPath: to.Ptr("{folderPath}"),
	// 		ProvisioningState: to.Ptr("Succeeded"),
	// 		SecurityToken: to.Ptr("{securityToken}"),
	// 		SourceType: to.Ptr(armdevtestlabs.SourceControlType("{VsoGit|GitHub|StorageAccount}")),
	// 		Status: to.Ptr(armdevtestlabs.EnableStatus("{Enabled|Disabled}")),
	// 		UniqueIdentifier: to.Ptr("{uniqueIdentifier}"),
	// 		URI: to.Ptr("{artifactSourceUri}"),
	// 	},
	// }
}
Output:

type ArtifactSourcesClientCreateOrUpdateOptions added in v0.2.0

type ArtifactSourcesClientCreateOrUpdateOptions struct {
}

ArtifactSourcesClientCreateOrUpdateOptions contains the optional parameters for the ArtifactSourcesClient.CreateOrUpdate method.

type ArtifactSourcesClientCreateOrUpdateResponse added in v0.2.0

type ArtifactSourcesClientCreateOrUpdateResponse struct {
	// Properties of an artifact source.
	ArtifactSource
}

ArtifactSourcesClientCreateOrUpdateResponse contains the response from method ArtifactSourcesClient.CreateOrUpdate.

type ArtifactSourcesClientDeleteOptions added in v0.2.0

type ArtifactSourcesClientDeleteOptions struct {
}

ArtifactSourcesClientDeleteOptions contains the optional parameters for the ArtifactSourcesClient.Delete method.

type ArtifactSourcesClientDeleteResponse added in v0.2.0

type ArtifactSourcesClientDeleteResponse struct {
}

ArtifactSourcesClientDeleteResponse contains the response from method ArtifactSourcesClient.Delete.

type ArtifactSourcesClientGetOptions added in v0.2.0

type ArtifactSourcesClientGetOptions struct {
	// Specify the $expand query. Example: 'properties($select=displayName)'
	Expand *string
}

ArtifactSourcesClientGetOptions contains the optional parameters for the ArtifactSourcesClient.Get method.

type ArtifactSourcesClientGetResponse added in v0.2.0

type ArtifactSourcesClientGetResponse struct {
	// Properties of an artifact source.
	ArtifactSource
}

ArtifactSourcesClientGetResponse contains the response from method ArtifactSourcesClient.Get.

type ArtifactSourcesClientListOptions added in v0.2.0

type ArtifactSourcesClientListOptions struct {
	// Specify the $expand query. Example: 'properties($select=displayName)'
	Expand *string

	// The filter to apply to the operation. Example: '$filter=contains(name,'myName')
	Filter *string

	// The ordering expression for the results, using OData notation. Example: '$orderby=name desc'
	Orderby *string

	// The maximum number of resources to return from the operation. Example: '$top=10'
	Top *int32
}

ArtifactSourcesClientListOptions contains the optional parameters for the ArtifactSourcesClient.NewListPager method.

type ArtifactSourcesClientListResponse added in v0.2.0

type ArtifactSourcesClientListResponse struct {
	// The response of a list operation.
	ArtifactSourceList
}

ArtifactSourcesClientListResponse contains the response from method ArtifactSourcesClient.NewListPager.

type ArtifactSourcesClientUpdateOptions added in v0.2.0

type ArtifactSourcesClientUpdateOptions struct {
}

ArtifactSourcesClientUpdateOptions contains the optional parameters for the ArtifactSourcesClient.Update method.

type ArtifactSourcesClientUpdateResponse added in v0.2.0

type ArtifactSourcesClientUpdateResponse struct {
	// Properties of an artifact source.
	ArtifactSource
}

ArtifactSourcesClientUpdateResponse contains the response from method ArtifactSourcesClient.Update.

type ArtifactsClient

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

ArtifactsClient contains the methods for the Artifacts group. Don't use this type directly, use NewArtifactsClient() instead.

func NewArtifactsClient

func NewArtifactsClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*ArtifactsClient, error)

NewArtifactsClient creates a new instance of ArtifactsClient with the specified values.

  • subscriptionID - The subscription ID.
  • credential - used to authorize requests. Usually a credential from azidentity.
  • options - pass nil to accept the default values.

func (*ArtifactsClient) GenerateArmTemplate

func (client *ArtifactsClient) GenerateArmTemplate(ctx context.Context, resourceGroupName string, labName string, artifactSourceName string, name string, generateArmTemplateRequest GenerateArmTemplateRequest, options *ArtifactsClientGenerateArmTemplateOptions) (ArtifactsClientGenerateArmTemplateResponse, error)

GenerateArmTemplate - Generates an ARM template for the given artifact, uploads the required files to a storage account, and validates the generated artifact. If the operation fails it returns an *azcore.ResponseError type.

Generated from API version 2018-09-15

  • resourceGroupName - The name of the resource group.
  • labName - The name of the lab.
  • artifactSourceName - The name of the artifact source.
  • name - The name of the artifact.
  • generateArmTemplateRequest - Parameters for generating an ARM template for deploying artifacts.
  • options - ArtifactsClientGenerateArmTemplateOptions contains the optional parameters for the ArtifactsClient.GenerateArmTemplate method.
Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/d55b8005f05b040b852c15e74a0f3e36494a15e1/specification/devtestlabs/resource-manager/Microsoft.DevTestLab/stable/2018-09-15/examples/Artifacts_GenerateArmTemplate.json

package main

import (
	"context"
	"log"

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

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armdevtestlabs.NewClientFactory("<subscription-id>", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	res, err := clientFactory.NewArtifactsClient().GenerateArmTemplate(ctx, "resourceGroupName", "{labName}", "{artifactSourceName}", "{artifactName}", armdevtestlabs.GenerateArmTemplateRequest{
		FileUploadOptions:  to.Ptr(armdevtestlabs.FileUploadOptionsNone),
		Location:           to.Ptr("{location}"),
		VirtualMachineName: to.Ptr("{vmName}"),
	}, 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.ArmTemplateInfo = armdevtestlabs.ArmTemplateInfo{
	// 	Parameters: map[string]any{
	// 		"extensionName":map[string]any{
	// 			"value": "{vmName}/CustomScriptExtension",
	// 		},
	// 		"location":map[string]any{
	// 			"value": "{location}",
	// 		},
	// 	},
	// 	Template: map[string]any{
	// 		"$schema": "http://schema.management.azure.com/schemas/2015-01-01/deploymentTemplate.json",
	// 		"contentVersion": "1.0.0.0",
	// 		"parameters":map[string]any{
	// 			"extensionName":map[string]any{
	// 				"type": "string",
	// 			},
	// 			"location":map[string]any{
	// 				"type": "string",
	// 			},
	// 		},
	// 		"resources":[]any{
	// 			map[string]any{
	// 				"name": "[parameters('extensionName')]",
	// 				"type": "Microsoft.Compute/virtualMachines/extensions",
	// 				"apiVersion": "2015-06-15",
	// 				"location": "[parameters('location')]",
	// 				"properties":map[string]any{
	// 					"type": "CustomScriptExtension",
	// 					"autoUpgradeMinorVersion": "true",
	// 					"forceUpdateTag": "15/10/2018 00:00:00 +00:00",
	// 					"protectedSettings":map[string]any{
	// 						"commandToExecute": "[concat('cd {MsDtlScriptFolder}/scripts && ', variables('_commandToExecute'))]",
	// 					},
	// 					"publisher": "Microsoft.Compute",
	// 					"settings":map[string]any{
	// 						"commandToExecute": "",
	// 						"fileUris":[]any{
	// 							"{MsDtlArtifactFileUris}",
	// 						},
	// 					},
	// 					"typeHandlerVersion": "1.9",
	// 				},
	// 			},
	// 		},
	// 		"variables":map[string]any{
	// 			"_commandToExecute": "{commandToExecute}.",
	// 		},
	// 	},
	// }
}
Output:

func (*ArtifactsClient) Get

func (client *ArtifactsClient) Get(ctx context.Context, resourceGroupName string, labName string, artifactSourceName string, name string, options *ArtifactsClientGetOptions) (ArtifactsClientGetResponse, error)

Get - Get artifact. If the operation fails it returns an *azcore.ResponseError type.

Generated from API version 2018-09-15

  • resourceGroupName - The name of the resource group.
  • labName - The name of the lab.
  • artifactSourceName - The name of the artifact source.
  • name - The name of the artifact.
  • options - ArtifactsClientGetOptions contains the optional parameters for the ArtifactsClient.Get method.
Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/d55b8005f05b040b852c15e74a0f3e36494a15e1/specification/devtestlabs/resource-manager/Microsoft.DevTestLab/stable/2018-09-15/examples/Artifacts_Get.json

package main

import (
	"context"
	"log"

	"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
	"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/devtestlabs/armdevtestlabs"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armdevtestlabs.NewClientFactory("<subscription-id>", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	res, err := clientFactory.NewArtifactsClient().Get(ctx, "resourceGroupName", "{labName}", "{artifactSourceName}", "{artifactName}", &armdevtestlabs.ArtifactsClientGetOptions{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.Artifact = armdevtestlabs.Artifact{
	// 	Name: to.Ptr("{artifactName}"),
	// 	Type: to.Ptr("Microsoft.DevTestLab/labs/artifactSources/artifacts"),
	// 	ID: to.Ptr("/subscriptions/{subscriptionId}/resourceGroups/resourceGroupName/providers/Microsoft.DevTestLab/labs/{labName}/artifactSources/{artifactSourceName}/artifacts/{artifactName}"),
	// 	Location: to.Ptr("{location}"),
	// 	Tags: map[string]*string{
	// 		"MyTag": to.Ptr("MyValue"),
	// 	},
	// 	Properties: &armdevtestlabs.ArtifactProperties{
	// 		Description: to.Ptr("Sample artifact description."),
	// 		FilePath: to.Ptr("{artifactsPath}/{artifactName}"),
	// 		Parameters: map[string]any{
	// 			"uri":map[string]any{
	// 				"type": "string",
	// 				"description": "Sample parameter 1 description.",
	// 				"defaultValue": "https://{labStorageAccount}.blob.core.windows.net/{artifactName}/...",
	// 				"displayName": "Sample Parameter 1",
	// 			},
	// 		},
	// 		Publisher: to.Ptr("Microsoft"),
	// 		TargetOsType: to.Ptr("Windows"),
	// 		Title: to.Ptr("Sample Artifact Title"),
	// 	},
	// }
}
Output:

func (*ArtifactsClient) NewListPager added in v0.4.0

func (client *ArtifactsClient) NewListPager(resourceGroupName string, labName string, artifactSourceName string, options *ArtifactsClientListOptions) *runtime.Pager[ArtifactsClientListResponse]

NewListPager - List artifacts in a given artifact source.

Generated from API version 2018-09-15

  • resourceGroupName - The name of the resource group.
  • labName - The name of the lab.
  • artifactSourceName - The name of the artifact source.
  • options - ArtifactsClientListOptions contains the optional parameters for the ArtifactsClient.NewListPager method.
Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/d55b8005f05b040b852c15e74a0f3e36494a15e1/specification/devtestlabs/resource-manager/Microsoft.DevTestLab/stable/2018-09-15/examples/Artifacts_List.json

package main

import (
	"context"
	"log"

	"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
	"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/devtestlabs/armdevtestlabs"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armdevtestlabs.NewClientFactory("<subscription-id>", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	pager := clientFactory.NewArtifactsClient().NewListPager("resourceGroupName", "{labName}", "{artifactSourceName}", &armdevtestlabs.ArtifactsClientListOptions{Expand: nil,
		Filter:  nil,
		Top:     nil,
		Orderby: 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.ArtifactList = armdevtestlabs.ArtifactList{
		// 	Value: []*armdevtestlabs.Artifact{
		// 		{
		// 			Name: to.Ptr("{artifactName}"),
		// 			Type: to.Ptr("Microsoft.DevTestLab/labs/artifactSources/artifacts"),
		// 			ID: to.Ptr("/subscriptions/{subscriptionId}/resourceGroups/resourceGroupName/providers/Microsoft.DevTestLab/labs/{labName}/artifactSources/{artifactSourceName}/artifacts/{artifactName}"),
		// 			Location: to.Ptr("{location}"),
		// 			Tags: map[string]*string{
		// 				"MyTag": to.Ptr("MyValue"),
		// 			},
		// 			Properties: &armdevtestlabs.ArtifactProperties{
		// 				Description: to.Ptr("Sample artifact description."),
		// 				FilePath: to.Ptr("{artifactsPath}/{artifactName}"),
		// 				Parameters: map[string]any{
		// 					"uri":map[string]any{
		// 						"type": "string",
		// 						"description": "Sample parameter 1 description.",
		// 						"defaultValue": "https://{labStorageAccount}.blob.core.windows.net/{artifactName}/...",
		// 						"displayName": "Sample Parameter 1",
		// 					},
		// 				},
		// 				Publisher: to.Ptr("Microsoft"),
		// 				TargetOsType: to.Ptr("Windows"),
		// 				Title: to.Ptr("Sample Artifact Title"),
		// 			},
		// 	}},
		// }
	}
}
Output:

type ArtifactsClientGenerateArmTemplateOptions added in v0.2.0

type ArtifactsClientGenerateArmTemplateOptions struct {
}

ArtifactsClientGenerateArmTemplateOptions contains the optional parameters for the ArtifactsClient.GenerateArmTemplate method.

type ArtifactsClientGenerateArmTemplateResponse added in v0.2.0

type ArtifactsClientGenerateArmTemplateResponse struct {
	// Information about a generated ARM template.
	ArmTemplateInfo
}

ArtifactsClientGenerateArmTemplateResponse contains the response from method ArtifactsClient.GenerateArmTemplate.

type ArtifactsClientGetOptions added in v0.2.0

type ArtifactsClientGetOptions struct {
	// Specify the $expand query. Example: 'properties($select=title)'
	Expand *string
}

ArtifactsClientGetOptions contains the optional parameters for the ArtifactsClient.Get method.

type ArtifactsClientGetResponse added in v0.2.0

type ArtifactsClientGetResponse struct {
	// An artifact.
	Artifact
}

ArtifactsClientGetResponse contains the response from method ArtifactsClient.Get.

type ArtifactsClientListOptions added in v0.2.0

type ArtifactsClientListOptions struct {
	// Specify the $expand query. Example: 'properties($select=title)'
	Expand *string

	// The filter to apply to the operation. Example: '$filter=contains(name,'myName')
	Filter *string

	// The ordering expression for the results, using OData notation. Example: '$orderby=name desc'
	Orderby *string

	// The maximum number of resources to return from the operation. Example: '$top=10'
	Top *int32
}

ArtifactsClientListOptions contains the optional parameters for the ArtifactsClient.NewListPager method.

type ArtifactsClientListResponse added in v0.2.0

type ArtifactsClientListResponse struct {
	// The response of a list operation.
	ArtifactList
}

ArtifactsClientListResponse contains the response from method ArtifactsClient.NewListPager.

type AttachDiskProperties

type AttachDiskProperties struct {
	// The resource ID of the Lab virtual machine to which the disk is attached.
	LeasedByLabVMID *string
}

AttachDiskProperties - Properties of the disk to attach.

func (AttachDiskProperties) MarshalJSON added in v1.1.0

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

MarshalJSON implements the json.Marshaller interface for type AttachDiskProperties.

func (*AttachDiskProperties) UnmarshalJSON added in v1.1.0

func (a *AttachDiskProperties) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the json.Unmarshaller interface for type AttachDiskProperties.

type AttachNewDataDiskOptions

type AttachNewDataDiskOptions struct {
	// The name of the disk to be attached.
	DiskName *string

	// Size of the disk to be attached in Gibibytes.
	DiskSizeGiB *int32

	// The storage type for the disk (i.e. Standard, Premium).
	DiskType *StorageType
}

AttachNewDataDiskOptions - Properties to attach new disk to the Virtual Machine.

func (AttachNewDataDiskOptions) MarshalJSON added in v1.1.0

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

MarshalJSON implements the json.Marshaller interface for type AttachNewDataDiskOptions.

func (*AttachNewDataDiskOptions) UnmarshalJSON added in v1.1.0

func (a *AttachNewDataDiskOptions) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the json.Unmarshaller interface for type AttachNewDataDiskOptions.

type BulkCreationParameters

type BulkCreationParameters struct {
	// The number of virtual machine instances to create.
	InstanceCount *int32
}

BulkCreationParameters - Parameters for creating multiple virtual machines as a single action.

func (BulkCreationParameters) MarshalJSON added in v1.1.0

func (b BulkCreationParameters) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.Marshaller interface for type BulkCreationParameters.

func (*BulkCreationParameters) UnmarshalJSON added in v1.1.0

func (b *BulkCreationParameters) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the json.Unmarshaller interface for type BulkCreationParameters.

type ClientFactory added in v1.1.0

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 added in v1.1.0

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 - The subscription ID.
  • credential - used to authorize requests. Usually a credential from azidentity.
  • options - pass nil to accept the default values.

func (*ClientFactory) NewArmTemplatesClient added in v1.1.0

func (c *ClientFactory) NewArmTemplatesClient() *ArmTemplatesClient

NewArmTemplatesClient creates a new instance of ArmTemplatesClient.

func (*ClientFactory) NewArtifactSourcesClient added in v1.1.0

func (c *ClientFactory) NewArtifactSourcesClient() *ArtifactSourcesClient

NewArtifactSourcesClient creates a new instance of ArtifactSourcesClient.

func (*ClientFactory) NewArtifactsClient added in v1.1.0

func (c *ClientFactory) NewArtifactsClient() *ArtifactsClient

NewArtifactsClient creates a new instance of ArtifactsClient.

func (*ClientFactory) NewCostsClient added in v1.1.0

func (c *ClientFactory) NewCostsClient() *CostsClient

NewCostsClient creates a new instance of CostsClient.

func (*ClientFactory) NewCustomImagesClient added in v1.1.0

func (c *ClientFactory) NewCustomImagesClient() *CustomImagesClient

NewCustomImagesClient creates a new instance of CustomImagesClient.

func (*ClientFactory) NewDisksClient added in v1.1.0

func (c *ClientFactory) NewDisksClient() *DisksClient

NewDisksClient creates a new instance of DisksClient.

func (*ClientFactory) NewEnvironmentsClient added in v1.1.0

func (c *ClientFactory) NewEnvironmentsClient() *EnvironmentsClient

NewEnvironmentsClient creates a new instance of EnvironmentsClient.

func (*ClientFactory) NewFormulasClient added in v1.1.0

func (c *ClientFactory) NewFormulasClient() *FormulasClient

NewFormulasClient creates a new instance of FormulasClient.

func (*ClientFactory) NewGalleryImagesClient added in v1.1.0

func (c *ClientFactory) NewGalleryImagesClient() *GalleryImagesClient

NewGalleryImagesClient creates a new instance of GalleryImagesClient.

func (*ClientFactory) NewGlobalSchedulesClient added in v1.1.0

func (c *ClientFactory) NewGlobalSchedulesClient() *GlobalSchedulesClient

NewGlobalSchedulesClient creates a new instance of GlobalSchedulesClient.

func (*ClientFactory) NewLabsClient added in v1.1.0

func (c *ClientFactory) NewLabsClient() *LabsClient

NewLabsClient creates a new instance of LabsClient.

func (*ClientFactory) NewNotificationChannelsClient added in v1.1.0

func (c *ClientFactory) NewNotificationChannelsClient() *NotificationChannelsClient

NewNotificationChannelsClient creates a new instance of NotificationChannelsClient.

func (*ClientFactory) NewOperationsClient added in v1.1.0

func (c *ClientFactory) NewOperationsClient() *OperationsClient

NewOperationsClient creates a new instance of OperationsClient.

func (*ClientFactory) NewPoliciesClient added in v1.1.0

func (c *ClientFactory) NewPoliciesClient() *PoliciesClient

NewPoliciesClient creates a new instance of PoliciesClient.

func (*ClientFactory) NewPolicySetsClient added in v1.1.0

func (c *ClientFactory) NewPolicySetsClient() *PolicySetsClient

NewPolicySetsClient creates a new instance of PolicySetsClient.

func (*ClientFactory) NewProviderOperationsClient added in v1.1.0

func (c *ClientFactory) NewProviderOperationsClient() *ProviderOperationsClient

NewProviderOperationsClient creates a new instance of ProviderOperationsClient.

func (*ClientFactory) NewSchedulesClient added in v1.1.0

func (c *ClientFactory) NewSchedulesClient() *SchedulesClient

NewSchedulesClient creates a new instance of SchedulesClient.

func (*ClientFactory) NewSecretsClient added in v1.1.0

func (c *ClientFactory) NewSecretsClient() *SecretsClient

NewSecretsClient creates a new instance of SecretsClient.

func (*ClientFactory) NewServiceFabricSchedulesClient added in v1.1.0

func (c *ClientFactory) NewServiceFabricSchedulesClient() *ServiceFabricSchedulesClient

NewServiceFabricSchedulesClient creates a new instance of ServiceFabricSchedulesClient.

func (*ClientFactory) NewServiceFabricsClient added in v1.1.0

func (c *ClientFactory) NewServiceFabricsClient() *ServiceFabricsClient

NewServiceFabricsClient creates a new instance of ServiceFabricsClient.

func (*ClientFactory) NewServiceRunnersClient added in v1.1.0

func (c *ClientFactory) NewServiceRunnersClient() *ServiceRunnersClient

NewServiceRunnersClient creates a new instance of ServiceRunnersClient.

func (*ClientFactory) NewUsersClient added in v1.1.0

func (c *ClientFactory) NewUsersClient() *UsersClient

NewUsersClient creates a new instance of UsersClient.

func (*ClientFactory) NewVirtualMachineSchedulesClient added in v1.1.0

func (c *ClientFactory) NewVirtualMachineSchedulesClient() *VirtualMachineSchedulesClient

NewVirtualMachineSchedulesClient creates a new instance of VirtualMachineSchedulesClient.

func (*ClientFactory) NewVirtualMachinesClient added in v1.1.0

func (c *ClientFactory) NewVirtualMachinesClient() *VirtualMachinesClient

NewVirtualMachinesClient creates a new instance of VirtualMachinesClient.

func (*ClientFactory) NewVirtualNetworksClient added in v1.1.0

func (c *ClientFactory) NewVirtualNetworksClient() *VirtualNetworksClient

NewVirtualNetworksClient creates a new instance of VirtualNetworksClient.

type ComputeDataDisk

type ComputeDataDisk struct {
	// Gets data disk size in GiB.
	DiskSizeGiB *int32

	// When backed by a blob, the URI of underlying blob.
	DiskURI *string

	// When backed by managed disk, this is the ID of the compute disk resource.
	ManagedDiskID *string

	// Gets data disk name.
	Name *string
}

ComputeDataDisk - A data disks attached to a virtual machine.

func (ComputeDataDisk) MarshalJSON added in v1.1.0

func (c ComputeDataDisk) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.Marshaller interface for type ComputeDataDisk.

func (*ComputeDataDisk) UnmarshalJSON added in v1.1.0

func (c *ComputeDataDisk) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the json.Unmarshaller interface for type ComputeDataDisk.

type ComputeVMInstanceViewStatus

type ComputeVMInstanceViewStatus struct {
	// Gets the status Code.
	Code *string

	// Gets the short localizable label for the status.
	DisplayStatus *string

	// Gets the message associated with the status.
	Message *string
}

ComputeVMInstanceViewStatus - Status information about a virtual machine.

func (ComputeVMInstanceViewStatus) MarshalJSON added in v1.1.0

func (c ComputeVMInstanceViewStatus) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.Marshaller interface for type ComputeVMInstanceViewStatus.

func (*ComputeVMInstanceViewStatus) UnmarshalJSON added in v1.1.0

func (c *ComputeVMInstanceViewStatus) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the json.Unmarshaller interface for type ComputeVMInstanceViewStatus.

type ComputeVMProperties

type ComputeVMProperties struct {
	// Gets data disks blob uri for the virtual machine.
	DataDiskIDs []*string

	// Gets all data disks attached to the virtual machine.
	DataDisks []*ComputeDataDisk

	// Gets the network interface ID of the virtual machine.
	NetworkInterfaceID *string

	// Gets OS disk blob uri for the virtual machine.
	OSDiskID *string

	// Gets the OS type of the virtual machine.
	OSType *string

	// Gets the statuses of the virtual machine.
	Statuses []*ComputeVMInstanceViewStatus

	// Gets the size of the virtual machine.
	VMSize *string
}

ComputeVMProperties - Properties of a virtual machine returned by the Microsoft.Compute API.

func (ComputeVMProperties) MarshalJSON

func (c ComputeVMProperties) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.Marshaller interface for type ComputeVMProperties.

func (*ComputeVMProperties) UnmarshalJSON added in v1.1.0

func (c *ComputeVMProperties) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the json.Unmarshaller interface for type ComputeVMProperties.

type CostThresholdProperties

type CostThresholdProperties struct {
	// Indicates whether this threshold will be displayed on cost charts.
	DisplayOnChart *CostThresholdStatus

	// Indicates the datetime when notifications were last sent for this threshold.
	NotificationSent *string

	// The value of the percentage cost threshold.
	PercentageThreshold *PercentageCostThresholdProperties

	// Indicates whether notifications will be sent when this threshold is exceeded.
	SendNotificationWhenExceeded *CostThresholdStatus

	// The ID of the cost threshold item.
	ThresholdID *string
}

CostThresholdProperties - Properties of a cost threshold item.

func (CostThresholdProperties) MarshalJSON added in v1.1.0

func (c CostThresholdProperties) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.Marshaller interface for type CostThresholdProperties.

func (*CostThresholdProperties) UnmarshalJSON added in v1.1.0

func (c *CostThresholdProperties) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the json.Unmarshaller interface for type CostThresholdProperties.

type CostThresholdStatus

type CostThresholdStatus string

CostThresholdStatus - Indicates whether this threshold will be displayed on cost charts.

const (
	CostThresholdStatusDisabled CostThresholdStatus = "Disabled"
	CostThresholdStatusEnabled  CostThresholdStatus = "Enabled"
)

func PossibleCostThresholdStatusValues

func PossibleCostThresholdStatusValues() []CostThresholdStatus

PossibleCostThresholdStatusValues returns the possible values for the CostThresholdStatus const type.

type CostType

type CostType string

CostType - The type of the cost.

const (
	CostTypeProjected   CostType = "Projected"
	CostTypeReported    CostType = "Reported"
	CostTypeUnavailable CostType = "Unavailable"
)

func PossibleCostTypeValues

func PossibleCostTypeValues() []CostType

PossibleCostTypeValues returns the possible values for the CostType const type.

type CostsClient

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

CostsClient contains the methods for the Costs group. Don't use this type directly, use NewCostsClient() instead.

func NewCostsClient

func NewCostsClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*CostsClient, error)

NewCostsClient creates a new instance of CostsClient with the specified values.

  • subscriptionID - The subscription ID.
  • credential - used to authorize requests. Usually a credential from azidentity.
  • options - pass nil to accept the default values.

func (*CostsClient) CreateOrUpdate

func (client *CostsClient) CreateOrUpdate(ctx context.Context, resourceGroupName string, labName string, name string, labCost LabCost, options *CostsClientCreateOrUpdateOptions) (CostsClientCreateOrUpdateResponse, error)

CreateOrUpdate - Create or replace an existing cost. If the operation fails it returns an *azcore.ResponseError type.

Generated from API version 2018-09-15

  • resourceGroupName - The name of the resource group.
  • labName - The name of the lab.
  • name - The name of the cost.
  • labCost - A cost item.
  • options - CostsClientCreateOrUpdateOptions contains the optional parameters for the CostsClient.CreateOrUpdate method.
Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/d55b8005f05b040b852c15e74a0f3e36494a15e1/specification/devtestlabs/resource-manager/Microsoft.DevTestLab/stable/2018-09-15/examples/Costs_CreateOrUpdate.json

package main

import (
	"context"
	"log"

	"time"

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

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armdevtestlabs.NewClientFactory("<subscription-id>", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	res, err := clientFactory.NewCostsClient().CreateOrUpdate(ctx, "resourceGroupName", "{labName}", "targetCost", armdevtestlabs.LabCost{
		Properties: &armdevtestlabs.LabCostProperties{
			CurrencyCode:  to.Ptr("USD"),
			EndDateTime:   to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-12-31T23:59:59.000Z"); return t }()),
			StartDateTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-12-01T00:00:00.000Z"); return t }()),
			TargetCost: &armdevtestlabs.TargetCostProperties{
				CostThresholds: []*armdevtestlabs.CostThresholdProperties{
					{
						DisplayOnChart: to.Ptr(armdevtestlabs.CostThresholdStatusDisabled),
						PercentageThreshold: &armdevtestlabs.PercentageCostThresholdProperties{
							ThresholdValue: to.Ptr[float64](25),
						},
						SendNotificationWhenExceeded: to.Ptr(armdevtestlabs.CostThresholdStatusDisabled),
						ThresholdID:                  to.Ptr("00000000-0000-0000-0000-000000000001"),
					},
					{
						DisplayOnChart: to.Ptr(armdevtestlabs.CostThresholdStatusEnabled),
						PercentageThreshold: &armdevtestlabs.PercentageCostThresholdProperties{
							ThresholdValue: to.Ptr[float64](50),
						},
						SendNotificationWhenExceeded: to.Ptr(armdevtestlabs.CostThresholdStatusEnabled),
						ThresholdID:                  to.Ptr("00000000-0000-0000-0000-000000000002"),
					},
					{
						DisplayOnChart: to.Ptr(armdevtestlabs.CostThresholdStatusDisabled),
						PercentageThreshold: &armdevtestlabs.PercentageCostThresholdProperties{
							ThresholdValue: to.Ptr[float64](75),
						},
						SendNotificationWhenExceeded: to.Ptr(armdevtestlabs.CostThresholdStatusDisabled),
						ThresholdID:                  to.Ptr("00000000-0000-0000-0000-000000000003"),
					},
					{
						DisplayOnChart: to.Ptr(armdevtestlabs.CostThresholdStatusDisabled),
						PercentageThreshold: &armdevtestlabs.PercentageCostThresholdProperties{
							ThresholdValue: to.Ptr[float64](100),
						},
						SendNotificationWhenExceeded: to.Ptr(armdevtestlabs.CostThresholdStatusDisabled),
						ThresholdID:                  to.Ptr("00000000-0000-0000-0000-000000000004"),
					},
					{
						DisplayOnChart: to.Ptr(armdevtestlabs.CostThresholdStatusDisabled),
						PercentageThreshold: &armdevtestlabs.PercentageCostThresholdProperties{
							ThresholdValue: to.Ptr[float64](125),
						},
						SendNotificationWhenExceeded: to.Ptr(armdevtestlabs.CostThresholdStatusDisabled),
						ThresholdID:                  to.Ptr("00000000-0000-0000-0000-000000000005"),
					}},
				CycleEndDateTime:   to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-12-31T00:00:00.000Z"); return t }()),
				CycleStartDateTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-12-01T00:00:00.000Z"); return t }()),
				CycleType:          to.Ptr(armdevtestlabs.ReportingCycleTypeCalendarMonth),
				Status:             to.Ptr(armdevtestlabs.TargetCostStatusEnabled),
				Target:             to.Ptr[int32](100),
			},
		},
	}, 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.LabCost = armdevtestlabs.LabCost{
	// 	Properties: &armdevtestlabs.LabCostProperties{
	// 		CreatedDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-12-23T22:43:54.725Z"); return t}()),
	// 		CurrencyCode: to.Ptr("USD"),
	// 		EndDateTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-12-31T23:59:59.000Z"); return t}()),
	// 		ProvisioningState: to.Ptr("Succeeded"),
	// 		StartDateTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-12-01T00:00:00.000Z"); return t}()),
	// 		TargetCost: &armdevtestlabs.TargetCostProperties{
	// 			CostThresholds: []*armdevtestlabs.CostThresholdProperties{
	// 				{
	// 					DisplayOnChart: to.Ptr(armdevtestlabs.CostThresholdStatusDisabled),
	// 					NotificationSent: to.Ptr("0001-01-01T00:00:00.0000000"),
	// 					PercentageThreshold: &armdevtestlabs.PercentageCostThresholdProperties{
	// 						ThresholdValue: to.Ptr[float64](25),
	// 					},
	// 					SendNotificationWhenExceeded: to.Ptr(armdevtestlabs.CostThresholdStatusDisabled),
	// 					ThresholdID: to.Ptr("00000000-0000-0000-0000-000000000001"),
	// 				},
	// 				{
	// 					DisplayOnChart: to.Ptr(armdevtestlabs.CostThresholdStatusEnabled),
	// 					NotificationSent: to.Ptr("0001-01-01T00:00:00.0000000"),
	// 					PercentageThreshold: &armdevtestlabs.PercentageCostThresholdProperties{
	// 						ThresholdValue: to.Ptr[float64](50),
	// 					},
	// 					SendNotificationWhenExceeded: to.Ptr(armdevtestlabs.CostThresholdStatusEnabled),
	// 					ThresholdID: to.Ptr("00000000-0000-0000-0000-000000000001"),
	// 				},
	// 				{
	// 					DisplayOnChart: to.Ptr(armdevtestlabs.CostThresholdStatusDisabled),
	// 					NotificationSent: to.Ptr("0001-01-01T00:00:00.0000000"),
	// 					PercentageThreshold: &armdevtestlabs.PercentageCostThresholdProperties{
	// 						ThresholdValue: to.Ptr[float64](75),
	// 					},
	// 					SendNotificationWhenExceeded: to.Ptr(armdevtestlabs.CostThresholdStatusDisabled),
	// 					ThresholdID: to.Ptr("00000000-0000-0000-0000-000000000001"),
	// 				},
	// 				{
	// 					DisplayOnChart: to.Ptr(armdevtestlabs.CostThresholdStatusDisabled),
	// 					NotificationSent: to.Ptr("0001-01-01T00:00:00.0000000"),
	// 					PercentageThreshold: &armdevtestlabs.PercentageCostThresholdProperties{
	// 						ThresholdValue: to.Ptr[float64](100),
	// 					},
	// 					SendNotificationWhenExceeded: to.Ptr(armdevtestlabs.CostThresholdStatusDisabled),
	// 					ThresholdID: to.Ptr("00000000-0000-0000-0000-000000000001"),
	// 				},
	// 				{
	// 					DisplayOnChart: to.Ptr(armdevtestlabs.CostThresholdStatusDisabled),
	// 					NotificationSent: to.Ptr("0001-01-01T00:00:00.0000000"),
	// 					PercentageThreshold: &armdevtestlabs.PercentageCostThresholdProperties{
	// 						ThresholdValue: to.Ptr[float64](125),
	// 					},
	// 					SendNotificationWhenExceeded: to.Ptr(armdevtestlabs.CostThresholdStatusDisabled),
	// 					ThresholdID: to.Ptr("00000000-0000-0000-0000-000000000001"),
	// 			}},
	// 			CycleEndDateTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-12-31T23:59:59.000Z"); return t}()),
	// 			CycleStartDateTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-12-01T00:00:00.000Z"); return t}()),
	// 			CycleType: to.Ptr(armdevtestlabs.ReportingCycleTypeCalendarMonth),
	// 			Status: to.Ptr(armdevtestlabs.TargetCostStatusEnabled),
	// 			Target: to.Ptr[int32](100),
	// 		},
	// 		UniqueIdentifier: to.Ptr("{uniqueIdentifier}"),
	// 	},
	// }
}
Output:

func (*CostsClient) Get

func (client *CostsClient) Get(ctx context.Context, resourceGroupName string, labName string, name string, options *CostsClientGetOptions) (CostsClientGetResponse, error)

Get - Get cost. If the operation fails it returns an *azcore.ResponseError type.

Generated from API version 2018-09-15

  • resourceGroupName - The name of the resource group.
  • labName - The name of the lab.
  • name - The name of the cost.
  • options - CostsClientGetOptions contains the optional parameters for the CostsClient.Get method.
Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/d55b8005f05b040b852c15e74a0f3e36494a15e1/specification/devtestlabs/resource-manager/Microsoft.DevTestLab/stable/2018-09-15/examples/Costs_Get.json

package main

import (
	"context"
	"log"

	"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
	"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/devtestlabs/armdevtestlabs"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armdevtestlabs.NewClientFactory("<subscription-id>", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	res, err := clientFactory.NewCostsClient().Get(ctx, "resourceGroupName", "{labName}", "targetCost", &armdevtestlabs.CostsClientGetOptions{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.LabCost = armdevtestlabs.LabCost{
	// 	Properties: &armdevtestlabs.LabCostProperties{
	// 		CreatedDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-12-23T22:43:54.725Z"); return t}()),
	// 		CurrencyCode: to.Ptr("USD"),
	// 		EndDateTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-12-31T23:59:59.000Z"); return t}()),
	// 		ProvisioningState: to.Ptr("Succeeded"),
	// 		StartDateTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-12-01T00:00:00.000Z"); return t}()),
	// 		TargetCost: &armdevtestlabs.TargetCostProperties{
	// 			CostThresholds: []*armdevtestlabs.CostThresholdProperties{
	// 				{
	// 					DisplayOnChart: to.Ptr(armdevtestlabs.CostThresholdStatusDisabled),
	// 					NotificationSent: to.Ptr("0001-01-01T00:00:00.0000000"),
	// 					PercentageThreshold: &armdevtestlabs.PercentageCostThresholdProperties{
	// 						ThresholdValue: to.Ptr[float64](25),
	// 					},
	// 					SendNotificationWhenExceeded: to.Ptr(armdevtestlabs.CostThresholdStatusDisabled),
	// 					ThresholdID: to.Ptr("00000000-0000-0000-0000-000000000001"),
	// 				},
	// 				{
	// 					DisplayOnChart: to.Ptr(armdevtestlabs.CostThresholdStatusEnabled),
	// 					NotificationSent: to.Ptr("0001-01-01T00:00:00.0000000"),
	// 					PercentageThreshold: &armdevtestlabs.PercentageCostThresholdProperties{
	// 						ThresholdValue: to.Ptr[float64](50),
	// 					},
	// 					SendNotificationWhenExceeded: to.Ptr(armdevtestlabs.CostThresholdStatusEnabled),
	// 					ThresholdID: to.Ptr("00000000-0000-0000-0000-000000000001"),
	// 				},
	// 				{
	// 					DisplayOnChart: to.Ptr(armdevtestlabs.CostThresholdStatusDisabled),
	// 					NotificationSent: to.Ptr("0001-01-01T00:00:00.0000000"),
	// 					PercentageThreshold: &armdevtestlabs.PercentageCostThresholdProperties{
	// 						ThresholdValue: to.Ptr[float64](75),
	// 					},
	// 					SendNotificationWhenExceeded: to.Ptr(armdevtestlabs.CostThresholdStatusDisabled),
	// 					ThresholdID: to.Ptr("00000000-0000-0000-0000-000000000001"),
	// 				},
	// 				{
	// 					DisplayOnChart: to.Ptr(armdevtestlabs.CostThresholdStatusDisabled),
	// 					NotificationSent: to.Ptr("0001-01-01T00:00:00.0000000"),
	// 					PercentageThreshold: &armdevtestlabs.PercentageCostThresholdProperties{
	// 						ThresholdValue: to.Ptr[float64](100),
	// 					},
	// 					SendNotificationWhenExceeded: to.Ptr(armdevtestlabs.CostThresholdStatusDisabled),
	// 					ThresholdID: to.Ptr("00000000-0000-0000-0000-000000000001"),
	// 				},
	// 				{
	// 					DisplayOnChart: to.Ptr(armdevtestlabs.CostThresholdStatusDisabled),
	// 					NotificationSent: to.Ptr("0001-01-01T00:00:00.0000000"),
	// 					PercentageThreshold: &armdevtestlabs.PercentageCostThresholdProperties{
	// 						ThresholdValue: to.Ptr[float64](125),
	// 					},
	// 					SendNotificationWhenExceeded: to.Ptr(armdevtestlabs.CostThresholdStatusDisabled),
	// 					ThresholdID: to.Ptr("00000000-0000-0000-0000-000000000001"),
	// 			}},
	// 			CycleEndDateTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-12-31T23:59:59.000Z"); return t}()),
	// 			CycleStartDateTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-12-01T00:00:00.000Z"); return t}()),
	// 			CycleType: to.Ptr(armdevtestlabs.ReportingCycleTypeCalendarMonth),
	// 			Status: to.Ptr(armdevtestlabs.TargetCostStatusEnabled),
	// 			Target: to.Ptr[int32](100),
	// 		},
	// 		UniqueIdentifier: to.Ptr("{uniqueIdentifier}"),
	// 	},
	// }
}
Output:

type CostsClientCreateOrUpdateOptions added in v0.2.0

type CostsClientCreateOrUpdateOptions struct {
}

CostsClientCreateOrUpdateOptions contains the optional parameters for the CostsClient.CreateOrUpdate method.

type CostsClientCreateOrUpdateResponse added in v0.2.0

type CostsClientCreateOrUpdateResponse struct {
	// A cost item.
	LabCost
}

CostsClientCreateOrUpdateResponse contains the response from method CostsClient.CreateOrUpdate.

type CostsClientGetOptions added in v0.2.0

type CostsClientGetOptions struct {
	// Specify the $expand query. Example: 'properties($expand=labCostDetails)'
	Expand *string
}

CostsClientGetOptions contains the optional parameters for the CostsClient.Get method.

type CostsClientGetResponse added in v0.2.0

type CostsClientGetResponse struct {
	// A cost item.
	LabCost
}

CostsClientGetResponse contains the response from method CostsClient.Get.

type CustomImage

type CustomImage struct {
	// REQUIRED; The properties of the resource.
	Properties *CustomImageProperties

	// The location of the resource.
	Location *string

	// The tags of the resource.
	Tags map[string]*string

	// READ-ONLY; The identifier of the resource.
	ID *string

	// READ-ONLY; The name of the resource.
	Name *string

	// READ-ONLY; The type of the resource.
	Type *string
}

CustomImage - A custom image.

func (CustomImage) MarshalJSON

func (c CustomImage) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.Marshaller interface for type CustomImage.

func (*CustomImage) UnmarshalJSON added in v1.1.0

func (c *CustomImage) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the json.Unmarshaller interface for type CustomImage.

type CustomImageFragment

type CustomImageFragment struct {
	// The tags of the resource.
	Tags map[string]*string
}

CustomImageFragment - A custom image.

func (CustomImageFragment) MarshalJSON added in v0.2.0

func (c CustomImageFragment) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.Marshaller interface for type CustomImageFragment.

func (*CustomImageFragment) UnmarshalJSON added in v1.1.0

func (c *CustomImageFragment) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the json.Unmarshaller interface for type CustomImageFragment.

type CustomImageList

type CustomImageList struct {
	// Link for next set of results.
	NextLink *string

	// Results of the list operation.
	Value []*CustomImage
}

CustomImageList - The response of a list operation.

func (CustomImageList) MarshalJSON

func (c CustomImageList) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.Marshaller interface for type CustomImageList.

func (*CustomImageList) UnmarshalJSON added in v1.1.0

func (c *CustomImageList) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the json.Unmarshaller interface for type CustomImageList.

type CustomImageOsType

type CustomImageOsType string

CustomImageOsType - The OS type of the custom image (i.e. Windows, Linux)

const (
	CustomImageOsTypeLinux   CustomImageOsType = "Linux"
	CustomImageOsTypeNone    CustomImageOsType = "None"
	CustomImageOsTypeWindows CustomImageOsType = "Windows"
)

func PossibleCustomImageOsTypeValues

func PossibleCustomImageOsTypeValues() []CustomImageOsType

PossibleCustomImageOsTypeValues returns the possible values for the CustomImageOsType const type.

type CustomImageProperties

type CustomImageProperties struct {
	// The author of the custom image.
	Author *string

	// Storage information about the plan related to this custom image
	CustomImagePlan *CustomImagePropertiesFromPlan

	// Storage information about the data disks present in the custom image
	DataDiskStorageInfo []*DataDiskStorageTypeInfo

	// The description of the custom image.
	Description *string

	// Whether or not the custom images underlying offer/plan has been enabled for programmatic deployment
	IsPlanAuthorized *bool

	// The Managed Image Id backing the custom image.
	ManagedImageID *string

	// The Managed Snapshot Id backing the custom image.
	ManagedSnapshotID *string

	// The virtual machine from which the image is to be created.
	VM *CustomImagePropertiesFromVM

	// The VHD from which the image is to be created.
	Vhd *CustomImagePropertiesCustom

	// READ-ONLY; The creation date of the custom image.
	CreationDate *time.Time

	// READ-ONLY; The provisioning status of the resource.
	ProvisioningState *string

	// READ-ONLY; The unique immutable identifier of a resource (Guid).
	UniqueIdentifier *string
}

CustomImageProperties - Properties of a custom image.

func (CustomImageProperties) MarshalJSON

func (c CustomImageProperties) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.Marshaller interface for type CustomImageProperties.

func (*CustomImageProperties) UnmarshalJSON

func (c *CustomImageProperties) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the json.Unmarshaller interface for type CustomImageProperties.

type CustomImagePropertiesCustom

type CustomImagePropertiesCustom struct {
	// REQUIRED; The OS type of the custom image (i.e. Windows, Linux)
	OSType *CustomImageOsType

	// The image name.
	ImageName *string

	// Indicates whether sysprep has been run on the VHD.
	SysPrep *bool
}

CustomImagePropertiesCustom - Properties for creating a custom image from a VHD.

func (CustomImagePropertiesCustom) MarshalJSON added in v1.1.0

func (c CustomImagePropertiesCustom) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.Marshaller interface for type CustomImagePropertiesCustom.

func (*CustomImagePropertiesCustom) UnmarshalJSON added in v1.1.0

func (c *CustomImagePropertiesCustom) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the json.Unmarshaller interface for type CustomImagePropertiesCustom.

type CustomImagePropertiesFromPlan

type CustomImagePropertiesFromPlan struct {
	// The id of the plan, equivalent to name of the plan
	ID *string

	// The offer for the plan from the marketplace image the custom image is derived from
	Offer *string

	// The publisher for the plan from the marketplace image the custom image is derived from
	Publisher *string
}

CustomImagePropertiesFromPlan - Properties for plan on a custom image.

func (CustomImagePropertiesFromPlan) MarshalJSON added in v1.1.0

func (c CustomImagePropertiesFromPlan) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.Marshaller interface for type CustomImagePropertiesFromPlan.

func (*CustomImagePropertiesFromPlan) UnmarshalJSON added in v1.1.0

func (c *CustomImagePropertiesFromPlan) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the json.Unmarshaller interface for type CustomImagePropertiesFromPlan.

type CustomImagePropertiesFromVM

type CustomImagePropertiesFromVM struct {
	// The Linux OS information of the VM.
	LinuxOsInfo *LinuxOsInfo

	// The source vm identifier.
	SourceVMID *string

	// The Windows OS information of the VM.
	WindowsOsInfo *WindowsOsInfo
}

CustomImagePropertiesFromVM - Properties for creating a custom image from a virtual machine.

func (CustomImagePropertiesFromVM) MarshalJSON added in v1.1.0

func (c CustomImagePropertiesFromVM) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.Marshaller interface for type CustomImagePropertiesFromVM.

func (*CustomImagePropertiesFromVM) UnmarshalJSON added in v1.1.0

func (c *CustomImagePropertiesFromVM) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the json.Unmarshaller interface for type CustomImagePropertiesFromVM.

type CustomImagesClient

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

CustomImagesClient contains the methods for the CustomImages group. Don't use this type directly, use NewCustomImagesClient() instead.

func NewCustomImagesClient

func NewCustomImagesClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*CustomImagesClient, error)

NewCustomImagesClient creates a new instance of CustomImagesClient with the specified values.

  • subscriptionID - The subscription ID.
  • credential - used to authorize requests. Usually a credential from azidentity.
  • options - pass nil to accept the default values.

func (*CustomImagesClient) BeginCreateOrUpdate

func (client *CustomImagesClient) BeginCreateOrUpdate(ctx context.Context, resourceGroupName string, labName string, name string, customImage CustomImage, options *CustomImagesClientBeginCreateOrUpdateOptions) (*runtime.Poller[CustomImagesClientCreateOrUpdateResponse], error)

BeginCreateOrUpdate - Create or replace an existing custom image. This operation can take a while to complete. If the operation fails it returns an *azcore.ResponseError type.

Generated from API version 2018-09-15

  • resourceGroupName - The name of the resource group.
  • labName - The name of the lab.
  • name - The name of the custom image.
  • customImage - A custom image.
  • options - CustomImagesClientBeginCreateOrUpdateOptions contains the optional parameters for the CustomImagesClient.BeginCreateOrUpdate method.
Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/d55b8005f05b040b852c15e74a0f3e36494a15e1/specification/devtestlabs/resource-manager/Microsoft.DevTestLab/stable/2018-09-15/examples/CustomImages_CreateOrUpdate.json

package main

import (
	"context"
	"log"

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

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armdevtestlabs.NewClientFactory("<subscription-id>", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	poller, err := clientFactory.NewCustomImagesClient().BeginCreateOrUpdate(ctx, "resourceGroupName", "{labName}", "{customImageName}", armdevtestlabs.CustomImage{
		Tags: map[string]*string{
			"tagName1": to.Ptr("tagValue1"),
		},
		Properties: &armdevtestlabs.CustomImageProperties{
			Description: to.Ptr("My Custom Image"),
			VM: &armdevtestlabs.CustomImagePropertiesFromVM{
				LinuxOsInfo: &armdevtestlabs.LinuxOsInfo{
					LinuxOsState: to.Ptr(armdevtestlabs.LinuxOsStateNonDeprovisioned),
				},
				SourceVMID: to.Ptr("/subscriptions/{subscriptionId}/resourcegroups/resourceGroupName/providers/microsoft.devtestlab/labs/{labName}/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.CustomImage = armdevtestlabs.CustomImage{
	// 	Name: to.Ptr("{customImageName}"),
	// 	Type: to.Ptr("Microsoft.DevTestLab/labs/customImages"),
	// 	ID: to.Ptr("/subscriptions/{subscriptionId}/resourcegroups/resourceGroupName/providers/microsoft.devtestlab/labs/{labName}/customimages/{customImageName}"),
	// 	Location: to.Ptr("{location}"),
	// 	Tags: map[string]*string{
	// 		"tagName1": to.Ptr("tagValue1"),
	// 	},
	// 	Properties: &armdevtestlabs.CustomImageProperties{
	// 		Description: to.Ptr("My Custom Image"),
	// 		Author: to.Ptr("{authorName}"),
	// 		CreationDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-10-10T09:59:28.798Z"); return t}()),
	// 		ProvisioningState: to.Ptr("Succeeded"),
	// 		UniqueIdentifier: to.Ptr("{uniqueIdentifier}"),
	// 		VM: &armdevtestlabs.CustomImagePropertiesFromVM{
	// 			LinuxOsInfo: &armdevtestlabs.LinuxOsInfo{
	// 				LinuxOsState: to.Ptr(armdevtestlabs.LinuxOsStateNonDeprovisioned),
	// 			},
	// 			SourceVMID: to.Ptr("/subscriptions/{subscriptionId}/resourcegroups/resourceGroupName/providers/microsoft.devtestlab/labs/{labName}/virtualmachines/{vmName}"),
	// 		},
	// 	},
	// }
}
Output:

func (*CustomImagesClient) BeginDelete

func (client *CustomImagesClient) BeginDelete(ctx context.Context, resourceGroupName string, labName string, name string, options *CustomImagesClientBeginDeleteOptions) (*runtime.Poller[CustomImagesClientDeleteResponse], error)

BeginDelete - Delete custom image. This operation can take a while to complete. If the operation fails it returns an *azcore.ResponseError type.

Generated from API version 2018-09-15

  • resourceGroupName - The name of the resource group.
  • labName - The name of the lab.
  • name - The name of the custom image.
  • options - CustomImagesClientBeginDeleteOptions contains the optional parameters for the CustomImagesClient.BeginDelete method.
Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/d55b8005f05b040b852c15e74a0f3e36494a15e1/specification/devtestlabs/resource-manager/Microsoft.DevTestLab/stable/2018-09-15/examples/CustomImages_Delete.json

package main

import (
	"context"
	"log"

	"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
	"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/devtestlabs/armdevtestlabs"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armdevtestlabs.NewClientFactory("<subscription-id>", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	poller, err := clientFactory.NewCustomImagesClient().BeginDelete(ctx, "resourceGroupName", "{labName}", "{customImageName}", 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 (*CustomImagesClient) Get

func (client *CustomImagesClient) Get(ctx context.Context, resourceGroupName string, labName string, name string, options *CustomImagesClientGetOptions) (CustomImagesClientGetResponse, error)

Get - Get custom image. If the operation fails it returns an *azcore.ResponseError type.

Generated from API version 2018-09-15

  • resourceGroupName - The name of the resource group.
  • labName - The name of the lab.
  • name - The name of the custom image.
  • options - CustomImagesClientGetOptions contains the optional parameters for the CustomImagesClient.Get method.
Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/d55b8005f05b040b852c15e74a0f3e36494a15e1/specification/devtestlabs/resource-manager/Microsoft.DevTestLab/stable/2018-09-15/examples/CustomImages_Get.json

package main

import (
	"context"
	"log"

	"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
	"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/devtestlabs/armdevtestlabs"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armdevtestlabs.NewClientFactory("<subscription-id>", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	res, err := clientFactory.NewCustomImagesClient().Get(ctx, "resourceGroupName", "{labName}", "{customImageName}", &armdevtestlabs.CustomImagesClientGetOptions{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.CustomImage = armdevtestlabs.CustomImage{
	// 	Name: to.Ptr("{customImageName}"),
	// 	Type: to.Ptr("Microsoft.DevTestLab/labs/customImages"),
	// 	ID: to.Ptr("/subscriptions/{subscriptionId}/resourcegroups/resourceGroupName/providers/microsoft.devtestlab/labs/{labName}/customimages/{customImageName}"),
	// 	Location: to.Ptr("{location}"),
	// 	Tags: map[string]*string{
	// 		"tagName1": to.Ptr("tagValue1"),
	// 	},
	// 	Properties: &armdevtestlabs.CustomImageProperties{
	// 		Description: to.Ptr("My Custom Image"),
	// 		Author: to.Ptr("{authorName}"),
	// 		CreationDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-10-10T09:59:28.798Z"); return t}()),
	// 		ProvisioningState: to.Ptr("Succeeded"),
	// 		UniqueIdentifier: to.Ptr("{uniqueIdentifier}"),
	// 		VM: &armdevtestlabs.CustomImagePropertiesFromVM{
	// 			LinuxOsInfo: &armdevtestlabs.LinuxOsInfo{
	// 				LinuxOsState: to.Ptr(armdevtestlabs.LinuxOsStateNonDeprovisioned),
	// 			},
	// 			SourceVMID: to.Ptr("/subscriptions/{subscriptionId}/resourcegroups/resourceGroupName/providers/microsoft.devtestlab/labs/{labName}/virtualmachines/{vmName}"),
	// 		},
	// 	},
	// }
}
Output:

func (*CustomImagesClient) NewListPager added in v0.4.0

func (client *CustomImagesClient) NewListPager(resourceGroupName string, labName string, options *CustomImagesClientListOptions) *runtime.Pager[CustomImagesClientListResponse]

NewListPager - List custom images in a given lab.

Generated from API version 2018-09-15

  • resourceGroupName - The name of the resource group.
  • labName - The name of the lab.
  • options - CustomImagesClientListOptions contains the optional parameters for the CustomImagesClient.NewListPager method.
Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/d55b8005f05b040b852c15e74a0f3e36494a15e1/specification/devtestlabs/resource-manager/Microsoft.DevTestLab/stable/2018-09-15/examples/CustomImages_List.json

package main

import (
	"context"
	"log"

	"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
	"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/devtestlabs/armdevtestlabs"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armdevtestlabs.NewClientFactory("<subscription-id>", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	pager := clientFactory.NewCustomImagesClient().NewListPager("resourceGroupName", "{labName}", &armdevtestlabs.CustomImagesClientListOptions{Expand: nil,
		Filter:  nil,
		Top:     nil,
		Orderby: 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.CustomImageList = armdevtestlabs.CustomImageList{
		// 	Value: []*armdevtestlabs.CustomImage{
		// 		{
		// 			Name: to.Ptr("{customImageName}"),
		// 			Type: to.Ptr("Microsoft.DevTestLab/labs/customImages"),
		// 			ID: to.Ptr("/subscriptions/{subscriptionId}/resourcegroups/resourceGroupName/providers/microsoft.devtestlab/labs/{labName}/customimages/{customImageName}"),
		// 			Location: to.Ptr("{location}"),
		// 			Properties: &armdevtestlabs.CustomImageProperties{
		// 				Description: to.Ptr("My Custom Image"),
		// 				Author: to.Ptr("{authorName}"),
		// 				CreationDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-10-10T09:59:28.798Z"); return t}()),
		// 				ProvisioningState: to.Ptr("Succeeded"),
		// 				UniqueIdentifier: to.Ptr("{uniqueIdentifier}"),
		// 				VM: &armdevtestlabs.CustomImagePropertiesFromVM{
		// 					LinuxOsInfo: &armdevtestlabs.LinuxOsInfo{
		// 						LinuxOsState: to.Ptr(armdevtestlabs.LinuxOsStateNonDeprovisioned),
		// 					},
		// 					SourceVMID: to.Ptr("/subscriptions/{subscriptionId}/resourcegroups/resourceGroupName/providers/microsoft.devtestlab/labs/{labName}/virtualmachines/{vmName}"),
		// 				},
		// 			},
		// 	}},
		// }
	}
}
Output:

func (*CustomImagesClient) Update

func (client *CustomImagesClient) Update(ctx context.Context, resourceGroupName string, labName string, name string, customImage CustomImageFragment, options *CustomImagesClientUpdateOptions) (CustomImagesClientUpdateResponse, error)

Update - Allows modifying tags of custom images. All other properties will be ignored. If the operation fails it returns an *azcore.ResponseError type.

Generated from API version 2018-09-15

  • resourceGroupName - The name of the resource group.
  • labName - The name of the lab.
  • name - The name of the custom image.
  • customImage - A custom image.
  • options - CustomImagesClientUpdateOptions contains the optional parameters for the CustomImagesClient.Update method.
Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/d55b8005f05b040b852c15e74a0f3e36494a15e1/specification/devtestlabs/resource-manager/Microsoft.DevTestLab/stable/2018-09-15/examples/CustomImages_Update.json

package main

import (
	"context"
	"log"

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

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armdevtestlabs.NewClientFactory("<subscription-id>", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	res, err := clientFactory.NewCustomImagesClient().Update(ctx, "resourceGroupName", "{labName}", "{customImageName}", armdevtestlabs.CustomImageFragment{
		Tags: map[string]*string{
			"tagName1": to.Ptr("tagValue2"),
		},
	}, 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.CustomImage = armdevtestlabs.CustomImage{
	// 	Name: to.Ptr("{customImageName}"),
	// 	Type: to.Ptr("Microsoft.DevTestLab/labs/customImages"),
	// 	ID: to.Ptr("/subscriptions/{subscriptionId}/resourcegroups/resourceGroupName/providers/microsoft.devtestlab/labs/{labName}/customimages/{customImageName}"),
	// 	Location: to.Ptr("{location}"),
	// 	Tags: map[string]*string{
	// 		"tagName1": to.Ptr("tagValue2"),
	// 	},
	// 	Properties: &armdevtestlabs.CustomImageProperties{
	// 		Description: to.Ptr("My Custom Image"),
	// 		Author: to.Ptr("{authorName}"),
	// 		CreationDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-10-10T09:59:28.798Z"); return t}()),
	// 		ProvisioningState: to.Ptr("Succeeded"),
	// 		UniqueIdentifier: to.Ptr("{uniqueIdentifier}"),
	// 		VM: &armdevtestlabs.CustomImagePropertiesFromVM{
	// 			LinuxOsInfo: &armdevtestlabs.LinuxOsInfo{
	// 				LinuxOsState: to.Ptr(armdevtestlabs.LinuxOsStateNonDeprovisioned),
	// 			},
	// 			SourceVMID: to.Ptr("/subscriptions/{subscriptionId}/resourcegroups/resourceGroupName/providers/microsoft.devtestlab/labs/{labName}/virtualmachines/{vmName}"),
	// 		},
	// 	},
	// }
}
Output:

type CustomImagesClientBeginCreateOrUpdateOptions added in v0.2.0

type CustomImagesClientBeginCreateOrUpdateOptions struct {
	// Resumes the LRO from the provided token.
	ResumeToken string
}

CustomImagesClientBeginCreateOrUpdateOptions contains the optional parameters for the CustomImagesClient.BeginCreateOrUpdate method.

type CustomImagesClientBeginDeleteOptions added in v0.2.0

type CustomImagesClientBeginDeleteOptions struct {
	// Resumes the LRO from the provided token.
	ResumeToken string
}

CustomImagesClientBeginDeleteOptions contains the optional parameters for the CustomImagesClient.BeginDelete method.

type CustomImagesClientCreateOrUpdateResponse added in v0.2.0

type CustomImagesClientCreateOrUpdateResponse struct {
	// A custom image.
	CustomImage
}

CustomImagesClientCreateOrUpdateResponse contains the response from method CustomImagesClient.BeginCreateOrUpdate.

type CustomImagesClientDeleteResponse added in v0.2.0

type CustomImagesClientDeleteResponse struct {
}

CustomImagesClientDeleteResponse contains the response from method CustomImagesClient.BeginDelete.

type CustomImagesClientGetOptions added in v0.2.0

type CustomImagesClientGetOptions struct {
	// Specify the $expand query. Example: 'properties($select=vm)'
	Expand *string
}

CustomImagesClientGetOptions contains the optional parameters for the CustomImagesClient.Get method.

type CustomImagesClientGetResponse added in v0.2.0

type CustomImagesClientGetResponse struct {
	// A custom image.
	CustomImage
}

CustomImagesClientGetResponse contains the response from method CustomImagesClient.Get.

type CustomImagesClientListOptions added in v0.2.0

type CustomImagesClientListOptions struct {
	// Specify the $expand query. Example: 'properties($select=vm)'
	Expand *string

	// The filter to apply to the operation. Example: '$filter=contains(name,'myName')
	Filter *string

	// The ordering expression for the results, using OData notation. Example: '$orderby=name desc'
	Orderby *string

	// The maximum number of resources to return from the operation. Example: '$top=10'
	Top *int32
}

CustomImagesClientListOptions contains the optional parameters for the CustomImagesClient.NewListPager method.

type CustomImagesClientListResponse added in v0.2.0

type CustomImagesClientListResponse struct {
	// The response of a list operation.
	CustomImageList
}

CustomImagesClientListResponse contains the response from method CustomImagesClient.NewListPager.

type CustomImagesClientUpdateOptions added in v0.2.0

type CustomImagesClientUpdateOptions struct {
}

CustomImagesClientUpdateOptions contains the optional parameters for the CustomImagesClient.Update method.

type CustomImagesClientUpdateResponse added in v0.2.0

type CustomImagesClientUpdateResponse struct {
	// A custom image.
	CustomImage
}

CustomImagesClientUpdateResponse contains the response from method CustomImagesClient.Update.

type DataDiskProperties

type DataDiskProperties struct {
	// Specifies options to attach a new disk to the virtual machine.
	AttachNewDataDiskOptions *AttachNewDataDiskOptions

	// Specifies the existing lab disk id to attach to virtual machine.
	ExistingLabDiskID *string

	// Caching option for a data disk (i.e. None, ReadOnly, ReadWrite).
	HostCaching *HostCachingOptions
}

DataDiskProperties - Request body for adding a new or existing data disk to a virtual machine.

func (DataDiskProperties) MarshalJSON added in v1.1.0

func (d DataDiskProperties) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.Marshaller interface for type DataDiskProperties.

func (*DataDiskProperties) UnmarshalJSON added in v1.1.0

func (d *DataDiskProperties) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the json.Unmarshaller interface for type DataDiskProperties.

type DataDiskStorageTypeInfo

type DataDiskStorageTypeInfo struct {
	// Disk Lun
	Lun *string

	// Disk Storage Type
	StorageType *StorageType
}

DataDiskStorageTypeInfo - Storage information about the data disks present in the custom image

func (DataDiskStorageTypeInfo) MarshalJSON added in v1.1.0

func (d DataDiskStorageTypeInfo) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.Marshaller interface for type DataDiskStorageTypeInfo.

func (*DataDiskStorageTypeInfo) UnmarshalJSON added in v1.1.0

func (d *DataDiskStorageTypeInfo) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the json.Unmarshaller interface for type DataDiskStorageTypeInfo.

type DayDetails

type DayDetails struct {
	// The time of day the schedule will occur.
	Time *string
}

DayDetails - Properties of a daily schedule.

func (DayDetails) MarshalJSON added in v1.1.0

func (d DayDetails) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.Marshaller interface for type DayDetails.

func (*DayDetails) UnmarshalJSON added in v1.1.0

func (d *DayDetails) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the json.Unmarshaller interface for type DayDetails.

type DetachDataDiskProperties

type DetachDataDiskProperties struct {
	// Specifies the disk resource ID to detach from virtual machine.
	ExistingLabDiskID *string
}

DetachDataDiskProperties - Request body for detaching data disk from a virtual machine.

func (DetachDataDiskProperties) MarshalJSON added in v1.1.0

func (d DetachDataDiskProperties) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.Marshaller interface for type DetachDataDiskProperties.

func (*DetachDataDiskProperties) UnmarshalJSON added in v1.1.0

func (d *DetachDataDiskProperties) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the json.Unmarshaller interface for type DetachDataDiskProperties.

type DetachDiskProperties

type DetachDiskProperties struct {
	// The resource ID of the Lab VM to which the disk is attached.
	LeasedByLabVMID *string
}

DetachDiskProperties - Properties of the disk to detach.

func (DetachDiskProperties) MarshalJSON added in v1.1.0

func (d DetachDiskProperties) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.Marshaller interface for type DetachDiskProperties.

func (*DetachDiskProperties) UnmarshalJSON added in v1.1.0

func (d *DetachDiskProperties) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the json.Unmarshaller interface for type DetachDiskProperties.

type Disk

type Disk struct {
	// REQUIRED; The properties of the resource.
	Properties *DiskProperties

	// The location of the resource.
	Location *string

	// The tags of the resource.
	Tags map[string]*string

	// READ-ONLY; The identifier of the resource.
	ID *string

	// READ-ONLY; The name of the resource.
	Name *string

	// READ-ONLY; The type of the resource.
	Type *string
}

Disk - A Disk.

func (Disk) MarshalJSON

func (d Disk) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.Marshaller interface for type Disk.

func (*Disk) UnmarshalJSON added in v1.1.0

func (d *Disk) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the json.Unmarshaller interface for type Disk.

type DiskFragment

type DiskFragment struct {
	// The tags of the resource.
	Tags map[string]*string
}

DiskFragment - A Disk.

func (DiskFragment) MarshalJSON added in v0.2.0

func (d DiskFragment) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.Marshaller interface for type DiskFragment.

func (*DiskFragment) UnmarshalJSON added in v1.1.0

func (d *DiskFragment) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the json.Unmarshaller interface for type DiskFragment.

type DiskList

type DiskList struct {
	// Link for next set of results.
	NextLink *string

	// Results of the list operation.
	Value []*Disk
}

DiskList - The response of a list operation.

func (DiskList) MarshalJSON

func (d DiskList) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.Marshaller interface for type DiskList.

func (*DiskList) UnmarshalJSON added in v1.1.0

func (d *DiskList) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the json.Unmarshaller interface for type DiskList.

type DiskProperties

type DiskProperties struct {
	// When backed by a blob, the name of the VHD blob without extension.
	DiskBlobName *string

	// The size of the disk in Gibibytes.
	DiskSizeGiB *int32

	// The storage type for the disk (i.e. Standard, Premium).
	DiskType *StorageType

	// When backed by a blob, the URI of underlying blob.
	DiskURI *string

	// The host caching policy of the disk (i.e. None, ReadOnly, ReadWrite).
	HostCaching *string

	// The resource ID of the VM to which this disk is leased.
	LeasedByLabVMID *string

	// When backed by managed disk, this is the ID of the compute disk resource.
	ManagedDiskID *string

	// When backed by a blob, the storage account where the blob is.
	StorageAccountID *string

	// READ-ONLY; The creation date of the disk.
	CreatedDate *time.Time

	// READ-ONLY; The provisioning status of the resource.
	ProvisioningState *string

	// READ-ONLY; The unique immutable identifier of a resource (Guid).
	UniqueIdentifier *string
}

DiskProperties - Properties of a disk.

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 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 - The subscription ID.
  • credential - used to authorize requests. Usually a credential from azidentity.
  • options - pass nil to accept the default values.

func (*DisksClient) BeginAttach

func (client *DisksClient) BeginAttach(ctx context.Context, resourceGroupName string, labName string, userName string, name string, attachDiskProperties AttachDiskProperties, options *DisksClientBeginAttachOptions) (*runtime.Poller[DisksClientAttachResponse], error)

BeginAttach - Attach and create the lease of the disk to the virtual machine. This operation can take a while to complete. If the operation fails it returns an *azcore.ResponseError type.

Generated from API version 2018-09-15

  • resourceGroupName - The name of the resource group.
  • labName - The name of the lab.
  • userName - The name of the user profile.
  • name - The name of the disk.
  • attachDiskProperties - Properties of the disk to attach.
  • options - DisksClientBeginAttachOptions contains the optional parameters for the DisksClient.BeginAttach method.
Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/d55b8005f05b040b852c15e74a0f3e36494a15e1/specification/devtestlabs/resource-manager/Microsoft.DevTestLab/stable/2018-09-15/examples/Disks_Attach.json

package main

import (
	"context"
	"log"

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

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armdevtestlabs.NewClientFactory("<subscription-id>", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	poller, err := clientFactory.NewDisksClient().BeginAttach(ctx, "resourceGroupName", "{labName}", "{userId}", "{diskName}", armdevtestlabs.AttachDiskProperties{
		LeasedByLabVMID: to.Ptr("/subscriptions/{subscriptionId}/resourcegroups/resourceGroupName/providers/microsoft.devtestlab/labs/{labName}/virtualmachines/{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 (*DisksClient) BeginCreateOrUpdate

func (client *DisksClient) BeginCreateOrUpdate(ctx context.Context, resourceGroupName string, labName string, userName string, name string, disk Disk, options *DisksClientBeginCreateOrUpdateOptions) (*runtime.Poller[DisksClientCreateOrUpdateResponse], error)

BeginCreateOrUpdate - Create or replace an existing disk. This operation can take a while to complete. If the operation fails it returns an *azcore.ResponseError type.

Generated from API version 2018-09-15

  • resourceGroupName - The name of the resource group.
  • labName - The name of the lab.
  • userName - The name of the user profile.
  • name - The name of the disk.
  • disk - A Disk.
  • options - DisksClientBeginCreateOrUpdateOptions contains the optional parameters for the DisksClient.BeginCreateOrUpdate method.
Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/d55b8005f05b040b852c15e74a0f3e36494a15e1/specification/devtestlabs/resource-manager/Microsoft.DevTestLab/stable/2018-09-15/examples/Disks_CreateOrUpdate.json

package main

import (
	"context"
	"log"

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

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armdevtestlabs.NewClientFactory("<subscription-id>", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	poller, err := clientFactory.NewDisksClient().BeginCreateOrUpdate(ctx, "resourceGroupName", "{labName}", "{userId}", "{diskName}", armdevtestlabs.Disk{
		Properties: &armdevtestlabs.DiskProperties{
			DiskSizeGiB:     to.Ptr[int32](1023),
			DiskType:        to.Ptr(armdevtestlabs.StorageTypeStandard),
			LeasedByLabVMID: to.Ptr("/subscriptions/{subscriptionId}/resourcegroups/resourceGroupName/providers/microsoft.devtestlab/labs/{labName}/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.Disk = armdevtestlabs.Disk{
	// 	Name: to.Ptr("{diskName}"),
	// 	Type: to.Ptr("Microsoft.DevTestLab/labs/users/disks"),
	// 	ID: to.Ptr("/subscriptions/{subscriptionId}/resourcegroups/resourceGroupName/providers/microsoft.devtestlab/labs/l{labName}/users/{userId}/disks/{diskName}"),
	// 	Properties: &armdevtestlabs.DiskProperties{
	// 		CreatedDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-01-04T20:21:02.018Z"); return t}()),
	// 		DiskSizeGiB: to.Ptr[int32](1023),
	// 		DiskType: to.Ptr(armdevtestlabs.StorageTypeStandard),
	// 		DiskURI: to.Ptr(""),
	// 		HostCaching: to.Ptr("None"),
	// 		LeasedByLabVMID: to.Ptr("/subscriptions/{subscriptionId}/resourcegroups/resourceGroupName/providers/microsoft.devtestlab/labs/{labName}/virtualmachines/vmName"),
	// 		ProvisioningState: to.Ptr("Succeeded"),
	// 		UniqueIdentifier: to.Ptr("b7183ac5-1097-4513-b597-4d9d23e0a820"),
	// 	},
	// }
}
Output:

func (*DisksClient) BeginDelete

func (client *DisksClient) BeginDelete(ctx context.Context, resourceGroupName string, labName string, userName string, name string, options *DisksClientBeginDeleteOptions) (*runtime.Poller[DisksClientDeleteResponse], error)

BeginDelete - Delete disk. This operation can take a while to complete. If the operation fails it returns an *azcore.ResponseError type.

Generated from API version 2018-09-15

  • resourceGroupName - The name of the resource group.
  • labName - The name of the lab.
  • userName - The name of the user profile.
  • name - The name of the disk.
  • 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/d55b8005f05b040b852c15e74a0f3e36494a15e1/specification/devtestlabs/resource-manager/Microsoft.DevTestLab/stable/2018-09-15/examples/Disks_Delete.json

package main

import (
	"context"
	"log"

	"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
	"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/devtestlabs/armdevtestlabs"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armdevtestlabs.NewClientFactory("<subscription-id>", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	poller, err := clientFactory.NewDisksClient().BeginDelete(ctx, "resourceGroupName", "{labName}", "{userId}", "{diskName}", 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) BeginDetach

func (client *DisksClient) BeginDetach(ctx context.Context, resourceGroupName string, labName string, userName string, name string, detachDiskProperties DetachDiskProperties, options *DisksClientBeginDetachOptions) (*runtime.Poller[DisksClientDetachResponse], error)

BeginDetach - Detach and break the lease of the disk attached to the virtual machine. This operation can take a while to complete. If the operation fails it returns an *azcore.ResponseError type.

Generated from API version 2018-09-15

  • resourceGroupName - The name of the resource group.
  • labName - The name of the lab.
  • userName - The name of the user profile.
  • name - The name of the disk.
  • detachDiskProperties - Properties of the disk to detach.
  • options - DisksClientBeginDetachOptions contains the optional parameters for the DisksClient.BeginDetach method.
Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/d55b8005f05b040b852c15e74a0f3e36494a15e1/specification/devtestlabs/resource-manager/Microsoft.DevTestLab/stable/2018-09-15/examples/Disks_Detach.json

package main

import (
	"context"
	"log"

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

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armdevtestlabs.NewClientFactory("<subscription-id>", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	poller, err := clientFactory.NewDisksClient().BeginDetach(ctx, "resourceGroupName", "{labName}", "{userId}", "{diskName}", armdevtestlabs.DetachDiskProperties{
		LeasedByLabVMID: to.Ptr("/subscriptions/{subscriptionId}/resourcegroups/myResourceGroup/providers/microsoft.devtestlab/labs/{labName}/virtualmachines/{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 (*DisksClient) Get

func (client *DisksClient) Get(ctx context.Context, resourceGroupName string, labName string, userName string, name string, options *DisksClientGetOptions) (DisksClientGetResponse, error)

Get - Get disk. If the operation fails it returns an *azcore.ResponseError type.

Generated from API version 2018-09-15

  • resourceGroupName - The name of the resource group.
  • labName - The name of the lab.
  • userName - The name of the user profile.
  • name - The name of the disk.
  • 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/d55b8005f05b040b852c15e74a0f3e36494a15e1/specification/devtestlabs/resource-manager/Microsoft.DevTestLab/stable/2018-09-15/examples/Disks_Get.json

package main

import (
	"context"
	"log"

	"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
	"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/devtestlabs/armdevtestlabs"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armdevtestlabs.NewClientFactory("<subscription-id>", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	res, err := clientFactory.NewDisksClient().Get(ctx, "resourceGroupName", "{labName}", "@me", "{diskName}", &armdevtestlabs.DisksClientGetOptions{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.Disk = armdevtestlabs.Disk{
	// 	Name: to.Ptr("{diskName}"),
	// 	Type: to.Ptr("Microsoft.DevTestLab/labs/users/disks"),
	// 	ID: to.Ptr("/subscriptions/{subscriptionId}/resourcegroups/resourceGroupName/providers/microsoft.devtestlab/labs/{labName}/users/{userId}/disks/{diskName}"),
	// 	Properties: &armdevtestlabs.DiskProperties{
	// 		CreatedDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-01-04T20:27:32.144Z"); return t}()),
	// 		DiskSizeGiB: to.Ptr[int32](1023),
	// 		DiskType: to.Ptr(armdevtestlabs.StorageTypeStandard),
	// 		DiskURI: to.Ptr(""),
	// 		HostCaching: to.Ptr("None"),
	// 		LeasedByLabVMID: to.Ptr("/subscriptions/{subscriptionId}/resourcegroups/resourceGroupName/providers/microsoft.devtestlab/labs/{labName}/virtualmachines/vmName"),
	// 		ManagedDiskID: to.Ptr("/subscriptions/{subscriptionId}/resourcegroups/resourceGroupName/providers/microsoft.compute/disks/{diskName}"),
	// 		ProvisioningState: to.Ptr("Succeeded"),
	// 		UniqueIdentifier: to.Ptr("9bf098d1-1b64-41a5-aa05-286767074a0b"),
	// 	},
	// }
}
Output:

func (*DisksClient) NewListPager added in v0.4.0

func (client *DisksClient) NewListPager(resourceGroupName string, labName string, userName string, options *DisksClientListOptions) *runtime.Pager[DisksClientListResponse]

NewListPager - List disks in a given user profile.

Generated from API version 2018-09-15

  • resourceGroupName - The name of the resource group.
  • labName - The name of the lab.
  • userName - The name of the user profile.
  • 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/d55b8005f05b040b852c15e74a0f3e36494a15e1/specification/devtestlabs/resource-manager/Microsoft.DevTestLab/stable/2018-09-15/examples/Disks_List.json

package main

import (
	"context"
	"log"

	"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
	"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/devtestlabs/armdevtestlabs"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armdevtestlabs.NewClientFactory("<subscription-id>", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	pager := clientFactory.NewDisksClient().NewListPager("resourceGroupName", "{labName}", "@me", &armdevtestlabs.DisksClientListOptions{Expand: nil,
		Filter:  nil,
		Top:     nil,
		Orderby: 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 = armdevtestlabs.DiskList{
		// 	Value: []*armdevtestlabs.Disk{
		// 		{
		// 			Name: to.Ptr("{diskName}"),
		// 			Type: to.Ptr("Microsoft.DevTestLab/labs/users/disks"),
		// 			ID: to.Ptr("/subscriptions/{subscriptionId}/resourcegroups/resourceGroupName/providers/microsoft.devtestlab/labs/{labName}/users/{userId}/disks/{diskName}"),
		// 			Properties: &armdevtestlabs.DiskProperties{
		// 				CreatedDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-01-04T20:27:32.144Z"); return t}()),
		// 				DiskSizeGiB: to.Ptr[int32](1023),
		// 				DiskType: to.Ptr(armdevtestlabs.StorageTypeStandard),
		// 				DiskURI: to.Ptr(""),
		// 				HostCaching: to.Ptr("None"),
		// 				LeasedByLabVMID: to.Ptr("/subscriptions/{subscriptionId}/resourcegroups/resourceGroupName/providers/microsoft.devtestlab/labs/{labName}/virtualmachines/vmName"),
		// 				ManagedDiskID: to.Ptr("/subscriptions/{subscriptionId}/resourcegroups/resourceGroupName/providers/microsoft.compute/disks/{diskName}"),
		// 				ProvisioningState: to.Ptr("Succeeded"),
		// 				UniqueIdentifier: to.Ptr("9bf098d1-1b64-41a5-aa05-286767074a0b"),
		// 			},
		// 	}},
		// }
	}
}
Output:

func (*DisksClient) Update

func (client *DisksClient) Update(ctx context.Context, resourceGroupName string, labName string, userName string, name string, disk DiskFragment, options *DisksClientUpdateOptions) (DisksClientUpdateResponse, error)

Update - Allows modifying tags of disks. All other properties will be ignored. If the operation fails it returns an *azcore.ResponseError type.

Generated from API version 2018-09-15

  • resourceGroupName - The name of the resource group.
  • labName - The name of the lab.
  • userName - The name of the user profile.
  • name - The name of the disk.
  • disk - A Disk.
  • options - DisksClientUpdateOptions contains the optional parameters for the DisksClient.Update method.
Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/d55b8005f05b040b852c15e74a0f3e36494a15e1/specification/devtestlabs/resource-manager/Microsoft.DevTestLab/stable/2018-09-15/examples/Disks_Update.json

package main

import (
	"context"
	"log"

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

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armdevtestlabs.NewClientFactory("<subscription-id>", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	res, err := clientFactory.NewDisksClient().Update(ctx, "resourceGroupName", "{labName}", "@me", "diskName", armdevtestlabs.DiskFragment{
		Tags: map[string]*string{
			"tagName1": to.Ptr("tagValue1"),
		},
	}, 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 = armdevtestlabs.Disk{
	// 	Name: to.Ptr("{disk-name}"),
	// 	Type: to.Ptr("Microsoft.DevTestLab/labs/users/disks"),
	// 	ID: to.Ptr("/subscriptions/{subscriptionId}/resourcegroups/resourceGroupName/providers/microsoft.devtestlab/labs/{labName}/users/{user-id}/disks/{diskName}"),
	// 	Tags: map[string]*string{
	// 		"tagName1": to.Ptr("tagValue1"),
	// 	},
	// 	Properties: &armdevtestlabs.DiskProperties{
	// 		CreatedDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-01-04T20:21:02.018Z"); return t}()),
	// 		DiskSizeGiB: to.Ptr[int32](1023),
	// 		DiskType: to.Ptr(armdevtestlabs.StorageTypeStandard),
	// 		DiskURI: to.Ptr(""),
	// 		HostCaching: to.Ptr("None"),
	// 		LeasedByLabVMID: to.Ptr("/subscriptions/{subscriptionId}/resourcegroups/resourceGroupName/providers/microsoft.devtestlab/labs/{labName}/virtualmachines/vmName"),
	// 		ProvisioningState: to.Ptr("Succeeded"),
	// 		UniqueIdentifier: to.Ptr("b7183ac5-1097-4513-b597-4d9d23e0a820"),
	// 	},
	// }
}
Output:

type DisksClientAttachResponse added in v0.2.0

type DisksClientAttachResponse struct {
}

DisksClientAttachResponse contains the response from method DisksClient.BeginAttach.

type DisksClientBeginAttachOptions added in v0.2.0

type DisksClientBeginAttachOptions struct {
	// Resumes the LRO from the provided token.
	ResumeToken string
}

DisksClientBeginAttachOptions contains the optional parameters for the DisksClient.BeginAttach method.

type DisksClientBeginCreateOrUpdateOptions added in v0.2.0

type DisksClientBeginCreateOrUpdateOptions struct {
	// Resumes the LRO from the provided token.
	ResumeToken string
}

DisksClientBeginCreateOrUpdateOptions contains the optional parameters for the DisksClient.BeginCreateOrUpdate method.

type DisksClientBeginDeleteOptions added in v0.2.0

type DisksClientBeginDeleteOptions struct {
	// Resumes the LRO from the provided token.
	ResumeToken string
}

DisksClientBeginDeleteOptions contains the optional parameters for the DisksClient.BeginDelete method.

type DisksClientBeginDetachOptions added in v0.2.0

type DisksClientBeginDetachOptions struct {
	// Resumes the LRO from the provided token.
	ResumeToken string
}

DisksClientBeginDetachOptions contains the optional parameters for the DisksClient.BeginDetach method.

type DisksClientCreateOrUpdateResponse added in v0.2.0

type DisksClientCreateOrUpdateResponse struct {
	// A Disk.
	Disk
}

DisksClientCreateOrUpdateResponse contains the response from method DisksClient.BeginCreateOrUpdate.

type DisksClientDeleteResponse added in v0.2.0

type DisksClientDeleteResponse struct {
}

DisksClientDeleteResponse contains the response from method DisksClient.BeginDelete.

type DisksClientDetachResponse added in v0.2.0

type DisksClientDetachResponse struct {
}

DisksClientDetachResponse contains the response from method DisksClient.BeginDetach.

type DisksClientGetOptions added in v0.2.0

type DisksClientGetOptions struct {
	// Specify the $expand query. Example: 'properties($select=diskType)'
	Expand *string
}

DisksClientGetOptions contains the optional parameters for the DisksClient.Get method.

type DisksClientGetResponse added in v0.2.0

type DisksClientGetResponse struct {
	// A Disk.
	Disk
}

DisksClientGetResponse contains the response from method DisksClient.Get.

type DisksClientListOptions added in v0.2.0

type DisksClientListOptions struct {
	// Specify the $expand query. Example: 'properties($select=diskType)'
	Expand *string

	// The filter to apply to the operation. Example: '$filter=contains(name,'myName')
	Filter *string

	// The ordering expression for the results, using OData notation. Example: '$orderby=name desc'
	Orderby *string

	// The maximum number of resources to return from the operation. Example: '$top=10'
	Top *int32
}

DisksClientListOptions contains the optional parameters for the DisksClient.NewListPager method.

type DisksClientListResponse added in v0.2.0

type DisksClientListResponse struct {
	// The response of a list operation.
	DiskList
}

DisksClientListResponse contains the response from method DisksClient.NewListPager.

type DisksClientUpdateOptions added in v0.2.0

type DisksClientUpdateOptions struct {
}

DisksClientUpdateOptions contains the optional parameters for the DisksClient.Update method.

type DisksClientUpdateResponse added in v0.2.0

type DisksClientUpdateResponse struct {
	// A Disk.
	Disk
}

DisksClientUpdateResponse contains the response from method DisksClient.Update.

type DtlEnvironment

type DtlEnvironment struct {
	// REQUIRED; The properties of the resource.
	Properties *EnvironmentProperties

	// The location of the resource.
	Location *string

	// The tags of the resource.
	Tags map[string]*string

	// READ-ONLY; The identifier of the resource.
	ID *string

	// READ-ONLY; The name of the resource.
	Name *string

	// READ-ONLY; The type of the resource.
	Type *string
}

DtlEnvironment - An environment, which is essentially an ARM template deployment.

func (DtlEnvironment) MarshalJSON

func (d DtlEnvironment) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.Marshaller interface for type DtlEnvironment.

func (*DtlEnvironment) UnmarshalJSON added in v1.1.0

func (d *DtlEnvironment) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the json.Unmarshaller interface for type DtlEnvironment.

type DtlEnvironmentFragment

type DtlEnvironmentFragment struct {
	// The tags of the resource.
	Tags map[string]*string
}

DtlEnvironmentFragment - An environment, which is essentially an ARM template deployment.

func (DtlEnvironmentFragment) MarshalJSON added in v0.2.0

func (d DtlEnvironmentFragment) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.Marshaller interface for type DtlEnvironmentFragment.

func (*DtlEnvironmentFragment) UnmarshalJSON added in v1.1.0

func (d *DtlEnvironmentFragment) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the json.Unmarshaller interface for type DtlEnvironmentFragment.

type DtlEnvironmentList

type DtlEnvironmentList struct {
	// Link for next set of results.
	NextLink *string

	// Results of the list operation.
	Value []*DtlEnvironment
}

DtlEnvironmentList - The response of a list operation.

func (DtlEnvironmentList) MarshalJSON

func (d DtlEnvironmentList) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.Marshaller interface for type DtlEnvironmentList.

func (*DtlEnvironmentList) UnmarshalJSON added in v1.1.0

func (d *DtlEnvironmentList) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the json.Unmarshaller interface for type DtlEnvironmentList.

type EnableStatus

type EnableStatus string

EnableStatus - Indicates if the artifact source is enabled (values: Enabled, Disabled).

const (
	EnableStatusDisabled EnableStatus = "Disabled"
	EnableStatusEnabled  EnableStatus = "Enabled"
)

func PossibleEnableStatusValues

func PossibleEnableStatusValues() []EnableStatus

PossibleEnableStatusValues returns the possible values for the EnableStatus const type.

type EnvironmentDeploymentProperties

type EnvironmentDeploymentProperties struct {
	// The Azure Resource Manager template's identifier.
	ArmTemplateID *string

	// The parameters of the Azure Resource Manager template.
	Parameters []*ArmTemplateParameterProperties
}

EnvironmentDeploymentProperties - Properties of an environment deployment.

func (EnvironmentDeploymentProperties) MarshalJSON

func (e EnvironmentDeploymentProperties) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.Marshaller interface for type EnvironmentDeploymentProperties.

func (*EnvironmentDeploymentProperties) UnmarshalJSON added in v1.1.0

func (e *EnvironmentDeploymentProperties) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the json.Unmarshaller interface for type EnvironmentDeploymentProperties.

type EnvironmentPermission

type EnvironmentPermission string

EnvironmentPermission - The access rights to be granted to the user when provisioning an environment

const (
	EnvironmentPermissionContributor EnvironmentPermission = "Contributor"
	EnvironmentPermissionReader      EnvironmentPermission = "Reader"
)

func PossibleEnvironmentPermissionValues

func PossibleEnvironmentPermissionValues() []EnvironmentPermission

PossibleEnvironmentPermissionValues returns the possible values for the EnvironmentPermission const type.

type EnvironmentProperties

type EnvironmentProperties struct {
	// The display name of the Azure Resource Manager template that produced the environment.
	ArmTemplateDisplayName *string

	// The deployment properties of the environment.
	DeploymentProperties *EnvironmentDeploymentProperties

	// READ-ONLY; The creator of the environment.
	CreatedByUser *string

	// READ-ONLY; The provisioning status of the resource.
	ProvisioningState *string

	// READ-ONLY; The identifier of the resource group containing the environment's resources.
	ResourceGroupID *string

	// READ-ONLY; The unique immutable identifier of a resource (Guid).
	UniqueIdentifier *string
}

EnvironmentProperties - Properties of an environment.

func (EnvironmentProperties) MarshalJSON added in v1.1.0

func (e EnvironmentProperties) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.Marshaller interface for type EnvironmentProperties.

func (*EnvironmentProperties) UnmarshalJSON added in v1.1.0

func (e *EnvironmentProperties) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the json.Unmarshaller interface for type EnvironmentProperties.

type EnvironmentsClient

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

EnvironmentsClient contains the methods for the Environments group. Don't use this type directly, use NewEnvironmentsClient() instead.

func NewEnvironmentsClient

func NewEnvironmentsClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*EnvironmentsClient, error)

NewEnvironmentsClient creates a new instance of EnvironmentsClient with the specified values.

  • subscriptionID - The subscription ID.
  • credential - used to authorize requests. Usually a credential from azidentity.
  • options - pass nil to accept the default values.

func (*EnvironmentsClient) BeginCreateOrUpdate

func (client *EnvironmentsClient) BeginCreateOrUpdate(ctx context.Context, resourceGroupName string, labName string, userName string, name string, dtlEnvironment DtlEnvironment, options *EnvironmentsClientBeginCreateOrUpdateOptions) (*runtime.Poller[EnvironmentsClientCreateOrUpdateResponse], error)

BeginCreateOrUpdate - Create or replace an existing environment. This operation can take a while to complete. If the operation fails it returns an *azcore.ResponseError type.

Generated from API version 2018-09-15

  • resourceGroupName - The name of the resource group.
  • labName - The name of the lab.
  • userName - The name of the user profile.
  • name - The name of the environment.
  • dtlEnvironment - An environment, which is essentially an ARM template deployment.
  • options - EnvironmentsClientBeginCreateOrUpdateOptions contains the optional parameters for the EnvironmentsClient.BeginCreateOrUpdate method.
Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/d55b8005f05b040b852c15e74a0f3e36494a15e1/specification/devtestlabs/resource-manager/Microsoft.DevTestLab/stable/2018-09-15/examples/Environments_CreateOrUpdate.json

package main

import (
	"context"
	"log"

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

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armdevtestlabs.NewClientFactory("<subscription-id>", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	poller, err := clientFactory.NewEnvironmentsClient().BeginCreateOrUpdate(ctx, "resourceGroupName", "{labName}", "@me", "{environmentName}", armdevtestlabs.DtlEnvironment{
		Properties: &armdevtestlabs.EnvironmentProperties{
			DeploymentProperties: &armdevtestlabs.EnvironmentDeploymentProperties{
				ArmTemplateID: to.Ptr("/subscriptions/{subscriptionId}/resourceGroups/resourceGroupName/providers/Microsoft.DevTestLab/labs/{labName}/artifactSources/{artifactSourceName}/armTemplates/{armTemplateName}"),
				Parameters:    []*armdevtestlabs.ArmTemplateParameterProperties{},
			},
		},
	}, 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.DtlEnvironment = armdevtestlabs.DtlEnvironment{
	// 	Name: to.Ptr("{environmentName}"),
	// 	Type: to.Ptr("Microsoft.DevTestLab/labs/users/environments"),
	// 	ID: to.Ptr("/subscriptions/{subscriptionId}/resourcegroups/resourceGroupName/providers/microsoft.devtestlab/labs/{labName}/users/{uniqueIdentifier}/environments/{environmentName}"),
	// 	Location: to.Ptr("{location}"),
	// 	Tags: map[string]*string{
	// 		"tagName1": to.Ptr("tagValue1"),
	// 	},
	// 	Properties: &armdevtestlabs.EnvironmentProperties{
	// 		CreatedByUser: to.Ptr("user@contoso.com"),
	// 		DeploymentProperties: &armdevtestlabs.EnvironmentDeploymentProperties{
	// 			ArmTemplateID: to.Ptr("/subscriptions/{subscriptionId}/resourcegroups/resourceGroupName/providers/microsoft.devtestlab/labs/{labName}/artifactSources/{artifactSourceName}/armTemplates/{armTemplateName}"),
	// 		},
	// 		ProvisioningState: to.Ptr("Succeeded"),
	// 		UniqueIdentifier: to.Ptr("{uniqueIdentifier}"),
	// 	},
	// }
}
Output:

func (*EnvironmentsClient) BeginDelete

func (client *EnvironmentsClient) BeginDelete(ctx context.Context, resourceGroupName string, labName string, userName string, name string, options *EnvironmentsClientBeginDeleteOptions) (*runtime.Poller[EnvironmentsClientDeleteResponse], error)

BeginDelete - Delete environment. This operation can take a while to complete. If the operation fails it returns an *azcore.ResponseError type.

Generated from API version 2018-09-15

  • resourceGroupName - The name of the resource group.
  • labName - The name of the lab.
  • userName - The name of the user profile.
  • name - The name of the environment.
  • options - EnvironmentsClientBeginDeleteOptions contains the optional parameters for the EnvironmentsClient.BeginDelete method.
Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/d55b8005f05b040b852c15e74a0f3e36494a15e1/specification/devtestlabs/resource-manager/Microsoft.DevTestLab/stable/2018-09-15/examples/Environments_Delete.json

package main

import (
	"context"
	"log"

	"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
	"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/devtestlabs/armdevtestlabs"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armdevtestlabs.NewClientFactory("<subscription-id>", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	poller, err := clientFactory.NewEnvironmentsClient().BeginDelete(ctx, "resourceGroupName", "{labName}", "@me", "{environmentName}", 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 (*EnvironmentsClient) Get

func (client *EnvironmentsClient) Get(ctx context.Context, resourceGroupName string, labName string, userName string, name string, options *EnvironmentsClientGetOptions) (EnvironmentsClientGetResponse, error)

Get - Get environment. If the operation fails it returns an *azcore.ResponseError type.

Generated from API version 2018-09-15

  • resourceGroupName - The name of the resource group.
  • labName - The name of the lab.
  • userName - The name of the user profile.
  • name - The name of the environment.
  • options - EnvironmentsClientGetOptions contains the optional parameters for the EnvironmentsClient.Get method.
Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/d55b8005f05b040b852c15e74a0f3e36494a15e1/specification/devtestlabs/resource-manager/Microsoft.DevTestLab/stable/2018-09-15/examples/Environments_Get.json

package main

import (
	"context"
	"log"

	"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
	"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/devtestlabs/armdevtestlabs"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armdevtestlabs.NewClientFactory("<subscription-id>", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	res, err := clientFactory.NewEnvironmentsClient().Get(ctx, "resourceGroupName", "{labName}", "@me", "{environmentName}", &armdevtestlabs.EnvironmentsClientGetOptions{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.DtlEnvironment = armdevtestlabs.DtlEnvironment{
	// 	Name: to.Ptr("{environmentName}"),
	// 	Type: to.Ptr("Microsoft.DevTestLab/labs/users/environments"),
	// 	ID: to.Ptr("/subscriptions/{subscriptionId}/resourcegroups/resourceGroupName/providers/microsoft.devtestlab/labs/{labName}/users/{uniqueIdentifier}/environments/{environmentName}"),
	// 	Location: to.Ptr("{location}"),
	// 	Tags: map[string]*string{
	// 		"tagName1": to.Ptr("tagValue1"),
	// 	},
	// 	Properties: &armdevtestlabs.EnvironmentProperties{
	// 		CreatedByUser: to.Ptr("user@contoso.com"),
	// 		DeploymentProperties: &armdevtestlabs.EnvironmentDeploymentProperties{
	// 			ArmTemplateID: to.Ptr("/subscriptions/{subscriptionId}/resourcegroups/resourceGroupName/providers/microsoft.devtestlab/labs/{labName}/artifactSources/{artifactSourceName}/armTemplates/{armTemplateName}"),
	// 		},
	// 		ProvisioningState: to.Ptr("Succeeded"),
	// 		UniqueIdentifier: to.Ptr("{uniqueIdentifier}"),
	// 	},
	// }
}
Output:

func (*EnvironmentsClient) NewListPager added in v0.4.0

func (client *EnvironmentsClient) NewListPager(resourceGroupName string, labName string, userName string, options *EnvironmentsClientListOptions) *runtime.Pager[EnvironmentsClientListResponse]

NewListPager - List environments in a given user profile.

Generated from API version 2018-09-15

  • resourceGroupName - The name of the resource group.
  • labName - The name of the lab.
  • userName - The name of the user profile.
  • options - EnvironmentsClientListOptions contains the optional parameters for the EnvironmentsClient.NewListPager method.
Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/d55b8005f05b040b852c15e74a0f3e36494a15e1/specification/devtestlabs/resource-manager/Microsoft.DevTestLab/stable/2018-09-15/examples/Environments_List.json

package main

import (
	"context"
	"log"

	"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
	"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/devtestlabs/armdevtestlabs"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armdevtestlabs.NewClientFactory("<subscription-id>", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	pager := clientFactory.NewEnvironmentsClient().NewListPager("resourceGroupName", "{labName}", "@me", &armdevtestlabs.EnvironmentsClientListOptions{Expand: nil,
		Filter:  nil,
		Top:     nil,
		Orderby: 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.DtlEnvironmentList = armdevtestlabs.DtlEnvironmentList{
		// 	Value: []*armdevtestlabs.DtlEnvironment{
		// 		{
		// 			Name: to.Ptr("{environmentName}"),
		// 			Type: to.Ptr("Microsoft.DevTestLab/labs/users/environments"),
		// 			ID: to.Ptr("/subscriptions/{subscriptionId}/resourcegroups/resourceGroupName/providers/microsoft.devtestlab/labs/{labName}/users/{uniqueIdentifier}/environments/{environmentName}"),
		// 			Location: to.Ptr("{location}"),
		// 			Tags: map[string]*string{
		// 				"tagName1": to.Ptr("tagValue1"),
		// 			},
		// 			Properties: &armdevtestlabs.EnvironmentProperties{
		// 				CreatedByUser: to.Ptr("user@contoso.com"),
		// 				DeploymentProperties: &armdevtestlabs.EnvironmentDeploymentProperties{
		// 					ArmTemplateID: to.Ptr("/subscriptions/{subscriptionId}/resourcegroups/resourceGroupName/providers/microsoft.devtestlab/labs/{labName}/artifactSources/{artifactSourceName}/armTemplates/{armTemplateName}"),
		// 				},
		// 				ProvisioningState: to.Ptr("Succeeded"),
		// 				UniqueIdentifier: to.Ptr("{uniqueIdentifier}"),
		// 			},
		// 	}},
		// }
	}
}
Output:

func (*EnvironmentsClient) Update

func (client *EnvironmentsClient) Update(ctx context.Context, resourceGroupName string, labName string, userName string, name string, dtlEnvironment DtlEnvironmentFragment, options *EnvironmentsClientUpdateOptions) (EnvironmentsClientUpdateResponse, error)

Update - Allows modifying tags of environments. All other properties will be ignored. If the operation fails it returns an *azcore.ResponseError type.

Generated from API version 2018-09-15

  • resourceGroupName - The name of the resource group.
  • labName - The name of the lab.
  • userName - The name of the user profile.
  • name - The name of the environment.
  • dtlEnvironment - An environment, which is essentially an ARM template deployment.
  • options - EnvironmentsClientUpdateOptions contains the optional parameters for the EnvironmentsClient.Update method.
Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/d55b8005f05b040b852c15e74a0f3e36494a15e1/specification/devtestlabs/resource-manager/Microsoft.DevTestLab/stable/2018-09-15/examples/Environments_Update.json

package main

import (
	"context"
	"log"

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

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armdevtestlabs.NewClientFactory("<subscription-id>", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	res, err := clientFactory.NewEnvironmentsClient().Update(ctx, "resourceGroupName", "{labName}", "@me", "{environmentName}", armdevtestlabs.DtlEnvironmentFragment{
		Tags: map[string]*string{
			"tagName1": to.Ptr("tagValue1"),
		},
	}, 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.DtlEnvironment = armdevtestlabs.DtlEnvironment{
	// 	Name: to.Ptr("{environmentName}"),
	// 	Type: to.Ptr("Microsoft.DevTestLab/labs/users/environments"),
	// 	ID: to.Ptr("/subscriptions/{subscriptionId}/resourcegroups/resourceGroupName/providers/microsoft.devtestlab/labs/{labName}/users/{uniqueIdentifier}/environments/{environmentName}"),
	// 	Location: to.Ptr("{location}"),
	// 	Tags: map[string]*string{
	// 		"tagName1": to.Ptr("tagValue1"),
	// 	},
	// 	Properties: &armdevtestlabs.EnvironmentProperties{
	// 		CreatedByUser: to.Ptr("user@contoso.com"),
	// 		DeploymentProperties: &armdevtestlabs.EnvironmentDeploymentProperties{
	// 			ArmTemplateID: to.Ptr("/subscriptions/{subscriptionId}/resourcegroups/resourceGroupName/providers/microsoft.devtestlab/labs/{labName}/artifactSources/{artifactSourceName}/armTemplates/{armTemplateName}"),
	// 		},
	// 		ProvisioningState: to.Ptr("Succeeded"),
	// 		UniqueIdentifier: to.Ptr("{uniqueIdentifier}"),
	// 	},
	// }
}
Output:

type EnvironmentsClientBeginCreateOrUpdateOptions added in v0.2.0

type EnvironmentsClientBeginCreateOrUpdateOptions struct {
	// Resumes the LRO from the provided token.
	ResumeToken string
}

EnvironmentsClientBeginCreateOrUpdateOptions contains the optional parameters for the EnvironmentsClient.BeginCreateOrUpdate method.

type EnvironmentsClientBeginDeleteOptions added in v0.2.0

type EnvironmentsClientBeginDeleteOptions struct {
	// Resumes the LRO from the provided token.
	ResumeToken string
}

EnvironmentsClientBeginDeleteOptions contains the optional parameters for the EnvironmentsClient.BeginDelete method.

type EnvironmentsClientCreateOrUpdateResponse added in v0.2.0

type EnvironmentsClientCreateOrUpdateResponse struct {
	// An environment, which is essentially an ARM template deployment.
	DtlEnvironment
}

EnvironmentsClientCreateOrUpdateResponse contains the response from method EnvironmentsClient.BeginCreateOrUpdate.

type EnvironmentsClientDeleteResponse added in v0.2.0

type EnvironmentsClientDeleteResponse struct {
}

EnvironmentsClientDeleteResponse contains the response from method EnvironmentsClient.BeginDelete.

type EnvironmentsClientGetOptions added in v0.2.0

type EnvironmentsClientGetOptions struct {
	// Specify the $expand query. Example: 'properties($select=deploymentProperties)'
	Expand *string
}

EnvironmentsClientGetOptions contains the optional parameters for the EnvironmentsClient.Get method.

type EnvironmentsClientGetResponse added in v0.2.0

type EnvironmentsClientGetResponse struct {
	// An environment, which is essentially an ARM template deployment.
	DtlEnvironment
}

EnvironmentsClientGetResponse contains the response from method EnvironmentsClient.Get.

type EnvironmentsClientListOptions added in v0.2.0

type EnvironmentsClientListOptions struct {
	// Specify the $expand query. Example: 'properties($select=deploymentProperties)'
	Expand *string

	// The filter to apply to the operation. Example: '$filter=contains(name,'myName')
	Filter *string

	// The ordering expression for the results, using OData notation. Example: '$orderby=name desc'
	Orderby *string

	// The maximum number of resources to return from the operation. Example: '$top=10'
	Top *int32
}

EnvironmentsClientListOptions contains the optional parameters for the EnvironmentsClient.NewListPager method.

type EnvironmentsClientListResponse added in v0.2.0

type EnvironmentsClientListResponse struct {
	// The response of a list operation.
	DtlEnvironmentList
}

EnvironmentsClientListResponse contains the response from method EnvironmentsClient.NewListPager.

type EnvironmentsClientUpdateOptions added in v0.2.0

type EnvironmentsClientUpdateOptions struct {
}

EnvironmentsClientUpdateOptions contains the optional parameters for the EnvironmentsClient.Update method.

type EnvironmentsClientUpdateResponse added in v0.2.0

type EnvironmentsClientUpdateResponse struct {
	// An environment, which is essentially an ARM template deployment.
	DtlEnvironment
}

EnvironmentsClientUpdateResponse contains the response from method EnvironmentsClient.Update.

type EvaluatePoliciesProperties

type EvaluatePoliciesProperties struct {
	// The fact data.
	FactData *string

	// The fact name.
	FactName *string

	// The user for which policies will be evaluated
	UserObjectID *string

	// The value offset.
	ValueOffset *string
}

EvaluatePoliciesProperties - Properties for evaluating a policy set.

func (EvaluatePoliciesProperties) MarshalJSON added in v1.1.0

func (e EvaluatePoliciesProperties) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.Marshaller interface for type EvaluatePoliciesProperties.

func (*EvaluatePoliciesProperties) UnmarshalJSON added in v1.1.0

func (e *EvaluatePoliciesProperties) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the json.Unmarshaller interface for type EvaluatePoliciesProperties.

type EvaluatePoliciesRequest

type EvaluatePoliciesRequest struct {
	// Policies to evaluate.
	Policies []*EvaluatePoliciesProperties
}

EvaluatePoliciesRequest - Request body for evaluating a policy set.

func (EvaluatePoliciesRequest) MarshalJSON

func (e EvaluatePoliciesRequest) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.Marshaller interface for type EvaluatePoliciesRequest.

func (*EvaluatePoliciesRequest) UnmarshalJSON added in v1.1.0

func (e *EvaluatePoliciesRequest) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the json.Unmarshaller interface for type EvaluatePoliciesRequest.

type EvaluatePoliciesResponse

type EvaluatePoliciesResponse struct {
	// Results of evaluating a policy set.
	Results []*PolicySetResult
}

EvaluatePoliciesResponse - Response body for evaluating a policy set.

func (EvaluatePoliciesResponse) MarshalJSON

func (e EvaluatePoliciesResponse) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.Marshaller interface for type EvaluatePoliciesResponse.

func (*EvaluatePoliciesResponse) UnmarshalJSON added in v1.1.0

func (e *EvaluatePoliciesResponse) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the json.Unmarshaller interface for type EvaluatePoliciesResponse.

type Event

type Event struct {
	// The event type for which this notification is enabled (i.e. AutoShutdown, Cost)
	EventName *NotificationChannelEventType
}

Event - An event to be notified for.

func (Event) MarshalJSON added in v1.1.0

func (e Event) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.Marshaller interface for type Event.

func (*Event) UnmarshalJSON added in v1.1.0

func (e *Event) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the json.Unmarshaller interface for type Event.

type ExportResourceUsageParameters

type ExportResourceUsageParameters struct {
	// The blob storage absolute sas uri with write permission to the container which the usage data needs to be uploaded to.
	BlobStorageAbsoluteSasURI *string

	// The start time of the usage. If not provided, usage will be reported since the beginning of data collection.
	UsageStartDate *time.Time
}

ExportResourceUsageParameters - The parameters of the export operation.

func (ExportResourceUsageParameters) MarshalJSON

func (e ExportResourceUsageParameters) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.Marshaller interface for type ExportResourceUsageParameters.

func (*ExportResourceUsageParameters) UnmarshalJSON

func (e *ExportResourceUsageParameters) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the json.Unmarshaller interface for type ExportResourceUsageParameters.

type ExternalSubnet

type ExternalSubnet struct {
	// Gets or sets the identifier.
	ID *string

	// Gets or sets the name.
	Name *string
}

ExternalSubnet - Subnet information as returned by the Microsoft.Network API.

func (ExternalSubnet) MarshalJSON added in v1.1.0

func (e ExternalSubnet) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.Marshaller interface for type ExternalSubnet.

func (*ExternalSubnet) UnmarshalJSON added in v1.1.0

func (e *ExternalSubnet) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the json.Unmarshaller interface for type ExternalSubnet.

type FileUploadOptions

type FileUploadOptions string

FileUploadOptions - Options for uploading the files for the artifact. UploadFilesAndGenerateSasTokens is the default value.

const (
	FileUploadOptionsNone                            FileUploadOptions = "None"
	FileUploadOptionsUploadFilesAndGenerateSasTokens FileUploadOptions = "UploadFilesAndGenerateSasTokens"
)

func PossibleFileUploadOptionsValues

func PossibleFileUploadOptionsValues() []FileUploadOptions

PossibleFileUploadOptionsValues returns the possible values for the FileUploadOptions const type.

type Formula

type Formula struct {
	// REQUIRED; The properties of the resource.
	Properties *FormulaProperties

	// The location of the resource.
	Location *string

	// The tags of the resource.
	Tags map[string]*string

	// READ-ONLY; The identifier of the resource.
	ID *string

	// READ-ONLY; The name of the resource.
	Name *string

	// READ-ONLY; The type of the resource.
	Type *string
}

Formula - A formula for creating a VM, specifying an image base and other parameters

func (Formula) MarshalJSON

func (f Formula) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.Marshaller interface for type Formula.

func (*Formula) UnmarshalJSON added in v1.1.0

func (f *Formula) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the json.Unmarshaller interface for type Formula.

type FormulaFragment

type FormulaFragment struct {
	// The tags of the resource.
	Tags map[string]*string
}

FormulaFragment - A formula for creating a VM, specifying an image base and other parameters

func (FormulaFragment) MarshalJSON added in v0.2.0

func (f FormulaFragment) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.Marshaller interface for type FormulaFragment.

func (*FormulaFragment) UnmarshalJSON added in v1.1.0

func (f *FormulaFragment) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the json.Unmarshaller interface for type FormulaFragment.

type FormulaList

type FormulaList struct {
	// Link for next set of results.
	NextLink *string

	// Results of the list operation.
	Value []*Formula
}

FormulaList - The response of a list operation.

func (FormulaList) MarshalJSON

func (f FormulaList) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.Marshaller interface for type FormulaList.

func (*FormulaList) UnmarshalJSON added in v1.1.0

func (f *FormulaList) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the json.Unmarshaller interface for type FormulaList.

type FormulaProperties

type FormulaProperties struct {
	// The description of the formula.
	Description *string

	// The content of the formula.
	FormulaContent *LabVirtualMachineCreationParameter

	// The OS type of the formula.
	OSType *string

	// Information about a VM from which a formula is to be created.
	VM *FormulaPropertiesFromVM

	// READ-ONLY; The author of the formula.
	Author *string

	// READ-ONLY; The creation date of the formula.
	CreationDate *time.Time

	// READ-ONLY; The provisioning status of the resource.
	ProvisioningState *string

	// READ-ONLY; The unique immutable identifier of a resource (Guid).
	UniqueIdentifier *string
}

FormulaProperties - Properties of a formula.

func (FormulaProperties) MarshalJSON

func (f FormulaProperties) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.Marshaller interface for type FormulaProperties.

func (*FormulaProperties) UnmarshalJSON

func (f *FormulaProperties) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the json.Unmarshaller interface for type FormulaProperties.

type FormulaPropertiesFromVM

type FormulaPropertiesFromVM struct {
	// The identifier of the VM from which a formula is to be created.
	LabVMID *string
}

FormulaPropertiesFromVM - Information about a VM from which a formula is to be created.

func (FormulaPropertiesFromVM) MarshalJSON added in v1.1.0

func (f FormulaPropertiesFromVM) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.Marshaller interface for type FormulaPropertiesFromVM.

func (*FormulaPropertiesFromVM) UnmarshalJSON added in v1.1.0

func (f *FormulaPropertiesFromVM) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the json.Unmarshaller interface for type FormulaPropertiesFromVM.

type FormulasClient

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

FormulasClient contains the methods for the Formulas group. Don't use this type directly, use NewFormulasClient() instead.

func NewFormulasClient

func NewFormulasClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*FormulasClient, error)

NewFormulasClient creates a new instance of FormulasClient with the specified values.

  • subscriptionID - The subscription ID.
  • credential - used to authorize requests. Usually a credential from azidentity.
  • options - pass nil to accept the default values.

func (*FormulasClient) BeginCreateOrUpdate

func (client *FormulasClient) BeginCreateOrUpdate(ctx context.Context, resourceGroupName string, labName string, name string, formula Formula, options *FormulasClientBeginCreateOrUpdateOptions) (*runtime.Poller[FormulasClientCreateOrUpdateResponse], error)

BeginCreateOrUpdate - Create or replace an existing formula. This operation can take a while to complete. If the operation fails it returns an *azcore.ResponseError type.

Generated from API version 2018-09-15

  • resourceGroupName - The name of the resource group.
  • labName - The name of the lab.
  • name - The name of the formula.
  • formula - A formula for creating a VM, specifying an image base and other parameters
  • options - FormulasClientBeginCreateOrUpdateOptions contains the optional parameters for the FormulasClient.BeginCreateOrUpdate method.
Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/d55b8005f05b040b852c15e74a0f3e36494a15e1/specification/devtestlabs/resource-manager/Microsoft.DevTestLab/stable/2018-09-15/examples/Formulas_CreateOrUpdate.json

package main

import (
	"context"
	"log"

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

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armdevtestlabs.NewClientFactory("<subscription-id>", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	poller, err := clientFactory.NewFormulasClient().BeginCreateOrUpdate(ctx, "resourceGroupName", "{labName}", "{formulaName}", armdevtestlabs.Formula{
		Location: to.Ptr("{location}"),
		Properties: &armdevtestlabs.FormulaProperties{
			Description: to.Ptr("Formula using a Linux base"),
			FormulaContent: &armdevtestlabs.LabVirtualMachineCreationParameter{
				Location: to.Ptr("{location}"),
				Properties: &armdevtestlabs.LabVirtualMachineCreationParameterProperties{
					AllowClaim: to.Ptr(false),
					Artifacts: []*armdevtestlabs.ArtifactInstallProperties{
						{
							ArtifactID: to.Ptr("/artifactsources/{artifactSourceName}/artifacts/linux-install-nodejs"),
							Parameters: []*armdevtestlabs.ArtifactParameterProperties{},
						}},
					DisallowPublicIPAddress: to.Ptr(true),
					GalleryImageReference: &armdevtestlabs.GalleryImageReference{
						Offer:     to.Ptr("0001-com-ubuntu-server-groovy"),
						OSType:    to.Ptr("Linux"),
						Publisher: to.Ptr("canonical"),
						SKU:       to.Ptr("20_10"),
						Version:   to.Ptr("latest"),
					},
					IsAuthenticationWithSSHKey: to.Ptr(false),
					LabSubnetName:              to.Ptr("Dtl{labName}Subnet"),
					LabVirtualNetworkID:        to.Ptr("/virtualnetworks/dtl{labName}"),
					NetworkInterface: &armdevtestlabs.NetworkInterfaceProperties{
						SharedPublicIPAddressConfiguration: &armdevtestlabs.SharedPublicIPAddressConfiguration{
							InboundNatRules: []*armdevtestlabs.InboundNatRule{
								{
									BackendPort:       to.Ptr[int32](22),
									TransportProtocol: to.Ptr(armdevtestlabs.TransportProtocolTCP),
								}},
						},
					},
					Notes:       to.Ptr("Ubuntu Server 20.10"),
					Size:        to.Ptr("Standard_B1ms"),
					StorageType: to.Ptr("Standard"),
					UserName:    to.Ptr("user"),
				},
			},
		},
	}, 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.Formula = armdevtestlabs.Formula{
	// 	Name: to.Ptr("{formulaName}"),
	// 	Type: to.Ptr("Microsoft.DevTestLab/labs/formulas"),
	// 	ID: to.Ptr("/subscriptions/{subscriptionId}/resourcegroups/resourceGroupName/providers/microsoft.devtestlab/labs/{labName}/formulas/{formulaName}"),
	// 	Location: to.Ptr("{location}"),
	// 	Tags: map[string]*string{
	// 		"tagName1": to.Ptr("tagValue1"),
	// 	},
	// 	Properties: &armdevtestlabs.FormulaProperties{
	// 		Description: to.Ptr("Formula using a Linux base"),
	// 		Author: to.Ptr("username@contoso.com"),
	// 		CreationDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2018-12-22T21:25:42.925Z"); return t}()),
	// 		FormulaContent: &armdevtestlabs.LabVirtualMachineCreationParameter{
	// 			Location: to.Ptr("{location}"),
	// 			Properties: &armdevtestlabs.LabVirtualMachineCreationParameterProperties{
	// 				AllowClaim: to.Ptr(false),
	// 				Artifacts: []*armdevtestlabs.ArtifactInstallProperties{
	// 					{
	// 						ArtifactID: to.Ptr("/artifactsources/{artifactSourceName}/artifacts/linux-install-nodejs"),
	// 						Parameters: []*armdevtestlabs.ArtifactParameterProperties{
	// 						},
	// 				}},
	// 				DisallowPublicIPAddress: to.Ptr(true),
	// 				GalleryImageReference: &armdevtestlabs.GalleryImageReference{
	// 					Offer: to.Ptr("0001-com-ubuntu-server-groovy"),
	// 					OSType: to.Ptr("Linux"),
	// 					Publisher: to.Ptr("canonical"),
	// 					SKU: to.Ptr("20_10"),
	// 					Version: to.Ptr("latest"),
	// 				},
	// 				IsAuthenticationWithSSHKey: to.Ptr(false),
	// 				LabSubnetName: to.Ptr("Dtl{labName}Subnet"),
	// 				LabVirtualNetworkID: to.Ptr("/virtualnetworks/dtl{labName}"),
	// 				NetworkInterface: &armdevtestlabs.NetworkInterfaceProperties{
	// 					SharedPublicIPAddressConfiguration: &armdevtestlabs.SharedPublicIPAddressConfiguration{
	// 						InboundNatRules: []*armdevtestlabs.InboundNatRule{
	// 							{
	// 								BackendPort: to.Ptr[int32](22),
	// 								TransportProtocol: to.Ptr(armdevtestlabs.TransportProtocolTCP),
	// 						}},
	// 					},
	// 				},
	// 				Notes: to.Ptr("Ubuntu Server 20.10"),
	// 				Size: to.Ptr("Standard_B1ms"),
	// 				StorageType: to.Ptr("Standard"),
	// 				UserName: to.Ptr("user"),
	// 			},
	// 		},
	// 		ProvisioningState: to.Ptr("Succeeded"),
	// 		UniqueIdentifier: to.Ptr("{uniqueIdentifier}"),
	// 	},
	// }
}
Output:

func (*FormulasClient) Delete

func (client *FormulasClient) Delete(ctx context.Context, resourceGroupName string, labName string, name string, options *FormulasClientDeleteOptions) (FormulasClientDeleteResponse, error)

Delete - Delete formula. If the operation fails it returns an *azcore.ResponseError type.

Generated from API version 2018-09-15

  • resourceGroupName - The name of the resource group.
  • labName - The name of the lab.
  • name - The name of the formula.
  • options - FormulasClientDeleteOptions contains the optional parameters for the FormulasClient.Delete method.
Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/d55b8005f05b040b852c15e74a0f3e36494a15e1/specification/devtestlabs/resource-manager/Microsoft.DevTestLab/stable/2018-09-15/examples/Formulas_Delete.json

package main

import (
	"context"
	"log"

	"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
	"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/devtestlabs/armdevtestlabs"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armdevtestlabs.NewClientFactory("<subscription-id>", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	_, err = clientFactory.NewFormulasClient().Delete(ctx, "resourceGroupName", "{labName}", "{formulaName}", nil)
	if err != nil {
		log.Fatalf("failed to finish the request: %v", err)
	}
}
Output:

func (*FormulasClient) Get

func (client *FormulasClient) Get(ctx context.Context, resourceGroupName string, labName string, name string, options *FormulasClientGetOptions) (FormulasClientGetResponse, error)

Get - Get formula. If the operation fails it returns an *azcore.ResponseError type.

Generated from API version 2018-09-15

  • resourceGroupName - The name of the resource group.
  • labName - The name of the lab.
  • name - The name of the formula.
  • options - FormulasClientGetOptions contains the optional parameters for the FormulasClient.Get method.
Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/d55b8005f05b040b852c15e74a0f3e36494a15e1/specification/devtestlabs/resource-manager/Microsoft.DevTestLab/stable/2018-09-15/examples/Formulas_Get.json

package main

import (
	"context"
	"log"

	"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
	"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/devtestlabs/armdevtestlabs"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armdevtestlabs.NewClientFactory("<subscription-id>", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	res, err := clientFactory.NewFormulasClient().Get(ctx, "resourceGroupName", "{labName}", "{formulaName}", &armdevtestlabs.FormulasClientGetOptions{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.Formula = armdevtestlabs.Formula{
	// 	Name: to.Ptr("{formulaName}"),
	// 	Type: to.Ptr("Microsoft.DevTestLab/labs/formulas"),
	// 	ID: to.Ptr("/subscriptions/{subscriptionId}/resourcegroups/resourceGroupName/providers/microsoft.devtestlab/labs/{labName}/formulas/{formulaName}"),
	// 	Properties: &armdevtestlabs.FormulaProperties{
	// 		Description: to.Ptr("Formula used to create a Linux VM"),
	// 		Author: to.Ptr("user@contoso.com"),
	// 		CreationDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2018-12-22T19:13:35.992Z"); return t}()),
	// 		FormulaContent: &armdevtestlabs.LabVirtualMachineCreationParameter{
	// 			Location: to.Ptr("{location}"),
	// 			Properties: &armdevtestlabs.LabVirtualMachineCreationParameterProperties{
	// 				AllowClaim: to.Ptr(false),
	// 				Artifacts: []*armdevtestlabs.ArtifactInstallProperties{
	// 					{
	// 						ArtifactID: to.Ptr("/artifactsources/{artifactSourceName}/artifacts/linux-install-nodejs"),
	// 						Parameters: []*armdevtestlabs.ArtifactParameterProperties{
	// 						},
	// 				}},
	// 				DisallowPublicIPAddress: to.Ptr(true),
	// 				GalleryImageReference: &armdevtestlabs.GalleryImageReference{
	// 					Offer: to.Ptr("0001-com-ubuntu-server-groovy"),
	// 					OSType: to.Ptr("Linux"),
	// 					Publisher: to.Ptr("canonical"),
	// 					SKU: to.Ptr("20_10"),
	// 					Version: to.Ptr("latest"),
	// 				},
	// 				IsAuthenticationWithSSHKey: to.Ptr(false),
	// 				LabSubnetName: to.Ptr("Dtl{labName}Subnet"),
	// 				LabVirtualNetworkID: to.Ptr("/virtualnetworks/dtl{labName}"),
	// 				NetworkInterface: &armdevtestlabs.NetworkInterfaceProperties{
	// 					SharedPublicIPAddressConfiguration: &armdevtestlabs.SharedPublicIPAddressConfiguration{
	// 						InboundNatRules: []*armdevtestlabs.InboundNatRule{
	// 							{
	// 								BackendPort: to.Ptr[int32](22),
	// 								TransportProtocol: to.Ptr(armdevtestlabs.TransportProtocolTCP),
	// 						}},
	// 					},
	// 				},
	// 				Notes: to.Ptr("Ubuntu Server 20.10"),
	// 				Size: to.Ptr("Standard_B1ms"),
	// 				StorageType: to.Ptr("Standard"),
	// 				UserName: to.Ptr("user"),
	// 			},
	// 		},
	// 		OSType: to.Ptr("Linux"),
	// 		ProvisioningState: to.Ptr("Succeeded"),
	// 		UniqueIdentifier: to.Ptr("7a7d20ab-8a50-46fb-8dc6-7c6c1443a01b"),
	// 	},
	// }
}
Output:

func (*FormulasClient) NewListPager added in v0.4.0

func (client *FormulasClient) NewListPager(resourceGroupName string, labName string, options *FormulasClientListOptions) *runtime.Pager[FormulasClientListResponse]

NewListPager - List formulas in a given lab.

Generated from API version 2018-09-15

  • resourceGroupName - The name of the resource group.
  • labName - The name of the lab.
  • options - FormulasClientListOptions contains the optional parameters for the FormulasClient.NewListPager method.
Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/d55b8005f05b040b852c15e74a0f3e36494a15e1/specification/devtestlabs/resource-manager/Microsoft.DevTestLab/stable/2018-09-15/examples/Formulas_List.json

package main

import (
	"context"
	"log"

	"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
	"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/devtestlabs/armdevtestlabs"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armdevtestlabs.NewClientFactory("<subscription-id>", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	pager := clientFactory.NewFormulasClient().NewListPager("resourceGroupName", "{labName}", &armdevtestlabs.FormulasClientListOptions{Expand: nil,
		Filter:  nil,
		Top:     nil,
		Orderby: 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.FormulaList = armdevtestlabs.FormulaList{
		// 	Value: []*armdevtestlabs.Formula{
		// 		{
		// 			Name: to.Ptr("{formulaName}"),
		// 			Type: to.Ptr("Microsoft.DevTestLab/labs/formulas"),
		// 			ID: to.Ptr("/subscriptions/{subscriptionId}/resourcegroups/resourceGroupName/providers/microsoft.devtestlab/labs/{labName}/formulas/{formulaName}"),
		// 			Properties: &armdevtestlabs.FormulaProperties{
		// 				Description: to.Ptr("Formula used to create a Linux VM"),
		// 				Author: to.Ptr("user@contoso.com"),
		// 				CreationDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2018-12-22T19:13:35.992Z"); return t}()),
		// 				FormulaContent: &armdevtestlabs.LabVirtualMachineCreationParameter{
		// 					Location: to.Ptr("{location}"),
		// 					Properties: &armdevtestlabs.LabVirtualMachineCreationParameterProperties{
		// 						AllowClaim: to.Ptr(false),
		// 						Artifacts: []*armdevtestlabs.ArtifactInstallProperties{
		// 							{
		// 								ArtifactID: to.Ptr("/artifactsources/{artifactSourceName}/artifacts/linux-install-nodejs"),
		// 								Parameters: []*armdevtestlabs.ArtifactParameterProperties{
		// 								},
		// 						}},
		// 						DisallowPublicIPAddress: to.Ptr(true),
		// 						GalleryImageReference: &armdevtestlabs.GalleryImageReference{
		// 							Offer: to.Ptr("0001-com-ubuntu-server-groovy"),
		// 							OSType: to.Ptr("Linux"),
		// 							Publisher: to.Ptr("canonical"),
		// 							SKU: to.Ptr("20_10"),
		// 							Version: to.Ptr("latest"),
		// 						},
		// 						IsAuthenticationWithSSHKey: to.Ptr(false),
		// 						LabSubnetName: to.Ptr("Dtl{labName}Subnet"),
		// 						LabVirtualNetworkID: to.Ptr("/virtualnetworks/dtl{labName}"),
		// 						NetworkInterface: &armdevtestlabs.NetworkInterfaceProperties{
		// 							SharedPublicIPAddressConfiguration: &armdevtestlabs.SharedPublicIPAddressConfiguration{
		// 								InboundNatRules: []*armdevtestlabs.InboundNatRule{
		// 									{
		// 										BackendPort: to.Ptr[int32](22),
		// 										TransportProtocol: to.Ptr(armdevtestlabs.TransportProtocolTCP),
		// 								}},
		// 							},
		// 						},
		// 						Notes: to.Ptr("Ubuntu Server 20.10"),
		// 						Size: to.Ptr("Standard_B1ms"),
		// 						StorageType: to.Ptr("Standard"),
		// 						UserName: to.Ptr("user"),
		// 					},
		// 				},
		// 				OSType: to.Ptr("Linux"),
		// 				ProvisioningState: to.Ptr("Succeeded"),
		// 				UniqueIdentifier: to.Ptr("7a7d20ab-8a50-46fb-8dc6-7c6c1443a01b"),
		// 			},
		// 	}},
		// }
	}
}
Output:

func (*FormulasClient) Update

func (client *FormulasClient) Update(ctx context.Context, resourceGroupName string, labName string, name string, formula FormulaFragment, options *FormulasClientUpdateOptions) (FormulasClientUpdateResponse, error)

Update - Allows modifying tags of formulas. All other properties will be ignored. If the operation fails it returns an *azcore.ResponseError type.

Generated from API version 2018-09-15

  • resourceGroupName - The name of the resource group.
  • labName - The name of the lab.
  • name - The name of the formula.
  • formula - A formula for creating a VM, specifying an image base and other parameters
  • options - FormulasClientUpdateOptions contains the optional parameters for the FormulasClient.Update method.
Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/d55b8005f05b040b852c15e74a0f3e36494a15e1/specification/devtestlabs/resource-manager/Microsoft.DevTestLab/stable/2018-09-15/examples/Formulas_Update.json

package main

import (
	"context"
	"log"

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

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armdevtestlabs.NewClientFactory("<subscription-id>", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	res, err := clientFactory.NewFormulasClient().Update(ctx, "resourceGroupName", "{labName}", "{formulaName}", armdevtestlabs.FormulaFragment{
		Tags: map[string]*string{
			"tagName1": to.Ptr("tagValue1"),
		},
	}, 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.Formula = armdevtestlabs.Formula{
	// 	Name: to.Ptr("{formulaName}"),
	// 	Type: to.Ptr("Microsoft.DevTestLab/labs/formulas"),
	// 	ID: to.Ptr("/subscriptions/{subscriptionId}/resourcegroups/resourceGroupName/providers/microsoft.devtestlab/labs/{labName}/formulas/{formulaName}"),
	// 	Tags: map[string]*string{
	// 		"tagName1": to.Ptr("tagValue1"),
	// 	},
	// 	Properties: &armdevtestlabs.FormulaProperties{
	// 		Description: to.Ptr("Formula using a Linux base"),
	// 		Author: to.Ptr("username@contoso.com"),
	// 		CreationDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2018-12-22T21:25:42.925Z"); return t}()),
	// 		FormulaContent: &armdevtestlabs.LabVirtualMachineCreationParameter{
	// 			Location: to.Ptr("{location}"),
	// 			Properties: &armdevtestlabs.LabVirtualMachineCreationParameterProperties{
	// 				AllowClaim: to.Ptr(false),
	// 				Artifacts: []*armdevtestlabs.ArtifactInstallProperties{
	// 					{
	// 						ArtifactID: to.Ptr("/artifactsources/{artifactSourceName}/artifacts/linux-install-nodejs"),
	// 						Parameters: []*armdevtestlabs.ArtifactParameterProperties{
	// 						},
	// 				}},
	// 				DisallowPublicIPAddress: to.Ptr(true),
	// 				GalleryImageReference: &armdevtestlabs.GalleryImageReference{
	// 					Offer: to.Ptr("0001-com-ubuntu-server-groovy"),
	// 					OSType: to.Ptr("Linux"),
	// 					Publisher: to.Ptr("canonical"),
	// 					SKU: to.Ptr("20_10"),
	// 					Version: to.Ptr("latest"),
	// 				},
	// 				IsAuthenticationWithSSHKey: to.Ptr(false),
	// 				LabSubnetName: to.Ptr("Dtl{labName}Subnet"),
	// 				LabVirtualNetworkID: to.Ptr("/virtualnetworks/dtl{labName}"),
	// 				NetworkInterface: &armdevtestlabs.NetworkInterfaceProperties{
	// 					SharedPublicIPAddressConfiguration: &armdevtestlabs.SharedPublicIPAddressConfiguration{
	// 						InboundNatRules: []*armdevtestlabs.InboundNatRule{
	// 							{
	// 								BackendPort: to.Ptr[int32](22),
	// 								TransportProtocol: to.Ptr(armdevtestlabs.TransportProtocolTCP),
	// 						}},
	// 					},
	// 				},
	// 				Notes: to.Ptr("Ubuntu Server 20.10"),
	// 				Size: to.Ptr("Standard_B1ms"),
	// 				StorageType: to.Ptr("Standard"),
	// 				UserName: to.Ptr("user"),
	// 			},
	// 		},
	// 		ProvisioningState: to.Ptr("Succeeded"),
	// 		UniqueIdentifier: to.Ptr("{uniqueIdentifier}"),
	// 	},
	// }
}
Output:

type FormulasClientBeginCreateOrUpdateOptions added in v0.2.0

type FormulasClientBeginCreateOrUpdateOptions struct {
	// Resumes the LRO from the provided token.
	ResumeToken string
}

FormulasClientBeginCreateOrUpdateOptions contains the optional parameters for the FormulasClient.BeginCreateOrUpdate method.

type FormulasClientCreateOrUpdateResponse added in v0.2.0

type FormulasClientCreateOrUpdateResponse struct {
	// A formula for creating a VM, specifying an image base and other parameters
	Formula
}

FormulasClientCreateOrUpdateResponse contains the response from method FormulasClient.BeginCreateOrUpdate.

type FormulasClientDeleteOptions added in v0.2.0

type FormulasClientDeleteOptions struct {
}

FormulasClientDeleteOptions contains the optional parameters for the FormulasClient.Delete method.

type FormulasClientDeleteResponse added in v0.2.0

type FormulasClientDeleteResponse struct {
}

FormulasClientDeleteResponse contains the response from method FormulasClient.Delete.

type FormulasClientGetOptions added in v0.2.0

type FormulasClientGetOptions struct {
	// Specify the $expand query. Example: 'properties($select=description)'
	Expand *string
}

FormulasClientGetOptions contains the optional parameters for the FormulasClient.Get method.

type FormulasClientGetResponse added in v0.2.0

type FormulasClientGetResponse struct {
	// A formula for creating a VM, specifying an image base and other parameters
	Formula
}

FormulasClientGetResponse contains the response from method FormulasClient.Get.

type FormulasClientListOptions added in v0.2.0

type FormulasClientListOptions struct {
	// Specify the $expand query. Example: 'properties($select=description)'
	Expand *string

	// The filter to apply to the operation. Example: '$filter=contains(name,'myName')
	Filter *string

	// The ordering expression for the results, using OData notation. Example: '$orderby=name desc'
	Orderby *string

	// The maximum number of resources to return from the operation. Example: '$top=10'
	Top *int32
}

FormulasClientListOptions contains the optional parameters for the FormulasClient.NewListPager method.

type FormulasClientListResponse added in v0.2.0

type FormulasClientListResponse struct {
	// The response of a list operation.
	FormulaList
}

FormulasClientListResponse contains the response from method FormulasClient.NewListPager.

type FormulasClientUpdateOptions added in v0.2.0

type FormulasClientUpdateOptions struct {
}

FormulasClientUpdateOptions contains the optional parameters for the FormulasClient.Update method.

type FormulasClientUpdateResponse added in v0.2.0

type FormulasClientUpdateResponse struct {
	// A formula for creating a VM, specifying an image base and other parameters
	Formula
}

FormulasClientUpdateResponse contains the response from method FormulasClient.Update.

type GalleryImage

type GalleryImage struct {
	// REQUIRED; The properties of the resource.
	Properties *GalleryImageProperties

	// The location of the resource.
	Location *string

	// The tags of the resource.
	Tags map[string]*string

	// READ-ONLY; The identifier of the resource.
	ID *string

	// READ-ONLY; The name of the resource.
	Name *string

	// READ-ONLY; The type of the resource.
	Type *string
}

GalleryImage - A gallery image.

func (GalleryImage) MarshalJSON

func (g GalleryImage) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.Marshaller interface for type GalleryImage.

func (*GalleryImage) UnmarshalJSON added in v1.1.0

func (g *GalleryImage) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the json.Unmarshaller interface for type GalleryImage.

type GalleryImageList

type GalleryImageList struct {
	// Link for next set of results.
	NextLink *string

	// Results of the list operation.
	Value []*GalleryImage
}

GalleryImageList - The response of a list operation.

func (GalleryImageList) MarshalJSON

func (g GalleryImageList) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.Marshaller interface for type GalleryImageList.

func (*GalleryImageList) UnmarshalJSON added in v1.1.0

func (g *GalleryImageList) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the json.Unmarshaller interface for type GalleryImageList.

type GalleryImageProperties

type GalleryImageProperties struct {
	// The author of the gallery image.
	Author *string

	// The description of the gallery image.
	Description *string

	// Indicates whether this gallery image is enabled.
	Enabled *bool

	// The icon of the gallery image.
	Icon *string

	// The image reference of the gallery image.
	ImageReference *GalleryImageReference

	// Indicates if the plan has been authorized for programmatic deployment.
	IsPlanAuthorized *bool

	// The third party plan that applies to this image
	PlanID *string

	// READ-ONLY; The creation date of the gallery image.
	CreatedDate *time.Time
}

GalleryImageProperties - Properties of a gallery image.

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 GalleryImageReference

type GalleryImageReference struct {
	// The OS type of the gallery image.
	OSType *string

	// The offer of the gallery image.
	Offer *string

	// The publisher of the gallery image.
	Publisher *string

	// The SKU of the gallery image.
	SKU *string

	// The version of the gallery image.
	Version *string
}

GalleryImageReference - The reference information for an Azure Marketplace image.

func (GalleryImageReference) MarshalJSON added in v1.1.0

func (g GalleryImageReference) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.Marshaller interface for type GalleryImageReference.

func (*GalleryImageReference) UnmarshalJSON added in v1.1.0

func (g *GalleryImageReference) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the json.Unmarshaller interface for type GalleryImageReference.

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 - The subscription ID.
  • credential - used to authorize requests. Usually a credential from azidentity.
  • options - pass nil to accept the default values.

func (*GalleryImagesClient) NewListPager added in v0.4.0

func (client *GalleryImagesClient) NewListPager(resourceGroupName string, labName string, options *GalleryImagesClientListOptions) *runtime.Pager[GalleryImagesClientListResponse]

NewListPager - List gallery images in a given lab.

Generated from API version 2018-09-15

  • resourceGroupName - The name of the resource group.
  • labName - The name of the lab.
  • options - GalleryImagesClientListOptions contains the optional parameters for the GalleryImagesClient.NewListPager method.
Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/d55b8005f05b040b852c15e74a0f3e36494a15e1/specification/devtestlabs/resource-manager/Microsoft.DevTestLab/stable/2018-09-15/examples/GalleryImages_List.json

package main

import (
	"context"
	"log"

	"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
	"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/devtestlabs/armdevtestlabs"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armdevtestlabs.NewClientFactory("<subscription-id>", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	pager := clientFactory.NewGalleryImagesClient().NewListPager("resourceGroupName", "{labName}", &armdevtestlabs.GalleryImagesClientListOptions{Expand: nil,
		Filter:  nil,
		Top:     nil,
		Orderby: 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 = armdevtestlabs.GalleryImageList{
		// 	Value: []*armdevtestlabs.GalleryImage{
		// 		{
		// 			Name: to.Ptr("Ubuntu Server 20.04 LTS"),
		// 			Type: to.Ptr("Microsoft.DevTestLab/labs/galleryImages"),
		// 			ID: to.Ptr("/subscriptions/{subscriptionId}/resourcegroups/resourceGroupName/providers/microsoft.devtestlab/labs/{labName}/galleryimages/ubuntu server 20.04 lts"),
		// 			Location: to.Ptr("{location}"),
		// 			Tags: map[string]*string{
		// 				"tagName1": to.Ptr("tagValue1"),
		// 			},
		// 			Properties: &armdevtestlabs.GalleryImageProperties{
		// 				Description: to.Ptr("Ubuntu Server is the world's most popular Linux for cloud environments. Updates and patches for Ubuntu Server 20.04 LTS will be available until April 2025. Ubuntu Server is the perfect virtual machine (VM) platform for all workloads from web applications to NoSQL databases and Hadoop. For more information see <a href='https://ubuntu.com/azure' target='_blank'>Ubuntu on Azure</a> and <a href='http://juju.ubuntu.com' target='_blank'>using Juju to deploy your workloads</a>.<p><h3 class='msportalfx-text-header'>Legal Terms</h3></p><p>By clicking the Create button, I acknowledge that I am getting this software from Canonical and that the <a href='http://www.ubuntu.com/project/about-ubuntu/licensing' target='_blank'>legal terms</a> of Canonical apply to it. Microsoft does not provide rights for third-party software. Also see the <a href='http://www.ubuntu.com/aboutus/privacypolicy' target='_blank'>privacy statement</a> from Canonical.</p>"),
		// 				Author: to.Ptr("Canonical"),
		// 				CreatedDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-12-14T23:43:43.764Z"); return t}()),
		// 				Enabled: to.Ptr(true),
		// 				Icon: to.Ptr("https://106c4.wpc.azureedge.net/80106C4/Gallery-Prod/cdn/2015-02-24/prod20161101-microsoft-windowsazure-gallery/canonical.0001-com-ubuntu-server-focal20_04-lts-ARM.1.0.22/Icons/Small.png"),
		// 				ImageReference: &armdevtestlabs.GalleryImageReference{
		// 					Offer: to.Ptr("0001-com-ubuntu-server-focal"),
		// 					OSType: to.Ptr("Linux"),
		// 					Publisher: to.Ptr("canonical"),
		// 					SKU: to.Ptr("20_04-lts"),
		// 					Version: to.Ptr("latest"),
		// 				},
		// 			},
		// 		},
		// 		{
		// 			Name: to.Ptr("Windows 10 Enterprise, Version 20H2"),
		// 			Type: to.Ptr("Microsoft.DevTestLab/labs/galleryImages"),
		// 			ID: to.Ptr("/subscriptions/{subscriptionId}/resourcegroups/resourceGroupName/providers/microsoft.devtestlab/labs/{labName}/galleryimages/windows 10 enterprise, version 20h2"),
		// 			Location: to.Ptr("{location}"),
		// 			Tags: map[string]*string{
		// 				"tagName1": to.Ptr("tagValue1"),
		// 			},
		// 			Properties: &armdevtestlabs.GalleryImageProperties{
		// 				Description: to.Ptr("<p>This software is provided by Microsoft. Use of this software in Microsoft Azure is not permitted except under a volume licensing agreement with Microsoft. By clicking Create, I acknowledge that I or the company I work for is licensed to use this software under a volume licensing agreement with Microsoft and that the right to use it will be subject to that agreement.</p> <p><h3 class='msportalfx-text-header'>Legal Terms</h3></p><p>By clicking the Create button, I acknowledge that I am getting this software from Microsoft and that the <a href='https://www.microsoft.com/en-us/Useterms/Retail/Windows/10/UseTerms_Retail_Windows_10_English.htm' target='_blank'>legal terms</a> of Microsoft apply to it. Microsoft does not provide rights for third-party software. Also see the <a href='https://go.microsoft.com/fwlink/?LinkId=529552' target='_blank'>privacy statement</a> from Microsoft.</p>"),
		// 				Author: to.Ptr("Microsoft"),
		// 				CreatedDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-12-14T21:33:33.246Z"); return t}()),
		// 				Enabled: to.Ptr(true),
		// 				Icon: to.Ptr("https://106c4.wpc.azureedge.net/80106C4/Gallery-Prod/cdn/2015-02-24/prod20161101-microsoft-windowsazure-gallery/microsoftwindowsdesktop.windows-1020h2-ent.1.0.238/Icons/Small.png"),
		// 				ImageReference: &armdevtestlabs.GalleryImageReference{
		// 					Offer: to.Ptr("Windows-10"),
		// 					OSType: to.Ptr("Windows"),
		// 					Publisher: to.Ptr("MicrosoftWindowsDesktop"),
		// 					SKU: to.Ptr("20h2-ent"),
		// 					Version: to.Ptr("latest"),
		// 				},
		// 			},
		// 	}},
		// }
	}
}
Output:

type GalleryImagesClientListOptions added in v0.2.0

type GalleryImagesClientListOptions struct {
	// Specify the $expand query. Example: 'properties($select=author)'
	Expand *string

	// The filter to apply to the operation. Example: '$filter=contains(name,'myName')
	Filter *string

	// The ordering expression for the results, using OData notation. Example: '$orderby=name desc'
	Orderby *string

	// The maximum number of resources to return from the operation. Example: '$top=10'
	Top *int32
}

GalleryImagesClientListOptions contains the optional parameters for the GalleryImagesClient.NewListPager method.

type GalleryImagesClientListResponse added in v0.2.0

type GalleryImagesClientListResponse struct {
	// The response of a list operation.
	GalleryImageList
}

GalleryImagesClientListResponse contains the response from method GalleryImagesClient.NewListPager.

type GenerateArmTemplateRequest

type GenerateArmTemplateRequest struct {
	// Options for uploading the files for the artifact. UploadFilesAndGenerateSasTokens is the default value.
	FileUploadOptions *FileUploadOptions

	// The location of the virtual machine.
	Location *string

	// The parameters of the ARM template.
	Parameters []*ParameterInfo

	// The resource name of the virtual machine.
	VirtualMachineName *string
}

GenerateArmTemplateRequest - Parameters for generating an ARM template for deploying artifacts.

func (GenerateArmTemplateRequest) MarshalJSON

func (g GenerateArmTemplateRequest) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.Marshaller interface for type GenerateArmTemplateRequest.

func (*GenerateArmTemplateRequest) UnmarshalJSON added in v1.1.0

func (g *GenerateArmTemplateRequest) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the json.Unmarshaller interface for type GenerateArmTemplateRequest.

type GenerateUploadURIParameter

type GenerateUploadURIParameter struct {
	// The blob name of the upload URI.
	BlobName *string
}

GenerateUploadURIParameter - Properties for generating an upload URI.

func (GenerateUploadURIParameter) MarshalJSON added in v1.1.0

func (g GenerateUploadURIParameter) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.Marshaller interface for type GenerateUploadURIParameter.

func (*GenerateUploadURIParameter) UnmarshalJSON added in v1.1.0

func (g *GenerateUploadURIParameter) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the json.Unmarshaller interface for type GenerateUploadURIParameter.

type GenerateUploadURIResponse

type GenerateUploadURIResponse struct {
	// The upload URI for the VHD.
	UploadURI *string
}

GenerateUploadURIResponse - Response body for generating an upload URI.

func (GenerateUploadURIResponse) MarshalJSON added in v1.1.0

func (g GenerateUploadURIResponse) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.Marshaller interface for type GenerateUploadURIResponse.

func (*GenerateUploadURIResponse) UnmarshalJSON added in v1.1.0

func (g *GenerateUploadURIResponse) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the json.Unmarshaller interface for type GenerateUploadURIResponse.

type GlobalSchedulesClient

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

GlobalSchedulesClient contains the methods for the GlobalSchedules group. Don't use this type directly, use NewGlobalSchedulesClient() instead.

func NewGlobalSchedulesClient

func NewGlobalSchedulesClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*GlobalSchedulesClient, error)

NewGlobalSchedulesClient creates a new instance of GlobalSchedulesClient with the specified values.

  • subscriptionID - The subscription ID.
  • credential - used to authorize requests. Usually a credential from azidentity.
  • options - pass nil to accept the default values.

func (*GlobalSchedulesClient) BeginExecute

BeginExecute - Execute a schedule. This operation can take a while to complete. If the operation fails it returns an *azcore.ResponseError type.

Generated from API version 2018-09-15

  • resourceGroupName - The name of the resource group.
  • name - The name of the schedule.
  • options - GlobalSchedulesClientBeginExecuteOptions contains the optional parameters for the GlobalSchedulesClient.BeginExecute method.
Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/d55b8005f05b040b852c15e74a0f3e36494a15e1/specification/devtestlabs/resource-manager/Microsoft.DevTestLab/stable/2018-09-15/examples/GlobalSchedules_Execute.json

package main

import (
	"context"
	"log"

	"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
	"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/devtestlabs/armdevtestlabs"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armdevtestlabs.NewClientFactory("<subscription-id>", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	poller, err := clientFactory.NewGlobalSchedulesClient().BeginExecute(ctx, "resourceGroupName", "labvmautostart", 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 (*GlobalSchedulesClient) BeginRetarget

func (client *GlobalSchedulesClient) BeginRetarget(ctx context.Context, resourceGroupName string, name string, retargetScheduleProperties RetargetScheduleProperties, options *GlobalSchedulesClientBeginRetargetOptions) (*runtime.Poller[GlobalSchedulesClientRetargetResponse], error)

BeginRetarget - Updates a schedule's target resource Id. This operation can take a while to complete. If the operation fails it returns an *azcore.ResponseError type.

Generated from API version 2018-09-15

  • resourceGroupName - The name of the resource group.
  • name - The name of the schedule.
  • retargetScheduleProperties - Properties for retargeting a virtual machine schedule.
  • options - GlobalSchedulesClientBeginRetargetOptions contains the optional parameters for the GlobalSchedulesClient.BeginRetarget method.
Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/d55b8005f05b040b852c15e74a0f3e36494a15e1/specification/devtestlabs/resource-manager/Microsoft.DevTestLab/stable/2018-09-15/examples/GlobalSchedules_Retarget.json

package main

import (
	"context"
	"log"

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

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armdevtestlabs.NewClientFactory("<subscription-id>", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	poller, err := clientFactory.NewGlobalSchedulesClient().BeginRetarget(ctx, "resourceGroupName", "{scheduleName}", armdevtestlabs.RetargetScheduleProperties{
		CurrentResourceID: to.Ptr("/subscriptions/{subscriptionId}/resourcegroups/resourceGroupName/providers/microsoft.devtestlab/labs/{targetLab}"),
		TargetResourceID:  to.Ptr("/subscriptions/{subscriptionId}/resourcegroups/resourceGroupName/providers/microsoft.devtestlab/labs/{currentLab}"),
	}, 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 (*GlobalSchedulesClient) CreateOrUpdate

CreateOrUpdate - Create or replace an existing schedule. If the operation fails it returns an *azcore.ResponseError type.

Generated from API version 2018-09-15

  • resourceGroupName - The name of the resource group.
  • name - The name of the schedule.
  • schedule - A schedule.
  • options - GlobalSchedulesClientCreateOrUpdateOptions contains the optional parameters for the GlobalSchedulesClient.CreateOrUpdate method.
Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/d55b8005f05b040b852c15e74a0f3e36494a15e1/specification/devtestlabs/resource-manager/Microsoft.DevTestLab/stable/2018-09-15/examples/GlobalSchedules_CreateOrUpdate.json

package main

import (
	"context"
	"log"

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

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armdevtestlabs.NewClientFactory("<subscription-id>", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	res, err := clientFactory.NewGlobalSchedulesClient().CreateOrUpdate(ctx, "resourceGroupName", "labvmautostart", armdevtestlabs.Schedule{
		Properties: &armdevtestlabs.ScheduleProperties{
			Status:     to.Ptr(armdevtestlabs.EnableStatusEnabled),
			TaskType:   to.Ptr("LabVmsStartupTask"),
			TimeZoneID: to.Ptr("Hawaiian Standard Time"),
			WeeklyRecurrence: &armdevtestlabs.WeekDetails{
				Time: to.Ptr("0700"),
				Weekdays: []*string{
					to.Ptr("Monday"),
					to.Ptr("Tuesday"),
					to.Ptr("Wednesday"),
					to.Ptr("Thursday"),
					to.Ptr("Friday"),
					to.Ptr("Saturday")},
			},
		},
	}, 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.Schedule = armdevtestlabs.Schedule{
	// 	Name: to.Ptr("LabVmAutoStart"),
	// 	Type: to.Ptr("microsoft.devtestlab/labs/schedules"),
	// 	ID: to.Ptr("/subscriptions/{subscriptionId}/resourcegroups/resourceGroupName/providers/microsoft.devtestlab/labs/{labName}/schedules/labvmautostart"),
	// 	Location: to.Ptr("{location}"),
	// 	Tags: map[string]*string{
	// 		"tagName1": to.Ptr("tagValue1"),
	// 	},
	// 	Properties: &armdevtestlabs.ScheduleProperties{
	// 		CreatedDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-12-29T22:54:54.933Z"); return t}()),
	// 		NotificationSettings: &armdevtestlabs.NotificationSettings{
	// 			Status: to.Ptr(armdevtestlabs.EnableStatusDisabled),
	// 			TimeInMinutes: to.Ptr[int32](0),
	// 		},
	// 		ProvisioningState: to.Ptr("Succeeded"),
	// 		Status: to.Ptr(armdevtestlabs.EnableStatusEnabled),
	// 		TaskType: to.Ptr("LabVmsStartupTask"),
	// 		TimeZoneID: to.Ptr("Hawaiian Standard Time"),
	// 		UniqueIdentifier: to.Ptr("{id}"),
	// 		WeeklyRecurrence: &armdevtestlabs.WeekDetails{
	// 			Time: to.Ptr("0700"),
	// 			Weekdays: []*string{
	// 				to.Ptr("Monday"),
	// 				to.Ptr("Tuesday"),
	// 				to.Ptr("Wednesday"),
	// 				to.Ptr("Thursday"),
	// 				to.Ptr("Friday")},
	// 			},
	// 		},
	// 	}
}
Output:

func (*GlobalSchedulesClient) Delete

Delete - Delete schedule. If the operation fails it returns an *azcore.ResponseError type.

Generated from API version 2018-09-15

  • resourceGroupName - The name of the resource group.
  • name - The name of the schedule.
  • options - GlobalSchedulesClientDeleteOptions contains the optional parameters for the GlobalSchedulesClient.Delete method.
Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/d55b8005f05b040b852c15e74a0f3e36494a15e1/specification/devtestlabs/resource-manager/Microsoft.DevTestLab/stable/2018-09-15/examples/GlobalSchedules_Delete.json

package main

import (
	"context"
	"log"

	"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
	"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/devtestlabs/armdevtestlabs"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armdevtestlabs.NewClientFactory("<subscription-id>", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	_, err = clientFactory.NewGlobalSchedulesClient().Delete(ctx, "resourceGroupName", "labvmautostart", nil)
	if err != nil {
		log.Fatalf("failed to finish the request: %v", err)
	}
}
Output:

func (*GlobalSchedulesClient) Get

Get - Get schedule. If the operation fails it returns an *azcore.ResponseError type.

Generated from API version 2018-09-15

  • resourceGroupName - The name of the resource group.
  • name - The name of the schedule.
  • options - GlobalSchedulesClientGetOptions contains the optional parameters for the GlobalSchedulesClient.Get method.
Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/d55b8005f05b040b852c15e74a0f3e36494a15e1/specification/devtestlabs/resource-manager/Microsoft.DevTestLab/stable/2018-09-15/examples/GlobalSchedules_Get.json

package main

import (
	"context"
	"log"

	"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
	"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/devtestlabs/armdevtestlabs"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armdevtestlabs.NewClientFactory("<subscription-id>", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	res, err := clientFactory.NewGlobalSchedulesClient().Get(ctx, "resourceGroupName", "labvmautostart", &armdevtestlabs.GlobalSchedulesClientGetOptions{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.Schedule = armdevtestlabs.Schedule{
	// 	Name: to.Ptr("LabVmAutoStart"),
	// 	Type: to.Ptr("microsoft.devtestlab/labs/schedules"),
	// 	ID: to.Ptr("/subscriptions/{subscriptionId}/resourcegroups/resourceGroupName/providers/microsoft.devtestlab/labs/{labName}/schedules/labvmautostart"),
	// 	Location: to.Ptr("{location}"),
	// 	Tags: map[string]*string{
	// 		"tagName1": to.Ptr("tagValue1"),
	// 	},
	// 	Properties: &armdevtestlabs.ScheduleProperties{
	// 		CreatedDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-12-29T22:54:54.933Z"); return t}()),
	// 		NotificationSettings: &armdevtestlabs.NotificationSettings{
	// 			Status: to.Ptr(armdevtestlabs.EnableStatusDisabled),
	// 			TimeInMinutes: to.Ptr[int32](0),
	// 		},
	// 		ProvisioningState: to.Ptr("Succeeded"),
	// 		Status: to.Ptr(armdevtestlabs.EnableStatusEnabled),
	// 		TaskType: to.Ptr("LabVmsStartupTask"),
	// 		TimeZoneID: to.Ptr("Hawaiian Standard Time"),
	// 		UniqueIdentifier: to.Ptr("{id}"),
	// 		WeeklyRecurrence: &armdevtestlabs.WeekDetails{
	// 			Time: to.Ptr("0700"),
	// 			Weekdays: []*string{
	// 				to.Ptr("Monday"),
	// 				to.Ptr("Tuesday"),
	// 				to.Ptr("Wednesday"),
	// 				to.Ptr("Thursday"),
	// 				to.Ptr("Friday")},
	// 			},
	// 		},
	// 	}
}
Output:

func (*GlobalSchedulesClient) NewListByResourceGroupPager added in v0.4.0

NewListByResourceGroupPager - List schedules in a resource group.

Generated from API version 2018-09-15

  • resourceGroupName - The name of the resource group.
  • options - GlobalSchedulesClientListByResourceGroupOptions contains the optional parameters for the GlobalSchedulesClient.NewListByResourceGroupPager method.
Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/d55b8005f05b040b852c15e74a0f3e36494a15e1/specification/devtestlabs/resource-manager/Microsoft.DevTestLab/stable/2018-09-15/examples/GlobalSchedules_ListByResourceGroup.json

package main

import (
	"context"
	"log"

	"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
	"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/devtestlabs/armdevtestlabs"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armdevtestlabs.NewClientFactory("<subscription-id>", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	pager := clientFactory.NewGlobalSchedulesClient().NewListByResourceGroupPager("resourceGroupName", &armdevtestlabs.GlobalSchedulesClientListByResourceGroupOptions{Expand: nil,
		Filter:  nil,
		Top:     nil,
		Orderby: 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.ScheduleList = armdevtestlabs.ScheduleList{
		// 	Value: []*armdevtestlabs.Schedule{
		// 		{
		// 			Name: to.Ptr("LabVmAutoStart"),
		// 			Type: to.Ptr("microsoft.devtestlab/labs/schedules"),
		// 			ID: to.Ptr("/subscriptions/{subscriptionId}/resourcegroups/resourceGroupName/providers/microsoft.devtestlab/labs/{labName}/schedules/labvmautostart"),
		// 			Location: to.Ptr("{location}"),
		// 			Properties: &armdevtestlabs.ScheduleProperties{
		// 				CreatedDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-12-29T22:54:54.933Z"); return t}()),
		// 				NotificationSettings: &armdevtestlabs.NotificationSettings{
		// 					Status: to.Ptr(armdevtestlabs.EnableStatusDisabled),
		// 					TimeInMinutes: to.Ptr[int32](0),
		// 				},
		// 				ProvisioningState: to.Ptr("Succeeded"),
		// 				Status: to.Ptr(armdevtestlabs.EnableStatusEnabled),
		// 				TaskType: to.Ptr("LabVmsStartupTask"),
		// 				TimeZoneID: to.Ptr("Hawaiian Standard Time"),
		// 				UniqueIdentifier: to.Ptr("{uniqueIdentifier}"),
		// 				WeeklyRecurrence: &armdevtestlabs.WeekDetails{
		// 					Time: to.Ptr("0700"),
		// 					Weekdays: []*string{
		// 						to.Ptr("Monday"),
		// 						to.Ptr("Tuesday"),
		// 						to.Ptr("Wednesday"),
		// 						to.Ptr("Thursday"),
		// 						to.Ptr("Friday")},
		// 					},
		// 				},
		// 		}},
		// 	}
	}
}
Output:

func (*GlobalSchedulesClient) NewListBySubscriptionPager added in v0.4.0

NewListBySubscriptionPager - List schedules in a subscription.

Generated from API version 2018-09-15

  • options - GlobalSchedulesClientListBySubscriptionOptions contains the optional parameters for the GlobalSchedulesClient.NewListBySubscriptionPager method.
Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/d55b8005f05b040b852c15e74a0f3e36494a15e1/specification/devtestlabs/resource-manager/Microsoft.DevTestLab/stable/2018-09-15/examples/GlobalSchedules_ListBySubscription.json

package main

import (
	"context"
	"log"

	"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
	"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/devtestlabs/armdevtestlabs"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armdevtestlabs.NewClientFactory("<subscription-id>", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	pager := clientFactory.NewGlobalSchedulesClient().NewListBySubscriptionPager(&armdevtestlabs.GlobalSchedulesClientListBySubscriptionOptions{Expand: nil,
		Filter:  nil,
		Top:     nil,
		Orderby: 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.ScheduleList = armdevtestlabs.ScheduleList{
		// }
	}
}
Output:

func (*GlobalSchedulesClient) Update

Update - Allows modifying tags of schedules. All other properties will be ignored. If the operation fails it returns an *azcore.ResponseError type.

Generated from API version 2018-09-15

  • resourceGroupName - The name of the resource group.
  • name - The name of the schedule.
  • schedule - A schedule.
  • options - GlobalSchedulesClientUpdateOptions contains the optional parameters for the GlobalSchedulesClient.Update method.
Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/d55b8005f05b040b852c15e74a0f3e36494a15e1/specification/devtestlabs/resource-manager/Microsoft.DevTestLab/stable/2018-09-15/examples/GlobalSchedules_Update.json

package main

import (
	"context"
	"log"

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

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armdevtestlabs.NewClientFactory("<subscription-id>", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	res, err := clientFactory.NewGlobalSchedulesClient().Update(ctx, "resourceGroupName", "labvmautostart", armdevtestlabs.ScheduleFragment{
		Tags: map[string]*string{
			"tagName1": to.Ptr("tagValue1"),
		},
	}, 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.Schedule = armdevtestlabs.Schedule{
	// 	Name: to.Ptr("LabVmAutoStart"),
	// 	Type: to.Ptr("microsoft.devtestlab/labs/schedules"),
	// 	ID: to.Ptr("/subscriptions/{subscriptionId}/resourcegroups/resourceGroupName/providers/microsoft.devtestlab/labs/{labName}/schedules/labvmautostart"),
	// 	Location: to.Ptr("{location}"),
	// 	Tags: map[string]*string{
	// 		"tagName1": to.Ptr("tagValue1"),
	// 	},
	// 	Properties: &armdevtestlabs.ScheduleProperties{
	// 		CreatedDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-12-29T22:54:54.933Z"); return t}()),
	// 		NotificationSettings: &armdevtestlabs.NotificationSettings{
	// 			Status: to.Ptr(armdevtestlabs.EnableStatusDisabled),
	// 			TimeInMinutes: to.Ptr[int32](0),
	// 		},
	// 		ProvisioningState: to.Ptr("Succeeded"),
	// 		Status: to.Ptr(armdevtestlabs.EnableStatusEnabled),
	// 		TaskType: to.Ptr("LabVmsStartupTask"),
	// 		TimeZoneID: to.Ptr("Hawaiian Standard Time"),
	// 		UniqueIdentifier: to.Ptr("{uniqueIdentifier}"),
	// 		WeeklyRecurrence: &armdevtestlabs.WeekDetails{
	// 			Time: to.Ptr("0700"),
	// 			Weekdays: []*string{
	// 				to.Ptr("Monday"),
	// 				to.Ptr("Tuesday"),
	// 				to.Ptr("Wednesday"),
	// 				to.Ptr("Thursday"),
	// 				to.Ptr("Friday")},
	// 			},
	// 		},
	// 	}
}
Output:

type GlobalSchedulesClientBeginExecuteOptions added in v0.2.0

type GlobalSchedulesClientBeginExecuteOptions struct {
	// Resumes the LRO from the provided token.
	ResumeToken string
}

GlobalSchedulesClientBeginExecuteOptions contains the optional parameters for the GlobalSchedulesClient.BeginExecute method.

type GlobalSchedulesClientBeginRetargetOptions added in v0.2.0

type GlobalSchedulesClientBeginRetargetOptions struct {
	// Resumes the LRO from the provided token.
	ResumeToken string
}

GlobalSchedulesClientBeginRetargetOptions contains the optional parameters for the GlobalSchedulesClient.BeginRetarget method.

type GlobalSchedulesClientCreateOrUpdateOptions added in v0.2.0

type GlobalSchedulesClientCreateOrUpdateOptions struct {
}

GlobalSchedulesClientCreateOrUpdateOptions contains the optional parameters for the GlobalSchedulesClient.CreateOrUpdate method.

type GlobalSchedulesClientCreateOrUpdateResponse added in v0.2.0

type GlobalSchedulesClientCreateOrUpdateResponse struct {
	// A schedule.
	Schedule
}

GlobalSchedulesClientCreateOrUpdateResponse contains the response from method GlobalSchedulesClient.CreateOrUpdate.

type GlobalSchedulesClientDeleteOptions added in v0.2.0

type GlobalSchedulesClientDeleteOptions struct {
}

GlobalSchedulesClientDeleteOptions contains the optional parameters for the GlobalSchedulesClient.Delete method.

type GlobalSchedulesClientDeleteResponse added in v0.2.0

type GlobalSchedulesClientDeleteResponse struct {
}

GlobalSchedulesClientDeleteResponse contains the response from method GlobalSchedulesClient.Delete.

type GlobalSchedulesClientExecuteResponse added in v0.2.0

type GlobalSchedulesClientExecuteResponse struct {
}

GlobalSchedulesClientExecuteResponse contains the response from method GlobalSchedulesClient.BeginExecute.

type GlobalSchedulesClientGetOptions added in v0.2.0

type GlobalSchedulesClientGetOptions struct {
	// Specify the $expand query. Example: 'properties($select=status)'
	Expand *string
}

GlobalSchedulesClientGetOptions contains the optional parameters for the GlobalSchedulesClient.Get method.

type GlobalSchedulesClientGetResponse added in v0.2.0

type GlobalSchedulesClientGetResponse struct {
	// A schedule.
	Schedule
}

GlobalSchedulesClientGetResponse contains the response from method GlobalSchedulesClient.Get.

type GlobalSchedulesClientListByResourceGroupOptions added in v0.2.0

type GlobalSchedulesClientListByResourceGroupOptions struct {
	// Specify the $expand query. Example: 'properties($select=status)'
	Expand *string

	// The filter to apply to the operation. Example: '$filter=contains(name,'myName')
	Filter *string

	// The ordering expression for the results, using OData notation. Example: '$orderby=name desc'
	Orderby *string

	// The maximum number of resources to return from the operation. Example: '$top=10'
	Top *int32
}

GlobalSchedulesClientListByResourceGroupOptions contains the optional parameters for the GlobalSchedulesClient.NewListByResourceGroupPager method.

type GlobalSchedulesClientListByResourceGroupResponse added in v0.2.0

type GlobalSchedulesClientListByResourceGroupResponse struct {
	// The response of a list operation.
	ScheduleList
}

GlobalSchedulesClientListByResourceGroupResponse contains the response from method GlobalSchedulesClient.NewListByResourceGroupPager.

type GlobalSchedulesClientListBySubscriptionOptions added in v0.2.0

type GlobalSchedulesClientListBySubscriptionOptions struct {
	// Specify the $expand query. Example: 'properties($select=status)'
	Expand *string

	// The filter to apply to the operation. Example: '$filter=contains(name,'myName')
	Filter *string

	// The ordering expression for the results, using OData notation. Example: '$orderby=name desc'
	Orderby *string

	// The maximum number of resources to return from the operation. Example: '$top=10'
	Top *int32
}

GlobalSchedulesClientListBySubscriptionOptions contains the optional parameters for the GlobalSchedulesClient.NewListBySubscriptionPager method.

type GlobalSchedulesClientListBySubscriptionResponse added in v0.2.0

type GlobalSchedulesClientListBySubscriptionResponse struct {
	// The response of a list operation.
	ScheduleList
}

GlobalSchedulesClientListBySubscriptionResponse contains the response from method GlobalSchedulesClient.NewListBySubscriptionPager.

type GlobalSchedulesClientRetargetResponse added in v0.2.0

type GlobalSchedulesClientRetargetResponse struct {
}

GlobalSchedulesClientRetargetResponse contains the response from method GlobalSchedulesClient.BeginRetarget.

type GlobalSchedulesClientUpdateOptions added in v0.2.0

type GlobalSchedulesClientUpdateOptions struct {
}

GlobalSchedulesClientUpdateOptions contains the optional parameters for the GlobalSchedulesClient.Update method.

type GlobalSchedulesClientUpdateResponse added in v0.2.0

type GlobalSchedulesClientUpdateResponse struct {
	// A schedule.
	Schedule
}

GlobalSchedulesClientUpdateResponse contains the response from method GlobalSchedulesClient.Update.

type HTTPStatusCode

type HTTPStatusCode string

HTTPStatusCode - The status code for the operation.

const (
	HTTPStatusCodeAccepted                     HTTPStatusCode = "Accepted"
	HTTPStatusCodeAmbiguous                    HTTPStatusCode = "Ambiguous"
	HTTPStatusCodeBadGateway                   HTTPStatusCode = "BadGateway"
	HTTPStatusCodeBadRequest                   HTTPStatusCode = "BadRequest"
	HTTPStatusCodeConflict                     HTTPStatusCode = "Conflict"
	HTTPStatusCodeContinue                     HTTPStatusCode = "Continue"
	HTTPStatusCodeCreated                      HTTPStatusCode = "Created"
	HTTPStatusCodeExpectationFailed            HTTPStatusCode = "ExpectationFailed"
	HTTPStatusCodeForbidden                    HTTPStatusCode = "Forbidden"
	HTTPStatusCodeFound                        HTTPStatusCode = "Found"
	HTTPStatusCodeGatewayTimeout               HTTPStatusCode = "GatewayTimeout"
	HTTPStatusCodeGone                         HTTPStatusCode = "Gone"
	HTTPStatusCodeHTTPVersionNotSupported      HTTPStatusCode = "HttpVersionNotSupported"
	HTTPStatusCodeInternalServerError          HTTPStatusCode = "InternalServerError"
	HTTPStatusCodeLengthRequired               HTTPStatusCode = "LengthRequired"
	HTTPStatusCodeMethodNotAllowed             HTTPStatusCode = "MethodNotAllowed"
	HTTPStatusCodeMoved                        HTTPStatusCode = "Moved"
	HTTPStatusCodeMovedPermanently             HTTPStatusCode = "MovedPermanently"
	HTTPStatusCodeMultipleChoices              HTTPStatusCode = "MultipleChoices"
	HTTPStatusCodeNoContent                    HTTPStatusCode = "NoContent"
	HTTPStatusCodeNonAuthoritativeInformation  HTTPStatusCode = "NonAuthoritativeInformation"
	HTTPStatusCodeNotAcceptable                HTTPStatusCode = "NotAcceptable"
	HTTPStatusCodeNotFound                     HTTPStatusCode = "NotFound"
	HTTPStatusCodeNotImplemented               HTTPStatusCode = "NotImplemented"
	HTTPStatusCodeNotModified                  HTTPStatusCode = "NotModified"
	HTTPStatusCodeOK                           HTTPStatusCode = "OK"
	HTTPStatusCodePartialContent               HTTPStatusCode = "PartialContent"
	HTTPStatusCodePaymentRequired              HTTPStatusCode = "PaymentRequired"
	HTTPStatusCodePreconditionFailed           HTTPStatusCode = "PreconditionFailed"
	HTTPStatusCodeProxyAuthenticationRequired  HTTPStatusCode = "ProxyAuthenticationRequired"
	HTTPStatusCodeRedirect                     HTTPStatusCode = "Redirect"
	HTTPStatusCodeRedirectKeepVerb             HTTPStatusCode = "RedirectKeepVerb"
	HTTPStatusCodeRedirectMethod               HTTPStatusCode = "RedirectMethod"
	HTTPStatusCodeRequestEntityTooLarge        HTTPStatusCode = "RequestEntityTooLarge"
	HTTPStatusCodeRequestTimeout               HTTPStatusCode = "RequestTimeout"
	HTTPStatusCodeRequestURITooLong            HTTPStatusCode = "RequestUriTooLong"
	HTTPStatusCodeRequestedRangeNotSatisfiable HTTPStatusCode = "RequestedRangeNotSatisfiable"
	HTTPStatusCodeResetContent                 HTTPStatusCode = "ResetContent"
	HTTPStatusCodeSeeOther                     HTTPStatusCode = "SeeOther"
	HTTPStatusCodeServiceUnavailable           HTTPStatusCode = "ServiceUnavailable"
	HTTPStatusCodeSwitchingProtocols           HTTPStatusCode = "SwitchingProtocols"
	HTTPStatusCodeTemporaryRedirect            HTTPStatusCode = "TemporaryRedirect"
	HTTPStatusCodeUnauthorized                 HTTPStatusCode = "Unauthorized"
	HTTPStatusCodeUnsupportedMediaType         HTTPStatusCode = "UnsupportedMediaType"
	HTTPStatusCodeUnused                       HTTPStatusCode = "Unused"
	HTTPStatusCodeUpgradeRequired              HTTPStatusCode = "UpgradeRequired"
	HTTPStatusCodeUseProxy                     HTTPStatusCode = "UseProxy"
)

func PossibleHTTPStatusCodeValues

func PossibleHTTPStatusCodeValues() []HTTPStatusCode

PossibleHTTPStatusCodeValues returns the possible values for the HTTPStatusCode const type.

type HostCachingOptions

type HostCachingOptions string

HostCachingOptions - Caching option for a data disk (i.e. None, ReadOnly, ReadWrite).

const (
	HostCachingOptionsNone      HostCachingOptions = "None"
	HostCachingOptionsReadOnly  HostCachingOptions = "ReadOnly"
	HostCachingOptionsReadWrite HostCachingOptions = "ReadWrite"
)

func PossibleHostCachingOptionsValues

func PossibleHostCachingOptionsValues() []HostCachingOptions

PossibleHostCachingOptionsValues returns the possible values for the HostCachingOptions const type.

type HourDetails

type HourDetails struct {
	// Minutes of the hour the schedule will run.
	Minute *int32
}

HourDetails - Properties of an hourly schedule.

func (HourDetails) MarshalJSON added in v1.1.0

func (h HourDetails) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.Marshaller interface for type HourDetails.

func (*HourDetails) UnmarshalJSON added in v1.1.0

func (h *HourDetails) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the json.Unmarshaller interface for type HourDetails.

type IdentityProperties

type IdentityProperties struct {
	// The client secret URL of the identity.
	ClientSecretURL *string

	// The principal id of resource identity.
	PrincipalID *string

	// The tenant identifier of resource.
	TenantID *string

	// Managed identity.
	Type *ManagedIdentityType
}

IdentityProperties - Properties of a managed identity

func (IdentityProperties) MarshalJSON added in v1.1.0

func (i IdentityProperties) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.Marshaller interface for type IdentityProperties.

func (*IdentityProperties) UnmarshalJSON added in v1.1.0

func (i *IdentityProperties) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the json.Unmarshaller interface for type IdentityProperties.

type ImportLabVirtualMachineRequest

type ImportLabVirtualMachineRequest struct {
	// The name of the virtual machine in the destination lab
	DestinationVirtualMachineName *string

	// The full resource ID of the virtual machine to be imported.
	SourceVirtualMachineResourceID *string
}

ImportLabVirtualMachineRequest - This represents the payload required to import a virtual machine from a different lab into the current one

func (ImportLabVirtualMachineRequest) MarshalJSON added in v1.1.0

func (i ImportLabVirtualMachineRequest) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.Marshaller interface for type ImportLabVirtualMachineRequest.

func (*ImportLabVirtualMachineRequest) UnmarshalJSON added in v1.1.0

func (i *ImportLabVirtualMachineRequest) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the json.Unmarshaller interface for type ImportLabVirtualMachineRequest.

type InboundNatRule

type InboundNatRule struct {
	// The port to which the external traffic will be redirected.
	BackendPort *int32

	// The external endpoint port of the inbound connection. Possible values range between 1 and 65535, inclusive. If unspecified,
	// a value will be allocated automatically.
	FrontendPort *int32

	// The transport protocol for the endpoint.
	TransportProtocol *TransportProtocol
}

InboundNatRule - A rule for NAT - exposing a VM's port (backendPort) on the public IP address using a load balancer.

func (InboundNatRule) MarshalJSON added in v1.1.0

func (i InboundNatRule) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.Marshaller interface for type InboundNatRule.

func (*InboundNatRule) UnmarshalJSON added in v1.1.0

func (i *InboundNatRule) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the json.Unmarshaller interface for type InboundNatRule.

type Lab

type Lab struct {
	// The location of the resource.
	Location *string

	// The properties of the resource.
	Properties *LabProperties

	// The tags of the resource.
	Tags map[string]*string

	// READ-ONLY; The identifier of the resource.
	ID *string

	// READ-ONLY; The name of the resource.
	Name *string

	// READ-ONLY; The type of the resource.
	Type *string
}

Lab - A lab.

func (Lab) MarshalJSON

func (l Lab) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.Marshaller interface for type Lab.

func (*Lab) UnmarshalJSON added in v1.1.0

func (l *Lab) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the json.Unmarshaller interface for type Lab.

type LabAnnouncementProperties

type LabAnnouncementProperties struct {
	// Is the lab announcement active/enabled at this time?
	Enabled *EnableStatus

	// The time at which the announcement expires (null for never)
	ExpirationDate *time.Time

	// Has this announcement expired?
	Expired *bool

	// The markdown text (if any) that this lab displays in the UI. If left empty/null, nothing will be shown.
	Markdown *string

	// The plain text title for the lab announcement
	Title *string

	// READ-ONLY; The provisioning status of the resource.
	ProvisioningState *string

	// READ-ONLY; The unique immutable identifier of a resource (Guid).
	UniqueIdentifier *string
}

LabAnnouncementProperties - Properties of a lab's announcement banner

func (LabAnnouncementProperties) MarshalJSON

func (l LabAnnouncementProperties) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.Marshaller interface for type LabAnnouncementProperties.

func (*LabAnnouncementProperties) UnmarshalJSON

func (l *LabAnnouncementProperties) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the json.Unmarshaller interface for type LabAnnouncementProperties.

type LabCost

type LabCost struct {
	// REQUIRED; The properties of the resource.
	Properties *LabCostProperties

	// The location of the resource.
	Location *string

	// The tags of the resource.
	Tags map[string]*string

	// READ-ONLY; The identifier of the resource.
	ID *string

	// READ-ONLY; The name of the resource.
	Name *string

	// READ-ONLY; The type of the resource.
	Type *string
}

LabCost - A cost item.

func (LabCost) MarshalJSON

func (l LabCost) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.Marshaller interface for type LabCost.

func (*LabCost) UnmarshalJSON added in v1.1.0

func (l *LabCost) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the json.Unmarshaller interface for type LabCost.

type LabCostDetailsProperties

type LabCostDetailsProperties struct {
	// The cost component of the cost item.
	Cost *float64

	// The type of the cost.
	CostType *CostType

	// The date of the cost item.
	Date *time.Time
}

LabCostDetailsProperties - The properties of a lab cost item.

func (LabCostDetailsProperties) MarshalJSON

func (l LabCostDetailsProperties) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.Marshaller interface for type LabCostDetailsProperties.

func (*LabCostDetailsProperties) UnmarshalJSON

func (l *LabCostDetailsProperties) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the json.Unmarshaller interface for type LabCostDetailsProperties.

type LabCostProperties

type LabCostProperties struct {
	// The creation date of the cost.
	CreatedDate *time.Time

	// The currency code of the cost.
	CurrencyCode *string

	// The end time of the cost data.
	EndDateTime *time.Time

	// The start time of the cost data.
	StartDateTime *time.Time

	// The target cost properties
	TargetCost *TargetCostProperties

	// READ-ONLY; The lab cost details component of the cost data.
	LabCostDetails []*LabCostDetailsProperties

	// READ-ONLY; The lab cost summary component of the cost data.
	LabCostSummary *LabCostSummaryProperties

	// READ-ONLY; The provisioning status of the resource.
	ProvisioningState *string

	// READ-ONLY; The resource cost component of the cost data.
	ResourceCosts []*LabResourceCostProperties

	// READ-ONLY; The unique immutable identifier of a resource (Guid).
	UniqueIdentifier *string
}

LabCostProperties - Properties of a cost item.

func (LabCostProperties) MarshalJSON

func (l LabCostProperties) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.Marshaller interface for type LabCostProperties.

func (*LabCostProperties) UnmarshalJSON

func (l *LabCostProperties) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the json.Unmarshaller interface for type LabCostProperties.

type LabCostSummaryProperties

type LabCostSummaryProperties struct {
	// The cost component of the cost item.
	EstimatedLabCost *float64
}

LabCostSummaryProperties - The properties of the cost summary.

func (LabCostSummaryProperties) MarshalJSON added in v1.1.0

func (l LabCostSummaryProperties) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.Marshaller interface for type LabCostSummaryProperties.

func (*LabCostSummaryProperties) UnmarshalJSON added in v1.1.0

func (l *LabCostSummaryProperties) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the json.Unmarshaller interface for type LabCostSummaryProperties.

type LabFragment

type LabFragment struct {
	// The tags of the resource.
	Tags map[string]*string
}

LabFragment - A lab.

func (LabFragment) MarshalJSON added in v0.2.0

func (l LabFragment) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.Marshaller interface for type LabFragment.

func (*LabFragment) UnmarshalJSON added in v1.1.0

func (l *LabFragment) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the json.Unmarshaller interface for type LabFragment.

type LabList

type LabList struct {
	// Link for next set of results.
	NextLink *string

	// Results of the list operation.
	Value []*Lab
}

LabList - The response of a list operation.

func (LabList) MarshalJSON

func (l LabList) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.Marshaller interface for type LabList.

func (*LabList) UnmarshalJSON added in v1.1.0

func (l *LabList) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the json.Unmarshaller interface for type LabList.

type LabProperties

type LabProperties struct {
	// The properties of any lab announcement associated with this lab
	Announcement *LabAnnouncementProperties

	// The access rights to be granted to the user when provisioning an environment
	EnvironmentPermission *EnvironmentPermission

	// Extended properties of the lab used for experimental features
	ExtendedProperties map[string]*string

	// Type of storage used by the lab. It can be either Premium or Standard. Default is Premium.
	LabStorageType *StorageType

	// The ordered list of artifact resource IDs that should be applied on all Linux VM creations by default, prior to the artifacts
	// specified by the user.
	MandatoryArtifactsResourceIDsLinux []*string

	// The ordered list of artifact resource IDs that should be applied on all Windows VM creations by default, prior to the artifacts
	// specified by the user.
	MandatoryArtifactsResourceIDsWindows []*string

	// The setting to enable usage of premium data disks. When its value is 'Enabled', creation of standard or premium data disks
	// is allowed. When its value is 'Disabled', only creation of standard data
	// disks is allowed.
	PremiumDataDisks *PremiumDataDisk

	// The properties of any lab support message associated with this lab
	Support *LabSupportProperties

	// READ-ONLY; The lab's artifact storage account.
	ArtifactsStorageAccount *string

	// READ-ONLY; The creation date of the lab.
	CreatedDate *time.Time

	// READ-ONLY; The lab's default premium storage account.
	DefaultPremiumStorageAccount *string

	// READ-ONLY; The lab's default storage account.
	DefaultStorageAccount *string

	// READ-ONLY; The load balancer used to for lab VMs that use shared IP address.
	LoadBalancerID *string

	// READ-ONLY; The Network Security Group attached to the lab VMs Network interfaces to restrict open ports.
	NetworkSecurityGroupID *string

	// READ-ONLY; The lab's premium data disk storage account.
	PremiumDataDiskStorageAccount *string

	// READ-ONLY; The provisioning status of the resource.
	ProvisioningState *string

	// READ-ONLY; The public IP address for the lab's load balancer.
	PublicIPID *string

	// READ-ONLY; The unique immutable identifier of a resource (Guid).
	UniqueIdentifier *string

	// READ-ONLY; The resource group in which all new lab virtual machines will be created. To let DevTest Labs manage resource
	// group creation, set this value to null.
	VMCreationResourceGroup *string

	// READ-ONLY; The lab's Key vault.
	VaultName *string
}

LabProperties - Properties of a lab.

func (LabProperties) MarshalJSON

func (l LabProperties) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.Marshaller interface for type LabProperties.

func (*LabProperties) UnmarshalJSON

func (l *LabProperties) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the json.Unmarshaller interface for type LabProperties.

type LabResourceCostProperties

type LabResourceCostProperties struct {
	// The ID of the external resource
	ExternalResourceID *string

	// The cost component of the resource cost item.
	ResourceCost *float64

	// The ID of the resource
	ResourceID *string

	// The owner of the resource (ex. janedoe@microsoft.com)
	ResourceOwner *string

	// The category of the resource (ex. PremiumLRS, StandardDS1)
	ResourcePricingTier *string

	// The status of the resource (ex. Active)
	ResourceStatus *string

	// The logical resource type (ex. virtualmachine, storageaccount)
	ResourceType *string

	// The unique identifier of the resource.
	ResourceUID *string

	// The name of the resource.
	Resourcename *string
}

LabResourceCostProperties - The properties of a resource cost item.

func (LabResourceCostProperties) MarshalJSON added in v1.1.0

func (l LabResourceCostProperties) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.Marshaller interface for type LabResourceCostProperties.

func (*LabResourceCostProperties) UnmarshalJSON added in v1.1.0

func (l *LabResourceCostProperties) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the json.Unmarshaller interface for type LabResourceCostProperties.

type LabSupportProperties

type LabSupportProperties struct {
	// Is the lab support banner active/enabled at this time?
	Enabled *EnableStatus

	// The markdown text (if any) that this lab displays in the UI. If left empty/null, nothing will be shown.
	Markdown *string
}

LabSupportProperties - Properties of a lab's support banner

func (LabSupportProperties) MarshalJSON added in v1.1.0

func (l LabSupportProperties) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.Marshaller interface for type LabSupportProperties.

func (*LabSupportProperties) UnmarshalJSON added in v1.1.0

func (l *LabSupportProperties) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the json.Unmarshaller interface for type LabSupportProperties.

type LabVhd

type LabVhd struct {
	// The URI to the VHD.
	ID *string
}

LabVhd - Properties of a VHD in the lab.

func (LabVhd) MarshalJSON added in v1.1.0

func (l LabVhd) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.Marshaller interface for type LabVhd.

func (*LabVhd) UnmarshalJSON added in v1.1.0

func (l *LabVhd) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the json.Unmarshaller interface for type LabVhd.

type LabVhdList

type LabVhdList struct {
	// Link for next set of results.
	NextLink *string

	// Results of the list operation.
	Value []*LabVhd
}

LabVhdList - The response of a list operation.

func (LabVhdList) MarshalJSON

func (l LabVhdList) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.Marshaller interface for type LabVhdList.

func (*LabVhdList) UnmarshalJSON added in v1.1.0

func (l *LabVhdList) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the json.Unmarshaller interface for type LabVhdList.

type LabVirtualMachine

type LabVirtualMachine struct {
	// REQUIRED; The properties of the resource.
	Properties *LabVirtualMachineProperties

	// The location of the resource.
	Location *string

	// The tags of the resource.
	Tags map[string]*string

	// READ-ONLY; The identifier of the resource.
	ID *string

	// READ-ONLY; The name of the resource.
	Name *string

	// READ-ONLY; The type of the resource.
	Type *string
}

LabVirtualMachine - A virtual machine.

func (LabVirtualMachine) MarshalJSON

func (l LabVirtualMachine) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.Marshaller interface for type LabVirtualMachine.

func (*LabVirtualMachine) UnmarshalJSON added in v1.1.0

func (l *LabVirtualMachine) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the json.Unmarshaller interface for type LabVirtualMachine.

type LabVirtualMachineCreationParameter

type LabVirtualMachineCreationParameter struct {
	// The location of the new virtual machine or environment
	Location *string

	// The name of the virtual machine or environment
	Name *string

	// The properties of the resource.
	Properties *LabVirtualMachineCreationParameterProperties

	// The tags of the resource.
	Tags map[string]*string
}

LabVirtualMachineCreationParameter - Properties for creating a virtual machine.

func (LabVirtualMachineCreationParameter) MarshalJSON

func (l LabVirtualMachineCreationParameter) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.Marshaller interface for type LabVirtualMachineCreationParameter.

func (*LabVirtualMachineCreationParameter) UnmarshalJSON added in v1.1.0

func (l *LabVirtualMachineCreationParameter) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the json.Unmarshaller interface for type LabVirtualMachineCreationParameter.

type LabVirtualMachineCreationParameterProperties

type LabVirtualMachineCreationParameterProperties struct {
	// Indicates whether another user can take ownership of the virtual machine
	AllowClaim *bool

	// The artifacts to be installed on the virtual machine.
	Artifacts []*ArtifactInstallProperties

	// The number of virtual machine instances to create.
	BulkCreationParameters *BulkCreationParameters

	// The creation date of the virtual machine.
	CreatedDate *time.Time

	// The custom image identifier of the virtual machine.
	CustomImageID *string

	// New or existing data disks to attach to the virtual machine after creation
	DataDiskParameters []*DataDiskProperties

	// Indicates whether the virtual machine is to be created without a public IP address.
	DisallowPublicIPAddress *bool

	// The resource ID of the environment that contains this virtual machine, if any.
	EnvironmentID *string

	// The expiration date for VM.
	ExpirationDate *time.Time

	// The Microsoft Azure Marketplace image reference of the virtual machine.
	GalleryImageReference *GalleryImageReference

	// Indicates whether this virtual machine uses an SSH key for authentication.
	IsAuthenticationWithSSHKey *bool

	// The lab subnet name of the virtual machine.
	LabSubnetName *string

	// The lab virtual network identifier of the virtual machine.
	LabVirtualNetworkID *string

	// The network interface properties.
	NetworkInterface *NetworkInterfaceProperties

	// The notes of the virtual machine.
	Notes *string

	// The object identifier of the owner of the virtual machine.
	OwnerObjectID *string

	// The user principal name of the virtual machine owner.
	OwnerUserPrincipalName *string

	// The password of the virtual machine administrator.
	Password *string

	// The id of the plan associated with the virtual machine image
	PlanID *string

	// The SSH key of the virtual machine administrator.
	SSHKey *string

	// Virtual Machine schedules to be created
	ScheduleParameters []*ScheduleCreationParameter

	// The size of the virtual machine.
	Size *string

	// Storage type to use for virtual machine (i.e. Standard, Premium).
	StorageType *string

	// The user name of the virtual machine.
	UserName *string
}

LabVirtualMachineCreationParameterProperties - Properties for virtual machine creation.

func (LabVirtualMachineCreationParameterProperties) MarshalJSON

MarshalJSON implements the json.Marshaller interface for type LabVirtualMachineCreationParameterProperties.

func (*LabVirtualMachineCreationParameterProperties) UnmarshalJSON

func (l *LabVirtualMachineCreationParameterProperties) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the json.Unmarshaller interface for type LabVirtualMachineCreationParameterProperties.

type LabVirtualMachineFragment

type LabVirtualMachineFragment struct {
	// The tags of the resource.
	Tags map[string]*string
}

LabVirtualMachineFragment - A virtual machine.

func (LabVirtualMachineFragment) MarshalJSON added in v0.2.0

func (l LabVirtualMachineFragment) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.Marshaller interface for type LabVirtualMachineFragment.

func (*LabVirtualMachineFragment) UnmarshalJSON added in v1.1.0

func (l *LabVirtualMachineFragment) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the json.Unmarshaller interface for type LabVirtualMachineFragment.

type LabVirtualMachineList

type LabVirtualMachineList struct {
	// Link for next set of results.
	NextLink *string

	// Results of the list operation.
	Value []*LabVirtualMachine
}

LabVirtualMachineList - The response of a list operation.

func (LabVirtualMachineList) MarshalJSON

func (l LabVirtualMachineList) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.Marshaller interface for type LabVirtualMachineList.

func (*LabVirtualMachineList) UnmarshalJSON added in v1.1.0

func (l *LabVirtualMachineList) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the json.Unmarshaller interface for type LabVirtualMachineList.

type LabVirtualMachineProperties

type LabVirtualMachineProperties struct {
	// Indicates whether another user can take ownership of the virtual machine
	AllowClaim *bool

	// The artifacts to be installed on the virtual machine.
	Artifacts []*ArtifactInstallProperties

	// The creation date of the virtual machine.
	CreatedDate *time.Time

	// The custom image identifier of the virtual machine.
	CustomImageID *string

	// New or existing data disks to attach to the virtual machine after creation
	DataDiskParameters []*DataDiskProperties

	// Indicates whether the virtual machine is to be created without a public IP address.
	DisallowPublicIPAddress *bool

	// The resource ID of the environment that contains this virtual machine, if any.
	EnvironmentID *string

	// The expiration date for VM.
	ExpirationDate *time.Time

	// The Microsoft Azure Marketplace image reference of the virtual machine.
	GalleryImageReference *GalleryImageReference

	// Indicates whether this virtual machine uses an SSH key for authentication.
	IsAuthenticationWithSSHKey *bool

	// The lab subnet name of the virtual machine.
	LabSubnetName *string

	// The lab virtual network identifier of the virtual machine.
	LabVirtualNetworkID *string

	// The network interface properties.
	NetworkInterface *NetworkInterfaceProperties

	// The notes of the virtual machine.
	Notes *string

	// The object identifier of the owner of the virtual machine.
	OwnerObjectID *string

	// The user principal name of the virtual machine owner.
	OwnerUserPrincipalName *string

	// The password of the virtual machine administrator.
	Password *string

	// The id of the plan associated with the virtual machine image
	PlanID *string

	// The SSH key of the virtual machine administrator.
	SSHKey *string

	// Virtual Machine schedules to be created
	ScheduleParameters []*ScheduleCreationParameter

	// The size of the virtual machine.
	Size *string

	// Storage type to use for virtual machine (i.e. Standard, Premium).
	StorageType *string

	// The user name of the virtual machine.
	UserName *string

	// READ-ONLY; The applicable schedule for the virtual machine.
	ApplicableSchedule *ApplicableSchedule

	// READ-ONLY; The artifact deployment status for the virtual machine.
	ArtifactDeploymentStatus *ArtifactDeploymentStatusProperties

	// READ-ONLY; The resource identifier (Microsoft.Compute) of the virtual machine.
	ComputeID *string

	// READ-ONLY; The compute virtual machine properties.
	ComputeVM *ComputeVMProperties

	// READ-ONLY; The email address of creator of the virtual machine.
	CreatedByUser *string

	// READ-ONLY; The object identifier of the creator of the virtual machine.
	CreatedByUserID *string

	// READ-ONLY; The fully-qualified domain name of the virtual machine.
	Fqdn *string

	// READ-ONLY; Last known compute power state captured in DTL
	LastKnownPowerState *string

	// READ-ONLY; The OS type of the virtual machine.
	OSType *string

	// READ-ONLY; The provisioning status of the resource.
	ProvisioningState *string

	// READ-ONLY; The unique immutable identifier of a resource (Guid).
	UniqueIdentifier *string

	// READ-ONLY; Tells source of creation of lab virtual machine. Output property only.
	VirtualMachineCreationSource *VirtualMachineCreationSource
}

LabVirtualMachineProperties - Properties of a virtual machine.

func (LabVirtualMachineProperties) MarshalJSON

func (l LabVirtualMachineProperties) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.Marshaller interface for type LabVirtualMachineProperties.

func (*LabVirtualMachineProperties) UnmarshalJSON

func (l *LabVirtualMachineProperties) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the json.Unmarshaller interface for type LabVirtualMachineProperties.

type LabsClient

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

LabsClient contains the methods for the Labs group. Don't use this type directly, use NewLabsClient() instead.

func NewLabsClient

func NewLabsClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*LabsClient, error)

NewLabsClient creates a new instance of LabsClient with the specified values.

  • subscriptionID - The subscription ID.
  • credential - used to authorize requests. Usually a credential from azidentity.
  • options - pass nil to accept the default values.

func (*LabsClient) BeginClaimAnyVM

func (client *LabsClient) BeginClaimAnyVM(ctx context.Context, resourceGroupName string, name string, options *LabsClientBeginClaimAnyVMOptions) (*runtime.Poller[LabsClientClaimAnyVMResponse], error)

BeginClaimAnyVM - Claim a random claimable virtual machine in the lab. This operation can take a while to complete. If the operation fails it returns an *azcore.ResponseError type.

Generated from API version 2018-09-15

  • resourceGroupName - The name of the resource group.
  • name - The name of the lab.
  • options - LabsClientBeginClaimAnyVMOptions contains the optional parameters for the LabsClient.BeginClaimAnyVM method.
Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/d55b8005f05b040b852c15e74a0f3e36494a15e1/specification/devtestlabs/resource-manager/Microsoft.DevTestLab/stable/2018-09-15/examples/Labs_ClaimAnyVm.json

package main

import (
	"context"
	"log"

	"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
	"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/devtestlabs/armdevtestlabs"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armdevtestlabs.NewClientFactory("<subscription-id>", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	poller, err := clientFactory.NewLabsClient().BeginClaimAnyVM(ctx, "resourceGroupName", "{labName}", 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 (*LabsClient) BeginCreateEnvironment

func (client *LabsClient) BeginCreateEnvironment(ctx context.Context, resourceGroupName string, name string, labVirtualMachineCreationParameter LabVirtualMachineCreationParameter, options *LabsClientBeginCreateEnvironmentOptions) (*runtime.Poller[LabsClientCreateEnvironmentResponse], error)

BeginCreateEnvironment - Create virtual machines in a lab. This operation can take a while to complete. If the operation fails it returns an *azcore.ResponseError type.

Generated from API version 2018-09-15

  • resourceGroupName - The name of the resource group.
  • name - The name of the lab.
  • labVirtualMachineCreationParameter - Properties for creating a virtual machine.
  • options - LabsClientBeginCreateEnvironmentOptions contains the optional parameters for the LabsClient.BeginCreateEnvironment method.
Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/d55b8005f05b040b852c15e74a0f3e36494a15e1/specification/devtestlabs/resource-manager/Microsoft.DevTestLab/stable/2018-09-15/examples/Labs_CreateEnvironment.json

package main

import (
	"context"
	"log"

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

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armdevtestlabs.NewClientFactory("<subscription-id>", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	poller, err := clientFactory.NewLabsClient().BeginCreateEnvironment(ctx, "resourceGroupName", "{labName}", armdevtestlabs.LabVirtualMachineCreationParameter{
		Name:     to.Ptr("{vmName}"),
		Location: to.Ptr("{location}"),
		Properties: &armdevtestlabs.LabVirtualMachineCreationParameterProperties{
			AllowClaim:              to.Ptr(true),
			DisallowPublicIPAddress: to.Ptr(true),
			GalleryImageReference: &armdevtestlabs.GalleryImageReference{
				Offer:     to.Ptr("UbuntuServer"),
				OSType:    to.Ptr("Linux"),
				Publisher: to.Ptr("Canonical"),
				SKU:       to.Ptr("16.04-LTS"),
				Version:   to.Ptr("Latest"),
			},
			LabSubnetName:       to.Ptr("{virtualnetwork-subnet-name}"),
			LabVirtualNetworkID: to.Ptr("/subscriptions/{subscriptionId}/resourcegroups/resourceGroupName/providers/microsoft.devtestlab/labs/{labName}/virtualnetworks/{virtualNetworkName}"),
			Password:            to.Ptr("{userPassword}"),
			Size:                to.Ptr("Standard_A2_v2"),
			StorageType:         to.Ptr("Standard"),
			UserName:            to.Ptr("{userName}"),
		},
		Tags: map[string]*string{
			"tagName1": to.Ptr("tagValue1"),
		},
	}, 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 (*LabsClient) BeginCreateOrUpdate

func (client *LabsClient) BeginCreateOrUpdate(ctx context.Context, resourceGroupName string, name string, lab Lab, options *LabsClientBeginCreateOrUpdateOptions) (*runtime.Poller[LabsClientCreateOrUpdateResponse], error)

BeginCreateOrUpdate - Create or replace an existing lab. This operation can take a while to complete. If the operation fails it returns an *azcore.ResponseError type.

Generated from API version 2018-09-15

  • resourceGroupName - The name of the resource group.
  • name - The name of the lab.
  • lab - A lab.
  • options - LabsClientBeginCreateOrUpdateOptions contains the optional parameters for the LabsClient.BeginCreateOrUpdate method.
Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/d55b8005f05b040b852c15e74a0f3e36494a15e1/specification/devtestlabs/resource-manager/Microsoft.DevTestLab/stable/2018-09-15/examples/Labs_CreateOrUpdate.json

package main

import (
	"context"
	"log"

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

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armdevtestlabs.NewClientFactory("<subscription-id>", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	poller, err := clientFactory.NewLabsClient().BeginCreateOrUpdate(ctx, "resourceGroupName", "{labName}", armdevtestlabs.Lab{
		Location: to.Ptr("{location}"),
		Tags: map[string]*string{
			"tagName1": to.Ptr("tagValue1"),
		},
		Properties: &armdevtestlabs.LabProperties{
			LabStorageType: to.Ptr(armdevtestlabs.StorageType("{Standard|Premium}")),
		},
	}, 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.Lab = armdevtestlabs.Lab{
	// 	Name: to.Ptr("{labName}"),
	// 	Type: to.Ptr("Microsoft.DevTestLab/labs"),
	// 	ID: to.Ptr("/subscriptions/{subscriptionId}/resourcegroups/resourceGroupName/providers/microsoft.devtestlab/labs/{labName}"),
	// 	Location: to.Ptr("{location}"),
	// 	Tags: map[string]*string{
	// 		"tagName1": to.Ptr("tagValue1"),
	// 	},
	// 	Properties: &armdevtestlabs.LabProperties{
	// 		Announcement: &armdevtestlabs.LabAnnouncementProperties{
	// 			Enabled: to.Ptr(armdevtestlabs.EnableStatusDisabled),
	// 			Expired: to.Ptr(false),
	// 			Markdown: to.Ptr(""),
	// 			Title: to.Ptr(""),
	// 		},
	// 		CreatedDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2018-10-02T01:40:48.173Z"); return t}()),
	// 		EnvironmentPermission: to.Ptr(armdevtestlabs.EnvironmentPermissionReader),
	// 		LabStorageType: to.Ptr(armdevtestlabs.StorageTypeStandard),
	// 		MandatoryArtifactsResourceIDsLinux: []*string{
	// 		},
	// 		MandatoryArtifactsResourceIDsWindows: []*string{
	// 		},
	// 		PremiumDataDisks: to.Ptr(armdevtestlabs.PremiumDataDiskDisabled),
	// 		ProvisioningState: to.Ptr("Succeeded"),
	// 		Support: &armdevtestlabs.LabSupportProperties{
	// 			Enabled: to.Ptr(armdevtestlabs.EnableStatusDisabled),
	// 			Markdown: to.Ptr(""),
	// 		},
	// 		UniqueIdentifier: to.Ptr("{uniqueIdentifier}"),
	// 	},
	// }
}
Output:

func (*LabsClient) BeginDelete

func (client *LabsClient) BeginDelete(ctx context.Context, resourceGroupName string, name string, options *LabsClientBeginDeleteOptions) (*runtime.Poller[LabsClientDeleteResponse], error)

BeginDelete - Delete lab. This operation can take a while to complete. If the operation fails it returns an *azcore.ResponseError type.

Generated from API version 2018-09-15

  • resourceGroupName - The name of the resource group.
  • name - The name of the lab.
  • options - LabsClientBeginDeleteOptions contains the optional parameters for the LabsClient.BeginDelete method.
Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/d55b8005f05b040b852c15e74a0f3e36494a15e1/specification/devtestlabs/resource-manager/Microsoft.DevTestLab/stable/2018-09-15/examples/Labs_Delete.json

package main

import (
	"context"
	"log"

	"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
	"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/devtestlabs/armdevtestlabs"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armdevtestlabs.NewClientFactory("<subscription-id>", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	poller, err := clientFactory.NewLabsClient().BeginDelete(ctx, "resourceGroupName", "{labName}", 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 (*LabsClient) BeginExportResourceUsage

func (client *LabsClient) BeginExportResourceUsage(ctx context.Context, resourceGroupName string, name string, exportResourceUsageParameters ExportResourceUsageParameters, options *LabsClientBeginExportResourceUsageOptions) (*runtime.Poller[LabsClientExportResourceUsageResponse], error)

BeginExportResourceUsage - Exports the lab resource usage into a storage account This operation can take a while to complete. If the operation fails it returns an *azcore.ResponseError type.

Generated from API version 2018-09-15

  • resourceGroupName - The name of the resource group.
  • name - The name of the lab.
  • exportResourceUsageParameters - The parameters of the export operation.
  • options - LabsClientBeginExportResourceUsageOptions contains the optional parameters for the LabsClient.BeginExportResourceUsage method.
Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/d55b8005f05b040b852c15e74a0f3e36494a15e1/specification/devtestlabs/resource-manager/Microsoft.DevTestLab/stable/2018-09-15/examples/Labs_ExportResourceUsage.json

package main

import (
	"context"
	"log"

	"time"

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

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armdevtestlabs.NewClientFactory("<subscription-id>", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	poller, err := clientFactory.NewLabsClient().BeginExportResourceUsage(ctx, "resourceGroupName", "{labName}", armdevtestlabs.ExportResourceUsageParameters{
		BlobStorageAbsoluteSasURI: to.Ptr("https://invalid.blob.core.windows.net/export.blob?sv=2015-07-08&sig={sas}&sp=rcw"),
		UsageStartDate:            to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-12-01T00:00:00.000Z"); return t }()),
	}, 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 (*LabsClient) BeginImportVirtualMachine

func (client *LabsClient) BeginImportVirtualMachine(ctx context.Context, resourceGroupName string, name string, importLabVirtualMachineRequest ImportLabVirtualMachineRequest, options *LabsClientBeginImportVirtualMachineOptions) (*runtime.Poller[LabsClientImportVirtualMachineResponse], error)

BeginImportVirtualMachine - Import a virtual machine into a different lab. This operation can take a while to complete. If the operation fails it returns an *azcore.ResponseError type.

Generated from API version 2018-09-15

  • resourceGroupName - The name of the resource group.
  • name - The name of the lab.
  • importLabVirtualMachineRequest - This represents the payload required to import a virtual machine from a different lab into the current one
  • options - LabsClientBeginImportVirtualMachineOptions contains the optional parameters for the LabsClient.BeginImportVirtualMachine method.
Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/d55b8005f05b040b852c15e74a0f3e36494a15e1/specification/devtestlabs/resource-manager/Microsoft.DevTestLab/stable/2018-09-15/examples/Labs_ImportVirtualMachine.json

package main

import (
	"context"
	"log"

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

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armdevtestlabs.NewClientFactory("<subscription-id>", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	poller, err := clientFactory.NewLabsClient().BeginImportVirtualMachine(ctx, "resourceGroupName", "{labName}", armdevtestlabs.ImportLabVirtualMachineRequest{
		DestinationVirtualMachineName:  to.Ptr("{vmName}"),
		SourceVirtualMachineResourceID: to.Ptr("/subscriptions/{subscriptionId}/resourceGroups/{otherResourceGroupName}/providers/Microsoft.Compute/virtualMachines/{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 (*LabsClient) GenerateUploadURI

func (client *LabsClient) GenerateUploadURI(ctx context.Context, resourceGroupName string, name string, generateUploadURIParameter GenerateUploadURIParameter, options *LabsClientGenerateUploadURIOptions) (LabsClientGenerateUploadURIResponse, error)

GenerateUploadURI - Generate a URI for uploading custom disk images to a Lab. If the operation fails it returns an *azcore.ResponseError type.

Generated from API version 2018-09-15

  • resourceGroupName - The name of the resource group.
  • name - The name of the lab.
  • generateUploadURIParameter - Properties for generating an upload URI.
  • options - LabsClientGenerateUploadURIOptions contains the optional parameters for the LabsClient.GenerateUploadURI method.
Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/d55b8005f05b040b852c15e74a0f3e36494a15e1/specification/devtestlabs/resource-manager/Microsoft.DevTestLab/stable/2018-09-15/examples/Labs_GenerateUploadUri.json

package main

import (
	"context"
	"log"

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

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armdevtestlabs.NewClientFactory("<subscription-id>", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	res, err := clientFactory.NewLabsClient().GenerateUploadURI(ctx, "resourceGroupName", "{labName}", armdevtestlabs.GenerateUploadURIParameter{
		BlobName: to.Ptr("{blob-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.GenerateUploadURIResponse = armdevtestlabs.GenerateUploadURIResponse{
	// 	UploadURI: to.Ptr("https://{storageName}.blob.core.windows.net/uploads/{blobName}?sv=2017-04-17&sr=b&sig={signature}&st=2018-10-02T01:55:24Z&se=2018-10-03T02:10:23Z&sp=rcw"),
	// }
}
Output:

func (*LabsClient) Get

func (client *LabsClient) Get(ctx context.Context, resourceGroupName string, name string, options *LabsClientGetOptions) (LabsClientGetResponse, error)

Get - Get lab. If the operation fails it returns an *azcore.ResponseError type.

Generated from API version 2018-09-15

  • resourceGroupName - The name of the resource group.
  • name - The name of the lab.
  • options - LabsClientGetOptions contains the optional parameters for the LabsClient.Get method.
Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/d55b8005f05b040b852c15e74a0f3e36494a15e1/specification/devtestlabs/resource-manager/Microsoft.DevTestLab/stable/2018-09-15/examples/Labs_Get.json

package main

import (
	"context"
	"log"

	"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
	"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/devtestlabs/armdevtestlabs"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armdevtestlabs.NewClientFactory("<subscription-id>", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	res, err := clientFactory.NewLabsClient().Get(ctx, "resourceGroupName", "{labName}", &armdevtestlabs.LabsClientGetOptions{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.Lab = armdevtestlabs.Lab{
	// 	Name: to.Ptr("{labName}"),
	// 	Type: to.Ptr("Microsoft.DevTestLab/labs"),
	// 	ID: to.Ptr("/subscriptions/{subscriptionId}/resourcegroups/resourceGroupName/providers/microsoft.devtestlab/labs/{labName}"),
	// 	Location: to.Ptr("{location}"),
	// 	Tags: map[string]*string{
	// 		"tagName1": to.Ptr("tagValue1"),
	// 	},
	// 	Properties: &armdevtestlabs.LabProperties{
	// 		Announcement: &armdevtestlabs.LabAnnouncementProperties{
	// 			Enabled: to.Ptr(armdevtestlabs.EnableStatusDisabled),
	// 			Expired: to.Ptr(false),
	// 			Markdown: to.Ptr(""),
	// 			Title: to.Ptr(""),
	// 		},
	// 		ArtifactsStorageAccount: to.Ptr("/subscriptions/{subscriptionId}/resourceGroups/resourceGroupName/providers/Microsoft.Storage/storageAccounts/{storageAccountName}"),
	// 		CreatedDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2018-10-02T01:40:48.173Z"); return t}()),
	// 		DefaultPremiumStorageAccount: to.Ptr("/subscriptions/{subscriptionId}/resourceGroups/resourceGroupName/providers/Microsoft.Storage/storageAccounts/{storageAccountName}"),
	// 		DefaultStorageAccount: to.Ptr("/subscriptions/{subscriptionId}/resourceGroups/resourceGroupName/providers/Microsoft.Storage/storageAccounts/{storageAccountName}"),
	// 		EnvironmentPermission: to.Ptr(armdevtestlabs.EnvironmentPermissionReader),
	// 		LabStorageType: to.Ptr(armdevtestlabs.StorageTypeStandard),
	// 		MandatoryArtifactsResourceIDsLinux: []*string{
	// 		},
	// 		MandatoryArtifactsResourceIDsWindows: []*string{
	// 		},
	// 		PremiumDataDiskStorageAccount: to.Ptr("/subscriptions/{subscriptionId}/resourceGroups/resourceGroupName/providers/Microsoft.Storage/storageAccounts/{storageAccountName}"),
	// 		PremiumDataDisks: to.Ptr(armdevtestlabs.PremiumDataDiskDisabled),
	// 		ProvisioningState: to.Ptr("Succeeded"),
	// 		Support: &armdevtestlabs.LabSupportProperties{
	// 			Enabled: to.Ptr(armdevtestlabs.EnableStatusDisabled),
	// 			Markdown: to.Ptr(""),
	// 		},
	// 		UniqueIdentifier: to.Ptr("{uniqueIdentifier}"),
	// 		VaultName: to.Ptr("/subscriptions/{subscriptionId}/resourceGroups/resourceGroupName/providers/Microsoft.KeyVault/vaults/{keyVaultName}"),
	// 	},
	// }
}
Output:

func (*LabsClient) NewListByResourceGroupPager added in v0.4.0

func (client *LabsClient) NewListByResourceGroupPager(resourceGroupName string, options *LabsClientListByResourceGroupOptions) *runtime.Pager[LabsClientListByResourceGroupResponse]

NewListByResourceGroupPager - List labs in a resource group.

Generated from API version 2018-09-15

  • resourceGroupName - The name of the resource group.
  • options - LabsClientListByResourceGroupOptions contains the optional parameters for the LabsClient.NewListByResourceGroupPager method.
Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/d55b8005f05b040b852c15e74a0f3e36494a15e1/specification/devtestlabs/resource-manager/Microsoft.DevTestLab/stable/2018-09-15/examples/Labs_ListByResourceGroup.json

package main

import (
	"context"
	"log"

	"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
	"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/devtestlabs/armdevtestlabs"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armdevtestlabs.NewClientFactory("<subscription-id>", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	pager := clientFactory.NewLabsClient().NewListByResourceGroupPager("resourceGroupName", &armdevtestlabs.LabsClientListByResourceGroupOptions{Expand: nil,
		Filter:  nil,
		Top:     nil,
		Orderby: 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.LabList = armdevtestlabs.LabList{
		// 	Value: []*armdevtestlabs.Lab{
		// 		{
		// 			Name: to.Ptr("{labName}"),
		// 			Type: to.Ptr("Microsoft.DevTestLab/labs"),
		// 			ID: to.Ptr("/subscriptions/{subscriptionId}/resourcegroups/resourceGroupName/providers/microsoft.devtestlab/labs/{labName}"),
		// 			Location: to.Ptr("{location}"),
		// 			Tags: map[string]*string{
		// 				"tagName1": to.Ptr("tagValue1"),
		// 			},
		// 			Properties: &armdevtestlabs.LabProperties{
		// 				Announcement: &armdevtestlabs.LabAnnouncementProperties{
		// 					Enabled: to.Ptr(armdevtestlabs.EnableStatusDisabled),
		// 					Expired: to.Ptr(false),
		// 					Markdown: to.Ptr(""),
		// 					Title: to.Ptr(""),
		// 				},
		// 				CreatedDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2018-10-02T17:23:20.957Z"); return t}()),
		// 				EnvironmentPermission: to.Ptr(armdevtestlabs.EnvironmentPermissionReader),
		// 				LabStorageType: to.Ptr(armdevtestlabs.StorageTypeStandard),
		// 				MandatoryArtifactsResourceIDsLinux: []*string{
		// 				},
		// 				MandatoryArtifactsResourceIDsWindows: []*string{
		// 				},
		// 				PremiumDataDisks: to.Ptr(armdevtestlabs.PremiumDataDiskDisabled),
		// 				ProvisioningState: to.Ptr("Succeeded"),
		// 				Support: &armdevtestlabs.LabSupportProperties{
		// 					Enabled: to.Ptr(armdevtestlabs.EnableStatusDisabled),
		// 					Markdown: to.Ptr(""),
		// 				},
		// 				UniqueIdentifier: to.Ptr("{uniqueIdentifier}"),
		// 				VaultName: to.Ptr("/subscriptions/{subscriptionId}/resourceGroups/resourceGroupName/providers/Microsoft.KeyVault/vaults/{keyVaultName}"),
		// 			},
		// 	}},
		// }
	}
}
Output:

func (*LabsClient) NewListBySubscriptionPager added in v0.4.0

NewListBySubscriptionPager - List labs in a subscription.

Generated from API version 2018-09-15

  • options - LabsClientListBySubscriptionOptions contains the optional parameters for the LabsClient.NewListBySubscriptionPager method.
Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/d55b8005f05b040b852c15e74a0f3e36494a15e1/specification/devtestlabs/resource-manager/Microsoft.DevTestLab/stable/2018-09-15/examples/Labs_ListBySubscription.json

package main

import (
	"context"
	"log"

	"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
	"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/devtestlabs/armdevtestlabs"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armdevtestlabs.NewClientFactory("<subscription-id>", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	pager := clientFactory.NewLabsClient().NewListBySubscriptionPager(&armdevtestlabs.LabsClientListBySubscriptionOptions{Expand: nil,
		Filter:  nil,
		Top:     nil,
		Orderby: 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.LabList = armdevtestlabs.LabList{
		// 	Value: []*armdevtestlabs.Lab{
		// 		{
		// 			Name: to.Ptr("{labName1}"),
		// 			Type: to.Ptr("Microsoft.DevTestLab/labs"),
		// 			ID: to.Ptr("/subscriptions/{subscriptionId}/resourcegroups/resourceGroupName/providers/microsoft.devtestlab/labs/{labName1}"),
		// 			Location: to.Ptr("westcentralus"),
		// 			Tags: map[string]*string{
		// 				"tagName1": to.Ptr("tagValue1"),
		// 			},
		// 			Properties: &armdevtestlabs.LabProperties{
		// 				Announcement: &armdevtestlabs.LabAnnouncementProperties{
		// 					Enabled: to.Ptr(armdevtestlabs.EnableStatusDisabled),
		// 					Expired: to.Ptr(false),
		// 					Markdown: to.Ptr(""),
		// 					Title: to.Ptr(""),
		// 				},
		// 				ArtifactsStorageAccount: to.Ptr("/subscriptions/{subscriptionId}/resourceGroups/resourceGroupName/providers/Microsoft.Storage/storageAccounts/{storageAccountName}"),
		// 				CreatedDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2018-09-30T15:38:13.197Z"); return t}()),
		// 				DefaultPremiumStorageAccount: to.Ptr("/subscriptions/{subscriptionId}/resourceGroups/resourceGroupName/providers/Microsoft.Storage/storageAccounts/{storageAccountName}"),
		// 				DefaultStorageAccount: to.Ptr("/subscriptions/{subscriptionId}/resourceGroups/resourceGroupName/providers/Microsoft.Storage/storageAccounts/{storageAccountName}"),
		// 				EnvironmentPermission: to.Ptr(armdevtestlabs.EnvironmentPermissionReader),
		// 				LabStorageType: to.Ptr(armdevtestlabs.StorageTypePremium),
		// 				MandatoryArtifactsResourceIDsLinux: []*string{
		// 				},
		// 				MandatoryArtifactsResourceIDsWindows: []*string{
		// 				},
		// 				PremiumDataDiskStorageAccount: to.Ptr("/subscriptions/{subscriptionId}/resourceGroups/resourceGroupName/providers/Microsoft.Storage/storageAccounts/{storageAccountName}"),
		// 				PremiumDataDisks: to.Ptr(armdevtestlabs.PremiumDataDiskDisabled),
		// 				ProvisioningState: to.Ptr("Succeeded"),
		// 				Support: &armdevtestlabs.LabSupportProperties{
		// 					Enabled: to.Ptr(armdevtestlabs.EnableStatusDisabled),
		// 					Markdown: to.Ptr(""),
		// 				},
		// 				UniqueIdentifier: to.Ptr("{uniqueIdentifier}"),
		// 				VaultName: to.Ptr("/subscriptions/{subscriptionId}/resourceGroups/resourceGroupName/providers/Microsoft.KeyVault/vaults/{keyVaultName}"),
		// 			},
		// 		},
		// 		{
		// 			Name: to.Ptr("{labName2}"),
		// 			Type: to.Ptr("Microsoft.DevTestLab/labs"),
		// 			ID: to.Ptr("/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName2}/providers/microsoft.devtestlab/labs/{labName2}"),
		// 			Location: to.Ptr("japaneast"),
		// 			Tags: map[string]*string{
		// 				"tagName1": to.Ptr("tagValue1"),
		// 			},
		// 			Properties: &armdevtestlabs.LabProperties{
		// 				Announcement: &armdevtestlabs.LabAnnouncementProperties{
		// 					Enabled: to.Ptr(armdevtestlabs.EnableStatusDisabled),
		// 					Expired: to.Ptr(false),
		// 					Markdown: to.Ptr(""),
		// 					Title: to.Ptr(""),
		// 				},
		// 				ArtifactsStorageAccount: to.Ptr("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName2}/providers/Microsoft.Storage/storageAccounts/{storageAccountName2}"),
		// 				CreatedDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2018-09-30T16:37:52.967Z"); return t}()),
		// 				DefaultPremiumStorageAccount: to.Ptr("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName2}/providers/Microsoft.Storage/storageAccounts/{storageAccountName2}"),
		// 				DefaultStorageAccount: to.Ptr("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName2}/providers/Microsoft.Storage/storageAccounts/{storageAccountName2}"),
		// 				EnvironmentPermission: to.Ptr(armdevtestlabs.EnvironmentPermissionReader),
		// 				LabStorageType: to.Ptr(armdevtestlabs.StorageTypePremium),
		// 				MandatoryArtifactsResourceIDsLinux: []*string{
		// 				},
		// 				MandatoryArtifactsResourceIDsWindows: []*string{
		// 				},
		// 				PremiumDataDiskStorageAccount: to.Ptr("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName2}/providers/Microsoft.Storage/storageAccounts/{storageAccountName2}"),
		// 				PremiumDataDisks: to.Ptr(armdevtestlabs.PremiumDataDiskDisabled),
		// 				ProvisioningState: to.Ptr("Succeeded"),
		// 				Support: &armdevtestlabs.LabSupportProperties{
		// 					Enabled: to.Ptr(armdevtestlabs.EnableStatusDisabled),
		// 					Markdown: to.Ptr(""),
		// 				},
		// 				UniqueIdentifier: to.Ptr("{uniqueIdentifier}"),
		// 				VaultName: to.Ptr("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName2}/providers/Microsoft.KeyVault/vaults/{keyVaultName2}"),
		// 			},
		// 	}},
		// }
	}
}
Output:

func (*LabsClient) NewListVhdsPager added in v0.4.0

func (client *LabsClient) NewListVhdsPager(resourceGroupName string, name string, options *LabsClientListVhdsOptions) *runtime.Pager[LabsClientListVhdsResponse]

NewListVhdsPager - List disk images available for custom image creation.

Generated from API version 2018-09-15

  • resourceGroupName - The name of the resource group.
  • name - The name of the lab.
  • options - LabsClientListVhdsOptions contains the optional parameters for the LabsClient.NewListVhdsPager method.
Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/d55b8005f05b040b852c15e74a0f3e36494a15e1/specification/devtestlabs/resource-manager/Microsoft.DevTestLab/stable/2018-09-15/examples/Labs_ListVhds.json

package main

import (
	"context"
	"log"

	"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
	"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/devtestlabs/armdevtestlabs"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armdevtestlabs.NewClientFactory("<subscription-id>", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	pager := clientFactory.NewLabsClient().NewListVhdsPager("resourceGroupName", "{labName}", 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.LabVhdList = armdevtestlabs.LabVhdList{
		// 	Value: []*armdevtestlabs.LabVhd{
		// 		{
		// 			ID: to.Ptr("https://{labStorageAccountName}.blob.core.windows.net/vhds/vhd1"),
		// 		},
		// 		{
		// 			ID: to.Ptr("https://{labStorageAccountName}.blob.core.windows.net/vhds/vhd2"),
		// 	}},
		// }
	}
}
Output:

func (*LabsClient) Update

func (client *LabsClient) Update(ctx context.Context, resourceGroupName string, name string, lab LabFragment, options *LabsClientUpdateOptions) (LabsClientUpdateResponse, error)

Update - Allows modifying tags of labs. All other properties will be ignored. If the operation fails it returns an *azcore.ResponseError type.

Generated from API version 2018-09-15

  • resourceGroupName - The name of the resource group.
  • name - The name of the lab.
  • lab - A lab.
  • options - LabsClientUpdateOptions contains the optional parameters for the LabsClient.Update method.
Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/d55b8005f05b040b852c15e74a0f3e36494a15e1/specification/devtestlabs/resource-manager/Microsoft.DevTestLab/stable/2018-09-15/examples/Labs_Update.json

package main

import (
	"context"
	"log"

	"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
	"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/devtestlabs/armdevtestlabs"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armdevtestlabs.NewClientFactory("<subscription-id>", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	res, err := clientFactory.NewLabsClient().Update(ctx, "resourceGroupName", "{labName}", armdevtestlabs.LabFragment{}, 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.Lab = armdevtestlabs.Lab{
	// 	Name: to.Ptr("{labName}"),
	// 	Type: to.Ptr("Microsoft.DevTestLab/labs"),
	// 	ID: to.Ptr("/subscriptions/{subscriptionId}/resourcegroups/resourceGroupName/providers/microsoft.devtestlab/labs/{labName}"),
	// 	Location: to.Ptr("{location}"),
	// 	Tags: map[string]*string{
	// 		"tagName1": to.Ptr("tagValue1"),
	// 	},
	// 	Properties: &armdevtestlabs.LabProperties{
	// 		Announcement: &armdevtestlabs.LabAnnouncementProperties{
	// 			Enabled: to.Ptr(armdevtestlabs.EnableStatusDisabled),
	// 			Expired: to.Ptr(false),
	// 			Markdown: to.Ptr(""),
	// 			Title: to.Ptr(""),
	// 		},
	// 		CreatedDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2018-10-02T01:40:48.173Z"); return t}()),
	// 		EnvironmentPermission: to.Ptr(armdevtestlabs.EnvironmentPermissionReader),
	// 		LabStorageType: to.Ptr(armdevtestlabs.StorageTypeStandard),
	// 		MandatoryArtifactsResourceIDsLinux: []*string{
	// 		},
	// 		MandatoryArtifactsResourceIDsWindows: []*string{
	// 		},
	// 		PremiumDataDisks: to.Ptr(armdevtestlabs.PremiumDataDiskDisabled),
	// 		ProvisioningState: to.Ptr("Succeeded"),
	// 		Support: &armdevtestlabs.LabSupportProperties{
	// 			Enabled: to.Ptr(armdevtestlabs.EnableStatusDisabled),
	// 			Markdown: to.Ptr(""),
	// 		},
	// 		UniqueIdentifier: to.Ptr("{uniqueIdentifier}"),
	// 		VaultName: to.Ptr("/subscriptions/{subscriptionId}/resourceGroups/resourceGroupName/providers/Microsoft.KeyVault/vaults/{keyVaultName}"),
	// 	},
	// }
}
Output:

type LabsClientBeginClaimAnyVMOptions added in v0.2.0

type LabsClientBeginClaimAnyVMOptions struct {
	// Resumes the LRO from the provided token.
	ResumeToken string
}

LabsClientBeginClaimAnyVMOptions contains the optional parameters for the LabsClient.BeginClaimAnyVM method.

type LabsClientBeginCreateEnvironmentOptions added in v0.2.0

type LabsClientBeginCreateEnvironmentOptions struct {
	// Resumes the LRO from the provided token.
	ResumeToken string
}

LabsClientBeginCreateEnvironmentOptions contains the optional parameters for the LabsClient.BeginCreateEnvironment method.

type LabsClientBeginCreateOrUpdateOptions added in v0.2.0

type LabsClientBeginCreateOrUpdateOptions struct {
	// Resumes the LRO from the provided token.
	ResumeToken string
}

LabsClientBeginCreateOrUpdateOptions contains the optional parameters for the LabsClient.BeginCreateOrUpdate method.

type LabsClientBeginDeleteOptions added in v0.2.0

type LabsClientBeginDeleteOptions struct {
	// Resumes the LRO from the provided token.
	ResumeToken string
}

LabsClientBeginDeleteOptions contains the optional parameters for the LabsClient.BeginDelete method.

type LabsClientBeginExportResourceUsageOptions added in v0.2.0

type LabsClientBeginExportResourceUsageOptions struct {
	// Resumes the LRO from the provided token.
	ResumeToken string
}

LabsClientBeginExportResourceUsageOptions contains the optional parameters for the LabsClient.BeginExportResourceUsage method.

type LabsClientBeginImportVirtualMachineOptions added in v0.2.0

type LabsClientBeginImportVirtualMachineOptions struct {
	// Resumes the LRO from the provided token.
	ResumeToken string
}

LabsClientBeginImportVirtualMachineOptions contains the optional parameters for the LabsClient.BeginImportVirtualMachine method.

type LabsClientClaimAnyVMResponse added in v0.2.0

type LabsClientClaimAnyVMResponse struct {
}

LabsClientClaimAnyVMResponse contains the response from method LabsClient.BeginClaimAnyVM.

type LabsClientCreateEnvironmentResponse added in v0.2.0

type LabsClientCreateEnvironmentResponse struct {
}

LabsClientCreateEnvironmentResponse contains the response from method LabsClient.BeginCreateEnvironment.

type LabsClientCreateOrUpdateResponse added in v0.2.0

type LabsClientCreateOrUpdateResponse struct {
	// A lab.
	Lab
}

LabsClientCreateOrUpdateResponse contains the response from method LabsClient.BeginCreateOrUpdate.

type LabsClientDeleteResponse added in v0.2.0

type LabsClientDeleteResponse struct {
}

LabsClientDeleteResponse contains the response from method LabsClient.BeginDelete.

type LabsClientExportResourceUsageResponse added in v0.2.0

type LabsClientExportResourceUsageResponse struct {
}

LabsClientExportResourceUsageResponse contains the response from method LabsClient.BeginExportResourceUsage.

type LabsClientGenerateUploadURIOptions added in v0.2.0

type LabsClientGenerateUploadURIOptions struct {
}

LabsClientGenerateUploadURIOptions contains the optional parameters for the LabsClient.GenerateUploadURI method.

type LabsClientGenerateUploadURIResponse added in v0.2.0

type LabsClientGenerateUploadURIResponse struct {
	// Response body for generating an upload URI.
	GenerateUploadURIResponse
}

LabsClientGenerateUploadURIResponse contains the response from method LabsClient.GenerateUploadURI.

type LabsClientGetOptions added in v0.2.0

type LabsClientGetOptions struct {
	// Specify the $expand query. Example: 'properties($select=defaultStorageAccount)'
	Expand *string
}

LabsClientGetOptions contains the optional parameters for the LabsClient.Get method.

type LabsClientGetResponse added in v0.2.0

type LabsClientGetResponse struct {
	// A lab.
	Lab
}

LabsClientGetResponse contains the response from method LabsClient.Get.

type LabsClientImportVirtualMachineResponse added in v0.2.0

type LabsClientImportVirtualMachineResponse struct {
}

LabsClientImportVirtualMachineResponse contains the response from method LabsClient.BeginImportVirtualMachine.

type LabsClientListByResourceGroupOptions added in v0.2.0

type LabsClientListByResourceGroupOptions struct {
	// Specify the $expand query. Example: 'properties($select=defaultStorageAccount)'
	Expand *string

	// The filter to apply to the operation. Example: '$filter=contains(name,'myName')
	Filter *string

	// The ordering expression for the results, using OData notation. Example: '$orderby=name desc'
	Orderby *string

	// The maximum number of resources to return from the operation. Example: '$top=10'
	Top *int32
}

LabsClientListByResourceGroupOptions contains the optional parameters for the LabsClient.NewListByResourceGroupPager method.

type LabsClientListByResourceGroupResponse added in v0.2.0

type LabsClientListByResourceGroupResponse struct {
	// The response of a list operation.
	LabList
}

LabsClientListByResourceGroupResponse contains the response from method LabsClient.NewListByResourceGroupPager.

type LabsClientListBySubscriptionOptions added in v0.2.0

type LabsClientListBySubscriptionOptions struct {
	// Specify the $expand query. Example: 'properties($select=defaultStorageAccount)'
	Expand *string

	// The filter to apply to the operation. Example: '$filter=contains(name,'myName')
	Filter *string

	// The ordering expression for the results, using OData notation. Example: '$orderby=name desc'
	Orderby *string

	// The maximum number of resources to return from the operation. Example: '$top=10'
	Top *int32
}

LabsClientListBySubscriptionOptions contains the optional parameters for the LabsClient.NewListBySubscriptionPager method.

type LabsClientListBySubscriptionResponse added in v0.2.0

type LabsClientListBySubscriptionResponse struct {
	// The response of a list operation.
	LabList
}

LabsClientListBySubscriptionResponse contains the response from method LabsClient.NewListBySubscriptionPager.

type LabsClientListVhdsOptions added in v0.2.0

type LabsClientListVhdsOptions struct {
}

LabsClientListVhdsOptions contains the optional parameters for the LabsClient.NewListVhdsPager method.

type LabsClientListVhdsResponse added in v0.2.0

type LabsClientListVhdsResponse struct {
	// The response of a list operation.
	LabVhdList
}

LabsClientListVhdsResponse contains the response from method LabsClient.NewListVhdsPager.

type LabsClientUpdateOptions added in v0.2.0

type LabsClientUpdateOptions struct {
}

LabsClientUpdateOptions contains the optional parameters for the LabsClient.Update method.

type LabsClientUpdateResponse added in v0.2.0

type LabsClientUpdateResponse struct {
	// A lab.
	Lab
}

LabsClientUpdateResponse contains the response from method LabsClient.Update.

type LinuxOsInfo

type LinuxOsInfo struct {
	// The state of the Linux OS (i.e. NonDeprovisioned, DeprovisionRequested, DeprovisionApplied).
	LinuxOsState *LinuxOsState
}

LinuxOsInfo - Information about a Linux OS.

func (LinuxOsInfo) MarshalJSON added in v1.1.0

func (l LinuxOsInfo) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.Marshaller interface for type LinuxOsInfo.

func (*LinuxOsInfo) UnmarshalJSON added in v1.1.0

func (l *LinuxOsInfo) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the json.Unmarshaller interface for type LinuxOsInfo.

type LinuxOsState

type LinuxOsState string

LinuxOsState - The state of the Linux OS (i.e. NonDeprovisioned, DeprovisionRequested, DeprovisionApplied).

const (
	LinuxOsStateDeprovisionApplied   LinuxOsState = "DeprovisionApplied"
	LinuxOsStateDeprovisionRequested LinuxOsState = "DeprovisionRequested"
	LinuxOsStateNonDeprovisioned     LinuxOsState = "NonDeprovisioned"
)

func PossibleLinuxOsStateValues

func PossibleLinuxOsStateValues() []LinuxOsState

PossibleLinuxOsStateValues returns the possible values for the LinuxOsState const type.

type ManagedIdentityType

type ManagedIdentityType string

ManagedIdentityType - Managed identity.

const (
	ManagedIdentityTypeNone                       ManagedIdentityType = "None"
	ManagedIdentityTypeSystemAssigned             ManagedIdentityType = "SystemAssigned"
	ManagedIdentityTypeSystemAssignedUserAssigned ManagedIdentityType = "SystemAssigned,UserAssigned"
	ManagedIdentityTypeUserAssigned               ManagedIdentityType = "UserAssigned"
)

func PossibleManagedIdentityTypeValues

func PossibleManagedIdentityTypeValues() []ManagedIdentityType

PossibleManagedIdentityTypeValues returns the possible values for the ManagedIdentityType const type.

type NetworkInterfaceProperties

type NetworkInterfaceProperties struct {
	// The DNS name.
	DNSName *string

	// The private IP address.
	PrivateIPAddress *string

	// The public IP address.
	PublicIPAddress *string

	// The resource ID of the public IP address.
	PublicIPAddressID *string

	// The RdpAuthority property is a server DNS host name or IP address followed by the service port number for RDP (Remote Desktop
	// Protocol).
	RdpAuthority *string

	// The SshAuthority property is a server DNS host name or IP address followed by the service port number for SSH.
	SSHAuthority *string

	// The configuration for sharing a public IP address across multiple virtual machines.
	SharedPublicIPAddressConfiguration *SharedPublicIPAddressConfiguration

	// The resource ID of the sub net.
	SubnetID *string

	// The resource ID of the virtual network.
	VirtualNetworkID *string
}

NetworkInterfaceProperties - Properties of a network interface.

func (NetworkInterfaceProperties) MarshalJSON added in v1.1.0

func (n NetworkInterfaceProperties) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.Marshaller interface for type NetworkInterfaceProperties.

func (*NetworkInterfaceProperties) UnmarshalJSON added in v1.1.0

func (n *NetworkInterfaceProperties) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the json.Unmarshaller interface for type NetworkInterfaceProperties.

type NotificationChannel

type NotificationChannel struct {
	// REQUIRED; The properties of the resource.
	Properties *NotificationChannelProperties

	// The location of the resource.
	Location *string

	// The tags of the resource.
	Tags map[string]*string

	// READ-ONLY; The identifier of the resource.
	ID *string

	// READ-ONLY; The name of the resource.
	Name *string

	// READ-ONLY; The type of the resource.
	Type *string
}

NotificationChannel - A notification.

func (NotificationChannel) MarshalJSON

func (n NotificationChannel) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.Marshaller interface for type NotificationChannel.

func (*NotificationChannel) UnmarshalJSON added in v1.1.0

func (n *NotificationChannel) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the json.Unmarshaller interface for type NotificationChannel.

type NotificationChannelEventType

type NotificationChannelEventType string

NotificationChannelEventType - The event type for which this notification is enabled (i.e. AutoShutdown, Cost)

const (
	NotificationChannelEventTypeAutoShutdown NotificationChannelEventType = "AutoShutdown"
	NotificationChannelEventTypeCost         NotificationChannelEventType = "Cost"
)

func PossibleNotificationChannelEventTypeValues

func PossibleNotificationChannelEventTypeValues() []NotificationChannelEventType

PossibleNotificationChannelEventTypeValues returns the possible values for the NotificationChannelEventType const type.

type NotificationChannelFragment

type NotificationChannelFragment struct {
	// The tags of the resource.
	Tags map[string]*string
}

NotificationChannelFragment - A notification.

func (NotificationChannelFragment) MarshalJSON added in v0.2.0

func (n NotificationChannelFragment) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.Marshaller interface for type NotificationChannelFragment.

func (*NotificationChannelFragment) UnmarshalJSON added in v1.1.0

func (n *NotificationChannelFragment) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the json.Unmarshaller interface for type NotificationChannelFragment.

type NotificationChannelList

type NotificationChannelList struct {
	// Link for next set of results.
	NextLink *string

	// Results of the list operation.
	Value []*NotificationChannel
}

NotificationChannelList - The response of a list operation.

func (NotificationChannelList) MarshalJSON

func (n NotificationChannelList) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.Marshaller interface for type NotificationChannelList.

func (*NotificationChannelList) UnmarshalJSON added in v1.1.0

func (n *NotificationChannelList) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the json.Unmarshaller interface for type NotificationChannelList.

type NotificationChannelProperties

type NotificationChannelProperties struct {
	// Description of notification.
	Description *string

	// The email recipient to send notifications to (can be a list of semi-colon separated email addresses).
	EmailRecipient *string

	// The list of event for which this notification is enabled.
	Events []*Event

	// The locale to use when sending a notification (fallback for unsupported languages is EN).
	NotificationLocale *string

	// The webhook URL to send notifications to.
	WebHookURL *string

	// READ-ONLY; The creation date of the notification channel.
	CreatedDate *time.Time

	// READ-ONLY; The provisioning status of the resource.
	ProvisioningState *string

	// READ-ONLY; The unique immutable identifier of a resource (Guid).
	UniqueIdentifier *string
}

NotificationChannelProperties - Properties of a schedule.

func (NotificationChannelProperties) MarshalJSON

func (n NotificationChannelProperties) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.Marshaller interface for type NotificationChannelProperties.

func (*NotificationChannelProperties) UnmarshalJSON

func (n *NotificationChannelProperties) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the json.Unmarshaller interface for type NotificationChannelProperties.

type NotificationChannelsClient

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

NotificationChannelsClient contains the methods for the NotificationChannels group. Don't use this type directly, use NewNotificationChannelsClient() instead.

func NewNotificationChannelsClient

func NewNotificationChannelsClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*NotificationChannelsClient, error)

NewNotificationChannelsClient creates a new instance of NotificationChannelsClient with the specified values.

  • subscriptionID - The subscription ID.
  • credential - used to authorize requests. Usually a credential from azidentity.
  • options - pass nil to accept the default values.

func (*NotificationChannelsClient) CreateOrUpdate

CreateOrUpdate - Create or replace an existing notification channel. If the operation fails it returns an *azcore.ResponseError type.

Generated from API version 2018-09-15

  • resourceGroupName - The name of the resource group.
  • labName - The name of the lab.
  • name - The name of the notification channel.
  • notificationChannel - A notification.
  • options - NotificationChannelsClientCreateOrUpdateOptions contains the optional parameters for the NotificationChannelsClient.CreateOrUpdate method.
Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/d55b8005f05b040b852c15e74a0f3e36494a15e1/specification/devtestlabs/resource-manager/Microsoft.DevTestLab/stable/2018-09-15/examples/NotificationChannels_CreateOrUpdate.json

package main

import (
	"context"
	"log"

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

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armdevtestlabs.NewClientFactory("<subscription-id>", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	res, err := clientFactory.NewNotificationChannelsClient().CreateOrUpdate(ctx, "resourceGroupName", "{labName}", "{notificationChannelName}", armdevtestlabs.NotificationChannel{
		Properties: &armdevtestlabs.NotificationChannelProperties{
			Description:    to.Ptr("Integration configured for auto-shutdown"),
			EmailRecipient: to.Ptr("{email}"),
			Events: []*armdevtestlabs.Event{
				{
					EventName: to.Ptr(armdevtestlabs.NotificationChannelEventTypeAutoShutdown),
				}},
			NotificationLocale: to.Ptr("en"),
			WebHookURL:         to.Ptr("{webhookUrl}"),
		},
	}, 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.NotificationChannel = armdevtestlabs.NotificationChannel{
	// 	Name: to.Ptr("{notificationChannelName}"),
	// 	Type: to.Ptr("Microsoft.DevTestLab/labs/notificationChannels"),
	// 	ID: to.Ptr("/subscriptions/{subscriptionId}/resourceGroups/resourceGroupName/providers/Microsoft.DevTestLab/labs/{labName}/notificationChannels/{notificationChannelName}"),
	// 	Location: to.Ptr("{location}"),
	// 	Tags: map[string]*string{
	// 		"tagName1": to.Ptr("tagValue1"),
	// 	},
	// 	Properties: &armdevtestlabs.NotificationChannelProperties{
	// 		Description: to.Ptr("Integration configured for auto-shutdown"),
	// 		CreatedDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-01-05T02:14:05.239Z"); return t}()),
	// 		EmailRecipient: to.Ptr("{email}"),
	// 		Events: []*armdevtestlabs.Event{
	// 			{
	// 				EventName: to.Ptr(armdevtestlabs.NotificationChannelEventTypeAutoShutdown),
	// 		}},
	// 		NotificationLocale: to.Ptr("en"),
	// 		ProvisioningState: to.Ptr("Succeeded"),
	// 		UniqueIdentifier: to.Ptr("{uniqueIdentifier}"),
	// 		WebHookURL: to.Ptr("{webhookUrl}"),
	// 	},
	// }
}
Output:

func (*NotificationChannelsClient) Delete

Delete - Delete notification channel. If the operation fails it returns an *azcore.ResponseError type.

Generated from API version 2018-09-15

  • resourceGroupName - The name of the resource group.
  • labName - The name of the lab.
  • name - The name of the notification channel.
  • options - NotificationChannelsClientDeleteOptions contains the optional parameters for the NotificationChannelsClient.Delete method.
Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/d55b8005f05b040b852c15e74a0f3e36494a15e1/specification/devtestlabs/resource-manager/Microsoft.DevTestLab/stable/2018-09-15/examples/NotificationChannels_Delete.json

package main

import (
	"context"
	"log"

	"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
	"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/devtestlabs/armdevtestlabs"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armdevtestlabs.NewClientFactory("<subscription-id>", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	_, err = clientFactory.NewNotificationChannelsClient().Delete(ctx, "resourceGroupName", "{labName}", "{notificationChannelName}", nil)
	if err != nil {
		log.Fatalf("failed to finish the request: %v", err)
	}
}
Output:

func (*NotificationChannelsClient) Get

Get - Get notification channel. If the operation fails it returns an *azcore.ResponseError type.

Generated from API version 2018-09-15

  • resourceGroupName - The name of the resource group.
  • labName - The name of the lab.
  • name - The name of the notification channel.
  • options - NotificationChannelsClientGetOptions contains the optional parameters for the NotificationChannelsClient.Get method.
Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/d55b8005f05b040b852c15e74a0f3e36494a15e1/specification/devtestlabs/resource-manager/Microsoft.DevTestLab/stable/2018-09-15/examples/NotificationChannels_Get.json

package main

import (
	"context"
	"log"

	"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
	"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/devtestlabs/armdevtestlabs"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armdevtestlabs.NewClientFactory("<subscription-id>", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	res, err := clientFactory.NewNotificationChannelsClient().Get(ctx, "resourceGroupName", "{labName}", "{notificationChannelName}", &armdevtestlabs.NotificationChannelsClientGetOptions{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.NotificationChannel = armdevtestlabs.NotificationChannel{
	// 	Name: to.Ptr("{notificationChannelName}"),
	// 	Type: to.Ptr("Microsoft.DevTestLab/labs/notificationChannels"),
	// 	ID: to.Ptr("/subscriptions/{subscriptionId}/resourceGroups/resourceGroupName/providers/Microsoft.DevTestLab/labs/{labName}/notificationChannels/{notificationChannelName}"),
	// 	Location: to.Ptr("{location}"),
	// 	Tags: map[string]*string{
	// 		"tagName1": to.Ptr("tagValue1"),
	// 	},
	// 	Properties: &armdevtestlabs.NotificationChannelProperties{
	// 		Description: to.Ptr("Integration configured for auto-shutdown"),
	// 		CreatedDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-01-05T02:14:05.239Z"); return t}()),
	// 		EmailRecipient: to.Ptr("{email}"),
	// 		Events: []*armdevtestlabs.Event{
	// 			{
	// 				EventName: to.Ptr(armdevtestlabs.NotificationChannelEventTypeAutoShutdown),
	// 		}},
	// 		NotificationLocale: to.Ptr("en"),
	// 		ProvisioningState: to.Ptr("Succeeded"),
	// 		UniqueIdentifier: to.Ptr("{uniqueIdentifier}"),
	// 		WebHookURL: to.Ptr("{webhookUrl}"),
	// 	},
	// }
}
Output:

func (*NotificationChannelsClient) NewListPager added in v0.4.0

NewListPager - List notification channels in a given lab.

Generated from API version 2018-09-15

  • resourceGroupName - The name of the resource group.
  • labName - The name of the lab.
  • options - NotificationChannelsClientListOptions contains the optional parameters for the NotificationChannelsClient.NewListPager method.
Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/d55b8005f05b040b852c15e74a0f3e36494a15e1/specification/devtestlabs/resource-manager/Microsoft.DevTestLab/stable/2018-09-15/examples/NotificationChannels_List.json

package main

import (
	"context"
	"log"

	"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
	"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/devtestlabs/armdevtestlabs"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armdevtestlabs.NewClientFactory("<subscription-id>", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	pager := clientFactory.NewNotificationChannelsClient().NewListPager("resourceGroupName", "{labName}", &armdevtestlabs.NotificationChannelsClientListOptions{Expand: nil,
		Filter:  nil,
		Top:     nil,
		Orderby: 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.NotificationChannelList = armdevtestlabs.NotificationChannelList{
		// 	Value: []*armdevtestlabs.NotificationChannel{
		// 		{
		// 			Name: to.Ptr("autoshutdown"),
		// 			Type: to.Ptr("Microsoft.DevTestLab/labs/notificationChannels"),
		// 			ID: to.Ptr("/subscriptions/{subscriptionId}/resourceGroups/resourceGroupName/providers/Microsoft.DevTestLab/labs/{labName}/notificationChannels/{notificationChannelName}"),
		// 			Location: to.Ptr("{location}"),
		// 			Tags: map[string]*string{
		// 				"tagName1": to.Ptr("tagValue1"),
		// 			},
		// 			Properties: &armdevtestlabs.NotificationChannelProperties{
		// 				Description: to.Ptr("Integration configured for auto-shutdown"),
		// 				CreatedDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-01-05T02:12:10.656Z"); return t}()),
		// 				EmailRecipient: to.Ptr("{email}"),
		// 				Events: []*armdevtestlabs.Event{
		// 					{
		// 						EventName: to.Ptr(armdevtestlabs.NotificationChannelEventTypeAutoShutdown),
		// 				}},
		// 				NotificationLocale: to.Ptr("en"),
		// 				ProvisioningState: to.Ptr("Succeeded"),
		// 				UniqueIdentifier: to.Ptr("{uniqueIdentifier}"),
		// 				WebHookURL: to.Ptr("{webhookUrl}"),
		// 			},
		// 		},
		// 		{
		// 			Name: to.Ptr("costThreshold"),
		// 			Type: to.Ptr("Microsoft.DevTestLab/labs/notificationChannels"),
		// 			ID: to.Ptr("/subscriptions/{subscriptionId}/resourceGroups/resourceGroupName/providers/Microsoft.DevTestLab/labs/{labName}/notificationChannels/{notificationChannelName}"),
		// 			Location: to.Ptr("{location}"),
		// 			Tags: map[string]*string{
		// 				"tagName1": to.Ptr("tagValue1"),
		// 			},
		// 			Properties: &armdevtestlabs.NotificationChannelProperties{
		// 				Description: to.Ptr("Integration configured for cost"),
		// 				CreatedDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-01-05T02:14:05.239Z"); return t}()),
		// 				Events: []*armdevtestlabs.Event{
		// 					{
		// 						EventName: to.Ptr(armdevtestlabs.NotificationChannelEventTypeCost),
		// 				}},
		// 				NotificationLocale: to.Ptr("en"),
		// 				ProvisioningState: to.Ptr("Succeeded"),
		// 				UniqueIdentifier: to.Ptr("{uniqueIdentifier}"),
		// 				WebHookURL: to.Ptr("{webhookUrl}"),
		// 			},
		// 	}},
		// }
	}
}
Output:

func (*NotificationChannelsClient) Notify

Notify - Send notification to provided channel. If the operation fails it returns an *azcore.ResponseError type.

Generated from API version 2018-09-15

  • resourceGroupName - The name of the resource group.
  • labName - The name of the lab.
  • name - The name of the notification channel.
  • notifyParameters - Properties for generating a Notification.
  • options - NotificationChannelsClientNotifyOptions contains the optional parameters for the NotificationChannelsClient.Notify method.
Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/d55b8005f05b040b852c15e74a0f3e36494a15e1/specification/devtestlabs/resource-manager/Microsoft.DevTestLab/stable/2018-09-15/examples/NotificationChannels_Notify.json

package main

import (
	"context"
	"log"

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

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armdevtestlabs.NewClientFactory("<subscription-id>", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	_, err = clientFactory.NewNotificationChannelsClient().Notify(ctx, "resourceGroupName", "{labName}", "{notificationChannelName}", armdevtestlabs.NotifyParameters{
		EventName:   to.Ptr(armdevtestlabs.NotificationChannelEventTypeAutoShutdown),
		JSONPayload: to.Ptr("{\"eventType\":\"AutoShutdown\",\"subscriptionId\":\"{subscriptionId}\",\"resourceGroupName\":\"resourceGroupName\",\"labName\":\"{labName}\"}"),
	}, nil)
	if err != nil {
		log.Fatalf("failed to finish the request: %v", err)
	}
}
Output:

func (*NotificationChannelsClient) Update

Update - Allows modifying tags of notification channels. All other properties will be ignored. If the operation fails it returns an *azcore.ResponseError type.

Generated from API version 2018-09-15

  • resourceGroupName - The name of the resource group.
  • labName - The name of the lab.
  • name - The name of the notification channel.
  • notificationChannel - A notification.
  • options - NotificationChannelsClientUpdateOptions contains the optional parameters for the NotificationChannelsClient.Update method.
Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/d55b8005f05b040b852c15e74a0f3e36494a15e1/specification/devtestlabs/resource-manager/Microsoft.DevTestLab/stable/2018-09-15/examples/NotificationChannels_Update.json

package main

import (
	"context"
	"log"

	"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
	"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/devtestlabs/armdevtestlabs"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armdevtestlabs.NewClientFactory("<subscription-id>", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	res, err := clientFactory.NewNotificationChannelsClient().Update(ctx, "resourceGroupName", "{labName}", "{notificationChannelName}", armdevtestlabs.NotificationChannelFragment{}, 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.NotificationChannel = armdevtestlabs.NotificationChannel{
	// 	Name: to.Ptr("{notificationChannelName}"),
	// 	Type: to.Ptr("Microsoft.DevTestLab/labs/notificationChannels"),
	// 	ID: to.Ptr("/subscriptions/{subscriptionId}/resourceGroups/resourceGroupName/providers/Microsoft.DevTestLab/labs/{labName}/notificationChannels/{notificationChannelName}"),
	// 	Location: to.Ptr("{location}"),
	// 	Tags: map[string]*string{
	// 		"tagName1": to.Ptr("tagValue1"),
	// 	},
	// 	Properties: &armdevtestlabs.NotificationChannelProperties{
	// 		Description: to.Ptr("Integration configured for auto-shutdown"),
	// 		CreatedDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-01-05T02:14:05.239Z"); return t}()),
	// 		EmailRecipient: to.Ptr("{email}"),
	// 		Events: []*armdevtestlabs.Event{
	// 			{
	// 				EventName: to.Ptr(armdevtestlabs.NotificationChannelEventTypeAutoShutdown),
	// 		}},
	// 		NotificationLocale: to.Ptr("en"),
	// 		ProvisioningState: to.Ptr("Succeeded"),
	// 		UniqueIdentifier: to.Ptr("{uniqueIdentifier}"),
	// 		WebHookURL: to.Ptr("{webhookUrl}"),
	// 	},
	// }
}
Output:

type NotificationChannelsClientCreateOrUpdateOptions added in v0.2.0

type NotificationChannelsClientCreateOrUpdateOptions struct {
}

NotificationChannelsClientCreateOrUpdateOptions contains the optional parameters for the NotificationChannelsClient.CreateOrUpdate method.

type NotificationChannelsClientCreateOrUpdateResponse added in v0.2.0

type NotificationChannelsClientCreateOrUpdateResponse struct {
	// A notification.
	NotificationChannel
}

NotificationChannelsClientCreateOrUpdateResponse contains the response from method NotificationChannelsClient.CreateOrUpdate.

type NotificationChannelsClientDeleteOptions added in v0.2.0

type NotificationChannelsClientDeleteOptions struct {
}

NotificationChannelsClientDeleteOptions contains the optional parameters for the NotificationChannelsClient.Delete method.

type NotificationChannelsClientDeleteResponse added in v0.2.0

type NotificationChannelsClientDeleteResponse struct {
}

NotificationChannelsClientDeleteResponse contains the response from method NotificationChannelsClient.Delete.

type NotificationChannelsClientGetOptions added in v0.2.0

type NotificationChannelsClientGetOptions struct {
	// Specify the $expand query. Example: 'properties($select=webHookUrl)'
	Expand *string
}

NotificationChannelsClientGetOptions contains the optional parameters for the NotificationChannelsClient.Get method.

type NotificationChannelsClientGetResponse added in v0.2.0

type NotificationChannelsClientGetResponse struct {
	// A notification.
	NotificationChannel
}

NotificationChannelsClientGetResponse contains the response from method NotificationChannelsClient.Get.

type NotificationChannelsClientListOptions added in v0.2.0

type NotificationChannelsClientListOptions struct {
	// Specify the $expand query. Example: 'properties($select=webHookUrl)'
	Expand *string

	// The filter to apply to the operation. Example: '$filter=contains(name,'myName')
	Filter *string

	// The ordering expression for the results, using OData notation. Example: '$orderby=name desc'
	Orderby *string

	// The maximum number of resources to return from the operation. Example: '$top=10'
	Top *int32
}

NotificationChannelsClientListOptions contains the optional parameters for the NotificationChannelsClient.NewListPager method.

type NotificationChannelsClientListResponse added in v0.2.0

type NotificationChannelsClientListResponse struct {
	// The response of a list operation.
	NotificationChannelList
}

NotificationChannelsClientListResponse contains the response from method NotificationChannelsClient.NewListPager.

type NotificationChannelsClientNotifyOptions added in v0.2.0

type NotificationChannelsClientNotifyOptions struct {
}

NotificationChannelsClientNotifyOptions contains the optional parameters for the NotificationChannelsClient.Notify method.

type NotificationChannelsClientNotifyResponse added in v0.2.0

type NotificationChannelsClientNotifyResponse struct {
}

NotificationChannelsClientNotifyResponse contains the response from method NotificationChannelsClient.Notify.

type NotificationChannelsClientUpdateOptions added in v0.2.0

type NotificationChannelsClientUpdateOptions struct {
}

NotificationChannelsClientUpdateOptions contains the optional parameters for the NotificationChannelsClient.Update method.

type NotificationChannelsClientUpdateResponse added in v0.2.0

type NotificationChannelsClientUpdateResponse struct {
	// A notification.
	NotificationChannel
}

NotificationChannelsClientUpdateResponse contains the response from method NotificationChannelsClient.Update.

type NotificationSettings

type NotificationSettings struct {
	// The email recipient to send notifications to (can be a list of semi-colon separated email addresses).
	EmailRecipient *string

	// The locale to use when sending a notification (fallback for unsupported languages is EN).
	NotificationLocale *string

	// If notifications are enabled for this schedule (i.e. Enabled, Disabled).
	Status *EnableStatus

	// Time in minutes before event at which notification will be sent.
	TimeInMinutes *int32

	// The webhook URL to which the notification will be sent.
	WebhookURL *string
}

NotificationSettings - Notification settings for a schedule.

func (NotificationSettings) MarshalJSON added in v1.1.0

func (n NotificationSettings) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.Marshaller interface for type NotificationSettings.

func (*NotificationSettings) UnmarshalJSON added in v1.1.0

func (n *NotificationSettings) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the json.Unmarshaller interface for type NotificationSettings.

type NotifyParameters

type NotifyParameters struct {
	// The type of event (i.e. AutoShutdown, Cost)
	EventName *NotificationChannelEventType

	// Properties for the notification in json format.
	JSONPayload *string
}

NotifyParameters - Properties for generating a Notification.

func (NotifyParameters) MarshalJSON added in v1.1.0

func (n NotifyParameters) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.Marshaller interface for type NotifyParameters.

func (*NotifyParameters) UnmarshalJSON added in v1.1.0

func (n *NotifyParameters) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the json.Unmarshaller interface for type NotifyParameters.

type OperationError

type OperationError struct {
	// The error code of the operation error.
	Code *string

	// The error message of the operation error.
	Message *string
}

OperationError - Error details for the operation in case of a failure.

func (OperationError) MarshalJSON added in v1.1.0

func (o OperationError) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.Marshaller interface for type OperationError.

func (*OperationError) UnmarshalJSON added in v1.1.0

func (o *OperationError) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the json.Unmarshaller interface for type OperationError.

type OperationMetadata

type OperationMetadata struct {
	// The object that describes the operations
	Display *OperationMetadataDisplay

	// Operation name: {provider}/{resource}/{operation}
	Name *string
}

OperationMetadata - The REST API operation supported by DevTestLab ResourceProvider.

func (OperationMetadata) MarshalJSON added in v1.1.0

func (o OperationMetadata) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.Marshaller interface for type OperationMetadata.

func (*OperationMetadata) UnmarshalJSON added in v1.1.0

func (o *OperationMetadata) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the json.Unmarshaller interface for type OperationMetadata.

type OperationMetadataDisplay

type OperationMetadataDisplay struct {
	// Friendly name of the operation
	Description *string

	// Operation type: read, write, delete, listKeys/action, etc.
	Operation *string

	// Friendly name of the resource provider
	Provider *string

	// Resource type on which the operation is performed.
	Resource *string
}

OperationMetadataDisplay - The object that describes the operations

func (OperationMetadataDisplay) MarshalJSON added in v1.1.0

func (o OperationMetadataDisplay) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.Marshaller interface for type OperationMetadataDisplay.

func (*OperationMetadataDisplay) UnmarshalJSON added in v1.1.0

func (o *OperationMetadataDisplay) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the json.Unmarshaller interface for type OperationMetadataDisplay.

type OperationResult

type OperationResult struct {
	// Error details for the operation in case of a failure.
	Error *OperationError

	// The operation status.
	Status *string

	// The status code for the operation.
	StatusCode *HTTPStatusCode
}

OperationResult - An Operation Result

func (OperationResult) MarshalJSON added in v1.1.0

func (o OperationResult) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.Marshaller interface for type OperationResult.

func (*OperationResult) UnmarshalJSON added in v1.1.0

func (o *OperationResult) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the json.Unmarshaller interface for type OperationResult.

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(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*OperationsClient, error)

NewOperationsClient creates a new instance of OperationsClient with the specified values.

  • subscriptionID - The subscription ID.
  • credential - used to authorize requests. Usually a credential from azidentity.
  • options - pass nil to accept the default values.

func (*OperationsClient) Get

Get - Get operation. If the operation fails it returns an *azcore.ResponseError type.

Generated from API version 2018-09-15

  • locationName - The name of the location.
  • name - The name of the operation.
  • options - OperationsClientGetOptions contains the optional parameters for the OperationsClient.Get method.
Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/d55b8005f05b040b852c15e74a0f3e36494a15e1/specification/devtestlabs/resource-manager/Microsoft.DevTestLab/stable/2018-09-15/examples/Operations_Get.json

package main

import (
	"context"
	"log"

	"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
	"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/devtestlabs/armdevtestlabs"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armdevtestlabs.NewClientFactory("<subscription-id>", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	res, err := clientFactory.NewOperationsClient().Get(ctx, "{locationName}", "{operationName}", 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.OperationResult = armdevtestlabs.OperationResult{
	// 	Status: to.Ptr("Running"),
	// 	StatusCode: to.Ptr(armdevtestlabs.HTTPStatusCodeOK),
	// }
}
Output:

type OperationsClientGetOptions added in v0.2.0

type OperationsClientGetOptions struct {
}

OperationsClientGetOptions contains the optional parameters for the OperationsClient.Get method.

type OperationsClientGetResponse added in v0.2.0

type OperationsClientGetResponse struct {
	// An Operation Result
	OperationResult
}

OperationsClientGetResponse contains the response from method OperationsClient.Get.

type ParameterInfo

type ParameterInfo struct {
	// The name of the artifact parameter.
	Name *string

	// The value of the artifact parameter.
	Value *string
}

ParameterInfo - Information about an artifact's parameter.

func (ParameterInfo) MarshalJSON added in v1.1.0

func (p ParameterInfo) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.Marshaller interface for type ParameterInfo.

func (*ParameterInfo) UnmarshalJSON added in v1.1.0

func (p *ParameterInfo) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the json.Unmarshaller interface for type ParameterInfo.

type ParametersValueFileInfo

type ParametersValueFileInfo struct {
	// File name.
	FileName *string

	// Contents of the file.
	ParametersValueInfo any
}

ParametersValueFileInfo - A file containing a set of parameter values for an ARM template.

func (ParametersValueFileInfo) MarshalJSON added in v1.1.0

func (p ParametersValueFileInfo) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.Marshaller interface for type ParametersValueFileInfo.

func (*ParametersValueFileInfo) UnmarshalJSON added in v1.1.0

func (p *ParametersValueFileInfo) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the json.Unmarshaller interface for type ParametersValueFileInfo.

type PercentageCostThresholdProperties

type PercentageCostThresholdProperties struct {
	// The cost threshold value.
	ThresholdValue *float64
}

PercentageCostThresholdProperties - Properties of a percentage cost threshold.

func (PercentageCostThresholdProperties) MarshalJSON added in v1.1.0

func (p PercentageCostThresholdProperties) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.Marshaller interface for type PercentageCostThresholdProperties.

func (*PercentageCostThresholdProperties) UnmarshalJSON added in v1.1.0

func (p *PercentageCostThresholdProperties) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the json.Unmarshaller interface for type PercentageCostThresholdProperties.

type PoliciesClient

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

PoliciesClient contains the methods for the Policies group. Don't use this type directly, use NewPoliciesClient() instead.

func NewPoliciesClient

func NewPoliciesClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*PoliciesClient, error)

NewPoliciesClient creates a new instance of PoliciesClient with the specified values.

  • subscriptionID - The subscription ID.
  • credential - used to authorize requests. Usually a credential from azidentity.
  • options - pass nil to accept the default values.

func (*PoliciesClient) CreateOrUpdate

func (client *PoliciesClient) CreateOrUpdate(ctx context.Context, resourceGroupName string, labName string, policySetName string, name string, policy Policy, options *PoliciesClientCreateOrUpdateOptions) (PoliciesClientCreateOrUpdateResponse, error)

CreateOrUpdate - Create or replace an existing policy. If the operation fails it returns an *azcore.ResponseError type.

Generated from API version 2018-09-15

  • resourceGroupName - The name of the resource group.
  • labName - The name of the lab.
  • policySetName - The name of the policy set.
  • name - The name of the policy.
  • policy - A Policy.
  • options - PoliciesClientCreateOrUpdateOptions contains the optional parameters for the PoliciesClient.CreateOrUpdate method.
Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/d55b8005f05b040b852c15e74a0f3e36494a15e1/specification/devtestlabs/resource-manager/Microsoft.DevTestLab/stable/2018-09-15/examples/Policies_CreateOrUpdate.json

package main

import (
	"context"
	"log"

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

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armdevtestlabs.NewClientFactory("<subscription-id>", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	res, err := clientFactory.NewPoliciesClient().CreateOrUpdate(ctx, "resourceGroupName", "{labName}", "{policySetName}", "{policyName}", armdevtestlabs.Policy{
		Location: to.Ptr("{location}"),
		Tags: map[string]*string{
			"tagName1": to.Ptr("tagValue1"),
		},
		Properties: &armdevtestlabs.PolicyProperties{
			Description:   to.Ptr("{policyDescription}"),
			EvaluatorType: to.Ptr(armdevtestlabs.PolicyEvaluatorType("{policyEvaluatorType}")),
			FactData:      to.Ptr("{policyFactData}"),
			FactName:      to.Ptr(armdevtestlabs.PolicyFactName("{policyFactName}")),
			Status:        to.Ptr(armdevtestlabs.PolicyStatus("{policyStatus}")),
			Threshold:     to.Ptr("{policyThreshold}"),
		},
	}, 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.Policy = armdevtestlabs.Policy{
	// 	Name: to.Ptr("{labName}"),
	// 	Type: to.Ptr("Microsoft.DevTestLab/labs/policies"),
	// 	ID: to.Ptr("/subscriptions/{subscriptionId}/resourceGroups/resourceGroupName/providers/Microsoft.DevTestLab/labs/{labName}/policysets/{policySetName}/policies/{policyName}"),
	// 	Location: to.Ptr("{location}"),
	// 	Properties: &armdevtestlabs.PolicyProperties{
	// 		Description: to.Ptr("{policyDescription}"),
	// 		CreatedDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2018-10-02T01:40:48.173Z"); return t}()),
	// 		EvaluatorType: to.Ptr(armdevtestlabs.PolicyEvaluatorType("{policyEvaluatorType}")),
	// 		FactData: to.Ptr("{policyFactData}"),
	// 		FactName: to.Ptr(armdevtestlabs.PolicyFactName("{policyFactName}")),
	// 		ProvisioningState: to.Ptr("Succeeded"),
	// 		Status: to.Ptr(armdevtestlabs.PolicyStatus("{policyStatus}")),
	// 		Threshold: to.Ptr("{policyThreshold}"),
	// 		UniqueIdentifier: to.Ptr("{uniqueIdentifier}"),
	// 	},
	// }
}
Output:

func (*PoliciesClient) Delete

func (client *PoliciesClient) Delete(ctx context.Context, resourceGroupName string, labName string, policySetName string, name string, options *PoliciesClientDeleteOptions) (PoliciesClientDeleteResponse, error)

Delete - Delete policy. If the operation fails it returns an *azcore.ResponseError type.

Generated from API version 2018-09-15

  • resourceGroupName - The name of the resource group.
  • labName - The name of the lab.
  • policySetName - The name of the policy set.
  • name - The name of the policy.
  • options - PoliciesClientDeleteOptions contains the optional parameters for the PoliciesClient.Delete method.
Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/d55b8005f05b040b852c15e74a0f3e36494a15e1/specification/devtestlabs/resource-manager/Microsoft.DevTestLab/stable/2018-09-15/examples/Policies_Delete.json

package main

import (
	"context"
	"log"

	"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
	"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/devtestlabs/armdevtestlabs"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armdevtestlabs.NewClientFactory("<subscription-id>", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	_, err = clientFactory.NewPoliciesClient().Delete(ctx, "resourceGroupName", "{labName}", "{policySetName}", "{policyName}", nil)
	if err != nil {
		log.Fatalf("failed to finish the request: %v", err)
	}
}
Output:

func (*PoliciesClient) Get

func (client *PoliciesClient) Get(ctx context.Context, resourceGroupName string, labName string, policySetName string, name string, options *PoliciesClientGetOptions) (PoliciesClientGetResponse, error)

Get - Get policy. If the operation fails it returns an *azcore.ResponseError type.

Generated from API version 2018-09-15

  • resourceGroupName - The name of the resource group.
  • labName - The name of the lab.
  • policySetName - The name of the policy set.
  • name - The name of the policy.
  • options - PoliciesClientGetOptions contains the optional parameters for the PoliciesClient.Get method.
Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/d55b8005f05b040b852c15e74a0f3e36494a15e1/specification/devtestlabs/resource-manager/Microsoft.DevTestLab/stable/2018-09-15/examples/Policies_Get.json

package main

import (
	"context"
	"log"

	"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
	"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/devtestlabs/armdevtestlabs"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armdevtestlabs.NewClientFactory("<subscription-id>", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	res, err := clientFactory.NewPoliciesClient().Get(ctx, "resourceGroupName", "{labName}", "{policySetName}", "{policyName}", &armdevtestlabs.PoliciesClientGetOptions{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.Policy = armdevtestlabs.Policy{
	// 	Properties: &armdevtestlabs.PolicyProperties{
	// 		Description: to.Ptr("{policyDescription}"),
	// 		CreatedDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2018-10-02T01:40:48.173Z"); return t}()),
	// 		EvaluatorType: to.Ptr(armdevtestlabs.PolicyEvaluatorType("{policyEvaluatorType}")),
	// 		FactData: to.Ptr("{policyFactData}"),
	// 		FactName: to.Ptr(armdevtestlabs.PolicyFactName("{policyFactName}")),
	// 		ProvisioningState: to.Ptr("Succeeded"),
	// 		Status: to.Ptr(armdevtestlabs.PolicyStatus("{policyStatus}")),
	// 		Threshold: to.Ptr("{policyThreshold}"),
	// 		UniqueIdentifier: to.Ptr("{uniqueIdentifier}"),
	// 	},
	// }
}
Output:

func (*PoliciesClient) NewListPager added in v0.4.0

func (client *PoliciesClient) NewListPager(resourceGroupName string, labName string, policySetName string, options *PoliciesClientListOptions) *runtime.Pager[PoliciesClientListResponse]

NewListPager - List policies in a given policy set.

Generated from API version 2018-09-15

  • resourceGroupName - The name of the resource group.
  • labName - The name of the lab.
  • policySetName - The name of the policy set.
  • options - PoliciesClientListOptions contains the optional parameters for the PoliciesClient.NewListPager method.
Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/d55b8005f05b040b852c15e74a0f3e36494a15e1/specification/devtestlabs/resource-manager/Microsoft.DevTestLab/stable/2018-09-15/examples/Policies_List.json

package main

import (
	"context"
	"log"

	"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
	"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/devtestlabs/armdevtestlabs"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armdevtestlabs.NewClientFactory("<subscription-id>", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	pager := clientFactory.NewPoliciesClient().NewListPager("resourceGroupName", "{labName}", "{policySetName}", &armdevtestlabs.PoliciesClientListOptions{Expand: nil,
		Filter:  nil,
		Top:     nil,
		Orderby: 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.PolicyList = armdevtestlabs.PolicyList{
		// 	Value: []*armdevtestlabs.Policy{
		// 		{
		// 			Name: to.Ptr("{labName}"),
		// 			Type: to.Ptr("Microsoft.DevTestLab/labs/policySets/policies"),
		// 			ID: to.Ptr("/subscriptions/{subscriptionId}/resourceGroups/resourceGroupName/providers/Microsoft.DevTestLab/labs/{labName}/policysets/{policySetName}/policies/{policyName}"),
		// 			Location: to.Ptr("{location}"),
		// 			Tags: map[string]*string{
		// 				"tagName1": to.Ptr("tagValue1"),
		// 			},
		// 			Properties: &armdevtestlabs.PolicyProperties{
		// 				Description: to.Ptr("{policyDescription}"),
		// 				CreatedDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2018-10-02T01:40:48.173Z"); return t}()),
		// 				EvaluatorType: to.Ptr(armdevtestlabs.PolicyEvaluatorType("{policyEvaluatorType}")),
		// 				FactData: to.Ptr("{policyFactData}"),
		// 				FactName: to.Ptr(armdevtestlabs.PolicyFactName("{policyFactName}")),
		// 				ProvisioningState: to.Ptr("Succeeded"),
		// 				Status: to.Ptr(armdevtestlabs.PolicyStatus("{policyStatus}")),
		// 				Threshold: to.Ptr("{policyThreshold}"),
		// 				UniqueIdentifier: to.Ptr("{uniqueIdentifier}"),
		// 			},
		// 	}},
		// }
	}
}
Output:

func (*PoliciesClient) Update

func (client *PoliciesClient) Update(ctx context.Context, resourceGroupName string, labName string, policySetName string, name string, policy PolicyFragment, options *PoliciesClientUpdateOptions) (PoliciesClientUpdateResponse, error)

Update - Allows modifying tags of policies. All other properties will be ignored. If the operation fails it returns an *azcore.ResponseError type.

Generated from API version 2018-09-15

  • resourceGroupName - The name of the resource group.
  • labName - The name of the lab.
  • policySetName - The name of the policy set.
  • name - The name of the policy.
  • policy - A Policy.
  • options - PoliciesClientUpdateOptions contains the optional parameters for the PoliciesClient.Update method.
Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/d55b8005f05b040b852c15e74a0f3e36494a15e1/specification/devtestlabs/resource-manager/Microsoft.DevTestLab/stable/2018-09-15/examples/Policies_Update.json

package main

import (
	"context"
	"log"

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

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armdevtestlabs.NewClientFactory("<subscription-id>", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	res, err := clientFactory.NewPoliciesClient().Update(ctx, "resourceGroupName", "{labName}", "{policySetName}", "{policyName}", armdevtestlabs.PolicyFragment{
		Tags: map[string]*string{
			"tagName1": to.Ptr("tagValue1"),
		},
	}, 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.Policy = armdevtestlabs.Policy{
	// 	Name: to.Ptr("{labName}"),
	// 	Type: to.Ptr("Microsoft.DevTestLab/labs/policies"),
	// 	ID: to.Ptr("/subscriptions/{subscriptionId}/resourceGroups/resourceGroupName/providers/Microsoft.DevTestLab/labs/{labName}/policysets/{policySetName}/policies/{policyName}"),
	// 	Location: to.Ptr("{location}"),
	// 	Properties: &armdevtestlabs.PolicyProperties{
	// 		Description: to.Ptr("{policyDescription}"),
	// 		CreatedDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2018-10-02T01:40:48.173Z"); return t}()),
	// 		EvaluatorType: to.Ptr(armdevtestlabs.PolicyEvaluatorType("{policyEvaluatorType}")),
	// 		FactData: to.Ptr("{policyFactData}"),
	// 		FactName: to.Ptr(armdevtestlabs.PolicyFactName("{policyFactName}")),
	// 		ProvisioningState: to.Ptr("Succeeded"),
	// 		Status: to.Ptr(armdevtestlabs.PolicyStatus("{policyStatus}")),
	// 		Threshold: to.Ptr("{policyThreshold}"),
	// 		UniqueIdentifier: to.Ptr("{uniqueIdentifier}"),
	// 	},
	// }
}
Output:

type PoliciesClientCreateOrUpdateOptions added in v0.2.0

type PoliciesClientCreateOrUpdateOptions struct {
}

PoliciesClientCreateOrUpdateOptions contains the optional parameters for the PoliciesClient.CreateOrUpdate method.

type PoliciesClientCreateOrUpdateResponse added in v0.2.0

type PoliciesClientCreateOrUpdateResponse struct {
	// A Policy.
	Policy
}

PoliciesClientCreateOrUpdateResponse contains the response from method PoliciesClient.CreateOrUpdate.

type PoliciesClientDeleteOptions added in v0.2.0

type PoliciesClientDeleteOptions struct {
}

PoliciesClientDeleteOptions contains the optional parameters for the PoliciesClient.Delete method.

type PoliciesClientDeleteResponse added in v0.2.0

type PoliciesClientDeleteResponse struct {
}

PoliciesClientDeleteResponse contains the response from method PoliciesClient.Delete.

type PoliciesClientGetOptions added in v0.2.0

type PoliciesClientGetOptions struct {
	// Specify the $expand query. Example: 'properties($select=description)'
	Expand *string
}

PoliciesClientGetOptions contains the optional parameters for the PoliciesClient.Get method.

type PoliciesClientGetResponse added in v0.2.0

type PoliciesClientGetResponse struct {
	// A Policy.
	Policy
}

PoliciesClientGetResponse contains the response from method PoliciesClient.Get.

type PoliciesClientListOptions added in v0.2.0

type PoliciesClientListOptions struct {
	// Specify the $expand query. Example: 'properties($select=description)'
	Expand *string

	// The filter to apply to the operation. Example: '$filter=contains(name,'myName')
	Filter *string

	// The ordering expression for the results, using OData notation. Example: '$orderby=name desc'
	Orderby *string

	// The maximum number of resources to return from the operation. Example: '$top=10'
	Top *int32
}

PoliciesClientListOptions contains the optional parameters for the PoliciesClient.NewListPager method.

type PoliciesClientListResponse added in v0.2.0

type PoliciesClientListResponse struct {
	// The response of a list operation.
	PolicyList
}

PoliciesClientListResponse contains the response from method PoliciesClient.NewListPager.

type PoliciesClientUpdateOptions added in v0.2.0

type PoliciesClientUpdateOptions struct {
}

PoliciesClientUpdateOptions contains the optional parameters for the PoliciesClient.Update method.

type PoliciesClientUpdateResponse added in v0.2.0

type PoliciesClientUpdateResponse struct {
	// A Policy.
	Policy
}

PoliciesClientUpdateResponse contains the response from method PoliciesClient.Update.

type Policy

type Policy struct {
	// REQUIRED; The properties of the resource.
	Properties *PolicyProperties

	// The location of the resource.
	Location *string

	// The tags of the resource.
	Tags map[string]*string

	// READ-ONLY; The identifier of the resource.
	ID *string

	// READ-ONLY; The name of the resource.
	Name *string

	// READ-ONLY; The type of the resource.
	Type *string
}

Policy - A Policy.

func (Policy) MarshalJSON

func (p Policy) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.Marshaller interface for type Policy.

func (*Policy) UnmarshalJSON added in v1.1.0

func (p *Policy) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the json.Unmarshaller interface for type Policy.

type PolicyEvaluatorType

type PolicyEvaluatorType string

PolicyEvaluatorType - The evaluator type of the policy (i.e. AllowedValuesPolicy, MaxValuePolicy).

const (
	PolicyEvaluatorTypeAllowedValuesPolicy PolicyEvaluatorType = "AllowedValuesPolicy"
	PolicyEvaluatorTypeMaxValuePolicy      PolicyEvaluatorType = "MaxValuePolicy"
)

func PossiblePolicyEvaluatorTypeValues

func PossiblePolicyEvaluatorTypeValues() []PolicyEvaluatorType

PossiblePolicyEvaluatorTypeValues returns the possible values for the PolicyEvaluatorType const type.

type PolicyFactName

type PolicyFactName string

PolicyFactName - The fact name of the policy (e.g. LabVmCount, LabVmSize, MaxVmsAllowedPerLab, etc.

const (
	PolicyFactNameEnvironmentTemplate         PolicyFactName = "EnvironmentTemplate"
	PolicyFactNameGalleryImage                PolicyFactName = "GalleryImage"
	PolicyFactNameLabPremiumVMCount           PolicyFactName = "LabPremiumVmCount"
	PolicyFactNameLabTargetCost               PolicyFactName = "LabTargetCost"
	PolicyFactNameLabVMCount                  PolicyFactName = "LabVmCount"
	PolicyFactNameLabVMSize                   PolicyFactName = "LabVmSize"
	PolicyFactNameScheduleEditPermission      PolicyFactName = "ScheduleEditPermission"
	PolicyFactNameUserOwnedLabPremiumVMCount  PolicyFactName = "UserOwnedLabPremiumVmCount"
	PolicyFactNameUserOwnedLabVMCount         PolicyFactName = "UserOwnedLabVmCount"
	PolicyFactNameUserOwnedLabVMCountInSubnet PolicyFactName = "UserOwnedLabVmCountInSubnet"
)

func PossiblePolicyFactNameValues

func PossiblePolicyFactNameValues() []PolicyFactName

PossiblePolicyFactNameValues returns the possible values for the PolicyFactName const type.

type PolicyFragment

type PolicyFragment struct {
	// The tags of the resource.
	Tags map[string]*string
}

PolicyFragment - A Policy.

func (PolicyFragment) MarshalJSON added in v0.2.0

func (p PolicyFragment) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.Marshaller interface for type PolicyFragment.

func (*PolicyFragment) UnmarshalJSON added in v1.1.0

func (p *PolicyFragment) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the json.Unmarshaller interface for type PolicyFragment.

type PolicyList

type PolicyList struct {
	// Link for next set of results.
	NextLink *string

	// Results of the list operation.
	Value []*Policy
}

PolicyList - The response of a list operation.

func (PolicyList) MarshalJSON

func (p PolicyList) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.Marshaller interface for type PolicyList.

func (*PolicyList) UnmarshalJSON added in v1.1.0

func (p *PolicyList) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the json.Unmarshaller interface for type PolicyList.

type PolicyProperties

type PolicyProperties struct {
	// The description of the policy.
	Description *string

	// The evaluator type of the policy (i.e. AllowedValuesPolicy, MaxValuePolicy).
	EvaluatorType *PolicyEvaluatorType

	// The fact data of the policy.
	FactData *string

	// The fact name of the policy (e.g. LabVmCount, LabVmSize, MaxVmsAllowedPerLab, etc.
	FactName *PolicyFactName

	// The status of the policy.
	Status *PolicyStatus

	// The threshold of the policy (i.e. a number for MaxValuePolicy, and a JSON array of values for AllowedValuesPolicy).
	Threshold *string

	// READ-ONLY; The creation date of the policy.
	CreatedDate *time.Time

	// READ-ONLY; The provisioning status of the resource.
	ProvisioningState *string

	// READ-ONLY; The unique immutable identifier of a resource (Guid).
	UniqueIdentifier *string
}

PolicyProperties - Properties of a Policy.

func (PolicyProperties) MarshalJSON

func (p PolicyProperties) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.Marshaller interface for type PolicyProperties.

func (*PolicyProperties) UnmarshalJSON

func (p *PolicyProperties) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the json.Unmarshaller interface for type PolicyProperties.

type PolicySetResult

type PolicySetResult struct {
	// A value indicating whether this policy set evaluation has discovered violations.
	HasError *bool

	// The list of policy violations.
	PolicyViolations []*PolicyViolation
}

PolicySetResult - Result of a policy set evaluation.

func (PolicySetResult) MarshalJSON

func (p PolicySetResult) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.Marshaller interface for type PolicySetResult.

func (*PolicySetResult) UnmarshalJSON added in v1.1.0

func (p *PolicySetResult) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the json.Unmarshaller interface for type PolicySetResult.

type PolicySetsClient

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

PolicySetsClient contains the methods for the PolicySets group. Don't use this type directly, use NewPolicySetsClient() instead.

func NewPolicySetsClient

func NewPolicySetsClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*PolicySetsClient, error)

NewPolicySetsClient creates a new instance of PolicySetsClient with the specified values.

  • subscriptionID - The subscription ID.
  • credential - used to authorize requests. Usually a credential from azidentity.
  • options - pass nil to accept the default values.

func (*PolicySetsClient) EvaluatePolicies

func (client *PolicySetsClient) EvaluatePolicies(ctx context.Context, resourceGroupName string, labName string, name string, evaluatePoliciesRequest EvaluatePoliciesRequest, options *PolicySetsClientEvaluatePoliciesOptions) (PolicySetsClientEvaluatePoliciesResponse, error)

EvaluatePolicies - Evaluates lab policy. If the operation fails it returns an *azcore.ResponseError type.

Generated from API version 2018-09-15

  • resourceGroupName - The name of the resource group.
  • labName - The name of the lab.
  • name - The name of the policy set.
  • evaluatePoliciesRequest - Request body for evaluating a policy set.
  • options - PolicySetsClientEvaluatePoliciesOptions contains the optional parameters for the PolicySetsClient.EvaluatePolicies method.
Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/d55b8005f05b040b852c15e74a0f3e36494a15e1/specification/devtestlabs/resource-manager/Microsoft.DevTestLab/stable/2018-09-15/examples/PolicySets_EvaluatePolicies.json

package main

import (
	"context"
	"log"

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

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armdevtestlabs.NewClientFactory("<subscription-id>", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	res, err := clientFactory.NewPolicySetsClient().EvaluatePolicies(ctx, "resourceGroupName", "{labName}", "{policySetName}", armdevtestlabs.EvaluatePoliciesRequest{
		Policies: []*armdevtestlabs.EvaluatePoliciesProperties{
			{
				FactName:    to.Ptr("LabVmCount"),
				ValueOffset: 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.EvaluatePoliciesResponse = armdevtestlabs.EvaluatePoliciesResponse{
	// 	Results: []*armdevtestlabs.PolicySetResult{
	// 		{
	// 			HasError: to.Ptr(true),
	// 			PolicyViolations: []*armdevtestlabs.PolicyViolation{
	// 				{
	// 					Code: to.Ptr("MaxValuePolicy"),
	// 					Message: to.Ptr("You cannot exceed the limit (1) of virtual machines that can be created in this lab."),
	// 			}},
	// 	}},
	// }
}
Output:

type PolicySetsClientEvaluatePoliciesOptions added in v0.2.0

type PolicySetsClientEvaluatePoliciesOptions struct {
}

PolicySetsClientEvaluatePoliciesOptions contains the optional parameters for the PolicySetsClient.EvaluatePolicies method.

type PolicySetsClientEvaluatePoliciesResponse added in v0.2.0

type PolicySetsClientEvaluatePoliciesResponse struct {
	// Response body for evaluating a policy set.
	EvaluatePoliciesResponse
}

PolicySetsClientEvaluatePoliciesResponse contains the response from method PolicySetsClient.EvaluatePolicies.

type PolicyStatus

type PolicyStatus string

PolicyStatus - The status of the policy.

const (
	PolicyStatusDisabled PolicyStatus = "Disabled"
	PolicyStatusEnabled  PolicyStatus = "Enabled"
)

func PossiblePolicyStatusValues

func PossiblePolicyStatusValues() []PolicyStatus

PossiblePolicyStatusValues returns the possible values for the PolicyStatus const type.

type PolicyViolation

type PolicyViolation struct {
	// The code of the policy violation.
	Code *string

	// The message of the policy violation.
	Message *string
}

PolicyViolation - Policy violation.

func (PolicyViolation) MarshalJSON added in v1.1.0

func (p PolicyViolation) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.Marshaller interface for type PolicyViolation.

func (*PolicyViolation) UnmarshalJSON added in v1.1.0

func (p *PolicyViolation) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the json.Unmarshaller interface for type PolicyViolation.

type Port

type Port struct {
	// Backend port of the target virtual machine.
	BackendPort *int32

	// Protocol type of the port.
	TransportProtocol *TransportProtocol
}

Port - Properties of a network port.

func (Port) MarshalJSON added in v1.1.0

func (p Port) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.Marshaller interface for type Port.

func (*Port) UnmarshalJSON added in v1.1.0

func (p *Port) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the json.Unmarshaller interface for type Port.

type PremiumDataDisk

type PremiumDataDisk string

PremiumDataDisk - The setting to enable usage of premium data disks. When its value is 'Enabled', creation of standard or premium data disks is allowed. When its value is 'Disabled', only creation of standard data disks is allowed.

const (
	PremiumDataDiskDisabled PremiumDataDisk = "Disabled"
	PremiumDataDiskEnabled  PremiumDataDisk = "Enabled"
)

func PossiblePremiumDataDiskValues

func PossiblePremiumDataDiskValues() []PremiumDataDisk

PossiblePremiumDataDiskValues returns the possible values for the PremiumDataDisk const type.

type ProviderOperationResult

type ProviderOperationResult struct {
	// List of operations supported by the resource provider.
	Value []*OperationMetadata

	// READ-ONLY; URL to get the next set of operation list results if there are any.
	NextLink *string
}

ProviderOperationResult - Result of the request to list REST API operations

func (ProviderOperationResult) MarshalJSON

func (p ProviderOperationResult) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.Marshaller interface for type ProviderOperationResult.

func (*ProviderOperationResult) UnmarshalJSON added in v1.1.0

func (p *ProviderOperationResult) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the json.Unmarshaller interface for type ProviderOperationResult.

type ProviderOperationsClient

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

ProviderOperationsClient contains the methods for the ProviderOperations group. Don't use this type directly, use NewProviderOperationsClient() instead.

func NewProviderOperationsClient

func NewProviderOperationsClient(credential azcore.TokenCredential, options *arm.ClientOptions) (*ProviderOperationsClient, error)

NewProviderOperationsClient creates a new instance of ProviderOperationsClient with the specified values.

  • credential - used to authorize requests. Usually a credential from azidentity.
  • options - pass nil to accept the default values.

func (*ProviderOperationsClient) NewListPager added in v0.4.0

NewListPager - Result of the request to list REST API operations

Generated from API version 2018-09-15

  • options - ProviderOperationsClientListOptions contains the optional parameters for the ProviderOperationsClient.NewListPager method.
Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/d55b8005f05b040b852c15e74a0f3e36494a15e1/specification/devtestlabs/resource-manager/Microsoft.DevTestLab/stable/2018-09-15/examples/ProviderOperations_List.json

package main

import (
	"context"
	"log"

	"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
	"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/devtestlabs/armdevtestlabs"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armdevtestlabs.NewClientFactory("<subscription-id>", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	pager := clientFactory.NewProviderOperationsClient().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.ProviderOperationResult = armdevtestlabs.ProviderOperationResult{
		// 	Value: []*armdevtestlabs.OperationMetadata{
		// 		{
		// 			Name: to.Ptr("Microsoft.DevTestLab/register/action"),
		// 			Display: &armdevtestlabs.OperationMetadataDisplay{
		// 				Description: to.Ptr("Registers the subscription"),
		// 				Operation: to.Ptr("Register Subscription"),
		// 				Provider: to.Ptr("Microsoft DevTest Labs"),
		// 				Resource: to.Ptr("register"),
		// 			},
		// 		},
		// 		{
		// 			Name: to.Ptr("Microsoft.DevTestLab/labs/policySets/EvaluatePolicies/action"),
		// 			Display: &armdevtestlabs.OperationMetadataDisplay{
		// 				Description: to.Ptr("Evaluates lab policy."),
		// 				Operation: to.Ptr("Evaluate policy"),
		// 				Provider: to.Ptr("Microsoft DevTest Labs"),
		// 				Resource: to.Ptr("policy sets"),
		// 			},
		// 		},
		// 		{
		// 			Name: to.Ptr("Microsoft.DevTestLab/labs/delete"),
		// 			Display: &armdevtestlabs.OperationMetadataDisplay{
		// 				Description: to.Ptr("Delete labs."),
		// 				Operation: to.Ptr("Delete labs."),
		// 				Provider: to.Ptr("Microsoft DevTest Labs"),
		// 				Resource: to.Ptr("Labs"),
		// 			},
		// 		},
		// 		{
		// 			Name: to.Ptr("Microsoft.DevTestLab/labs/read"),
		// 			Display: &armdevtestlabs.OperationMetadataDisplay{
		// 				Description: to.Ptr("Read labs."),
		// 				Operation: to.Ptr("Read labs."),
		// 				Provider: to.Ptr("Microsoft DevTest Labs"),
		// 				Resource: to.Ptr("Labs"),
		// 			},
		// 		},
		// 		{
		// 			Name: to.Ptr("Microsoft.DevTestLab/labs/write"),
		// 			Display: &armdevtestlabs.OperationMetadataDisplay{
		// 				Description: to.Ptr("Add or modify labs."),
		// 				Operation: to.Ptr("Add or modify labs."),
		// 				Provider: to.Ptr("Microsoft DevTest Labs"),
		// 				Resource: to.Ptr("Labs"),
		// 			},
		// 		},
		// 		{
		// 			Name: to.Ptr("Microsoft.DevTestLab/labs/ListVhds/action"),
		// 			Display: &armdevtestlabs.OperationMetadataDisplay{
		// 				Description: to.Ptr("List disk images available for custom image creation."),
		// 				Operation: to.Ptr("List VHDs"),
		// 				Provider: to.Ptr("Microsoft DevTest Labs"),
		// 				Resource: to.Ptr("Labs"),
		// 			},
		// 		},
		// 		{
		// 			Name: to.Ptr("Microsoft.DevTestLab/labs/GenerateUploadUri/action"),
		// 			Display: &armdevtestlabs.OperationMetadataDisplay{
		// 				Description: to.Ptr("Generate a URI for uploading custom disk images to a Lab."),
		// 				Operation: to.Ptr("Generate image upload URI"),
		// 				Provider: to.Ptr("Microsoft DevTest Labs"),
		// 				Resource: to.Ptr("Labs"),
		// 			},
		// 		},
		// 		{
		// 			Name: to.Ptr("Microsoft.DevTestLab/labs/CreateEnvironment/action"),
		// 			Display: &armdevtestlabs.OperationMetadataDisplay{
		// 				Description: to.Ptr("Create virtual machines in a lab."),
		// 				Operation: to.Ptr("Create a virtual machine"),
		// 				Provider: to.Ptr("Microsoft DevTest Labs"),
		// 				Resource: to.Ptr("Labs"),
		// 			},
		// 		},
		// 		{
		// 			Name: to.Ptr("Microsoft.DevTestLab/labs/ClaimAnyVm/action"),
		// 			Display: &armdevtestlabs.OperationMetadataDisplay{
		// 				Description: to.Ptr("Claim a random claimable virtual machine in the lab."),
		// 				Operation: to.Ptr("Claim Any Virtual Machine"),
		// 				Provider: to.Ptr("Microsoft DevTest Labs"),
		// 				Resource: to.Ptr("Labs"),
		// 			},
		// 		},
		// 		{
		// 			Name: to.Ptr("Microsoft.DevTestLab/labs/ExportResourceUsage/action"),
		// 			Display: &armdevtestlabs.OperationMetadataDisplay{
		// 				Description: to.Ptr("Exports the lab resource usage into a storage account"),
		// 				Operation: to.Ptr("Exports the lab resource usage into a storage account"),
		// 				Provider: to.Ptr("Microsoft DevTest Labs"),
		// 				Resource: to.Ptr("Labs"),
		// 			},
		// 		},
		// 		{
		// 			Name: to.Ptr("Microsoft.DevTestLab/labs/ImportVirtualMachine/action"),
		// 			Display: &armdevtestlabs.OperationMetadataDisplay{
		// 				Description: to.Ptr("Import a virtual machine into a different lab."),
		// 				Operation: to.Ptr("Import a virtual machine"),
		// 				Provider: to.Ptr("Microsoft DevTest Labs"),
		// 				Resource: to.Ptr("Labs"),
		// 			},
		// 		},
		// 		{
		// 			Name: to.Ptr("Microsoft.DevTestLab/labs/policySets/policies/delete"),
		// 			Display: &armdevtestlabs.OperationMetadataDisplay{
		// 				Description: to.Ptr("Delete policies."),
		// 				Operation: to.Ptr("Delete policies."),
		// 				Provider: to.Ptr("Microsoft DevTest Labs"),
		// 				Resource: to.Ptr("policies"),
		// 			},
		// 		},
		// 		{
		// 			Name: to.Ptr("Microsoft.DevTestLab/labs/policySets/policies/read"),
		// 			Display: &armdevtestlabs.OperationMetadataDisplay{
		// 				Description: to.Ptr("Read policies."),
		// 				Operation: to.Ptr("Read policies."),
		// 				Provider: to.Ptr("Microsoft DevTest Labs"),
		// 				Resource: to.Ptr("policies"),
		// 			},
		// 		},
		// 		{
		// 			Name: to.Ptr("Microsoft.DevTestLab/labs/policySets/policies/write"),
		// 			Display: &armdevtestlabs.OperationMetadataDisplay{
		// 				Description: to.Ptr("Add or modify policies."),
		// 				Operation: to.Ptr("Add or modify policies."),
		// 				Provider: to.Ptr("Microsoft DevTest Labs"),
		// 				Resource: to.Ptr("policies"),
		// 			},
		// 		},
		// 		{
		// 			Name: to.Ptr("Microsoft.DevTestLab/labs/schedules/delete"),
		// 			Display: &armdevtestlabs.OperationMetadataDisplay{
		// 				Description: to.Ptr("Delete schedules."),
		// 				Operation: to.Ptr("Delete schedules."),
		// 				Provider: to.Ptr("Microsoft DevTest Labs"),
		// 				Resource: to.Ptr("schedules"),
		// 			},
		// 		},
		// 		{
		// 			Name: to.Ptr("Microsoft.DevTestLab/labs/schedules/read"),
		// 			Display: &armdevtestlabs.OperationMetadataDisplay{
		// 				Description: to.Ptr("Read schedules."),
		// 				Operation: to.Ptr("Read schedules."),
		// 				Provider: to.Ptr("Microsoft DevTest Labs"),
		// 				Resource: to.Ptr("schedules"),
		// 			},
		// 		},
		// 		{
		// 			Name: to.Ptr("Microsoft.DevTestLab/labs/schedules/write"),
		// 			Display: &armdevtestlabs.OperationMetadataDisplay{
		// 				Description: to.Ptr("Add or modify schedules."),
		// 				Operation: to.Ptr("Add or modify schedules."),
		// 				Provider: to.Ptr("Microsoft DevTest Labs"),
		// 				Resource: to.Ptr("schedules"),
		// 			},
		// 		},
		// 		{
		// 			Name: to.Ptr("Microsoft.DevTestLab/labs/schedules/Execute/action"),
		// 			Display: &armdevtestlabs.OperationMetadataDisplay{
		// 				Description: to.Ptr("Execute a schedule."),
		// 				Operation: to.Ptr("Execute schedule"),
		// 				Provider: to.Ptr("Microsoft DevTest Labs"),
		// 				Resource: to.Ptr("schedules"),
		// 			},
		// 		},
		// 		{
		// 			Name: to.Ptr("Microsoft.DevTestLab/labs/schedules/ListApplicable/action"),
		// 			Display: &armdevtestlabs.OperationMetadataDisplay{
		// 				Description: to.Ptr("Lists all applicable schedules"),
		// 				Operation: to.Ptr("List all applicable schedules"),
		// 				Provider: to.Ptr("Microsoft DevTest Labs"),
		// 				Resource: to.Ptr("schedules"),
		// 			},
		// 		},
		// 		{
		// 			Name: to.Ptr("Microsoft.DevTestLab/schedules/delete"),
		// 			Display: &armdevtestlabs.OperationMetadataDisplay{
		// 				Description: to.Ptr("Delete schedules."),
		// 				Operation: to.Ptr("Delete schedules."),
		// 				Provider: to.Ptr("Microsoft DevTest Labs"),
		// 				Resource: to.Ptr("schedules"),
		// 			},
		// 		},
		// 		{
		// 			Name: to.Ptr("Microsoft.DevTestLab/schedules/read"),
		// 			Display: &armdevtestlabs.OperationMetadataDisplay{
		// 				Description: to.Ptr("Read schedules."),
		// 				Operation: to.Ptr("Read schedules."),
		// 				Provider: to.Ptr("Microsoft DevTest Labs"),
		// 				Resource: to.Ptr("schedules"),
		// 			},
		// 		},
		// 		{
		// 			Name: to.Ptr("Microsoft.DevTestLab/schedules/write"),
		// 			Display: &armdevtestlabs.OperationMetadataDisplay{
		// 				Description: to.Ptr("Add or modify schedules."),
		// 				Operation: to.Ptr("Add or modify schedules."),
		// 				Provider: to.Ptr("Microsoft DevTest Labs"),
		// 				Resource: to.Ptr("schedules"),
		// 			},
		// 		},
		// 		{
		// 			Name: to.Ptr("Microsoft.DevTestLab/schedules/Execute/action"),
		// 			Display: &armdevtestlabs.OperationMetadataDisplay{
		// 				Description: to.Ptr("Execute a schedule."),
		// 				Operation: to.Ptr("Execute schedule"),
		// 				Provider: to.Ptr("Microsoft DevTest Labs"),
		// 				Resource: to.Ptr("schedules"),
		// 			},
		// 		},
		// 		{
		// 			Name: to.Ptr("Microsoft.DevTestLab/schedules/Retarget/action"),
		// 			Display: &armdevtestlabs.OperationMetadataDisplay{
		// 				Description: to.Ptr("Updates a schedule's target resource Id."),
		// 				Operation: to.Ptr("Retarget schedule."),
		// 				Provider: to.Ptr("Microsoft DevTest Labs"),
		// 				Resource: to.Ptr("schedules"),
		// 			},
		// 		},
		// 		{
		// 			Name: to.Ptr("Microsoft.DevTestLab/labs/virtualMachines/schedules/delete"),
		// 			Display: &armdevtestlabs.OperationMetadataDisplay{
		// 				Description: to.Ptr("Delete schedules."),
		// 				Operation: to.Ptr("Delete schedules."),
		// 				Provider: to.Ptr("Microsoft DevTest Labs"),
		// 				Resource: to.Ptr("schedules"),
		// 			},
		// 		},
		// 		{
		// 			Name: to.Ptr("Microsoft.DevTestLab/labs/virtualMachines/schedules/read"),
		// 			Display: &armdevtestlabs.OperationMetadataDisplay{
		// 				Description: to.Ptr("Read schedules."),
		// 				Operation: to.Ptr("Read schedules."),
		// 				Provider: to.Ptr("Microsoft DevTest Labs"),
		// 				Resource: to.Ptr("schedules"),
		// 			},
		// 		},
		// 		{
		// 			Name: to.Ptr("Microsoft.DevTestLab/labs/virtualMachines/schedules/write"),
		// 			Display: &armdevtestlabs.OperationMetadataDisplay{
		// 				Description: to.Ptr("Add or modify schedules."),
		// 				Operation: to.Ptr("Add or modify schedules."),
		// 				Provider: to.Ptr("Microsoft DevTest Labs"),
		// 				Resource: to.Ptr("schedules"),
		// 			},
		// 		},
		// 		{
		// 			Name: to.Ptr("Microsoft.DevTestLab/labs/virtualMachines/schedules/Execute/action"),
		// 			Display: &armdevtestlabs.OperationMetadataDisplay{
		// 				Description: to.Ptr("Execute a schedule."),
		// 				Operation: to.Ptr("Execute schedule"),
		// 				Provider: to.Ptr("Microsoft DevTest Labs"),
		// 				Resource: to.Ptr("schedules"),
		// 			},
		// 		},
		// 		{
		// 			Name: to.Ptr("Microsoft.DevTestLab/labs/users/serviceFabrics/schedules/delete"),
		// 			Display: &armdevtestlabs.OperationMetadataDisplay{
		// 				Description: to.Ptr("Delete schedules."),
		// 				Operation: to.Ptr("Delete schedules."),
		// 				Provider: to.Ptr("Microsoft DevTest Labs"),
		// 				Resource: to.Ptr("schedules"),
		// 			},
		// 		},
		// 		{
		// 			Name: to.Ptr("Microsoft.DevTestLab/labs/users/serviceFabrics/schedules/read"),
		// 			Display: &armdevtestlabs.OperationMetadataDisplay{
		// 				Description: to.Ptr("Read schedules."),
		// 				Operation: to.Ptr("Read schedules."),
		// 				Provider: to.Ptr("Microsoft DevTest Labs"),
		// 				Resource: to.Ptr("schedules"),
		// 			},
		// 		},
		// 		{
		// 			Name: to.Ptr("Microsoft.DevTestLab/labs/users/serviceFabrics/schedules/write"),
		// 			Display: &armdevtestlabs.OperationMetadataDisplay{
		// 				Description: to.Ptr("Add or modify schedules."),
		// 				Operation: to.Ptr("Add or modify schedules."),
		// 				Provider: to.Ptr("Microsoft DevTest Labs"),
		// 				Resource: to.Ptr("schedules"),
		// 			},
		// 		},
		// 		{
		// 			Name: to.Ptr("Microsoft.DevTestLab/labs/users/serviceFabrics/schedules/Execute/action"),
		// 			Display: &armdevtestlabs.OperationMetadataDisplay{
		// 				Description: to.Ptr("Execute a schedule."),
		// 				Operation: to.Ptr("Execute schedule"),
		// 				Provider: to.Ptr("Microsoft DevTest Labs"),
		// 				Resource: to.Ptr("schedules"),
		// 			},
		// 		},
		// 		{
		// 			Name: to.Ptr("Microsoft.DevTestLab/labs/artifactSources/delete"),
		// 			Display: &armdevtestlabs.OperationMetadataDisplay{
		// 				Description: to.Ptr("Delete artifact sources."),
		// 				Operation: to.Ptr("Delete artifact sources."),
		// 				Provider: to.Ptr("Microsoft DevTest Labs"),
		// 				Resource: to.Ptr("Artifact sources"),
		// 			},
		// 		},
		// 		{
		// 			Name: to.Ptr("Microsoft.DevTestLab/labs/artifactSources/read"),
		// 			Display: &armdevtestlabs.OperationMetadataDisplay{
		// 				Description: to.Ptr("Read artifact sources."),
		// 				Operation: to.Ptr("Read artifact sources."),
		// 				Provider: to.Ptr("Microsoft DevTest Labs"),
		// 				Resource: to.Ptr("Artifact sources"),
		// 			},
		// 		},
		// 		{
		// 			Name: to.Ptr("Microsoft.DevTestLab/labs/artifactSources/write"),
		// 			Display: &armdevtestlabs.OperationMetadataDisplay{
		// 				Description: to.Ptr("Add or modify artifact sources."),
		// 				Operation: to.Ptr("Add or modify artifact sources."),
		// 				Provider: to.Ptr("Microsoft DevTest Labs"),
		// 				Resource: to.Ptr("Artifact sources"),
		// 			},
		// 		},
		// 		{
		// 			Name: to.Ptr("Microsoft.DevTestLab/labs/artifactSources/artifacts/read"),
		// 			Display: &armdevtestlabs.OperationMetadataDisplay{
		// 				Description: to.Ptr("Read artifacts."),
		// 				Operation: to.Ptr("Read artifacts."),
		// 				Provider: to.Ptr("Microsoft DevTest Labs"),
		// 				Resource: to.Ptr("Artifacts"),
		// 			},
		// 		},
		// 		{
		// 			Name: to.Ptr("Microsoft.DevTestLab/labs/artifactSources/artifacts/GenerateArmTemplate/action"),
		// 			Display: &armdevtestlabs.OperationMetadataDisplay{
		// 				Description: to.Ptr("Generates an ARM template for the given artifact, uploads the required files to a storage account, and validates the generated artifact."),
		// 				Operation: to.Ptr("Generates an ARM template for the given artifact"),
		// 				Provider: to.Ptr("Microsoft DevTest Labs"),
		// 				Resource: to.Ptr("Artifacts"),
		// 			},
		// 		},
		// 		{
		// 			Name: to.Ptr("Microsoft.DevTestLab/labs/galleryImages/read"),
		// 			Display: &armdevtestlabs.OperationMetadataDisplay{
		// 				Description: to.Ptr("Read gallery images."),
		// 				Operation: to.Ptr("Read gallery images."),
		// 				Provider: to.Ptr("Microsoft DevTest Labs"),
		// 				Resource: to.Ptr("gallery images"),
		// 			},
		// 		},
		// 		{
		// 			Name: to.Ptr("Microsoft.DevTestLab/labs/customImages/delete"),
		// 			Display: &armdevtestlabs.OperationMetadataDisplay{
		// 				Description: to.Ptr("Delete custom images."),
		// 				Operation: to.Ptr("Delete custom images."),
		// 				Provider: to.Ptr("Microsoft DevTest Labs"),
		// 				Resource: to.Ptr("custom images"),
		// 			},
		// 		},
		// 		{
		// 			Name: to.Ptr("Microsoft.DevTestLab/labs/customImages/read"),
		// 			Display: &armdevtestlabs.OperationMetadataDisplay{
		// 				Description: to.Ptr("Read custom images."),
		// 				Operation: to.Ptr("Read custom images."),
		// 				Provider: to.Ptr("Microsoft DevTest Labs"),
		// 				Resource: to.Ptr("custom images"),
		// 			},
		// 		},
		// 		{
		// 			Name: to.Ptr("Microsoft.DevTestLab/labs/customImages/write"),
		// 			Display: &armdevtestlabs.OperationMetadataDisplay{
		// 				Description: to.Ptr("Add or modify custom images."),
		// 				Operation: to.Ptr("Add or modify custom images."),
		// 				Provider: to.Ptr("Microsoft DevTest Labs"),
		// 				Resource: to.Ptr("custom images"),
		// 			},
		// 		},
		// 		{
		// 			Name: to.Ptr("Microsoft.DevTestLab/labs/virtualNetworks/delete"),
		// 			Display: &armdevtestlabs.OperationMetadataDisplay{
		// 				Description: to.Ptr("Delete virtual networks."),
		// 				Operation: to.Ptr("Delete virtual networks."),
		// 				Provider: to.Ptr("Microsoft DevTest Labs"),
		// 				Resource: to.Ptr("virtual networks"),
		// 			},
		// 		},
		// 		{
		// 			Name: to.Ptr("Microsoft.DevTestLab/labs/virtualNetworks/read"),
		// 			Display: &armdevtestlabs.OperationMetadataDisplay{
		// 				Description: to.Ptr("Read virtual networks."),
		// 				Operation: to.Ptr("Read virtual networks."),
		// 				Provider: to.Ptr("Microsoft DevTest Labs"),
		// 				Resource: to.Ptr("virtual networks"),
		// 			},
		// 		},
		// 		{
		// 			Name: to.Ptr("Microsoft.DevTestLab/labs/virtualNetworks/write"),
		// 			Display: &armdevtestlabs.OperationMetadataDisplay{
		// 				Description: to.Ptr("Add or modify virtual networks."),
		// 				Operation: to.Ptr("Add or modify virtual networks."),
		// 				Provider: to.Ptr("Microsoft DevTest Labs"),
		// 				Resource: to.Ptr("virtual networks"),
		// 			},
		// 		},
		// 		{
		// 			Name: to.Ptr("Microsoft.DevTestLab/labs/virtualMachines/delete"),
		// 			Display: &armdevtestlabs.OperationMetadataDisplay{
		// 				Description: to.Ptr("Delete virtual machines."),
		// 				Operation: to.Ptr("Delete virtual machines."),
		// 				Provider: to.Ptr("Microsoft DevTest Labs"),
		// 				Resource: to.Ptr("Virtual machines"),
		// 			},
		// 		},
		// 		{
		// 			Name: to.Ptr("Microsoft.DevTestLab/labs/virtualMachines/read"),
		// 			Display: &armdevtestlabs.OperationMetadataDisplay{
		// 				Description: to.Ptr("Read virtual machines."),
		// 				Operation: to.Ptr("Read virtual machines."),
		// 				Provider: to.Ptr("Microsoft DevTest Labs"),
		// 				Resource: to.Ptr("Virtual machines"),
		// 			},
		// 		},
		// 		{
		// 			Name: to.Ptr("Microsoft.DevTestLab/labs/virtualMachines/write"),
		// 			Display: &armdevtestlabs.OperationMetadataDisplay{
		// 				Description: to.Ptr("Add or modify virtual machines."),
		// 				Operation: to.Ptr("Add or modify virtual machines."),
		// 				Provider: to.Ptr("Microsoft DevTest Labs"),
		// 				Resource: to.Ptr("Virtual machines"),
		// 			},
		// 		},
		// 		{
		// 			Name: to.Ptr("Microsoft.DevTestLab/labs/virtualMachines/Start/action"),
		// 			Display: &armdevtestlabs.OperationMetadataDisplay{
		// 				Description: to.Ptr("Start a virtual machine."),
		// 				Operation: to.Ptr("Start virtual machine"),
		// 				Provider: to.Ptr("Microsoft DevTest Labs"),
		// 				Resource: to.Ptr("Virtual machines"),
		// 			},
		// 		},
		// 		{
		// 			Name: to.Ptr("Microsoft.DevTestLab/labs/virtualMachines/Stop/action"),
		// 			Display: &armdevtestlabs.OperationMetadataDisplay{
		// 				Description: to.Ptr("Stop a virtual machine"),
		// 				Operation: to.Ptr("Stop virtual machine"),
		// 				Provider: to.Ptr("Microsoft DevTest Labs"),
		// 				Resource: to.Ptr("Virtual machines"),
		// 			},
		// 		},
		// 		{
		// 			Name: to.Ptr("Microsoft.DevTestLab/labs/virtualMachines/Restart/action"),
		// 			Display: &armdevtestlabs.OperationMetadataDisplay{
		// 				Description: to.Ptr("Restart a virtual machine."),
		// 				Operation: to.Ptr("Restart virtual machine"),
		// 				Provider: to.Ptr("Microsoft DevTest Labs"),
		// 				Resource: to.Ptr("Virtual machines"),
		// 			},
		// 		},
		// 		{
		// 			Name: to.Ptr("Microsoft.DevTestLab/labs/virtualMachines/Redeploy/action"),
		// 			Display: &armdevtestlabs.OperationMetadataDisplay{
		// 				Description: to.Ptr("Redeploy a virtual machine"),
		// 				Operation: to.Ptr("Redeploy a virtual machine"),
		// 				Provider: to.Ptr("Microsoft DevTest Labs"),
		// 				Resource: to.Ptr("Virtual machines"),
		// 			},
		// 		},
		// 		{
		// 			Name: to.Ptr("Microsoft.DevTestLab/labs/virtualMachines/Resize/action"),
		// 			Display: &armdevtestlabs.OperationMetadataDisplay{
		// 				Description: to.Ptr("Resize Virtual Machine."),
		// 				Operation: to.Ptr("Resize Virtual Machine."),
		// 				Provider: to.Ptr("Microsoft DevTest Labs"),
		// 				Resource: to.Ptr("Virtual machines"),
		// 			},
		// 		},
		// 		{
		// 			Name: to.Ptr("Microsoft.DevTestLab/labs/virtualMachines/ApplyArtifacts/action"),
		// 			Display: &armdevtestlabs.OperationMetadataDisplay{
		// 				Description: to.Ptr("Apply artifacts to virtual machine."),
		// 				Operation: to.Ptr("Apply artifacts to virtual machine"),
		// 				Provider: to.Ptr("Microsoft DevTest Labs"),
		// 				Resource: to.Ptr("Virtual machines"),
		// 			},
		// 		},
		// 		{
		// 			Name: to.Ptr("Microsoft.DevTestLab/labs/virtualMachines/AddDataDisk/action"),
		// 			Display: &armdevtestlabs.OperationMetadataDisplay{
		// 				Description: to.Ptr("Attach a new or existing data disk to virtual machine."),
		// 				Operation: to.Ptr("Add or attach a data disk"),
		// 				Provider: to.Ptr("Microsoft DevTest Labs"),
		// 				Resource: to.Ptr("Virtual machines"),
		// 			},
		// 		},
		// 		{
		// 			Name: to.Ptr("Microsoft.DevTestLab/labs/virtualMachines/DetachDataDisk/action"),
		// 			Display: &armdevtestlabs.OperationMetadataDisplay{
		// 				Description: to.Ptr("Detach the specified disk from the virtual machine."),
		// 				Operation: to.Ptr("Detach the specified disk from the virtual machine"),
		// 				Provider: to.Ptr("Microsoft DevTest Labs"),
		// 				Resource: to.Ptr("Virtual machines"),
		// 			},
		// 		},
		// 		{
		// 			Name: to.Ptr("Microsoft.DevTestLab/labs/virtualMachines/Claim/action"),
		// 			Display: &armdevtestlabs.OperationMetadataDisplay{
		// 				Description: to.Ptr("Take ownership of an existing virtual machine"),
		// 				Operation: to.Ptr("Claim a virtual machine"),
		// 				Provider: to.Ptr("Microsoft DevTest Labs"),
		// 				Resource: to.Ptr("Virtual machines"),
		// 			},
		// 		},
		// 		{
		// 			Name: to.Ptr("Microsoft.DevTestLab/labs/virtualMachines/UnClaim/action"),
		// 			Display: &armdevtestlabs.OperationMetadataDisplay{
		// 				Description: to.Ptr("Release ownership of an existing virtual machine"),
		// 				Operation: to.Ptr("Unclaim a virtual machine"),
		// 				Provider: to.Ptr("Microsoft DevTest Labs"),
		// 				Resource: to.Ptr("Virtual machines"),
		// 			},
		// 		},
		// 		{
		// 			Name: to.Ptr("Microsoft.DevTestLab/labs/virtualMachines/TransferDisks/action"),
		// 			Display: &armdevtestlabs.OperationMetadataDisplay{
		// 				Description: to.Ptr("Transfer ownership of virtual machine data disks to yourself"),
		// 				Operation: to.Ptr("Transfer data disks to yourself"),
		// 				Provider: to.Ptr("Microsoft DevTest Labs"),
		// 				Resource: to.Ptr("Virtual machines"),
		// 			},
		// 		},
		// 		{
		// 			Name: to.Ptr("Microsoft.DevTestLab/labs/virtualMachines/ListApplicableSchedules/action"),
		// 			Display: &armdevtestlabs.OperationMetadataDisplay{
		// 				Description: to.Ptr("Lists all applicable schedules"),
		// 				Operation: to.Ptr("List all applicable schedules"),
		// 				Provider: to.Ptr("Microsoft DevTest Labs"),
		// 				Resource: to.Ptr("Virtual machines"),
		// 			},
		// 		},
		// 		{
		// 			Name: to.Ptr("Microsoft.DevTestLab/labs/virtualMachines/GetRdpFileContents/action"),
		// 			Display: &armdevtestlabs.OperationMetadataDisplay{
		// 				Description: to.Ptr("Gets a string that represents the contents of the RDP file for the virtual machine"),
		// 				Operation: to.Ptr("Get RDP file contents"),
		// 				Provider: to.Ptr("Microsoft DevTest Labs"),
		// 				Resource: to.Ptr("Virtual machines"),
		// 			},
		// 		},
		// 		{
		// 			Name: to.Ptr("Microsoft.DevTestLab/labs/formulas/delete"),
		// 			Display: &armdevtestlabs.OperationMetadataDisplay{
		// 				Description: to.Ptr("Delete formulas."),
		// 				Operation: to.Ptr("Delete formulas."),
		// 				Provider: to.Ptr("Microsoft DevTest Labs"),
		// 				Resource: to.Ptr("Formulas"),
		// 			},
		// 		},
		// 		{
		// 			Name: to.Ptr("Microsoft.DevTestLab/labs/formulas/read"),
		// 			Display: &armdevtestlabs.OperationMetadataDisplay{
		// 				Description: to.Ptr("Read formulas."),
		// 				Operation: to.Ptr("Read formulas."),
		// 				Provider: to.Ptr("Microsoft DevTest Labs"),
		// 				Resource: to.Ptr("Formulas"),
		// 			},
		// 		},
		// 		{
		// 			Name: to.Ptr("Microsoft.DevTestLab/labs/formulas/write"),
		// 			Display: &armdevtestlabs.OperationMetadataDisplay{
		// 				Description: to.Ptr("Add or modify formulas."),
		// 				Operation: to.Ptr("Add or modify formulas."),
		// 				Provider: to.Ptr("Microsoft DevTest Labs"),
		// 				Resource: to.Ptr("Formulas"),
		// 			},
		// 		},
		// 		{
		// 			Name: to.Ptr("Microsoft.DevTestLab/labs/costs/read"),
		// 			Display: &armdevtestlabs.OperationMetadataDisplay{
		// 				Description: to.Ptr("Read costs."),
		// 				Operation: to.Ptr("Read costs."),
		// 				Provider: to.Ptr("Microsoft DevTest Labs"),
		// 				Resource: to.Ptr("costs"),
		// 			},
		// 		},
		// 		{
		// 			Name: to.Ptr("Microsoft.DevTestLab/labs/costs/write"),
		// 			Display: &armdevtestlabs.OperationMetadataDisplay{
		// 				Description: to.Ptr("Add or modify costs."),
		// 				Operation: to.Ptr("Add or modify costs."),
		// 				Provider: to.Ptr("Microsoft DevTest Labs"),
		// 				Resource: to.Ptr("costs"),
		// 			},
		// 		},
		// 		{
		// 			Name: to.Ptr("Microsoft.DevTestLab/labs/users/disks/delete"),
		// 			Display: &armdevtestlabs.OperationMetadataDisplay{
		// 				Description: to.Ptr("Delete disks."),
		// 				Operation: to.Ptr("Delete disks."),
		// 				Provider: to.Ptr("Microsoft DevTest Labs"),
		// 				Resource: to.Ptr("disks"),
		// 			},
		// 		},
		// 		{
		// 			Name: to.Ptr("Microsoft.DevTestLab/labs/users/disks/read"),
		// 			Display: &armdevtestlabs.OperationMetadataDisplay{
		// 				Description: to.Ptr("Read disks."),
		// 				Operation: to.Ptr("Read disks."),
		// 				Provider: to.Ptr("Microsoft DevTest Labs"),
		// 				Resource: to.Ptr("disks"),
		// 			},
		// 		},
		// 		{
		// 			Name: to.Ptr("Microsoft.DevTestLab/labs/users/disks/write"),
		// 			Display: &armdevtestlabs.OperationMetadataDisplay{
		// 				Description: to.Ptr("Add or modify disks."),
		// 				Operation: to.Ptr("Add or modify disks."),
		// 				Provider: to.Ptr("Microsoft DevTest Labs"),
		// 				Resource: to.Ptr("disks"),
		// 			},
		// 		},
		// 		{
		// 			Name: to.Ptr("Microsoft.DevTestLab/labs/users/disks/Attach/action"),
		// 			Display: &armdevtestlabs.OperationMetadataDisplay{
		// 				Description: to.Ptr("Attach and create the lease of the disk to the virtual machine."),
		// 				Operation: to.Ptr("Attach disk"),
		// 				Provider: to.Ptr("Microsoft DevTest Labs"),
		// 				Resource: to.Ptr("disks"),
		// 			},
		// 		},
		// 		{
		// 			Name: to.Ptr("Microsoft.DevTestLab/labs/users/disks/Detach/action"),
		// 			Display: &armdevtestlabs.OperationMetadataDisplay{
		// 				Description: to.Ptr("Detach and break the lease of the disk attached to the virtual machine."),
		// 				Operation: to.Ptr("Detach and break the lease of the disk attached to the virtual machine"),
		// 				Provider: to.Ptr("Microsoft DevTest Labs"),
		// 				Resource: to.Ptr("disks"),
		// 			},
		// 		},
		// 		{
		// 			Name: to.Ptr("Microsoft.DevTestLab/labs/users/delete"),
		// 			Display: &armdevtestlabs.OperationMetadataDisplay{
		// 				Description: to.Ptr("Delete user profiles."),
		// 				Operation: to.Ptr("Delete user profiles."),
		// 				Provider: to.Ptr("Microsoft DevTest Labs"),
		// 				Resource: to.Ptr("user profiles"),
		// 			},
		// 		},
		// 		{
		// 			Name: to.Ptr("Microsoft.DevTestLab/labs/users/read"),
		// 			Display: &armdevtestlabs.OperationMetadataDisplay{
		// 				Description: to.Ptr("Read user profiles."),
		// 				Operation: to.Ptr("Read user profiles."),
		// 				Provider: to.Ptr("Microsoft DevTest Labs"),
		// 				Resource: to.Ptr("user profiles"),
		// 			},
		// 		},
		// 		{
		// 			Name: to.Ptr("Microsoft.DevTestLab/labs/users/write"),
		// 			Display: &armdevtestlabs.OperationMetadataDisplay{
		// 				Description: to.Ptr("Add or modify user profiles."),
		// 				Operation: to.Ptr("Add or modify user profiles."),
		// 				Provider: to.Ptr("Microsoft DevTest Labs"),
		// 				Resource: to.Ptr("user profiles"),
		// 			},
		// 		},
		// 		{
		// 			Name: to.Ptr("Microsoft.DevTestLab/labs/notificationChannels/delete"),
		// 			Display: &armdevtestlabs.OperationMetadataDisplay{
		// 				Description: to.Ptr("Delete notification channels."),
		// 				Operation: to.Ptr("Delete notification channels."),
		// 				Provider: to.Ptr("Microsoft DevTest Labs"),
		// 				Resource: to.Ptr("notificationChannels"),
		// 			},
		// 		},
		// 		{
		// 			Name: to.Ptr("Microsoft.DevTestLab/labs/notificationChannels/read"),
		// 			Display: &armdevtestlabs.OperationMetadataDisplay{
		// 				Description: to.Ptr("Read notification channels."),
		// 				Operation: to.Ptr("Read notification channels."),
		// 				Provider: to.Ptr("Microsoft DevTest Labs"),
		// 				Resource: to.Ptr("notificationChannels"),
		// 			},
		// 		},
		// 		{
		// 			Name: to.Ptr("Microsoft.DevTestLab/labs/notificationChannels/write"),
		// 			Display: &armdevtestlabs.OperationMetadataDisplay{
		// 				Description: to.Ptr("Add or modify notification channels."),
		// 				Operation: to.Ptr("Add or modify notification channels."),
		// 				Provider: to.Ptr("Microsoft DevTest Labs"),
		// 				Resource: to.Ptr("notificationChannels"),
		// 			},
		// 		},
		// 		{
		// 			Name: to.Ptr("Microsoft.DevTestLab/labs/notificationChannels/Notify/action"),
		// 			Display: &armdevtestlabs.OperationMetadataDisplay{
		// 				Description: to.Ptr("Send notification to provided channel."),
		// 				Operation: to.Ptr("Notify"),
		// 				Provider: to.Ptr("Microsoft DevTest Labs"),
		// 				Resource: to.Ptr("notificationChannels"),
		// 			},
		// 		},
		// 		{
		// 			Name: to.Ptr("Microsoft.DevTestLab/labs/users/secrets/delete"),
		// 			Display: &armdevtestlabs.OperationMetadataDisplay{
		// 				Description: to.Ptr("Delete secrets."),
		// 				Operation: to.Ptr("Delete secrets."),
		// 				Provider: to.Ptr("Microsoft DevTest Labs"),
		// 				Resource: to.Ptr("secrets"),
		// 			},
		// 		},
		// 		{
		// 			Name: to.Ptr("Microsoft.DevTestLab/labs/users/secrets/read"),
		// 			Display: &armdevtestlabs.OperationMetadataDisplay{
		// 				Description: to.Ptr("Read secrets."),
		// 				Operation: to.Ptr("Read secrets."),
		// 				Provider: to.Ptr("Microsoft DevTest Labs"),
		// 				Resource: to.Ptr("secrets"),
		// 			},
		// 		},
		// 		{
		// 			Name: to.Ptr("Microsoft.DevTestLab/labs/users/secrets/write"),
		// 			Display: &armdevtestlabs.OperationMetadataDisplay{
		// 				Description: to.Ptr("Add or modify secrets."),
		// 				Operation: to.Ptr("Add or modify secrets."),
		// 				Provider: to.Ptr("Microsoft DevTest Labs"),
		// 				Resource: to.Ptr("secrets"),
		// 			},
		// 		},
		// 		{
		// 			Name: to.Ptr("Microsoft.DevTestLab/locations/operations/read"),
		// 			Display: &armdevtestlabs.OperationMetadataDisplay{
		// 				Description: to.Ptr("Read operations."),
		// 				Operation: to.Ptr("Read operations."),
		// 				Provider: to.Ptr("Microsoft DevTest Labs"),
		// 				Resource: to.Ptr("operations"),
		// 			},
		// 		},
		// 		{
		// 			Name: to.Ptr("Microsoft.DevTestLab/labs/artifactSources/armTemplates/read"),
		// 			Display: &armdevtestlabs.OperationMetadataDisplay{
		// 				Description: to.Ptr("Read azure resource manager templates."),
		// 				Operation: to.Ptr("Read azure resource manager templates."),
		// 				Provider: to.Ptr("Microsoft DevTest Labs"),
		// 				Resource: to.Ptr("Azure Resource Manager templates"),
		// 			},
		// 		},
		// 		{
		// 			Name: to.Ptr("Microsoft.DevTestLab/labs/users/environments/delete"),
		// 			Display: &armdevtestlabs.OperationMetadataDisplay{
		// 				Description: to.Ptr("Delete environments."),
		// 				Operation: to.Ptr("Delete environments."),
		// 				Provider: to.Ptr("Microsoft DevTest Labs"),
		// 				Resource: to.Ptr("environments"),
		// 			},
		// 		},
		// 		{
		// 			Name: to.Ptr("Microsoft.DevTestLab/labs/users/environments/read"),
		// 			Display: &armdevtestlabs.OperationMetadataDisplay{
		// 				Description: to.Ptr("Read environments."),
		// 				Operation: to.Ptr("Read environments."),
		// 				Provider: to.Ptr("Microsoft DevTest Labs"),
		// 				Resource: to.Ptr("environments"),
		// 			},
		// 		},
		// 		{
		// 			Name: to.Ptr("Microsoft.DevTestLab/labs/users/environments/write"),
		// 			Display: &armdevtestlabs.OperationMetadataDisplay{
		// 				Description: to.Ptr("Add or modify environments."),
		// 				Operation: to.Ptr("Add or modify environments."),
		// 				Provider: to.Ptr("Microsoft DevTest Labs"),
		// 				Resource: to.Ptr("environments"),
		// 			},
		// 		},
		// 		{
		// 			Name: to.Ptr("Microsoft.DevTestLab/labs/serviceRunners/delete"),
		// 			Display: &armdevtestlabs.OperationMetadataDisplay{
		// 				Description: to.Ptr("Delete service runners."),
		// 				Operation: to.Ptr("Delete service runners."),
		// 				Provider: to.Ptr("Microsoft DevTest Labs"),
		// 				Resource: to.Ptr("Service runners"),
		// 			},
		// 		},
		// 		{
		// 			Name: to.Ptr("Microsoft.DevTestLab/labs/serviceRunners/read"),
		// 			Display: &armdevtestlabs.OperationMetadataDisplay{
		// 				Description: to.Ptr("Read service runners."),
		// 				Operation: to.Ptr("Read service runners."),
		// 				Provider: to.Ptr("Microsoft DevTest Labs"),
		// 				Resource: to.Ptr("Service runners"),
		// 			},
		// 		},
		// 		{
		// 			Name: to.Ptr("Microsoft.DevTestLab/labs/serviceRunners/write"),
		// 			Display: &armdevtestlabs.OperationMetadataDisplay{
		// 				Description: to.Ptr("Add or modify service runners."),
		// 				Operation: to.Ptr("Add or modify service runners."),
		// 				Provider: to.Ptr("Microsoft DevTest Labs"),
		// 				Resource: to.Ptr("Service runners"),
		// 			},
		// 		},
		// 		{
		// 			Name: to.Ptr("Microsoft.DevTestLab/labs/users/serviceFabrics/delete"),
		// 			Display: &armdevtestlabs.OperationMetadataDisplay{
		// 				Description: to.Ptr("Delete service fabrics."),
		// 				Operation: to.Ptr("Delete service fabrics."),
		// 				Provider: to.Ptr("Microsoft DevTest Labs"),
		// 				Resource: to.Ptr("Service Fabrics"),
		// 			},
		// 		},
		// 		{
		// 			Name: to.Ptr("Microsoft.DevTestLab/labs/users/serviceFabrics/read"),
		// 			Display: &armdevtestlabs.OperationMetadataDisplay{
		// 				Description: to.Ptr("Read service fabrics."),
		// 				Operation: to.Ptr("Read service fabrics."),
		// 				Provider: to.Ptr("Microsoft DevTest Labs"),
		// 				Resource: to.Ptr("Service Fabrics"),
		// 			},
		// 		},
		// 		{
		// 			Name: to.Ptr("Microsoft.DevTestLab/labs/users/serviceFabrics/write"),
		// 			Display: &armdevtestlabs.OperationMetadataDisplay{
		// 				Description: to.Ptr("Add or modify service fabrics."),
		// 				Operation: to.Ptr("Add or modify service fabrics."),
		// 				Provider: to.Ptr("Microsoft DevTest Labs"),
		// 				Resource: to.Ptr("Service Fabrics"),
		// 			},
		// 		},
		// 		{
		// 			Name: to.Ptr("Microsoft.DevTestLab/labs/users/serviceFabrics/Start/action"),
		// 			Display: &armdevtestlabs.OperationMetadataDisplay{
		// 				Description: to.Ptr("Start a service fabric."),
		// 				Operation: to.Ptr("Start service fabric"),
		// 				Provider: to.Ptr("Microsoft DevTest Labs"),
		// 				Resource: to.Ptr("Service Fabrics"),
		// 			},
		// 		},
		// 		{
		// 			Name: to.Ptr("Microsoft.DevTestLab/labs/users/serviceFabrics/Stop/action"),
		// 			Display: &armdevtestlabs.OperationMetadataDisplay{
		// 				Description: to.Ptr("Stop a service fabric"),
		// 				Operation: to.Ptr("Stop service fabric"),
		// 				Provider: to.Ptr("Microsoft DevTest Labs"),
		// 				Resource: to.Ptr("Service Fabrics"),
		// 			},
		// 		},
		// 		{
		// 			Name: to.Ptr("Microsoft.DevTestLab/labs/users/serviceFabrics/ListApplicableSchedules/action"),
		// 			Display: &armdevtestlabs.OperationMetadataDisplay{
		// 				Description: to.Ptr("Lists all applicable schedules"),
		// 				Operation: to.Ptr("List all applicable schedules"),
		// 				Provider: to.Ptr("Microsoft DevTest Labs"),
		// 				Resource: to.Ptr("Service Fabrics"),
		// 			},
		// 	}},
		// }
	}
}
Output:

type ProviderOperationsClientListOptions added in v0.2.0

type ProviderOperationsClientListOptions struct {
}

ProviderOperationsClientListOptions contains the optional parameters for the ProviderOperationsClient.NewListPager method.

type ProviderOperationsClientListResponse added in v0.2.0

type ProviderOperationsClientListResponse struct {
	// Result of the request to list REST API operations
	ProviderOperationResult
}

ProviderOperationsClientListResponse contains the response from method ProviderOperationsClient.NewListPager.

type RdpConnection

type RdpConnection struct {
	// The contents of the .rdp file
	Contents *string
}

RdpConnection - Represents a .rdp file

func (RdpConnection) MarshalJSON added in v1.1.0

func (r RdpConnection) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.Marshaller interface for type RdpConnection.

func (*RdpConnection) UnmarshalJSON added in v1.1.0

func (r *RdpConnection) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the json.Unmarshaller interface for type RdpConnection.

type ReportingCycleType

type ReportingCycleType string

ReportingCycleType - Reporting cycle type.

const (
	ReportingCycleTypeCalendarMonth ReportingCycleType = "CalendarMonth"
	ReportingCycleTypeCustom        ReportingCycleType = "Custom"
)

func PossibleReportingCycleTypeValues

func PossibleReportingCycleTypeValues() []ReportingCycleType

PossibleReportingCycleTypeValues returns the possible values for the ReportingCycleType const type.

type ResizeLabVirtualMachineProperties

type ResizeLabVirtualMachineProperties struct {
	// Specifies the size of the virtual machine.
	Size *string
}

ResizeLabVirtualMachineProperties - Request body for resizing a virtual machine.

func (ResizeLabVirtualMachineProperties) MarshalJSON added in v1.1.0

func (r ResizeLabVirtualMachineProperties) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.Marshaller interface for type ResizeLabVirtualMachineProperties.

func (*ResizeLabVirtualMachineProperties) UnmarshalJSON added in v1.1.0

func (r *ResizeLabVirtualMachineProperties) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the json.Unmarshaller interface for type ResizeLabVirtualMachineProperties.

type Resource

type Resource struct {
	// The location of the resource.
	Location *string

	// The tags of the resource.
	Tags map[string]*string

	// READ-ONLY; The identifier of the resource.
	ID *string

	// READ-ONLY; The name of the resource.
	Name *string

	// READ-ONLY; The type of the resource.
	Type *string
}

Resource - An Azure resource.

func (Resource) MarshalJSON

func (r Resource) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.Marshaller interface for type Resource.

func (*Resource) UnmarshalJSON added in v1.1.0

func (r *Resource) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the json.Unmarshaller interface for type Resource.

type RetargetScheduleProperties

type RetargetScheduleProperties struct {
	// The resource Id of the virtual machine on which the schedule operates
	CurrentResourceID *string

	// The resource Id of the virtual machine that the schedule should be retargeted to
	TargetResourceID *string
}

RetargetScheduleProperties - Properties for retargeting a virtual machine schedule.

func (RetargetScheduleProperties) MarshalJSON added in v1.1.0

func (r RetargetScheduleProperties) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.Marshaller interface for type RetargetScheduleProperties.

func (*RetargetScheduleProperties) UnmarshalJSON added in v1.1.0

func (r *RetargetScheduleProperties) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the json.Unmarshaller interface for type RetargetScheduleProperties.

type Schedule

type Schedule struct {
	// REQUIRED; The properties of the resource.
	Properties *ScheduleProperties

	// The location of the resource.
	Location *string

	// The tags of the resource.
	Tags map[string]*string

	// READ-ONLY; The identifier of the resource.
	ID *string

	// READ-ONLY; The name of the resource.
	Name *string

	// READ-ONLY; The type of the resource.
	Type *string
}

Schedule - A schedule.

func (Schedule) MarshalJSON

func (s Schedule) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.Marshaller interface for type Schedule.

func (*Schedule) UnmarshalJSON added in v1.1.0

func (s *Schedule) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the json.Unmarshaller interface for type Schedule.

type ScheduleCreationParameter

type ScheduleCreationParameter struct {
	// The name of the virtual machine or environment
	Name *string

	// The properties of the schedule.
	Properties *ScheduleCreationParameterProperties

	// The tags of the resource.
	Tags map[string]*string

	// READ-ONLY; The location of the new virtual machine or environment
	Location *string
}

ScheduleCreationParameter - Properties for creating a schedule.

func (ScheduleCreationParameter) MarshalJSON

func (s ScheduleCreationParameter) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.Marshaller interface for type ScheduleCreationParameter.

func (*ScheduleCreationParameter) UnmarshalJSON added in v1.1.0

func (s *ScheduleCreationParameter) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the json.Unmarshaller interface for type ScheduleCreationParameter.

type ScheduleCreationParameterProperties

type ScheduleCreationParameterProperties struct {
	// If the schedule will occur once each day of the week, specify the daily recurrence.
	DailyRecurrence *DayDetails

	// If the schedule will occur multiple times a day, specify the hourly recurrence.
	HourlyRecurrence *HourDetails

	// Notification settings.
	NotificationSettings *NotificationSettings

	// The status of the schedule (i.e. Enabled, Disabled)
	Status *EnableStatus

	// The resource ID to which the schedule belongs
	TargetResourceID *string

	// The task type of the schedule (e.g. LabVmsShutdownTask, LabVmAutoStart).
	TaskType *string

	// The time zone ID (e.g. Pacific Standard time).
	TimeZoneID *string

	// If the schedule will occur only some days of the week, specify the weekly recurrence.
	WeeklyRecurrence *WeekDetails
}

ScheduleCreationParameterProperties - Properties for schedule creation.

func (ScheduleCreationParameterProperties) MarshalJSON added in v1.1.0

func (s ScheduleCreationParameterProperties) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.Marshaller interface for type ScheduleCreationParameterProperties.

func (*ScheduleCreationParameterProperties) UnmarshalJSON added in v1.1.0

func (s *ScheduleCreationParameterProperties) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the json.Unmarshaller interface for type ScheduleCreationParameterProperties.

type ScheduleFragment

type ScheduleFragment struct {
	// The tags of the resource.
	Tags map[string]*string
}

ScheduleFragment - A schedule.

func (ScheduleFragment) MarshalJSON added in v0.2.0

func (s ScheduleFragment) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.Marshaller interface for type ScheduleFragment.

func (*ScheduleFragment) UnmarshalJSON added in v1.1.0

func (s *ScheduleFragment) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the json.Unmarshaller interface for type ScheduleFragment.

type ScheduleList

type ScheduleList struct {
	// Link for next set of results.
	NextLink *string

	// Results of the list operation.
	Value []*Schedule
}

ScheduleList - The response of a list operation.

func (ScheduleList) MarshalJSON

func (s ScheduleList) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.Marshaller interface for type ScheduleList.

func (*ScheduleList) UnmarshalJSON added in v1.1.0

func (s *ScheduleList) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the json.Unmarshaller interface for type ScheduleList.

type ScheduleProperties

type ScheduleProperties struct {
	// If the schedule will occur once each day of the week, specify the daily recurrence.
	DailyRecurrence *DayDetails

	// If the schedule will occur multiple times a day, specify the hourly recurrence.
	HourlyRecurrence *HourDetails

	// Notification settings.
	NotificationSettings *NotificationSettings

	// The status of the schedule (i.e. Enabled, Disabled)
	Status *EnableStatus

	// The resource ID to which the schedule belongs
	TargetResourceID *string

	// The task type of the schedule (e.g. LabVmsShutdownTask, LabVmAutoStart).
	TaskType *string

	// The time zone ID (e.g. Pacific Standard time).
	TimeZoneID *string

	// If the schedule will occur only some days of the week, specify the weekly recurrence.
	WeeklyRecurrence *WeekDetails

	// READ-ONLY; The creation date of the schedule.
	CreatedDate *time.Time

	// READ-ONLY; The provisioning status of the resource.
	ProvisioningState *string

	// READ-ONLY; The unique immutable identifier of a resource (Guid).
	UniqueIdentifier *string
}

ScheduleProperties - Properties of a schedule.

func (ScheduleProperties) MarshalJSON

func (s ScheduleProperties) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.Marshaller interface for type ScheduleProperties.

func (*ScheduleProperties) UnmarshalJSON

func (s *ScheduleProperties) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the json.Unmarshaller interface for type ScheduleProperties.

type SchedulesClient

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

SchedulesClient contains the methods for the Schedules group. Don't use this type directly, use NewSchedulesClient() instead.

func NewSchedulesClient

func NewSchedulesClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*SchedulesClient, error)

NewSchedulesClient creates a new instance of SchedulesClient with the specified values.

  • subscriptionID - The subscription ID.
  • credential - used to authorize requests. Usually a credential from azidentity.
  • options - pass nil to accept the default values.

func (*SchedulesClient) BeginExecute

func (client *SchedulesClient) BeginExecute(ctx context.Context, resourceGroupName string, labName string, name string, options *SchedulesClientBeginExecuteOptions) (*runtime.Poller[SchedulesClientExecuteResponse], error)

BeginExecute - Execute a schedule. This operation can take a while to complete. If the operation fails it returns an *azcore.ResponseError type.

Generated from API version 2018-09-15

  • resourceGroupName - The name of the resource group.
  • labName - The name of the lab.
  • name - The name of the schedule.
  • options - SchedulesClientBeginExecuteOptions contains the optional parameters for the SchedulesClient.BeginExecute method.
Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/d55b8005f05b040b852c15e74a0f3e36494a15e1/specification/devtestlabs/resource-manager/Microsoft.DevTestLab/stable/2018-09-15/examples/Schedules_Execute.json

package main

import (
	"context"
	"log"

	"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
	"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/devtestlabs/armdevtestlabs"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armdevtestlabs.NewClientFactory("<subscription-id>", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	poller, err := clientFactory.NewSchedulesClient().BeginExecute(ctx, "resourceGroupName", "{labName}", "{scheduleName}", 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 (*SchedulesClient) CreateOrUpdate

func (client *SchedulesClient) CreateOrUpdate(ctx context.Context, resourceGroupName string, labName string, name string, schedule Schedule, options *SchedulesClientCreateOrUpdateOptions) (SchedulesClientCreateOrUpdateResponse, error)

CreateOrUpdate - Create or replace an existing schedule. If the operation fails it returns an *azcore.ResponseError type.

Generated from API version 2018-09-15

  • resourceGroupName - The name of the resource group.
  • labName - The name of the lab.
  • name - The name of the schedule.
  • schedule - A schedule.
  • options - SchedulesClientCreateOrUpdateOptions contains the optional parameters for the SchedulesClient.CreateOrUpdate method.
Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/d55b8005f05b040b852c15e74a0f3e36494a15e1/specification/devtestlabs/resource-manager/Microsoft.DevTestLab/stable/2018-09-15/examples/Schedules_CreateOrUpdate.json

package main

import (
	"context"
	"log"

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

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armdevtestlabs.NewClientFactory("<subscription-id>", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	res, err := clientFactory.NewSchedulesClient().CreateOrUpdate(ctx, "resourceGroupName", "{labName}", "{scheduleName}", armdevtestlabs.Schedule{
		Location: to.Ptr("{location}"),
		Tags: map[string]*string{
			"tagName1": to.Ptr("tagValue1"),
		},
		Properties: &armdevtestlabs.ScheduleProperties{
			DailyRecurrence: &armdevtestlabs.DayDetails{
				Time: to.Ptr("{timeOfTheDayTheScheduleWillOccurEveryDay}"),
			},
			HourlyRecurrence: &armdevtestlabs.HourDetails{
				Minute: to.Ptr[int32](30),
			},
			NotificationSettings: &armdevtestlabs.NotificationSettings{
				EmailRecipient:     to.Ptr("{email}"),
				NotificationLocale: to.Ptr("EN"),
				Status:             to.Ptr(armdevtestlabs.EnableStatus("{Enabled|Disabled}")),
				TimeInMinutes:      to.Ptr[int32](15),
				WebhookURL:         to.Ptr("{webhookUrl}"),
			},
			Status:           to.Ptr(armdevtestlabs.EnableStatus("{Enabled|Disabled}")),
			TargetResourceID: to.Ptr("/subscriptions/{subscriptionId}/resourcegroups/resourceGroupName/providers/microsoft.devtestlab/labs/{labName}"),
			TaskType:         to.Ptr("{myLabVmTaskType}"),
			TimeZoneID:       to.Ptr("Pacific Standard Time"),
			WeeklyRecurrence: &armdevtestlabs.WeekDetails{
				Time: to.Ptr("{timeOfTheDayTheScheduleWillOccurOnThoseDays}"),
				Weekdays: []*string{
					to.Ptr("Monday"),
					to.Ptr("Wednesday"),
					to.Ptr("Friday")},
			},
		},
	}, 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.Schedule = armdevtestlabs.Schedule{
	// 	Name: to.Ptr("{scheduleName}"),
	// 	Type: to.Ptr("Microsoft.DevTestLab/labs/schedules"),
	// 	ID: to.Ptr("/subscriptions/{subscriptionId}/resourcegroups/resourceGroupName/providers/microsoft.devtestlab/labs/{labName}/schedules/{scheduleName}"),
	// 	Location: to.Ptr("{location}"),
	// 	Tags: map[string]*string{
	// 		"tagName1": to.Ptr("tagValue1"),
	// 	},
	// 	Properties: &armdevtestlabs.ScheduleProperties{
	// 		CreatedDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2018-10-02T01:40:48.173Z"); return t}()),
	// 		DailyRecurrence: &armdevtestlabs.DayDetails{
	// 			Time: to.Ptr("{timeOfTheDayTheScheduleWillOccurEveryDay}"),
	// 		},
	// 		HourlyRecurrence: &armdevtestlabs.HourDetails{
	// 			Minute: to.Ptr[int32](30),
	// 		},
	// 		NotificationSettings: &armdevtestlabs.NotificationSettings{
	// 			EmailRecipient: to.Ptr("{email}"),
	// 			NotificationLocale: to.Ptr("EN"),
	// 			Status: to.Ptr(armdevtestlabs.EnableStatus("{Enabled|Disabled}")),
	// 			TimeInMinutes: to.Ptr[int32](15),
	// 			WebhookURL: to.Ptr("{webhookUrl}"),
	// 		},
	// 		ProvisioningState: to.Ptr("Succeeded"),
	// 		Status: to.Ptr(armdevtestlabs.EnableStatus("{Enabled|Disabled}")),
	// 		TargetResourceID: to.Ptr("/subscriptions/{subscriptionId}/resourcegroups/resourceGroupName/providers/microsoft.devtestlab/labs/{labName}"),
	// 		TaskType: to.Ptr("{myLabVmTaskType}"),
	// 		TimeZoneID: to.Ptr("Pacific Standard Time"),
	// 		UniqueIdentifier: to.Ptr("{uniqueIdentifier}"),
	// 		WeeklyRecurrence: &armdevtestlabs.WeekDetails{
	// 			Time: to.Ptr("{timeOfTheDayTheScheduleWillOccurOnThoseDays}"),
	// 			Weekdays: []*string{
	// 				to.Ptr("Monday"),
	// 				to.Ptr("Wednesday"),
	// 				to.Ptr("Friday")},
	// 			},
	// 		},
	// 	}
}
Output:

func (*SchedulesClient) Delete

func (client *SchedulesClient) Delete(ctx context.Context, resourceGroupName string, labName string, name string, options *SchedulesClientDeleteOptions) (SchedulesClientDeleteResponse, error)

Delete - Delete schedule. If the operation fails it returns an *azcore.ResponseError type.

Generated from API version 2018-09-15

  • resourceGroupName - The name of the resource group.
  • labName - The name of the lab.
  • name - The name of the schedule.
  • options - SchedulesClientDeleteOptions contains the optional parameters for the SchedulesClient.Delete method.
Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/d55b8005f05b040b852c15e74a0f3e36494a15e1/specification/devtestlabs/resource-manager/Microsoft.DevTestLab/stable/2018-09-15/examples/Schedules_Delete.json

package main

import (
	"context"
	"log"

	"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
	"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/devtestlabs/armdevtestlabs"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armdevtestlabs.NewClientFactory("<subscription-id>", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	_, err = clientFactory.NewSchedulesClient().Delete(ctx, "resourceGroupName", "{labName}", "{scheduleName}", nil)
	if err != nil {
		log.Fatalf("failed to finish the request: %v", err)
	}
}
Output:

func (*SchedulesClient) Get

func (client *SchedulesClient) Get(ctx context.Context, resourceGroupName string, labName string, name string, options *SchedulesClientGetOptions) (SchedulesClientGetResponse, error)

Get - Get schedule. If the operation fails it returns an *azcore.ResponseError type.

Generated from API version 2018-09-15

  • resourceGroupName - The name of the resource group.
  • labName - The name of the lab.
  • name - The name of the schedule.
  • options - SchedulesClientGetOptions contains the optional parameters for the SchedulesClient.Get method.
Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/d55b8005f05b040b852c15e74a0f3e36494a15e1/specification/devtestlabs/resource-manager/Microsoft.DevTestLab/stable/2018-09-15/examples/Schedules_Get.json

package main

import (
	"context"
	"log"

	"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
	"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/devtestlabs/armdevtestlabs"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armdevtestlabs.NewClientFactory("<subscription-id>", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	res, err := clientFactory.NewSchedulesClient().Get(ctx, "resourceGroupName", "{labName}", "{scheduleName}", &armdevtestlabs.SchedulesClientGetOptions{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.Schedule = armdevtestlabs.Schedule{
	// 	Name: to.Ptr("{scheduleName}"),
	// 	Type: to.Ptr("Microsoft.DevTestLab/labs/schedules"),
	// 	ID: to.Ptr("/subscriptions/{subscriptionId}/resourcegroups/resourceGroupName/providers/microsoft.devtestlab/labs/{labName}/schedules/{scheduleName}"),
	// 	Location: to.Ptr("{location}"),
	// 	Tags: map[string]*string{
	// 		"tagName1": to.Ptr("tagValue1"),
	// 	},
	// 	Properties: &armdevtestlabs.ScheduleProperties{
	// 		CreatedDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2018-10-02T01:40:48.173Z"); return t}()),
	// 		DailyRecurrence: &armdevtestlabs.DayDetails{
	// 			Time: to.Ptr("{timeOfTheDayTheScheduleWillOccurEveryDay}"),
	// 		},
	// 		HourlyRecurrence: &armdevtestlabs.HourDetails{
	// 			Minute: to.Ptr[int32](30),
	// 		},
	// 		NotificationSettings: &armdevtestlabs.NotificationSettings{
	// 			EmailRecipient: to.Ptr("{email}"),
	// 			NotificationLocale: to.Ptr("EN"),
	// 			Status: to.Ptr(armdevtestlabs.EnableStatus("{Enabled|Disabled}")),
	// 			TimeInMinutes: to.Ptr[int32](15),
	// 			WebhookURL: to.Ptr("{webhookUrl}"),
	// 		},
	// 		ProvisioningState: to.Ptr("Succeeded"),
	// 		Status: to.Ptr(armdevtestlabs.EnableStatus("{Enabled|Disabled}")),
	// 		TargetResourceID: to.Ptr("/subscriptions/{subscriptionId}/resourcegroups/resourceGroupName/providers/microsoft.devtestlab/labs/{labName}"),
	// 		TaskType: to.Ptr("{myLabVmTaskType}"),
	// 		TimeZoneID: to.Ptr("Pacific Standard Time"),
	// 		UniqueIdentifier: to.Ptr("{uniqueIdentifier}"),
	// 		WeeklyRecurrence: &armdevtestlabs.WeekDetails{
	// 			Time: to.Ptr("{timeOfTheDayTheScheduleWillOccurOnThoseDays}"),
	// 			Weekdays: []*string{
	// 				to.Ptr("Monday"),
	// 				to.Ptr("Wednesday"),
	// 				to.Ptr("Friday")},
	// 			},
	// 		},
	// 	}
}
Output:

func (*SchedulesClient) NewListApplicablePager added in v0.4.0

func (client *SchedulesClient) NewListApplicablePager(resourceGroupName string, labName string, name string, options *SchedulesClientListApplicableOptions) *runtime.Pager[SchedulesClientListApplicableResponse]

NewListApplicablePager - Lists all applicable schedules

Generated from API version 2018-09-15

  • resourceGroupName - The name of the resource group.
  • labName - The name of the lab.
  • name - The name of the schedule.
  • options - SchedulesClientListApplicableOptions contains the optional parameters for the SchedulesClient.NewListApplicablePager method.
Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/d55b8005f05b040b852c15e74a0f3e36494a15e1/specification/devtestlabs/resource-manager/Microsoft.DevTestLab/stable/2018-09-15/examples/Schedules_ListApplicable.json

package main

import (
	"context"
	"log"

	"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
	"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/devtestlabs/armdevtestlabs"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armdevtestlabs.NewClientFactory("<subscription-id>", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	pager := clientFactory.NewSchedulesClient().NewListApplicablePager("resourceGroupName", "{labName}", "{scheduleName}", 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.ScheduleList = armdevtestlabs.ScheduleList{
		// 	Value: []*armdevtestlabs.Schedule{
		// 		{
		// 			Name: to.Ptr("{scheduleName}"),
		// 			Type: to.Ptr("Microsoft.DevTestLab/labs/schedules"),
		// 			ID: to.Ptr("/subscriptions/{subscriptionId}/resourcegroups/resourceGroupName/providers/microsoft.devtestlab/labs/{labName}/schedules/{scheduleName}"),
		// 			Location: to.Ptr("{location}"),
		// 			Tags: map[string]*string{
		// 				"tagName1": to.Ptr("tagValue1"),
		// 			},
		// 			Properties: &armdevtestlabs.ScheduleProperties{
		// 				CreatedDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2018-10-02T01:40:48.173Z"); return t}()),
		// 				DailyRecurrence: &armdevtestlabs.DayDetails{
		// 					Time: to.Ptr("{timeOfTheDayTheScheduleWillOccurEveryDay}"),
		// 				},
		// 				HourlyRecurrence: &armdevtestlabs.HourDetails{
		// 					Minute: to.Ptr[int32](30),
		// 				},
		// 				NotificationSettings: &armdevtestlabs.NotificationSettings{
		// 					EmailRecipient: to.Ptr("{email}"),
		// 					NotificationLocale: to.Ptr("EN"),
		// 					Status: to.Ptr(armdevtestlabs.EnableStatus("{Enabled|Disabled}")),
		// 					TimeInMinutes: to.Ptr[int32](15),
		// 					WebhookURL: to.Ptr("{webhookUrl}"),
		// 				},
		// 				ProvisioningState: to.Ptr("Succeeded"),
		// 				Status: to.Ptr(armdevtestlabs.EnableStatus("{Enabled|Disabled}")),
		// 				TargetResourceID: to.Ptr("/subscriptions/{subscriptionId}/resourcegroups/resourceGroupName/providers/microsoft.devtestlab/labs/{labName}"),
		// 				TaskType: to.Ptr("{myLabVmTaskType}"),
		// 				TimeZoneID: to.Ptr("Pacific Standard Time"),
		// 				UniqueIdentifier: to.Ptr("{uniqueIdentifier}"),
		// 				WeeklyRecurrence: &armdevtestlabs.WeekDetails{
		// 					Time: to.Ptr("{timeOfTheDayTheScheduleWillOccurOnThoseDays}"),
		// 					Weekdays: []*string{
		// 						to.Ptr("Monday"),
		// 						to.Ptr("Wednesday"),
		// 						to.Ptr("Friday")},
		// 					},
		// 				},
		// 		}},
		// 	}
	}
}
Output:

func (*SchedulesClient) NewListPager added in v0.4.0

func (client *SchedulesClient) NewListPager(resourceGroupName string, labName string, options *SchedulesClientListOptions) *runtime.Pager[SchedulesClientListResponse]

NewListPager - List schedules in a given lab.

Generated from API version 2018-09-15

  • resourceGroupName - The name of the resource group.
  • labName - The name of the lab.
  • options - SchedulesClientListOptions contains the optional parameters for the SchedulesClient.NewListPager method.
Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/d55b8005f05b040b852c15e74a0f3e36494a15e1/specification/devtestlabs/resource-manager/Microsoft.DevTestLab/stable/2018-09-15/examples/Schedules_List.json

package main

import (
	"context"
	"log"

	"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
	"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/devtestlabs/armdevtestlabs"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armdevtestlabs.NewClientFactory("<subscription-id>", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	pager := clientFactory.NewSchedulesClient().NewListPager("resourceGroupName", "{labName}", &armdevtestlabs.SchedulesClientListOptions{Expand: nil,
		Filter:  nil,
		Top:     nil,
		Orderby: 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.ScheduleList = armdevtestlabs.ScheduleList{
		// 	Value: []*armdevtestlabs.Schedule{
		// 		{
		// 			Name: to.Ptr("{scheduleName}"),
		// 			Type: to.Ptr("Microsoft.DevTestLab/labs/schedules"),
		// 			ID: to.Ptr("/subscriptions/{subscriptionId}/resourcegroups/resourceGroupName/providers/microsoft.devtestlab/labs/{labName}/schedules/{scheduleName}"),
		// 			Location: to.Ptr("{location}"),
		// 			Tags: map[string]*string{
		// 				"tagName1": to.Ptr("tagValue1"),
		// 			},
		// 			Properties: &armdevtestlabs.ScheduleProperties{
		// 				CreatedDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2018-10-02T01:40:48.173Z"); return t}()),
		// 				DailyRecurrence: &armdevtestlabs.DayDetails{
		// 					Time: to.Ptr("{timeOfTheDayTheScheduleWillOccurEveryDay}"),
		// 				},
		// 				HourlyRecurrence: &armdevtestlabs.HourDetails{
		// 					Minute: to.Ptr[int32](30),
		// 				},
		// 				NotificationSettings: &armdevtestlabs.NotificationSettings{
		// 					EmailRecipient: to.Ptr("{email}"),
		// 					NotificationLocale: to.Ptr("EN"),
		// 					Status: to.Ptr(armdevtestlabs.EnableStatus("{Enabled|Disabled}")),
		// 					TimeInMinutes: to.Ptr[int32](15),
		// 					WebhookURL: to.Ptr("{webhookUrl}"),
		// 				},
		// 				ProvisioningState: to.Ptr("Succeeded"),
		// 				Status: to.Ptr(armdevtestlabs.EnableStatus("{Enabled|Disabled}")),
		// 				TargetResourceID: to.Ptr("/subscriptions/{subscriptionId}/resourcegroups/resourceGroupName/providers/microsoft.devtestlab/labs/{labName}"),
		// 				TaskType: to.Ptr("{myLabVmTaskType}"),
		// 				TimeZoneID: to.Ptr("Pacific Standard Time"),
		// 				UniqueIdentifier: to.Ptr("{uniqueIdentifier}"),
		// 				WeeklyRecurrence: &armdevtestlabs.WeekDetails{
		// 					Time: to.Ptr("{timeOfTheDayTheScheduleWillOccurOnThoseDays}"),
		// 					Weekdays: []*string{
		// 						to.Ptr("Monday"),
		// 						to.Ptr("Wednesday"),
		// 						to.Ptr("Friday")},
		// 					},
		// 				},
		// 		}},
		// 	}
	}
}
Output:

func (*SchedulesClient) Update

func (client *SchedulesClient) Update(ctx context.Context, resourceGroupName string, labName string, name string, schedule ScheduleFragment, options *SchedulesClientUpdateOptions) (SchedulesClientUpdateResponse, error)

Update - Allows modifying tags of schedules. All other properties will be ignored. If the operation fails it returns an *azcore.ResponseError type.

Generated from API version 2018-09-15

  • resourceGroupName - The name of the resource group.
  • labName - The name of the lab.
  • name - The name of the schedule.
  • schedule - A schedule.
  • options - SchedulesClientUpdateOptions contains the optional parameters for the SchedulesClient.Update method.
Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/d55b8005f05b040b852c15e74a0f3e36494a15e1/specification/devtestlabs/resource-manager/Microsoft.DevTestLab/stable/2018-09-15/examples/Schedules_Update.json

package main

import (
	"context"
	"log"

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

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armdevtestlabs.NewClientFactory("<subscription-id>", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	res, err := clientFactory.NewSchedulesClient().Update(ctx, "resourceGroupName", "{labName}", "{scheduleName}", armdevtestlabs.ScheduleFragment{
		Tags: map[string]*string{
			"tagName1": to.Ptr("tagValue1"),
		},
	}, 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.Schedule = armdevtestlabs.Schedule{
	// 	Name: to.Ptr("{scheduleName}"),
	// 	Type: to.Ptr("Microsoft.DevTestLab/labs/schedules"),
	// 	ID: to.Ptr("/subscriptions/{subscriptionId}/resourcegroups/resourceGroupName/providers/microsoft.devtestlab/labs/{labName}/schedules/{scheduleName}"),
	// 	Location: to.Ptr("{location}"),
	// 	Tags: map[string]*string{
	// 		"tagName1": to.Ptr("tagValue1"),
	// 	},
	// 	Properties: &armdevtestlabs.ScheduleProperties{
	// 		CreatedDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2018-10-02T01:40:48.173Z"); return t}()),
	// 		DailyRecurrence: &armdevtestlabs.DayDetails{
	// 			Time: to.Ptr("{timeOfTheDayTheScheduleWillOccurEveryDay}"),
	// 		},
	// 		HourlyRecurrence: &armdevtestlabs.HourDetails{
	// 			Minute: to.Ptr[int32](30),
	// 		},
	// 		NotificationSettings: &armdevtestlabs.NotificationSettings{
	// 			EmailRecipient: to.Ptr("{email}"),
	// 			NotificationLocale: to.Ptr("EN"),
	// 			Status: to.Ptr(armdevtestlabs.EnableStatus("{Enabled|Disabled}")),
	// 			TimeInMinutes: to.Ptr[int32](15),
	// 			WebhookURL: to.Ptr("{webhookUrl}"),
	// 		},
	// 		ProvisioningState: to.Ptr("Succeeded"),
	// 		Status: to.Ptr(armdevtestlabs.EnableStatus("{Enabled|Disabled}")),
	// 		TargetResourceID: to.Ptr("/subscriptions/{subscriptionId}/resourcegroups/resourceGroupName/providers/microsoft.devtestlab/labs/{labName}"),
	// 		TaskType: to.Ptr("{myLabVmTaskType}"),
	// 		TimeZoneID: to.Ptr("Pacific Standard Time"),
	// 		UniqueIdentifier: to.Ptr("{uniqueIdentifier}"),
	// 		WeeklyRecurrence: &armdevtestlabs.WeekDetails{
	// 			Time: to.Ptr("{timeOfTheDayTheScheduleWillOccurOnThoseDays}"),
	// 			Weekdays: []*string{
	// 				to.Ptr("Monday"),
	// 				to.Ptr("Wednesday"),
	// 				to.Ptr("Friday")},
	// 			},
	// 		},
	// 	}
}
Output:

type SchedulesClientBeginExecuteOptions added in v0.2.0

type SchedulesClientBeginExecuteOptions struct {
	// Resumes the LRO from the provided token.
	ResumeToken string
}

SchedulesClientBeginExecuteOptions contains the optional parameters for the SchedulesClient.BeginExecute method.

type SchedulesClientCreateOrUpdateOptions added in v0.2.0

type SchedulesClientCreateOrUpdateOptions struct {
}

SchedulesClientCreateOrUpdateOptions contains the optional parameters for the SchedulesClient.CreateOrUpdate method.

type SchedulesClientCreateOrUpdateResponse added in v0.2.0

type SchedulesClientCreateOrUpdateResponse struct {
	// A schedule.
	Schedule
}

SchedulesClientCreateOrUpdateResponse contains the response from method SchedulesClient.CreateOrUpdate.

type SchedulesClientDeleteOptions added in v0.2.0

type SchedulesClientDeleteOptions struct {
}

SchedulesClientDeleteOptions contains the optional parameters for the SchedulesClient.Delete method.

type SchedulesClientDeleteResponse added in v0.2.0

type SchedulesClientDeleteResponse struct {
}

SchedulesClientDeleteResponse contains the response from method SchedulesClient.Delete.

type SchedulesClientExecuteResponse added in v0.2.0

type SchedulesClientExecuteResponse struct {
}

SchedulesClientExecuteResponse contains the response from method SchedulesClient.BeginExecute.

type SchedulesClientGetOptions added in v0.2.0

type SchedulesClientGetOptions struct {
	// Specify the $expand query. Example: 'properties($select=status)'
	Expand *string
}

SchedulesClientGetOptions contains the optional parameters for the SchedulesClient.Get method.

type SchedulesClientGetResponse added in v0.2.0

type SchedulesClientGetResponse struct {
	// A schedule.
	Schedule
}

SchedulesClientGetResponse contains the response from method SchedulesClient.Get.

type SchedulesClientListApplicableOptions added in v0.2.0

type SchedulesClientListApplicableOptions struct {
}

SchedulesClientListApplicableOptions contains the optional parameters for the SchedulesClient.NewListApplicablePager method.

type SchedulesClientListApplicableResponse added in v0.2.0

type SchedulesClientListApplicableResponse struct {
	// The response of a list operation.
	ScheduleList
}

SchedulesClientListApplicableResponse contains the response from method SchedulesClient.NewListApplicablePager.

type SchedulesClientListOptions added in v0.2.0

type SchedulesClientListOptions struct {
	// Specify the $expand query. Example: 'properties($select=status)'
	Expand *string

	// The filter to apply to the operation. Example: '$filter=contains(name,'myName')
	Filter *string

	// The ordering expression for the results, using OData notation. Example: '$orderby=name desc'
	Orderby *string

	// The maximum number of resources to return from the operation. Example: '$top=10'
	Top *int32
}

SchedulesClientListOptions contains the optional parameters for the SchedulesClient.NewListPager method.

type SchedulesClientListResponse added in v0.2.0

type SchedulesClientListResponse struct {
	// The response of a list operation.
	ScheduleList
}

SchedulesClientListResponse contains the response from method SchedulesClient.NewListPager.

type SchedulesClientUpdateOptions added in v0.2.0

type SchedulesClientUpdateOptions struct {
}

SchedulesClientUpdateOptions contains the optional parameters for the SchedulesClient.Update method.

type SchedulesClientUpdateResponse added in v0.2.0

type SchedulesClientUpdateResponse struct {
	// A schedule.
	Schedule
}

SchedulesClientUpdateResponse contains the response from method SchedulesClient.Update.

type Secret

type Secret struct {
	// REQUIRED; The properties of the resource.
	Properties *SecretProperties

	// The location of the resource.
	Location *string

	// The tags of the resource.
	Tags map[string]*string

	// READ-ONLY; The identifier of the resource.
	ID *string

	// READ-ONLY; The name of the resource.
	Name *string

	// READ-ONLY; The type of the resource.
	Type *string
}

Secret - A secret.

func (Secret) MarshalJSON

func (s Secret) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.Marshaller interface for type Secret.

func (*Secret) UnmarshalJSON added in v1.1.0

func (s *Secret) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the json.Unmarshaller interface for type Secret.

type SecretFragment

type SecretFragment struct {
	// The tags of the resource.
	Tags map[string]*string
}

SecretFragment - A secret.

func (SecretFragment) MarshalJSON added in v0.2.0

func (s SecretFragment) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.Marshaller interface for type SecretFragment.

func (*SecretFragment) UnmarshalJSON added in v1.1.0

func (s *SecretFragment) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the json.Unmarshaller interface for type SecretFragment.

type SecretList

type SecretList struct {
	// Link for next set of results.
	NextLink *string

	// Results of the list operation.
	Value []*Secret
}

SecretList - The response of a list operation.

func (SecretList) MarshalJSON

func (s SecretList) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.Marshaller interface for type SecretList.

func (*SecretList) UnmarshalJSON added in v1.1.0

func (s *SecretList) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the json.Unmarshaller interface for type SecretList.

type SecretProperties

type SecretProperties struct {
	// The value of the secret for secret creation.
	Value *string

	// READ-ONLY; The provisioning status of the resource.
	ProvisioningState *string

	// READ-ONLY; The unique immutable identifier of a resource (Guid).
	UniqueIdentifier *string
}

SecretProperties - Properties of a secret.

func (SecretProperties) MarshalJSON added in v1.1.0

func (s SecretProperties) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.Marshaller interface for type SecretProperties.

func (*SecretProperties) UnmarshalJSON added in v1.1.0

func (s *SecretProperties) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the json.Unmarshaller interface for type SecretProperties.

type SecretsClient

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

SecretsClient contains the methods for the Secrets group. Don't use this type directly, use NewSecretsClient() instead.

func NewSecretsClient

func NewSecretsClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*SecretsClient, error)

NewSecretsClient creates a new instance of SecretsClient with the specified values.

  • subscriptionID - The subscription ID.
  • credential - used to authorize requests. Usually a credential from azidentity.
  • options - pass nil to accept the default values.

func (*SecretsClient) BeginCreateOrUpdate

func (client *SecretsClient) BeginCreateOrUpdate(ctx context.Context, resourceGroupName string, labName string, userName string, name string, secret Secret, options *SecretsClientBeginCreateOrUpdateOptions) (*runtime.Poller[SecretsClientCreateOrUpdateResponse], error)

BeginCreateOrUpdate - Create or replace an existing secret. This operation can take a while to complete. If the operation fails it returns an *azcore.ResponseError type.

Generated from API version 2018-09-15

  • resourceGroupName - The name of the resource group.
  • labName - The name of the lab.
  • userName - The name of the user profile.
  • name - The name of the secret.
  • secret - A secret.
  • options - SecretsClientBeginCreateOrUpdateOptions contains the optional parameters for the SecretsClient.BeginCreateOrUpdate method.
Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/d55b8005f05b040b852c15e74a0f3e36494a15e1/specification/devtestlabs/resource-manager/Microsoft.DevTestLab/stable/2018-09-15/examples/Secrets_CreateOrUpdate.json

package main

import (
	"context"
	"log"

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

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armdevtestlabs.NewClientFactory("<subscription-id>", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	poller, err := clientFactory.NewSecretsClient().BeginCreateOrUpdate(ctx, "resourceGroupName", "{labName}", "{userName}", "{secretName}", armdevtestlabs.Secret{
		Properties: &armdevtestlabs.SecretProperties{
			Value: to.Ptr("{secret}"),
		},
	}, 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.Secret = armdevtestlabs.Secret{
	// 	Name: to.Ptr("{secretName}"),
	// 	Type: to.Ptr("Microsoft.DevTestLab/labs/users/secrets"),
	// 	ID: to.Ptr("/subscriptions/{subscriptionId}/resourcegroups/resourceGroupName/providers/microsoft.devtestlab/labs/{labName}/users/{userName}/secrets/{secretName}"),
	// 	Properties: &armdevtestlabs.SecretProperties{
	// 		UniqueIdentifier: to.Ptr("00000000-0000-0000-0000-000000000000"),
	// 	},
	// }
}
Output:

func (*SecretsClient) Delete

func (client *SecretsClient) Delete(ctx context.Context, resourceGroupName string, labName string, userName string, name string, options *SecretsClientDeleteOptions) (SecretsClientDeleteResponse, error)

Delete - Delete secret. If the operation fails it returns an *azcore.ResponseError type.

Generated from API version 2018-09-15

  • resourceGroupName - The name of the resource group.
  • labName - The name of the lab.
  • userName - The name of the user profile.
  • name - The name of the secret.
  • options - SecretsClientDeleteOptions contains the optional parameters for the SecretsClient.Delete method.
Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/d55b8005f05b040b852c15e74a0f3e36494a15e1/specification/devtestlabs/resource-manager/Microsoft.DevTestLab/stable/2018-09-15/examples/Secrets_Delete.json

package main

import (
	"context"
	"log"

	"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
	"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/devtestlabs/armdevtestlabs"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armdevtestlabs.NewClientFactory("<subscription-id>", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	_, err = clientFactory.NewSecretsClient().Delete(ctx, "resourceGroupName", "{labName}", "{userName}", "{secretName}", nil)
	if err != nil {
		log.Fatalf("failed to finish the request: %v", err)
	}
}
Output:

func (*SecretsClient) Get

func (client *SecretsClient) Get(ctx context.Context, resourceGroupName string, labName string, userName string, name string, options *SecretsClientGetOptions) (SecretsClientGetResponse, error)

Get - Get secret. If the operation fails it returns an *azcore.ResponseError type.

Generated from API version 2018-09-15

  • resourceGroupName - The name of the resource group.
  • labName - The name of the lab.
  • userName - The name of the user profile.
  • name - The name of the secret.
  • options - SecretsClientGetOptions contains the optional parameters for the SecretsClient.Get method.
Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/d55b8005f05b040b852c15e74a0f3e36494a15e1/specification/devtestlabs/resource-manager/Microsoft.DevTestLab/stable/2018-09-15/examples/Secrets_Get.json

package main

import (
	"context"
	"log"

	"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
	"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/devtestlabs/armdevtestlabs"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armdevtestlabs.NewClientFactory("<subscription-id>", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	res, err := clientFactory.NewSecretsClient().Get(ctx, "resourceGroupName", "{labName}", "{userName}", "{secretName}", &armdevtestlabs.SecretsClientGetOptions{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.Secret = armdevtestlabs.Secret{
	// 	Name: to.Ptr("{secretName}"),
	// 	Type: to.Ptr("Microsoft.DevTestLab/labs/users/secrets"),
	// 	ID: to.Ptr("/subscriptions/{subscriptionId}/resourcegroups/resourceGroupName/providers/microsoft.devtestlab/labs/{labName}/users/{userName}/secrets/{secretName}"),
	// 	Properties: &armdevtestlabs.SecretProperties{
	// 		UniqueIdentifier: to.Ptr("00000000-0000-0000-0000-000000000000"),
	// 	},
	// }
}
Output:

func (*SecretsClient) NewListPager added in v0.4.0

func (client *SecretsClient) NewListPager(resourceGroupName string, labName string, userName string, options *SecretsClientListOptions) *runtime.Pager[SecretsClientListResponse]

NewListPager - List secrets in a given user profile.

Generated from API version 2018-09-15

  • resourceGroupName - The name of the resource group.
  • labName - The name of the lab.
  • userName - The name of the user profile.
  • options - SecretsClientListOptions contains the optional parameters for the SecretsClient.NewListPager method.
Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/d55b8005f05b040b852c15e74a0f3e36494a15e1/specification/devtestlabs/resource-manager/Microsoft.DevTestLab/stable/2018-09-15/examples/Secrets_List.json

package main

import (
	"context"
	"log"

	"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
	"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/devtestlabs/armdevtestlabs"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armdevtestlabs.NewClientFactory("<subscription-id>", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	pager := clientFactory.NewSecretsClient().NewListPager("resourceGroupName", "{labName}", "{userName}", &armdevtestlabs.SecretsClientListOptions{Expand: nil,
		Filter:  nil,
		Top:     nil,
		Orderby: 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.SecretList = armdevtestlabs.SecretList{
		// 	Value: []*armdevtestlabs.Secret{
		// 		{
		// 			Name: to.Ptr("secret1"),
		// 			Type: to.Ptr("Microsoft.DevTestLab/labs/users/secrets"),
		// 			ID: to.Ptr("/subscriptions/{subscriptionId}/resourcegroups/resourceGroupName/providers/microsoft.devtestlab/labs/{labName}/users/{userName}/secrets/secret1"),
		// 			Properties: &armdevtestlabs.SecretProperties{
		// 				UniqueIdentifier: to.Ptr("00000000-0000-0000-0000-000000000000"),
		// 			},
		// 		},
		// 		{
		// 			Name: to.Ptr("secret2"),
		// 			Type: to.Ptr("Microsoft.DevTestLab/labs/users/secrets"),
		// 			ID: to.Ptr("/subscriptions/{subscriptionId}/resourcegroups/resourceGroupName/providers/microsoft.devtestlab/labs/{labName}/users/{userName}/secrets/secret2"),
		// 			Properties: &armdevtestlabs.SecretProperties{
		// 				UniqueIdentifier: to.Ptr("00000000-0000-0000-0000-000000000000"),
		// 			},
		// 	}},
		// }
	}
}
Output:

func (*SecretsClient) Update

func (client *SecretsClient) Update(ctx context.Context, resourceGroupName string, labName string, userName string, name string, secret SecretFragment, options *SecretsClientUpdateOptions) (SecretsClientUpdateResponse, error)

Update - Allows modifying tags of secrets. All other properties will be ignored. If the operation fails it returns an *azcore.ResponseError type.

Generated from API version 2018-09-15

  • resourceGroupName - The name of the resource group.
  • labName - The name of the lab.
  • userName - The name of the user profile.
  • name - The name of the secret.
  • secret - A secret.
  • options - SecretsClientUpdateOptions contains the optional parameters for the SecretsClient.Update method.
Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/d55b8005f05b040b852c15e74a0f3e36494a15e1/specification/devtestlabs/resource-manager/Microsoft.DevTestLab/stable/2018-09-15/examples/Secrets_Update.json

package main

import (
	"context"
	"log"

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

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armdevtestlabs.NewClientFactory("<subscription-id>", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	res, err := clientFactory.NewSecretsClient().Update(ctx, "resourceGroupName", "{labName}", "{userName}", "{secretName}", armdevtestlabs.SecretFragment{
		Tags: map[string]*string{
			"tagName1": to.Ptr("tagValue1"),
		},
	}, 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.Secret = armdevtestlabs.Secret{
	// 	Name: to.Ptr("{secretName}"),
	// 	Type: to.Ptr("Microsoft.DevTestLab/labs/users/secrets"),
	// 	ID: to.Ptr("/subscriptions/{subscriptionId}/resourcegroups/resourceGroupName/providers/microsoft.devtestlab/labs/{labName}/users/{userName}/secrets/{secretName}"),
	// 	Properties: &armdevtestlabs.SecretProperties{
	// 		UniqueIdentifier: to.Ptr("00000000-0000-0000-0000-000000000000"),
	// 	},
	// }
}
Output:

type SecretsClientBeginCreateOrUpdateOptions added in v0.2.0

type SecretsClientBeginCreateOrUpdateOptions struct {
	// Resumes the LRO from the provided token.
	ResumeToken string
}

SecretsClientBeginCreateOrUpdateOptions contains the optional parameters for the SecretsClient.BeginCreateOrUpdate method.

type SecretsClientCreateOrUpdateResponse added in v0.2.0

type SecretsClientCreateOrUpdateResponse struct {
	// A secret.
	Secret
}

SecretsClientCreateOrUpdateResponse contains the response from method SecretsClient.BeginCreateOrUpdate.

type SecretsClientDeleteOptions added in v0.2.0

type SecretsClientDeleteOptions struct {
}

SecretsClientDeleteOptions contains the optional parameters for the SecretsClient.Delete method.

type SecretsClientDeleteResponse added in v0.2.0

type SecretsClientDeleteResponse struct {
}

SecretsClientDeleteResponse contains the response from method SecretsClient.Delete.

type SecretsClientGetOptions added in v0.2.0

type SecretsClientGetOptions struct {
	// Specify the $expand query. Example: 'properties($select=value)'
	Expand *string
}

SecretsClientGetOptions contains the optional parameters for the SecretsClient.Get method.

type SecretsClientGetResponse added in v0.2.0

type SecretsClientGetResponse struct {
	// A secret.
	Secret
}

SecretsClientGetResponse contains the response from method SecretsClient.Get.

type SecretsClientListOptions added in v0.2.0

type SecretsClientListOptions struct {
	// Specify the $expand query. Example: 'properties($select=value)'
	Expand *string

	// The filter to apply to the operation. Example: '$filter=contains(name,'myName')
	Filter *string

	// The ordering expression for the results, using OData notation. Example: '$orderby=name desc'
	Orderby *string

	// The maximum number of resources to return from the operation. Example: '$top=10'
	Top *int32
}

SecretsClientListOptions contains the optional parameters for the SecretsClient.NewListPager method.

type SecretsClientListResponse added in v0.2.0

type SecretsClientListResponse struct {
	// The response of a list operation.
	SecretList
}

SecretsClientListResponse contains the response from method SecretsClient.NewListPager.

type SecretsClientUpdateOptions added in v0.2.0

type SecretsClientUpdateOptions struct {
}

SecretsClientUpdateOptions contains the optional parameters for the SecretsClient.Update method.

type SecretsClientUpdateResponse added in v0.2.0

type SecretsClientUpdateResponse struct {
	// A secret.
	Secret
}

SecretsClientUpdateResponse contains the response from method SecretsClient.Update.

type ServiceFabric

type ServiceFabric struct {
	// REQUIRED; The properties of the resource.
	Properties *ServiceFabricProperties

	// The location of the resource.
	Location *string

	// The tags of the resource.
	Tags map[string]*string

	// READ-ONLY; The identifier of the resource.
	ID *string

	// READ-ONLY; The name of the resource.
	Name *string

	// READ-ONLY; The type of the resource.
	Type *string
}

ServiceFabric - A Service Fabric.

func (ServiceFabric) MarshalJSON

func (s ServiceFabric) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.Marshaller interface for type ServiceFabric.

func (*ServiceFabric) UnmarshalJSON added in v1.1.0

func (s *ServiceFabric) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the json.Unmarshaller interface for type ServiceFabric.

type ServiceFabricFragment

type ServiceFabricFragment struct {
	// The tags of the resource.
	Tags map[string]*string
}

ServiceFabricFragment - A Service Fabric.

func (ServiceFabricFragment) MarshalJSON added in v0.2.0

func (s ServiceFabricFragment) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.Marshaller interface for type ServiceFabricFragment.

func (*ServiceFabricFragment) UnmarshalJSON added in v1.1.0

func (s *ServiceFabricFragment) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the json.Unmarshaller interface for type ServiceFabricFragment.

type ServiceFabricList

type ServiceFabricList struct {
	// Link for next set of results.
	NextLink *string

	// Results of the list operation.
	Value []*ServiceFabric
}

ServiceFabricList - The response of a list operation.

func (ServiceFabricList) MarshalJSON

func (s ServiceFabricList) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.Marshaller interface for type ServiceFabricList.

func (*ServiceFabricList) UnmarshalJSON added in v1.1.0

func (s *ServiceFabricList) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the json.Unmarshaller interface for type ServiceFabricList.

type ServiceFabricProperties

type ServiceFabricProperties struct {
	// The resource id of the environment under which the service fabric resource is present
	EnvironmentID *string

	// The backing service fabric resource's id
	ExternalServiceFabricID *string

	// READ-ONLY; The applicable schedule for the virtual machine.
	ApplicableSchedule *ApplicableSchedule

	// READ-ONLY; The provisioning status of the resource.
	ProvisioningState *string

	// READ-ONLY; The unique immutable identifier of a resource (Guid).
	UniqueIdentifier *string
}

ServiceFabricProperties - Properties of a service fabric.

func (ServiceFabricProperties) MarshalJSON added in v1.1.0

func (s ServiceFabricProperties) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.Marshaller interface for type ServiceFabricProperties.

func (*ServiceFabricProperties) UnmarshalJSON added in v1.1.0

func (s *ServiceFabricProperties) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the json.Unmarshaller interface for type ServiceFabricProperties.

type ServiceFabricSchedulesClient

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

ServiceFabricSchedulesClient contains the methods for the ServiceFabricSchedules group. Don't use this type directly, use NewServiceFabricSchedulesClient() instead.

func NewServiceFabricSchedulesClient

func NewServiceFabricSchedulesClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*ServiceFabricSchedulesClient, error)

NewServiceFabricSchedulesClient creates a new instance of ServiceFabricSchedulesClient with the specified values.

  • subscriptionID - The subscription ID.
  • credential - used to authorize requests. Usually a credential from azidentity.
  • options - pass nil to accept the default values.

func (*ServiceFabricSchedulesClient) BeginExecute

func (client *ServiceFabricSchedulesClient) BeginExecute(ctx context.Context, resourceGroupName string, labName string, userName string, serviceFabricName string, name string, options *ServiceFabricSchedulesClientBeginExecuteOptions) (*runtime.Poller[ServiceFabricSchedulesClientExecuteResponse], error)

BeginExecute - Execute a schedule. This operation can take a while to complete. If the operation fails it returns an *azcore.ResponseError type.

Generated from API version 2018-09-15

  • resourceGroupName - The name of the resource group.
  • labName - The name of the lab.
  • userName - The name of the user profile.
  • serviceFabricName - The name of the service fabric.
  • name - The name of the schedule.
  • options - ServiceFabricSchedulesClientBeginExecuteOptions contains the optional parameters for the ServiceFabricSchedulesClient.BeginExecute method.
Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/d55b8005f05b040b852c15e74a0f3e36494a15e1/specification/devtestlabs/resource-manager/Microsoft.DevTestLab/stable/2018-09-15/examples/ServiceFabricSchedules_Execute.json

package main

import (
	"context"
	"log"

	"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
	"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/devtestlabs/armdevtestlabs"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armdevtestlabs.NewClientFactory("<subscription-id>", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	poller, err := clientFactory.NewServiceFabricSchedulesClient().BeginExecute(ctx, "resourceGroupName", "{labName}", "@me", "{serviceFrabicName}", "{scheduleName}", 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 (*ServiceFabricSchedulesClient) CreateOrUpdate

func (client *ServiceFabricSchedulesClient) CreateOrUpdate(ctx context.Context, resourceGroupName string, labName string, userName string, serviceFabricName string, name string, schedule Schedule, options *ServiceFabricSchedulesClientCreateOrUpdateOptions) (ServiceFabricSchedulesClientCreateOrUpdateResponse, error)

CreateOrUpdate - Create or replace an existing schedule. If the operation fails it returns an *azcore.ResponseError type.

Generated from API version 2018-09-15

  • resourceGroupName - The name of the resource group.
  • labName - The name of the lab.
  • userName - The name of the user profile.
  • serviceFabricName - The name of the service fabric.
  • name - The name of the schedule.
  • schedule - A schedule.
  • options - ServiceFabricSchedulesClientCreateOrUpdateOptions contains the optional parameters for the ServiceFabricSchedulesClient.CreateOrUpdate method.
Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/d55b8005f05b040b852c15e74a0f3e36494a15e1/specification/devtestlabs/resource-manager/Microsoft.DevTestLab/stable/2018-09-15/examples/ServiceFabricSchedules_CreateOrUpdate.json

package main

import (
	"context"
	"log"

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

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armdevtestlabs.NewClientFactory("<subscription-id>", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	res, err := clientFactory.NewServiceFabricSchedulesClient().CreateOrUpdate(ctx, "resourceGroupName", "{labName}", "@me", "{serviceFrabicName}", "{scheduleName}", armdevtestlabs.Schedule{
		Location: to.Ptr("{location}"),
		Tags: map[string]*string{
			"tagName1": to.Ptr("tagValue1"),
		},
		Properties: &armdevtestlabs.ScheduleProperties{
			DailyRecurrence: &armdevtestlabs.DayDetails{
				Time: to.Ptr("19:00"),
			},
			HourlyRecurrence: &armdevtestlabs.HourDetails{
				Minute: to.Ptr[int32](0),
			},
			NotificationSettings: &armdevtestlabs.NotificationSettings{
				EmailRecipient:     to.Ptr("{email}"),
				NotificationLocale: to.Ptr("EN"),
				Status:             to.Ptr(armdevtestlabs.EnableStatus("{Enabled|Disabled}")),
				TimeInMinutes:      to.Ptr[int32](15),
				WebhookURL:         to.Ptr("{webhoolUrl}"),
			},
			Status:           to.Ptr(armdevtestlabs.EnableStatus("{Enabled|Disabled}")),
			TargetResourceID: to.Ptr("/subscriptions/{subscriptionId}/resourceGroups/resourceGroupName/providers/Microsoft.DevTestLab/labs/{labName}/users/{uniqueIdentifier}/servicefabrics/{serviceFrabicName}"),
			TaskType:         to.Ptr("{Unknown|LabVmsShutdownTask|LabVmsStartupTask|LabVmReclamationTask|ComputeVmShutdownTask}"),
			TimeZoneID:       to.Ptr("Pacific Standard Time"),
			WeeklyRecurrence: &armdevtestlabs.WeekDetails{
				Time: to.Ptr("19:00"),
				Weekdays: []*string{
					to.Ptr("Monday"),
					to.Ptr("Tuesday"),
					to.Ptr("Wednesday"),
					to.Ptr("Thursday"),
					to.Ptr("Friday"),
					to.Ptr("Saturday"),
					to.Ptr("Sunday")},
			},
		},
	}, 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.Schedule = armdevtestlabs.Schedule{
	// 	Name: to.Ptr("{scheduleName}"),
	// 	Type: to.Ptr("microsoft.devtestlab/labs/users/servicefabrics/schedules"),
	// 	ID: to.Ptr("/subscriptions/{subscriptionId}/resourceGroups/resourceGroupName/providers/Microsoft.DevTestLab/labs/{labName}/users/{uniqueIdentifier}/servicefabrics/{serviceFrabicName}/schedules/{scheduleName}"),
	// 	Location: to.Ptr("{location}"),
	// 	Tags: map[string]*string{
	// 		"tagName1": to.Ptr("tagValue1"),
	// 	},
	// 	Properties: &armdevtestlabs.ScheduleProperties{
	// 		CreatedDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2018-09-15T00:00:00.000Z"); return t}()),
	// 		NotificationSettings: &armdevtestlabs.NotificationSettings{
	// 			EmailRecipient: to.Ptr("{email}"),
	// 			NotificationLocale: to.Ptr("EN"),
	// 			Status: to.Ptr(armdevtestlabs.EnableStatusDisabled),
	// 			TimeInMinutes: to.Ptr[int32](15),
	// 			WebhookURL: to.Ptr("{webhookUrl}"),
	// 		},
	// 		ProvisioningState: to.Ptr("Succeeded"),
	// 		Status: to.Ptr(armdevtestlabs.EnableStatusEnabled),
	// 		TargetResourceID: to.Ptr("/subscriptions/{subscriptionId}/resourceGroups/resourceGroupName/providers/Microsoft.DevTestLab/labs/{labName}/users/{uniqueIdentifier}/servicefabrics/{serviceFrabicName}"),
	// 		TaskType: to.Ptr("Unknown"),
	// 		TimeZoneID: to.Ptr("Pacific Standard Time"),
	// 		UniqueIdentifier: to.Ptr("{uniqueIdentifier}"),
	// 		WeeklyRecurrence: &armdevtestlabs.WeekDetails{
	// 			Time: to.Ptr("1900"),
	// 			Weekdays: []*string{
	// 				to.Ptr("Sunday"),
	// 				to.Ptr("Monday"),
	// 				to.Ptr("Tuesday"),
	// 				to.Ptr("Wednesday"),
	// 				to.Ptr("Thursday"),
	// 				to.Ptr("Friday"),
	// 				to.Ptr("Saturday")},
	// 			},
	// 		},
	// 	}
}
Output:

func (*ServiceFabricSchedulesClient) Delete

func (client *ServiceFabricSchedulesClient) Delete(ctx context.Context, resourceGroupName string, labName string, userName string, serviceFabricName string, name string, options *ServiceFabricSchedulesClientDeleteOptions) (ServiceFabricSchedulesClientDeleteResponse, error)

Delete - Delete schedule. If the operation fails it returns an *azcore.ResponseError type.

Generated from API version 2018-09-15

  • resourceGroupName - The name of the resource group.
  • labName - The name of the lab.
  • userName - The name of the user profile.
  • serviceFabricName - The name of the service fabric.
  • name - The name of the schedule.
  • options - ServiceFabricSchedulesClientDeleteOptions contains the optional parameters for the ServiceFabricSchedulesClient.Delete method.
Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/d55b8005f05b040b852c15e74a0f3e36494a15e1/specification/devtestlabs/resource-manager/Microsoft.DevTestLab/stable/2018-09-15/examples/ServiceFabricSchedules_Delete.json

package main

import (
	"context"
	"log"

	"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
	"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/devtestlabs/armdevtestlabs"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armdevtestlabs.NewClientFactory("<subscription-id>", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	_, err = clientFactory.NewServiceFabricSchedulesClient().Delete(ctx, "resourceGroupName", "{labName}", "@me", "{serviceFrabicName}", "{scheduleName}", nil)
	if err != nil {
		log.Fatalf("failed to finish the request: %v", err)
	}
}
Output:

func (*ServiceFabricSchedulesClient) Get

func (client *ServiceFabricSchedulesClient) Get(ctx context.Context, resourceGroupName string, labName string, userName string, serviceFabricName string, name string, options *ServiceFabricSchedulesClientGetOptions) (ServiceFabricSchedulesClientGetResponse, error)

Get - Get schedule. If the operation fails it returns an *azcore.ResponseError type.

Generated from API version 2018-09-15

  • resourceGroupName - The name of the resource group.
  • labName - The name of the lab.
  • userName - The name of the user profile.
  • serviceFabricName - The name of the service fabric.
  • name - The name of the schedule.
  • options - ServiceFabricSchedulesClientGetOptions contains the optional parameters for the ServiceFabricSchedulesClient.Get method.
Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/d55b8005f05b040b852c15e74a0f3e36494a15e1/specification/devtestlabs/resource-manager/Microsoft.DevTestLab/stable/2018-09-15/examples/ServiceFabricSchedules_Get.json

package main

import (
	"context"
	"log"

	"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
	"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/devtestlabs/armdevtestlabs"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armdevtestlabs.NewClientFactory("<subscription-id>", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	res, err := clientFactory.NewServiceFabricSchedulesClient().Get(ctx, "resourceGroupName", "{labName}", "@me", "{serviceFrabicName}", "{scheduleName}", &armdevtestlabs.ServiceFabricSchedulesClientGetOptions{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.Schedule = armdevtestlabs.Schedule{
	// 	Name: to.Ptr("{scheduleName}"),
	// 	Type: to.Ptr("microsoft.devtestlab/labs/users/servicefabrics/schedules"),
	// 	ID: to.Ptr("/subscriptions/{subscriptionId}/resourceGroups/resourceGroupName/providers/Microsoft.DevTestLab/labs/{labName}/users/{uniqueIdentifier}/servicefabrics/{serviceFrabicName}/schedules/{scheduleName}"),
	// 	Location: to.Ptr("{location}"),
	// 	Tags: map[string]*string{
	// 		"tagName1": to.Ptr("tagValue1"),
	// 	},
	// 	Properties: &armdevtestlabs.ScheduleProperties{
	// 		CreatedDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2018-09-15T00:00:00.000Z"); return t}()),
	// 		NotificationSettings: &armdevtestlabs.NotificationSettings{
	// 			EmailRecipient: to.Ptr("{email}"),
	// 			NotificationLocale: to.Ptr("EN"),
	// 			Status: to.Ptr(armdevtestlabs.EnableStatusDisabled),
	// 			TimeInMinutes: to.Ptr[int32](15),
	// 			WebhookURL: to.Ptr("{webhookUrl}"),
	// 		},
	// 		ProvisioningState: to.Ptr("Succeeded"),
	// 		Status: to.Ptr(armdevtestlabs.EnableStatusEnabled),
	// 		TargetResourceID: to.Ptr("/subscriptions/{subscriptionId}/resourceGroups/resourceGroupName/providers/Microsoft.DevTestLab/labs/{labName}/users/{uniqueIdentifier}/servicefabrics/{serviceFrabicName}"),
	// 		TaskType: to.Ptr("Unknown"),
	// 		TimeZoneID: to.Ptr("Pacific Standard Time"),
	// 		UniqueIdentifier: to.Ptr("{uniqueIdentifier}"),
	// 		WeeklyRecurrence: &armdevtestlabs.WeekDetails{
	// 			Time: to.Ptr("1900"),
	// 			Weekdays: []*string{
	// 				to.Ptr("Sunday"),
	// 				to.Ptr("Monday"),
	// 				to.Ptr("Tuesday"),
	// 				to.Ptr("Wednesday"),
	// 				to.Ptr("Thursday"),
	// 				to.Ptr("Friday"),
	// 				to.Ptr("Saturday")},
	// 			},
	// 		},
	// 	}
}
Output:

func (*ServiceFabricSchedulesClient) NewListPager added in v0.4.0

func (client *ServiceFabricSchedulesClient) NewListPager(resourceGroupName string, labName string, userName string, serviceFabricName string, options *ServiceFabricSchedulesClientListOptions) *runtime.Pager[ServiceFabricSchedulesClientListResponse]

NewListPager - List schedules in a given service fabric.

Generated from API version 2018-09-15

  • resourceGroupName - The name of the resource group.
  • labName - The name of the lab.
  • userName - The name of the user profile.
  • serviceFabricName - The name of the service fabric.
  • options - ServiceFabricSchedulesClientListOptions contains the optional parameters for the ServiceFabricSchedulesClient.NewListPager method.
Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/d55b8005f05b040b852c15e74a0f3e36494a15e1/specification/devtestlabs/resource-manager/Microsoft.DevTestLab/stable/2018-09-15/examples/ServiceFabricSchedules_List.json

package main

import (
	"context"
	"log"

	"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
	"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/devtestlabs/armdevtestlabs"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armdevtestlabs.NewClientFactory("<subscription-id>", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	pager := clientFactory.NewServiceFabricSchedulesClient().NewListPager("resourceGroupName", "{labName}", "@me", "{serviceFrabicName}", &armdevtestlabs.ServiceFabricSchedulesClientListOptions{Expand: nil,
		Filter:  nil,
		Top:     nil,
		Orderby: 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.ScheduleList = armdevtestlabs.ScheduleList{
		// 	Value: []*armdevtestlabs.Schedule{
		// 		{
		// 			Name: to.Ptr("{scheduleName}"),
		// 			Type: to.Ptr("microsoft.devtestlab/labs/users/servicefabrics/schedules"),
		// 			ID: to.Ptr("/subscriptions/{subscriptionId}/resourceGroups/resourceGroupName/providers/Microsoft.DevTestLab/labs/{labName}/users/{uniqueIdentifier}/servicefabrics/{serviceFrabicName}/schedules/{scheduleName}"),
		// 			Location: to.Ptr("{location}"),
		// 			Tags: map[string]*string{
		// 				"tagName1": to.Ptr("tagValue1"),
		// 			},
		// 			Properties: &armdevtestlabs.ScheduleProperties{
		// 				CreatedDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2018-09-15T00:00:00.000Z"); return t}()),
		// 				NotificationSettings: &armdevtestlabs.NotificationSettings{
		// 					EmailRecipient: to.Ptr("{email}"),
		// 					NotificationLocale: to.Ptr("EN"),
		// 					Status: to.Ptr(armdevtestlabs.EnableStatusDisabled),
		// 					TimeInMinutes: to.Ptr[int32](15),
		// 					WebhookURL: to.Ptr("{webhookUrl}"),
		// 				},
		// 				ProvisioningState: to.Ptr("Succeeded"),
		// 				Status: to.Ptr(armdevtestlabs.EnableStatusEnabled),
		// 				TargetResourceID: to.Ptr("/subscriptions/{subscriptionId}/resourceGroups/resourceGroupName/providers/Microsoft.DevTestLab/labs/{labName}/users/{uniqueIdentifier}/servicefabrics/{serviceFrabicName}"),
		// 				TaskType: to.Ptr("Unknown"),
		// 				TimeZoneID: to.Ptr("Pacific Standard Time"),
		// 				UniqueIdentifier: to.Ptr("{uniqueIdentifier}"),
		// 				WeeklyRecurrence: &armdevtestlabs.WeekDetails{
		// 					Time: to.Ptr("1900"),
		// 					Weekdays: []*string{
		// 						to.Ptr("Sunday"),
		// 						to.Ptr("Monday"),
		// 						to.Ptr("Tuesday"),
		// 						to.Ptr("Wednesday"),
		// 						to.Ptr("Thursday"),
		// 						to.Ptr("Friday"),
		// 						to.Ptr("Saturday")},
		// 					},
		// 				},
		// 		}},
		// 	}
	}
}
Output:

func (*ServiceFabricSchedulesClient) Update

func (client *ServiceFabricSchedulesClient) Update(ctx context.Context, resourceGroupName string, labName string, userName string, serviceFabricName string, name string, schedule ScheduleFragment, options *ServiceFabricSchedulesClientUpdateOptions) (ServiceFabricSchedulesClientUpdateResponse, error)

Update - Allows modifying tags of schedules. All other properties will be ignored. If the operation fails it returns an *azcore.ResponseError type.

Generated from API version 2018-09-15

  • resourceGroupName - The name of the resource group.
  • labName - The name of the lab.
  • userName - The name of the user profile.
  • serviceFabricName - The name of the service fabric.
  • name - The name of the schedule.
  • schedule - A schedule.
  • options - ServiceFabricSchedulesClientUpdateOptions contains the optional parameters for the ServiceFabricSchedulesClient.Update method.
Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/d55b8005f05b040b852c15e74a0f3e36494a15e1/specification/devtestlabs/resource-manager/Microsoft.DevTestLab/stable/2018-09-15/examples/ServiceFabricSchedules_Update.json

package main

import (
	"context"
	"log"

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

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armdevtestlabs.NewClientFactory("<subscription-id>", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	res, err := clientFactory.NewServiceFabricSchedulesClient().Update(ctx, "resourceGroupName", "{labName}", "@me", "{serviceFrabicName}", "{scheduleName}", armdevtestlabs.ScheduleFragment{
		Tags: map[string]*string{
			"tagName1": to.Ptr("tagValue1"),
		},
	}, 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.Schedule = armdevtestlabs.Schedule{
	// 	Name: to.Ptr("{scheduleName}"),
	// 	Type: to.Ptr("microsoft.devtestlab/labs/users/servicefabrics/schedules"),
	// 	ID: to.Ptr("/subscriptions/{subscriptionId}/resourceGroups/resourceGroupName/providers/Microsoft.DevTestLab/labs/{labName}/users/{uniqueIdentifier}/servicefabrics/{serviceFrabicName}/schedules/{scheduleName}"),
	// 	Location: to.Ptr("{location}"),
	// 	Tags: map[string]*string{
	// 		"tagName1": to.Ptr("tagValue1"),
	// 	},
	// 	Properties: &armdevtestlabs.ScheduleProperties{
	// 		CreatedDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2018-09-15T00:00:00.000Z"); return t}()),
	// 		NotificationSettings: &armdevtestlabs.NotificationSettings{
	// 			EmailRecipient: to.Ptr("{email}"),
	// 			NotificationLocale: to.Ptr("EN"),
	// 			Status: to.Ptr(armdevtestlabs.EnableStatusDisabled),
	// 			TimeInMinutes: to.Ptr[int32](15),
	// 			WebhookURL: to.Ptr("{webhookUrl}"),
	// 		},
	// 		ProvisioningState: to.Ptr("Succeeded"),
	// 		Status: to.Ptr(armdevtestlabs.EnableStatusDisabled),
	// 		TargetResourceID: to.Ptr("/subscriptions/{subscriptionId}/resourceGroups/resourceGroupName/providers/Microsoft.DevTestLab/labs/{labName}/users/{uniqueIdentifier}/servicefabrics/{serviceFrabicName}"),
	// 		TaskType: to.Ptr("Unknown"),
	// 		TimeZoneID: to.Ptr("Pacific Standard Time"),
	// 		UniqueIdentifier: to.Ptr("{uniqueIdentifier}"),
	// 		WeeklyRecurrence: &armdevtestlabs.WeekDetails{
	// 			Time: to.Ptr("1900"),
	// 			Weekdays: []*string{
	// 				to.Ptr("Sunday"),
	// 				to.Ptr("Monday"),
	// 				to.Ptr("Tuesday"),
	// 				to.Ptr("Wednesday"),
	// 				to.Ptr("Thursday"),
	// 				to.Ptr("Friday"),
	// 				to.Ptr("Saturday")},
	// 			},
	// 		},
	// 	}
}
Output:

type ServiceFabricSchedulesClientBeginExecuteOptions added in v0.2.0

type ServiceFabricSchedulesClientBeginExecuteOptions struct {
	// Resumes the LRO from the provided token.
	ResumeToken string
}

ServiceFabricSchedulesClientBeginExecuteOptions contains the optional parameters for the ServiceFabricSchedulesClient.BeginExecute method.

type ServiceFabricSchedulesClientCreateOrUpdateOptions added in v0.2.0

type ServiceFabricSchedulesClientCreateOrUpdateOptions struct {
}

ServiceFabricSchedulesClientCreateOrUpdateOptions contains the optional parameters for the ServiceFabricSchedulesClient.CreateOrUpdate method.

type ServiceFabricSchedulesClientCreateOrUpdateResponse added in v0.2.0

type ServiceFabricSchedulesClientCreateOrUpdateResponse struct {
	// A schedule.
	Schedule
}

ServiceFabricSchedulesClientCreateOrUpdateResponse contains the response from method ServiceFabricSchedulesClient.CreateOrUpdate.

type ServiceFabricSchedulesClientDeleteOptions added in v0.2.0

type ServiceFabricSchedulesClientDeleteOptions struct {
}

ServiceFabricSchedulesClientDeleteOptions contains the optional parameters for the ServiceFabricSchedulesClient.Delete method.

type ServiceFabricSchedulesClientDeleteResponse added in v0.2.0

type ServiceFabricSchedulesClientDeleteResponse struct {
}

ServiceFabricSchedulesClientDeleteResponse contains the response from method ServiceFabricSchedulesClient.Delete.

type ServiceFabricSchedulesClientExecuteResponse added in v0.2.0

type ServiceFabricSchedulesClientExecuteResponse struct {
}

ServiceFabricSchedulesClientExecuteResponse contains the response from method ServiceFabricSchedulesClient.BeginExecute.

type ServiceFabricSchedulesClientGetOptions added in v0.2.0

type ServiceFabricSchedulesClientGetOptions struct {
	// Specify the $expand query. Example: 'properties($select=status)'
	Expand *string
}

ServiceFabricSchedulesClientGetOptions contains the optional parameters for the ServiceFabricSchedulesClient.Get method.

type ServiceFabricSchedulesClientGetResponse added in v0.2.0

type ServiceFabricSchedulesClientGetResponse struct {
	// A schedule.
	Schedule
}

ServiceFabricSchedulesClientGetResponse contains the response from method ServiceFabricSchedulesClient.Get.

type ServiceFabricSchedulesClientListOptions added in v0.2.0

type ServiceFabricSchedulesClientListOptions struct {
	// Specify the $expand query. Example: 'properties($select=status)'
	Expand *string

	// The filter to apply to the operation. Example: '$filter=contains(name,'myName')
	Filter *string

	// The ordering expression for the results, using OData notation. Example: '$orderby=name desc'
	Orderby *string

	// The maximum number of resources to return from the operation. Example: '$top=10'
	Top *int32
}

ServiceFabricSchedulesClientListOptions contains the optional parameters for the ServiceFabricSchedulesClient.NewListPager method.

type ServiceFabricSchedulesClientListResponse added in v0.2.0

type ServiceFabricSchedulesClientListResponse struct {
	// The response of a list operation.
	ScheduleList
}

ServiceFabricSchedulesClientListResponse contains the response from method ServiceFabricSchedulesClient.NewListPager.

type ServiceFabricSchedulesClientUpdateOptions added in v0.2.0

type ServiceFabricSchedulesClientUpdateOptions struct {
}

ServiceFabricSchedulesClientUpdateOptions contains the optional parameters for the ServiceFabricSchedulesClient.Update method.

type ServiceFabricSchedulesClientUpdateResponse added in v0.2.0

type ServiceFabricSchedulesClientUpdateResponse struct {
	// A schedule.
	Schedule
}

ServiceFabricSchedulesClientUpdateResponse contains the response from method ServiceFabricSchedulesClient.Update.

type ServiceFabricsClient

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

ServiceFabricsClient contains the methods for the ServiceFabrics group. Don't use this type directly, use NewServiceFabricsClient() instead.

func NewServiceFabricsClient

func NewServiceFabricsClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*ServiceFabricsClient, error)

NewServiceFabricsClient creates a new instance of ServiceFabricsClient with the specified values.

  • subscriptionID - The subscription ID.
  • credential - used to authorize requests. Usually a credential from azidentity.
  • options - pass nil to accept the default values.

func (*ServiceFabricsClient) BeginCreateOrUpdate

func (client *ServiceFabricsClient) BeginCreateOrUpdate(ctx context.Context, resourceGroupName string, labName string, userName string, name string, serviceFabric ServiceFabric, options *ServiceFabricsClientBeginCreateOrUpdateOptions) (*runtime.Poller[ServiceFabricsClientCreateOrUpdateResponse], error)

BeginCreateOrUpdate - Create or replace an existing service fabric. This operation can take a while to complete. If the operation fails it returns an *azcore.ResponseError type.

Generated from API version 2018-09-15

  • resourceGroupName - The name of the resource group.
  • labName - The name of the lab.
  • userName - The name of the user profile.
  • name - The name of the service fabric.
  • serviceFabric - A Service Fabric.
  • options - ServiceFabricsClientBeginCreateOrUpdateOptions contains the optional parameters for the ServiceFabricsClient.BeginCreateOrUpdate method.
Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/d55b8005f05b040b852c15e74a0f3e36494a15e1/specification/devtestlabs/resource-manager/Microsoft.DevTestLab/stable/2018-09-15/examples/ServiceFabrics_CreateOrUpdate.json

package main

import (
	"context"
	"log"

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

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armdevtestlabs.NewClientFactory("<subscription-id>", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	poller, err := clientFactory.NewServiceFabricsClient().BeginCreateOrUpdate(ctx, "resourceGroupName", "{labName}", "{userName}", "{serviceFabricName}", armdevtestlabs.ServiceFabric{
		Location: to.Ptr("{location}"),
		Tags: map[string]*string{
			"tagName1": to.Ptr("tagValue1"),
		},
		Properties: &armdevtestlabs.ServiceFabricProperties{
			EnvironmentID:           to.Ptr("{environmentId}"),
			ExternalServiceFabricID: to.Ptr("{serviceFabricId}"),
		},
	}, 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.ServiceFabric = armdevtestlabs.ServiceFabric{
	// 	Name: to.Ptr("{serviceFabricName}"),
	// 	Type: to.Ptr("Microsoft.DevTestLab/labs/users/serviceFabrics"),
	// 	ID: to.Ptr("/subscriptions/{subscriptionId}/resourcegroups/resourceGroupName/providers/microsoft.devtestlab/labs/{labName}/users/{userName}/servicefabrics/{serviceFabricName}"),
	// 	Location: to.Ptr("{location}"),
	// 	Tags: map[string]*string{
	// 		"tagName1": to.Ptr("tagValue1"),
	// 	},
	// 	Properties: &armdevtestlabs.ServiceFabricProperties{
	// 		ApplicableSchedule: &armdevtestlabs.ApplicableSchedule{
	// 			Name: to.Ptr("{scheduleName}"),
	// 			Type: to.Ptr("{scheduleType}"),
	// 			ID: to.Ptr("/subscriptions/{subscriptionId}/resourceGroups/resourceGroupName/providers/Microsoft.DevTestLab/labs/{labName}/schedules/{scheduleName}"),
	// 			Location: to.Ptr("{location}"),
	// 			Tags: map[string]*string{
	// 				"tagName1": to.Ptr("tagValue1"),
	// 			},
	// 			Properties: &armdevtestlabs.ApplicableScheduleProperties{
	// 				LabVMsShutdown: &armdevtestlabs.Schedule{
	// 					Name: to.Ptr("{scheduleName}"),
	// 					Type: to.Ptr("Microsoft.DevTestLab/labs/schedules"),
	// 					ID: to.Ptr("/subscriptions/{subscriptionId}/resourcegroups/resourceGroupName/providers/microsoft.devtestlab/labs/{labName}/schedules/{scheduleName}"),
	// 					Location: to.Ptr("{location}"),
	// 					Tags: map[string]*string{
	// 						"tagName1": to.Ptr("tagValue1"),
	// 					},
	// 					Properties: &armdevtestlabs.ScheduleProperties{
	// 						CreatedDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2018-10-02T01:40:48.173Z"); return t}()),
	// 						DailyRecurrence: &armdevtestlabs.DayDetails{
	// 							Time: to.Ptr("{timeOfTheDayTheScheduleWillOccurEveryDay}"),
	// 						},
	// 						HourlyRecurrence: &armdevtestlabs.HourDetails{
	// 							Minute: to.Ptr[int32](30),
	// 						},
	// 						NotificationSettings: &armdevtestlabs.NotificationSettings{
	// 							EmailRecipient: to.Ptr("{email}"),
	// 							NotificationLocale: to.Ptr("EN"),
	// 							Status: to.Ptr(armdevtestlabs.EnableStatus("{Enabled|Disabled}")),
	// 							TimeInMinutes: to.Ptr[int32](15),
	// 							WebhookURL: to.Ptr("{webhookUrl}"),
	// 						},
	// 						ProvisioningState: to.Ptr("Succeeded"),
	// 						Status: to.Ptr(armdevtestlabs.EnableStatus("{Enabled|Disabled}")),
	// 						TargetResourceID: to.Ptr("/subscriptions/{subscriptionId}/resourcegroups/resourceGroupName/providers/microsoft.devtestlab/labs/{labName}"),
	// 						TaskType: to.Ptr("{myLabVmTaskType}"),
	// 						TimeZoneID: to.Ptr("Pacific Standard Time"),
	// 						UniqueIdentifier: to.Ptr("{uniqueIdentifier}"),
	// 						WeeklyRecurrence: &armdevtestlabs.WeekDetails{
	// 							Time: to.Ptr("{timeOfTheDayTheScheduleWillOccurOnThoseDays}"),
	// 							Weekdays: []*string{
	// 								to.Ptr("Monday"),
	// 								to.Ptr("Wednesday"),
	// 								to.Ptr("Friday")},
	// 							},
	// 						},
	// 					},
	// 					LabVMsStartup: &armdevtestlabs.Schedule{
	// 						Name: to.Ptr("{scheduleName}"),
	// 						Type: to.Ptr("Microsoft.DevTestLab/labs/schedules"),
	// 						ID: to.Ptr("/subscriptions/{subscriptionId}/resourcegroups/resourceGroupName/providers/microsoft.devtestlab/labs/{labName}/schedules/{scheduleName}"),
	// 						Location: to.Ptr("{location}"),
	// 						Tags: map[string]*string{
	// 							"tagName1": to.Ptr("tagValue1"),
	// 						},
	// 						Properties: &armdevtestlabs.ScheduleProperties{
	// 							CreatedDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2018-10-02T01:40:48.173Z"); return t}()),
	// 							DailyRecurrence: &armdevtestlabs.DayDetails{
	// 								Time: to.Ptr("{timeOfTheDayTheScheduleWillOccurEveryDay}"),
	// 							},
	// 							HourlyRecurrence: &armdevtestlabs.HourDetails{
	// 								Minute: to.Ptr[int32](30),
	// 							},
	// 							NotificationSettings: &armdevtestlabs.NotificationSettings{
	// 								EmailRecipient: to.Ptr("{email}"),
	// 								NotificationLocale: to.Ptr("EN"),
	// 								Status: to.Ptr(armdevtestlabs.EnableStatus("{Enabled|Disabled}")),
	// 								TimeInMinutes: to.Ptr[int32](15),
	// 								WebhookURL: to.Ptr("{webhookUrl}"),
	// 							},
	// 							ProvisioningState: to.Ptr("Succeeded"),
	// 							Status: to.Ptr(armdevtestlabs.EnableStatus("{Enabled|Disabled}")),
	// 							TargetResourceID: to.Ptr("/subscriptions/{subscriptionId}/resourcegroups/resourceGroupName/providers/microsoft.devtestlab/labs/{labName}"),
	// 							TaskType: to.Ptr("{myLabVmTaskType}"),
	// 							TimeZoneID: to.Ptr("Pacific Standard Time"),
	// 							UniqueIdentifier: to.Ptr("{uniqueIdentifier}"),
	// 							WeeklyRecurrence: &armdevtestlabs.WeekDetails{
	// 								Time: to.Ptr("{timeOfTheDayTheScheduleWillOccurOnThoseDays}"),
	// 								Weekdays: []*string{
	// 									to.Ptr("Monday"),
	// 									to.Ptr("Wednesday"),
	// 									to.Ptr("Friday")},
	// 								},
	// 							},
	// 						},
	// 					},
	// 				},
	// 				EnvironmentID: to.Ptr("{environmentId}"),
	// 				ExternalServiceFabricID: to.Ptr("{serviceFabricId}"),
	// 				ProvisioningState: to.Ptr("Succeeded"),
	// 				UniqueIdentifier: to.Ptr("{uniqueIdentifier}"),
	// 			},
	// 		}
}
Output:

func (*ServiceFabricsClient) BeginDelete

func (client *ServiceFabricsClient) BeginDelete(ctx context.Context, resourceGroupName string, labName string, userName string, name string, options *ServiceFabricsClientBeginDeleteOptions) (*runtime.Poller[ServiceFabricsClientDeleteResponse], error)

BeginDelete - Delete service fabric. This operation can take a while to complete. If the operation fails it returns an *azcore.ResponseError type.

Generated from API version 2018-09-15

  • resourceGroupName - The name of the resource group.
  • labName - The name of the lab.
  • userName - The name of the user profile.
  • name - The name of the service fabric.
  • options - ServiceFabricsClientBeginDeleteOptions contains the optional parameters for the ServiceFabricsClient.BeginDelete method.
Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/d55b8005f05b040b852c15e74a0f3e36494a15e1/specification/devtestlabs/resource-manager/Microsoft.DevTestLab/stable/2018-09-15/examples/ServiceFabrics_Delete.json

package main

import (
	"context"
	"log"

	"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
	"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/devtestlabs/armdevtestlabs"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armdevtestlabs.NewClientFactory("<subscription-id>", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	poller, err := clientFactory.NewServiceFabricsClient().BeginDelete(ctx, "resourceGroupName", "{labName}", "{userName}", "{serviceFabricName}", 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 (*ServiceFabricsClient) BeginStart

func (client *ServiceFabricsClient) BeginStart(ctx context.Context, resourceGroupName string, labName string, userName string, name string, options *ServiceFabricsClientBeginStartOptions) (*runtime.Poller[ServiceFabricsClientStartResponse], error)

BeginStart - Start a service fabric. This operation can take a while to complete. If the operation fails it returns an *azcore.ResponseError type.

Generated from API version 2018-09-15

  • resourceGroupName - The name of the resource group.
  • labName - The name of the lab.
  • userName - The name of the user profile.
  • name - The name of the service fabric.
  • options - ServiceFabricsClientBeginStartOptions contains the optional parameters for the ServiceFabricsClient.BeginStart method.
Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/d55b8005f05b040b852c15e74a0f3e36494a15e1/specification/devtestlabs/resource-manager/Microsoft.DevTestLab/stable/2018-09-15/examples/ServiceFabrics_Start.json

package main

import (
	"context"
	"log"

	"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
	"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/devtestlabs/armdevtestlabs"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armdevtestlabs.NewClientFactory("<subscription-id>", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	poller, err := clientFactory.NewServiceFabricsClient().BeginStart(ctx, "resourceGroupName", "{labName}", "{userName}", "{serviceFabricName}", 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 (*ServiceFabricsClient) BeginStop

func (client *ServiceFabricsClient) BeginStop(ctx context.Context, resourceGroupName string, labName string, userName string, name string, options *ServiceFabricsClientBeginStopOptions) (*runtime.Poller[ServiceFabricsClientStopResponse], error)

BeginStop - Stop a service fabric This operation can take a while to complete. If the operation fails it returns an *azcore.ResponseError type.

Generated from API version 2018-09-15

  • resourceGroupName - The name of the resource group.
  • labName - The name of the lab.
  • userName - The name of the user profile.
  • name - The name of the service fabric.
  • options - ServiceFabricsClientBeginStopOptions contains the optional parameters for the ServiceFabricsClient.BeginStop method.
Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/d55b8005f05b040b852c15e74a0f3e36494a15e1/specification/devtestlabs/resource-manager/Microsoft.DevTestLab/stable/2018-09-15/examples/ServiceFabrics_Stop.json

package main

import (
	"context"
	"log"

	"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
	"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/devtestlabs/armdevtestlabs"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armdevtestlabs.NewClientFactory("<subscription-id>", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	poller, err := clientFactory.NewServiceFabricsClient().BeginStop(ctx, "resourceGroupName", "{labName}", "{userName}", "{serviceFabricName}", 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 (*ServiceFabricsClient) Get

func (client *ServiceFabricsClient) Get(ctx context.Context, resourceGroupName string, labName string, userName string, name string, options *ServiceFabricsClientGetOptions) (ServiceFabricsClientGetResponse, error)

Get - Get service fabric. If the operation fails it returns an *azcore.ResponseError type.

Generated from API version 2018-09-15

  • resourceGroupName - The name of the resource group.
  • labName - The name of the lab.
  • userName - The name of the user profile.
  • name - The name of the service fabric.
  • options - ServiceFabricsClientGetOptions contains the optional parameters for the ServiceFabricsClient.Get method.
Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/d55b8005f05b040b852c15e74a0f3e36494a15e1/specification/devtestlabs/resource-manager/Microsoft.DevTestLab/stable/2018-09-15/examples/ServiceFabrics_Get.json

package main

import (
	"context"
	"log"

	"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
	"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/devtestlabs/armdevtestlabs"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armdevtestlabs.NewClientFactory("<subscription-id>", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	res, err := clientFactory.NewServiceFabricsClient().Get(ctx, "resourceGroupName", "{labName}", "{userName}", "{serviceFabricName}", &armdevtestlabs.ServiceFabricsClientGetOptions{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.ServiceFabric = armdevtestlabs.ServiceFabric{
	// 	Name: to.Ptr("{serviceFabricName}"),
	// 	Type: to.Ptr("Microsoft.DevTestLab/labs/users/serviceFabrics"),
	// 	ID: to.Ptr("/subscriptions/{subscriptionId}/resourcegroups/resourceGroupName/providers/microsoft.devtestlab/labs/{labName}/users/{userName}/servicefabrics/{serviceFabricName}"),
	// 	Location: to.Ptr("{location}"),
	// 	Tags: map[string]*string{
	// 		"tagName1": to.Ptr("tagValue1"),
	// 	},
	// 	Properties: &armdevtestlabs.ServiceFabricProperties{
	// 		ApplicableSchedule: &armdevtestlabs.ApplicableSchedule{
	// 			Name: to.Ptr("{scheduleName}"),
	// 			Type: to.Ptr("{scheduleType}"),
	// 			ID: to.Ptr("/subscriptions/{subscriptionId}/resourceGroups/resourceGroupName/providers/Microsoft.DevTestLab/labs/{labName}/schedules/{scheduleName}"),
	// 			Location: to.Ptr("{location}"),
	// 			Tags: map[string]*string{
	// 				"tagName1": to.Ptr("tagValue1"),
	// 			},
	// 			Properties: &armdevtestlabs.ApplicableScheduleProperties{
	// 				LabVMsShutdown: &armdevtestlabs.Schedule{
	// 					Name: to.Ptr("{scheduleName}"),
	// 					Type: to.Ptr("Microsoft.DevTestLab/labs/schedules"),
	// 					ID: to.Ptr("/subscriptions/{subscriptionId}/resourcegroups/resourceGroupName/providers/microsoft.devtestlab/labs/{labName}/schedules/{scheduleName}"),
	// 					Location: to.Ptr("{location}"),
	// 					Tags: map[string]*string{
	// 						"tagName1": to.Ptr("tagValue1"),
	// 					},
	// 					Properties: &armdevtestlabs.ScheduleProperties{
	// 						CreatedDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2018-10-02T01:40:48.173Z"); return t}()),
	// 						DailyRecurrence: &armdevtestlabs.DayDetails{
	// 							Time: to.Ptr("{timeOfTheDayTheScheduleWillOccurEveryDay}"),
	// 						},
	// 						HourlyRecurrence: &armdevtestlabs.HourDetails{
	// 							Minute: to.Ptr[int32](30),
	// 						},
	// 						NotificationSettings: &armdevtestlabs.NotificationSettings{
	// 							EmailRecipient: to.Ptr("{email}"),
	// 							NotificationLocale: to.Ptr("EN"),
	// 							Status: to.Ptr(armdevtestlabs.EnableStatus("{Enabled|Disabled}")),
	// 							TimeInMinutes: to.Ptr[int32](15),
	// 							WebhookURL: to.Ptr("{webhookUrl}"),
	// 						},
	// 						ProvisioningState: to.Ptr("Succeeded"),
	// 						Status: to.Ptr(armdevtestlabs.EnableStatus("{Enabled|Disabled}")),
	// 						TargetResourceID: to.Ptr("/subscriptions/{subscriptionId}/resourcegroups/resourceGroupName/providers/microsoft.devtestlab/labs/{labName}"),
	// 						TaskType: to.Ptr("{myLabVmTaskType}"),
	// 						TimeZoneID: to.Ptr("Pacific Standard Time"),
	// 						UniqueIdentifier: to.Ptr("{uniqueIdentifier}"),
	// 						WeeklyRecurrence: &armdevtestlabs.WeekDetails{
	// 							Time: to.Ptr("{timeOfTheDayTheScheduleWillOccurOnThoseDays}"),
	// 							Weekdays: []*string{
	// 								to.Ptr("Monday"),
	// 								to.Ptr("Wednesday"),
	// 								to.Ptr("Friday")},
	// 							},
	// 						},
	// 					},
	// 					LabVMsStartup: &armdevtestlabs.Schedule{
	// 						Name: to.Ptr("{scheduleName}"),
	// 						Type: to.Ptr("Microsoft.DevTestLab/labs/schedules"),
	// 						ID: to.Ptr("/subscriptions/{subscriptionId}/resourcegroups/resourceGroupName/providers/microsoft.devtestlab/labs/{labName}/schedules/{scheduleName}"),
	// 						Location: to.Ptr("{location}"),
	// 						Tags: map[string]*string{
	// 							"tagName1": to.Ptr("tagValue1"),
	// 						},
	// 						Properties: &armdevtestlabs.ScheduleProperties{
	// 							CreatedDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2018-10-02T01:40:48.173Z"); return t}()),
	// 							DailyRecurrence: &armdevtestlabs.DayDetails{
	// 								Time: to.Ptr("{timeOfTheDayTheScheduleWillOccurEveryDay}"),
	// 							},
	// 							HourlyRecurrence: &armdevtestlabs.HourDetails{
	// 								Minute: to.Ptr[int32](30),
	// 							},
	// 							NotificationSettings: &armdevtestlabs.NotificationSettings{
	// 								EmailRecipient: to.Ptr("{email}"),
	// 								NotificationLocale: to.Ptr("EN"),
	// 								Status: to.Ptr(armdevtestlabs.EnableStatus("{Enabled|Disabled}")),
	// 								TimeInMinutes: to.Ptr[int32](15),
	// 								WebhookURL: to.Ptr("{webhookUrl}"),
	// 							},
	// 							ProvisioningState: to.Ptr("Succeeded"),
	// 							Status: to.Ptr(armdevtestlabs.EnableStatus("{Enabled|Disabled}")),
	// 							TargetResourceID: to.Ptr("/subscriptions/{subscriptionId}/resourcegroups/resourceGroupName/providers/microsoft.devtestlab/labs/{labName}"),
	// 							TaskType: to.Ptr("{myLabVmTaskType}"),
	// 							TimeZoneID: to.Ptr("Pacific Standard Time"),
	// 							UniqueIdentifier: to.Ptr("{uniqueIdentifier}"),
	// 							WeeklyRecurrence: &armdevtestlabs.WeekDetails{
	// 								Time: to.Ptr("{timeOfTheDayTheScheduleWillOccurOnThoseDays}"),
	// 								Weekdays: []*string{
	// 									to.Ptr("Monday"),
	// 									to.Ptr("Wednesday"),
	// 									to.Ptr("Friday")},
	// 								},
	// 							},
	// 						},
	// 					},
	// 				},
	// 				EnvironmentID: to.Ptr("{environmentId}"),
	// 				ExternalServiceFabricID: to.Ptr("{serviceFabricId}"),
	// 				ProvisioningState: to.Ptr("Succeeded"),
	// 				UniqueIdentifier: to.Ptr("{uniqueIdentifier}"),
	// 			},
	// 		}
}
Output:

func (*ServiceFabricsClient) ListApplicableSchedules

func (client *ServiceFabricsClient) ListApplicableSchedules(ctx context.Context, resourceGroupName string, labName string, userName string, name string, options *ServiceFabricsClientListApplicableSchedulesOptions) (ServiceFabricsClientListApplicableSchedulesResponse, error)

ListApplicableSchedules - Lists the applicable start/stop schedules, if any. If the operation fails it returns an *azcore.ResponseError type.

Generated from API version 2018-09-15

  • resourceGroupName - The name of the resource group.
  • labName - The name of the lab.
  • userName - The name of the user profile.
  • name - The name of the service fabric.
  • options - ServiceFabricsClientListApplicableSchedulesOptions contains the optional parameters for the ServiceFabricsClient.ListApplicableSchedules method.
Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/d55b8005f05b040b852c15e74a0f3e36494a15e1/specification/devtestlabs/resource-manager/Microsoft.DevTestLab/stable/2018-09-15/examples/ServiceFabrics_ListApplicableSchedules.json

package main

import (
	"context"
	"log"

	"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
	"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/devtestlabs/armdevtestlabs"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armdevtestlabs.NewClientFactory("<subscription-id>", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	res, err := clientFactory.NewServiceFabricsClient().ListApplicableSchedules(ctx, "resourceGroupName", "{labName}", "{userName}", "{serviceFabricName}", 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.ApplicableSchedule = armdevtestlabs.ApplicableSchedule{
	// 	Name: to.Ptr("{scheduleName}"),
	// 	Type: to.Ptr("{scheduleType}"),
	// 	ID: to.Ptr("/subscriptions/{subscriptionId}/resourceGroups/resourceGroupName/providers/Microsoft.DevTestLab/labs/{labName}/schedules/{scheduleName}"),
	// 	Location: to.Ptr("{location}"),
	// 	Tags: map[string]*string{
	// 		"tagName1": to.Ptr("tagValue1"),
	// 	},
	// 	Properties: &armdevtestlabs.ApplicableScheduleProperties{
	// 		LabVMsShutdown: &armdevtestlabs.Schedule{
	// 			Name: to.Ptr("{scheduleName}"),
	// 			Type: to.Ptr("Microsoft.DevTestLab/labs/schedules"),
	// 			ID: to.Ptr("/subscriptions/{subscriptionId}/resourcegroups/resourceGroupName/providers/microsoft.devtestlab/labs/{labName}/schedules/{scheduleName}"),
	// 			Location: to.Ptr("{location}"),
	// 			Tags: map[string]*string{
	// 				"tagName1": to.Ptr("tagValue1"),
	// 			},
	// 			Properties: &armdevtestlabs.ScheduleProperties{
	// 				CreatedDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2018-10-02T01:40:48.173Z"); return t}()),
	// 				DailyRecurrence: &armdevtestlabs.DayDetails{
	// 					Time: to.Ptr("{timeOfTheDayTheScheduleWillOccurEveryDay}"),
	// 				},
	// 				HourlyRecurrence: &armdevtestlabs.HourDetails{
	// 					Minute: to.Ptr[int32](30),
	// 				},
	// 				NotificationSettings: &armdevtestlabs.NotificationSettings{
	// 					EmailRecipient: to.Ptr("{email}"),
	// 					NotificationLocale: to.Ptr("EN"),
	// 					Status: to.Ptr(armdevtestlabs.EnableStatus("{Enabled|Disabled}")),
	// 					TimeInMinutes: to.Ptr[int32](15),
	// 					WebhookURL: to.Ptr("{webhookUrl}"),
	// 				},
	// 				ProvisioningState: to.Ptr("Succeeded"),
	// 				Status: to.Ptr(armdevtestlabs.EnableStatus("{Enabled|Disabled}")),
	// 				TargetResourceID: to.Ptr("/subscriptions/{subscriptionId}/resourcegroups/resourceGroupName/providers/microsoft.devtestlab/labs/{labName}"),
	// 				TaskType: to.Ptr("{myLabVmTaskType}"),
	// 				TimeZoneID: to.Ptr("Pacific Standard Time"),
	// 				UniqueIdentifier: to.Ptr("{uniqueIdentifier}"),
	// 				WeeklyRecurrence: &armdevtestlabs.WeekDetails{
	// 					Time: to.Ptr("{timeOfTheDayTheScheduleWillOccurOnThoseDays}"),
	// 					Weekdays: []*string{
	// 						to.Ptr("Monday"),
	// 						to.Ptr("Wednesday"),
	// 						to.Ptr("Friday")},
	// 					},
	// 				},
	// 			},
	// 			LabVMsStartup: &armdevtestlabs.Schedule{
	// 				Name: to.Ptr("{scheduleName}"),
	// 				Type: to.Ptr("Microsoft.DevTestLab/labs/schedules"),
	// 				ID: to.Ptr("/subscriptions/{subscriptionId}/resourcegroups/resourceGroupName/providers/microsoft.devtestlab/labs/{labName}/schedules/{scheduleName}"),
	// 				Location: to.Ptr("{location}"),
	// 				Tags: map[string]*string{
	// 					"tagName1": to.Ptr("tagValue1"),
	// 				},
	// 				Properties: &armdevtestlabs.ScheduleProperties{
	// 					CreatedDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2018-10-02T01:40:48.173Z"); return t}()),
	// 					DailyRecurrence: &armdevtestlabs.DayDetails{
	// 						Time: to.Ptr("{timeOfTheDayTheScheduleWillOccurEveryDay}"),
	// 					},
	// 					HourlyRecurrence: &armdevtestlabs.HourDetails{
	// 						Minute: to.Ptr[int32](30),
	// 					},
	// 					NotificationSettings: &armdevtestlabs.NotificationSettings{
	// 						EmailRecipient: to.Ptr("{email}"),
	// 						NotificationLocale: to.Ptr("EN"),
	// 						Status: to.Ptr(armdevtestlabs.EnableStatus("{Enabled|Disabled}")),
	// 						TimeInMinutes: to.Ptr[int32](15),
	// 						WebhookURL: to.Ptr("{webhookUrl}"),
	// 					},
	// 					ProvisioningState: to.Ptr("Succeeded"),
	// 					Status: to.Ptr(armdevtestlabs.EnableStatus("{Enabled|Disabled}")),
	// 					TargetResourceID: to.Ptr("/subscriptions/{subscriptionId}/resourcegroups/resourceGroupName/providers/microsoft.devtestlab/labs/{labName}"),
	// 					TaskType: to.Ptr("{myLabVmTaskType}"),
	// 					TimeZoneID: to.Ptr("Pacific Standard Time"),
	// 					UniqueIdentifier: to.Ptr("{uniqueIdentifier}"),
	// 					WeeklyRecurrence: &armdevtestlabs.WeekDetails{
	// 						Time: to.Ptr("{timeOfTheDayTheScheduleWillOccurOnThoseDays}"),
	// 						Weekdays: []*string{
	// 							to.Ptr("Monday"),
	// 							to.Ptr("Wednesday"),
	// 							to.Ptr("Friday")},
	// 						},
	// 					},
	// 				},
	// 			},
	// 		}
}
Output:

func (*ServiceFabricsClient) NewListPager added in v0.4.0

func (client *ServiceFabricsClient) NewListPager(resourceGroupName string, labName string, userName string, options *ServiceFabricsClientListOptions) *runtime.Pager[ServiceFabricsClientListResponse]

NewListPager - List service fabrics in a given user profile.

Generated from API version 2018-09-15

  • resourceGroupName - The name of the resource group.
  • labName - The name of the lab.
  • userName - The name of the user profile.
  • options - ServiceFabricsClientListOptions contains the optional parameters for the ServiceFabricsClient.NewListPager method.
Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/d55b8005f05b040b852c15e74a0f3e36494a15e1/specification/devtestlabs/resource-manager/Microsoft.DevTestLab/stable/2018-09-15/examples/ServiceFabrics_List.json

package main

import (
	"context"
	"log"

	"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
	"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/devtestlabs/armdevtestlabs"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armdevtestlabs.NewClientFactory("<subscription-id>", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	pager := clientFactory.NewServiceFabricsClient().NewListPager("resourceGroupName", "{labName}", "{userName}", &armdevtestlabs.ServiceFabricsClientListOptions{Expand: nil,
		Filter:  nil,
		Top:     nil,
		Orderby: 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.ServiceFabricList = armdevtestlabs.ServiceFabricList{
		// 	Value: []*armdevtestlabs.ServiceFabric{
		// 		{
		// 			Name: to.Ptr("{serviceFabricName}"),
		// 			Type: to.Ptr("Microsoft.DevTestLab/labs/users/serviceFabrics"),
		// 			ID: to.Ptr("/subscriptions/{subscriptionId}/resourcegroups/resourceGroupName/providers/microsoft.devtestlab/labs/{labName}/users/{userName}/servicefabrics/{serviceFabricName}"),
		// 			Location: to.Ptr("{location}"),
		// 			Tags: map[string]*string{
		// 				"tagName1": to.Ptr("tagValue1"),
		// 			},
		// 			Properties: &armdevtestlabs.ServiceFabricProperties{
		// 				ApplicableSchedule: &armdevtestlabs.ApplicableSchedule{
		// 					Name: to.Ptr("{scheduleName}"),
		// 					Type: to.Ptr("{scheduleType}"),
		// 					ID: to.Ptr("/subscriptions/{subscriptionId}/resourceGroups/resourceGroupName/providers/Microsoft.DevTestLab/labs/{labName}/schedules/{scheduleName}"),
		// 					Location: to.Ptr("{location}"),
		// 					Tags: map[string]*string{
		// 						"tagName1": to.Ptr("tagValue1"),
		// 					},
		// 					Properties: &armdevtestlabs.ApplicableScheduleProperties{
		// 						LabVMsShutdown: &armdevtestlabs.Schedule{
		// 							Name: to.Ptr("{scheduleName}"),
		// 							Type: to.Ptr("Microsoft.DevTestLab/labs/schedules"),
		// 							ID: to.Ptr("/subscriptions/{subscriptionId}/resourcegroups/resourceGroupName/providers/microsoft.devtestlab/labs/{labName}/schedules/{scheduleName}"),
		// 							Location: to.Ptr("{location}"),
		// 							Tags: map[string]*string{
		// 								"tagName1": to.Ptr("tagValue1"),
		// 							},
		// 							Properties: &armdevtestlabs.ScheduleProperties{
		// 								CreatedDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2018-10-02T01:40:48.173Z"); return t}()),
		// 								DailyRecurrence: &armdevtestlabs.DayDetails{
		// 									Time: to.Ptr("{timeOfTheDayTheScheduleWillOccurEveryDay}"),
		// 								},
		// 								HourlyRecurrence: &armdevtestlabs.HourDetails{
		// 									Minute: to.Ptr[int32](30),
		// 								},
		// 								NotificationSettings: &armdevtestlabs.NotificationSettings{
		// 									EmailRecipient: to.Ptr("{email}"),
		// 									NotificationLocale: to.Ptr("EN"),
		// 									Status: to.Ptr(armdevtestlabs.EnableStatus("{Enabled|Disabled}")),
		// 									TimeInMinutes: to.Ptr[int32](15),
		// 									WebhookURL: to.Ptr("{webhookUrl}"),
		// 								},
		// 								ProvisioningState: to.Ptr("Succeeded"),
		// 								Status: to.Ptr(armdevtestlabs.EnableStatus("{Enabled|Disabled}")),
		// 								TargetResourceID: to.Ptr("/subscriptions/{subscriptionId}/resourcegroups/resourceGroupName/providers/microsoft.devtestlab/labs/{labName}"),
		// 								TaskType: to.Ptr("{myLabVmTaskType}"),
		// 								TimeZoneID: to.Ptr("Pacific Standard Time"),
		// 								UniqueIdentifier: to.Ptr("{uniqueIdentifier}"),
		// 								WeeklyRecurrence: &armdevtestlabs.WeekDetails{
		// 									Time: to.Ptr("{timeOfTheDayTheScheduleWillOccurOnThoseDays}"),
		// 									Weekdays: []*string{
		// 										to.Ptr("Monday"),
		// 										to.Ptr("Wednesday"),
		// 										to.Ptr("Friday")},
		// 									},
		// 								},
		// 							},
		// 							LabVMsStartup: &armdevtestlabs.Schedule{
		// 								Name: to.Ptr("{scheduleName}"),
		// 								Type: to.Ptr("Microsoft.DevTestLab/labs/schedules"),
		// 								ID: to.Ptr("/subscriptions/{subscriptionId}/resourcegroups/resourceGroupName/providers/microsoft.devtestlab/labs/{labName}/schedules/{scheduleName}"),
		// 								Location: to.Ptr("{location}"),
		// 								Tags: map[string]*string{
		// 									"tagName1": to.Ptr("tagValue1"),
		// 								},
		// 								Properties: &armdevtestlabs.ScheduleProperties{
		// 									CreatedDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2018-10-02T01:40:48.173Z"); return t}()),
		// 									DailyRecurrence: &armdevtestlabs.DayDetails{
		// 										Time: to.Ptr("{timeOfTheDayTheScheduleWillOccurEveryDay}"),
		// 									},
		// 									HourlyRecurrence: &armdevtestlabs.HourDetails{
		// 										Minute: to.Ptr[int32](30),
		// 									},
		// 									NotificationSettings: &armdevtestlabs.NotificationSettings{
		// 										EmailRecipient: to.Ptr("{email}"),
		// 										NotificationLocale: to.Ptr("EN"),
		// 										Status: to.Ptr(armdevtestlabs.EnableStatus("{Enabled|Disabled}")),
		// 										TimeInMinutes: to.Ptr[int32](15),
		// 										WebhookURL: to.Ptr("{webhookUrl}"),
		// 									},
		// 									ProvisioningState: to.Ptr("Succeeded"),
		// 									Status: to.Ptr(armdevtestlabs.EnableStatus("{Enabled|Disabled}")),
		// 									TargetResourceID: to.Ptr("/subscriptions/{subscriptionId}/resourcegroups/resourceGroupName/providers/microsoft.devtestlab/labs/{labName}"),
		// 									TaskType: to.Ptr("{myLabVmTaskType}"),
		// 									TimeZoneID: to.Ptr("Pacific Standard Time"),
		// 									UniqueIdentifier: to.Ptr("{uniqueIdentifier}"),
		// 									WeeklyRecurrence: &armdevtestlabs.WeekDetails{
		// 										Time: to.Ptr("{timeOfTheDayTheScheduleWillOccurOnThoseDays}"),
		// 										Weekdays: []*string{
		// 											to.Ptr("Monday"),
		// 											to.Ptr("Wednesday"),
		// 											to.Ptr("Friday")},
		// 										},
		// 									},
		// 								},
		// 							},
		// 						},
		// 						EnvironmentID: to.Ptr("{environmentId}"),
		// 						ExternalServiceFabricID: to.Ptr("{serviceFabricId}"),
		// 						ProvisioningState: to.Ptr("Succeeded"),
		// 						UniqueIdentifier: to.Ptr("{uniqueIdentifier}"),
		// 					},
		// 			}},
		// 		}
	}
}
Output:

func (*ServiceFabricsClient) Update

func (client *ServiceFabricsClient) Update(ctx context.Context, resourceGroupName string, labName string, userName string, name string, serviceFabric ServiceFabricFragment, options *ServiceFabricsClientUpdateOptions) (ServiceFabricsClientUpdateResponse, error)

Update - Allows modifying tags of service fabrics. All other properties will be ignored. If the operation fails it returns an *azcore.ResponseError type.

Generated from API version 2018-09-15

  • resourceGroupName - The name of the resource group.
  • labName - The name of the lab.
  • userName - The name of the user profile.
  • name - The name of the service fabric.
  • serviceFabric - A Service Fabric.
  • options - ServiceFabricsClientUpdateOptions contains the optional parameters for the ServiceFabricsClient.Update method.
Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/d55b8005f05b040b852c15e74a0f3e36494a15e1/specification/devtestlabs/resource-manager/Microsoft.DevTestLab/stable/2018-09-15/examples/ServiceFabrics_Update.json

package main

import (
	"context"
	"log"

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

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armdevtestlabs.NewClientFactory("<subscription-id>", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	res, err := clientFactory.NewServiceFabricsClient().Update(ctx, "resourceGroupName", "{labName}", "{userName}", "{serviceFabricName}", armdevtestlabs.ServiceFabricFragment{
		Tags: map[string]*string{
			"tagName1": to.Ptr("tagValue1"),
		},
	}, 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.ServiceFabric = armdevtestlabs.ServiceFabric{
	// 	Name: to.Ptr("{serviceFabricName}"),
	// 	Type: to.Ptr("Microsoft.DevTestLab/labs/users/serviceFabrics"),
	// 	ID: to.Ptr("/subscriptions/{subscriptionId}/resourcegroups/resourceGroupName/providers/microsoft.devtestlab/labs/{labName}/users/{userName}/servicefabrics/{serviceFabricName}"),
	// 	Location: to.Ptr("{location}"),
	// 	Tags: map[string]*string{
	// 		"tagName1": to.Ptr("tagValue1"),
	// 	},
	// 	Properties: &armdevtestlabs.ServiceFabricProperties{
	// 		ApplicableSchedule: &armdevtestlabs.ApplicableSchedule{
	// 			Name: to.Ptr("{scheduleName}"),
	// 			Type: to.Ptr("{scheduleType}"),
	// 			ID: to.Ptr("/subscriptions/{subscriptionId}/resourceGroups/resourceGroupName/providers/Microsoft.DevTestLab/labs/{labName}/schedules/{scheduleName}"),
	// 			Location: to.Ptr("{location}"),
	// 			Tags: map[string]*string{
	// 				"tagName1": to.Ptr("tagValue1"),
	// 			},
	// 			Properties: &armdevtestlabs.ApplicableScheduleProperties{
	// 				LabVMsShutdown: &armdevtestlabs.Schedule{
	// 					Name: to.Ptr("{scheduleName}"),
	// 					Type: to.Ptr("Microsoft.DevTestLab/labs/schedules"),
	// 					ID: to.Ptr("/subscriptions/{subscriptionId}/resourcegroups/resourceGroupName/providers/microsoft.devtestlab/labs/{labName}/schedules/{scheduleName}"),
	// 					Location: to.Ptr("{location}"),
	// 					Tags: map[string]*string{
	// 						"tagName1": to.Ptr("tagValue1"),
	// 					},
	// 					Properties: &armdevtestlabs.ScheduleProperties{
	// 						CreatedDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2018-10-02T01:40:48.173Z"); return t}()),
	// 						DailyRecurrence: &armdevtestlabs.DayDetails{
	// 							Time: to.Ptr("{timeOfTheDayTheScheduleWillOccurEveryDay}"),
	// 						},
	// 						HourlyRecurrence: &armdevtestlabs.HourDetails{
	// 							Minute: to.Ptr[int32](30),
	// 						},
	// 						NotificationSettings: &armdevtestlabs.NotificationSettings{
	// 							EmailRecipient: to.Ptr("{email}"),
	// 							NotificationLocale: to.Ptr("EN"),
	// 							Status: to.Ptr(armdevtestlabs.EnableStatus("{Enabled|Disabled}")),
	// 							TimeInMinutes: to.Ptr[int32](15),
	// 							WebhookURL: to.Ptr("{webhookUrl}"),
	// 						},
	// 						ProvisioningState: to.Ptr("Succeeded"),
	// 						Status: to.Ptr(armdevtestlabs.EnableStatus("{Enabled|Disabled}")),
	// 						TargetResourceID: to.Ptr("/subscriptions/{subscriptionId}/resourcegroups/resourceGroupName/providers/microsoft.devtestlab/labs/{labName}"),
	// 						TaskType: to.Ptr("{myLabVmTaskType}"),
	// 						TimeZoneID: to.Ptr("Pacific Standard Time"),
	// 						UniqueIdentifier: to.Ptr("{uniqueIdentifier}"),
	// 						WeeklyRecurrence: &armdevtestlabs.WeekDetails{
	// 							Time: to.Ptr("{timeOfTheDayTheScheduleWillOccurOnThoseDays}"),
	// 							Weekdays: []*string{
	// 								to.Ptr("Monday"),
	// 								to.Ptr("Wednesday"),
	// 								to.Ptr("Friday")},
	// 							},
	// 						},
	// 					},
	// 					LabVMsStartup: &armdevtestlabs.Schedule{
	// 						Name: to.Ptr("{scheduleName}"),
	// 						Type: to.Ptr("Microsoft.DevTestLab/labs/schedules"),
	// 						ID: to.Ptr("/subscriptions/{subscriptionId}/resourcegroups/resourceGroupName/providers/microsoft.devtestlab/labs/{labName}/schedules/{scheduleName}"),
	// 						Location: to.Ptr("{location}"),
	// 						Tags: map[string]*string{
	// 							"tagName1": to.Ptr("tagValue1"),
	// 						},
	// 						Properties: &armdevtestlabs.ScheduleProperties{
	// 							CreatedDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2018-10-02T01:40:48.173Z"); return t}()),
	// 							DailyRecurrence: &armdevtestlabs.DayDetails{
	// 								Time: to.Ptr("{timeOfTheDayTheScheduleWillOccurEveryDay}"),
	// 							},
	// 							HourlyRecurrence: &armdevtestlabs.HourDetails{
	// 								Minute: to.Ptr[int32](30),
	// 							},
	// 							NotificationSettings: &armdevtestlabs.NotificationSettings{
	// 								EmailRecipient: to.Ptr("{email}"),
	// 								NotificationLocale: to.Ptr("EN"),
	// 								Status: to.Ptr(armdevtestlabs.EnableStatus("{Enabled|Disabled}")),
	// 								TimeInMinutes: to.Ptr[int32](15),
	// 								WebhookURL: to.Ptr("{webhookUrl}"),
	// 							},
	// 							ProvisioningState: to.Ptr("Succeeded"),
	// 							Status: to.Ptr(armdevtestlabs.EnableStatus("{Enabled|Disabled}")),
	// 							TargetResourceID: to.Ptr("/subscriptions/{subscriptionId}/resourcegroups/resourceGroupName/providers/microsoft.devtestlab/labs/{labName}"),
	// 							TaskType: to.Ptr("{myLabVmTaskType}"),
	// 							TimeZoneID: to.Ptr("Pacific Standard Time"),
	// 							UniqueIdentifier: to.Ptr("{uniqueIdentifier}"),
	// 							WeeklyRecurrence: &armdevtestlabs.WeekDetails{
	// 								Time: to.Ptr("{timeOfTheDayTheScheduleWillOccurOnThoseDays}"),
	// 								Weekdays: []*string{
	// 									to.Ptr("Monday"),
	// 									to.Ptr("Wednesday"),
	// 									to.Ptr("Friday")},
	// 								},
	// 							},
	// 						},
	// 					},
	// 				},
	// 				EnvironmentID: to.Ptr("{environmentId}"),
	// 				ExternalServiceFabricID: to.Ptr("{serviceFabricId}"),
	// 				ProvisioningState: to.Ptr("Succeeded"),
	// 				UniqueIdentifier: to.Ptr("{uniqueIdentifier}"),
	// 			},
	// 		}
}
Output:

type ServiceFabricsClientBeginCreateOrUpdateOptions added in v0.2.0

type ServiceFabricsClientBeginCreateOrUpdateOptions struct {
	// Resumes the LRO from the provided token.
	ResumeToken string
}

ServiceFabricsClientBeginCreateOrUpdateOptions contains the optional parameters for the ServiceFabricsClient.BeginCreateOrUpdate method.

type ServiceFabricsClientBeginDeleteOptions added in v0.2.0

type ServiceFabricsClientBeginDeleteOptions struct {
	// Resumes the LRO from the provided token.
	ResumeToken string
}

ServiceFabricsClientBeginDeleteOptions contains the optional parameters for the ServiceFabricsClient.BeginDelete method.

type ServiceFabricsClientBeginStartOptions added in v0.2.0

type ServiceFabricsClientBeginStartOptions struct {
	// Resumes the LRO from the provided token.
	ResumeToken string
}

ServiceFabricsClientBeginStartOptions contains the optional parameters for the ServiceFabricsClient.BeginStart method.

type ServiceFabricsClientBeginStopOptions added in v0.2.0

type ServiceFabricsClientBeginStopOptions struct {
	// Resumes the LRO from the provided token.
	ResumeToken string
}

ServiceFabricsClientBeginStopOptions contains the optional parameters for the ServiceFabricsClient.BeginStop method.

type ServiceFabricsClientCreateOrUpdateResponse added in v0.2.0

type ServiceFabricsClientCreateOrUpdateResponse struct {
	// A Service Fabric.
	ServiceFabric
}

ServiceFabricsClientCreateOrUpdateResponse contains the response from method ServiceFabricsClient.BeginCreateOrUpdate.

type ServiceFabricsClientDeleteResponse added in v0.2.0

type ServiceFabricsClientDeleteResponse struct {
}

ServiceFabricsClientDeleteResponse contains the response from method ServiceFabricsClient.BeginDelete.

type ServiceFabricsClientGetOptions added in v0.2.0

type ServiceFabricsClientGetOptions struct {
	// Specify the $expand query. Example: 'properties($expand=applicableSchedule)'
	Expand *string
}

ServiceFabricsClientGetOptions contains the optional parameters for the ServiceFabricsClient.Get method.

type ServiceFabricsClientGetResponse added in v0.2.0

type ServiceFabricsClientGetResponse struct {
	// A Service Fabric.
	ServiceFabric
}

ServiceFabricsClientGetResponse contains the response from method ServiceFabricsClient.Get.

type ServiceFabricsClientListApplicableSchedulesOptions added in v0.2.0

type ServiceFabricsClientListApplicableSchedulesOptions struct {
}

ServiceFabricsClientListApplicableSchedulesOptions contains the optional parameters for the ServiceFabricsClient.ListApplicableSchedules method.

type ServiceFabricsClientListApplicableSchedulesResponse added in v0.2.0

type ServiceFabricsClientListApplicableSchedulesResponse struct {
	// Schedules applicable to a virtual machine. The schedules may have been defined on a VM or on lab level.
	ApplicableSchedule
}

ServiceFabricsClientListApplicableSchedulesResponse contains the response from method ServiceFabricsClient.ListApplicableSchedules.

type ServiceFabricsClientListOptions added in v0.2.0

type ServiceFabricsClientListOptions struct {
	// Specify the $expand query. Example: 'properties($expand=applicableSchedule)'
	Expand *string

	// The filter to apply to the operation. Example: '$filter=contains(name,'myName')
	Filter *string

	// The ordering expression for the results, using OData notation. Example: '$orderby=name desc'
	Orderby *string

	// The maximum number of resources to return from the operation. Example: '$top=10'
	Top *int32
}

ServiceFabricsClientListOptions contains the optional parameters for the ServiceFabricsClient.NewListPager method.

type ServiceFabricsClientListResponse added in v0.2.0

type ServiceFabricsClientListResponse struct {
	// The response of a list operation.
	ServiceFabricList
}

ServiceFabricsClientListResponse contains the response from method ServiceFabricsClient.NewListPager.

type ServiceFabricsClientStartResponse added in v0.2.0

type ServiceFabricsClientStartResponse struct {
}

ServiceFabricsClientStartResponse contains the response from method ServiceFabricsClient.BeginStart.

type ServiceFabricsClientStopResponse added in v0.2.0

type ServiceFabricsClientStopResponse struct {
}

ServiceFabricsClientStopResponse contains the response from method ServiceFabricsClient.BeginStop.

type ServiceFabricsClientUpdateOptions added in v0.2.0

type ServiceFabricsClientUpdateOptions struct {
}

ServiceFabricsClientUpdateOptions contains the optional parameters for the ServiceFabricsClient.Update method.

type ServiceFabricsClientUpdateResponse added in v0.2.0

type ServiceFabricsClientUpdateResponse struct {
	// A Service Fabric.
	ServiceFabric
}

ServiceFabricsClientUpdateResponse contains the response from method ServiceFabricsClient.Update.

type ServiceRunner

type ServiceRunner struct {
	// The identity of the resource.
	Identity *IdentityProperties

	// The location of the resource.
	Location *string

	// The tags of the resource.
	Tags map[string]*string

	// READ-ONLY; The identifier of the resource.
	ID *string

	// READ-ONLY; The name of the resource.
	Name *string

	// READ-ONLY; The type of the resource.
	Type *string
}

ServiceRunner - A container for a managed identity to execute DevTest lab services.

func (ServiceRunner) MarshalJSON

func (s ServiceRunner) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.Marshaller interface for type ServiceRunner.

func (*ServiceRunner) UnmarshalJSON added in v1.1.0

func (s *ServiceRunner) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the json.Unmarshaller interface for type ServiceRunner.

type ServiceRunnerList

type ServiceRunnerList struct {
	// Link for next set of results.
	NextLink *string

	// Results of the list operation.
	Value []*ServiceRunner
}

ServiceRunnerList - The response of a list operation.

func (ServiceRunnerList) MarshalJSON

func (s ServiceRunnerList) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.Marshaller interface for type ServiceRunnerList.

func (*ServiceRunnerList) UnmarshalJSON added in v1.1.0

func (s *ServiceRunnerList) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the json.Unmarshaller interface for type ServiceRunnerList.

type ServiceRunnersClient

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

ServiceRunnersClient contains the methods for the ServiceRunners group. Don't use this type directly, use NewServiceRunnersClient() instead.

func NewServiceRunnersClient

func NewServiceRunnersClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*ServiceRunnersClient, error)

NewServiceRunnersClient creates a new instance of ServiceRunnersClient with the specified values.

  • subscriptionID - The subscription ID.
  • credential - used to authorize requests. Usually a credential from azidentity.
  • options - pass nil to accept the default values.

func (*ServiceRunnersClient) CreateOrUpdate

func (client *ServiceRunnersClient) CreateOrUpdate(ctx context.Context, resourceGroupName string, labName string, name string, serviceRunner ServiceRunner, options *ServiceRunnersClientCreateOrUpdateOptions) (ServiceRunnersClientCreateOrUpdateResponse, error)

CreateOrUpdate - Create or replace an existing service runner. If the operation fails it returns an *azcore.ResponseError type.

Generated from API version 2018-09-15

  • resourceGroupName - The name of the resource group.
  • labName - The name of the lab.
  • name - The name of the service runner.
  • serviceRunner - A container for a managed identity to execute DevTest lab services.
  • options - ServiceRunnersClientCreateOrUpdateOptions contains the optional parameters for the ServiceRunnersClient.CreateOrUpdate method.
Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/d55b8005f05b040b852c15e74a0f3e36494a15e1/specification/devtestlabs/resource-manager/Microsoft.DevTestLab/stable/2018-09-15/examples/ServiceRunners_CreateOrUpdate.json

package main

import (
	"context"
	"log"

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

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armdevtestlabs.NewClientFactory("<subscription-id>", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	res, err := clientFactory.NewServiceRunnersClient().CreateOrUpdate(ctx, "resourceGroupName", "{devtestlabName}", "{servicerunnerName}", armdevtestlabs.ServiceRunner{
		Location: to.Ptr("{location}"),
		Tags: map[string]*string{
			"tagName1": to.Ptr("tagValue1"),
		},
		Identity: &armdevtestlabs.IdentityProperties{
			Type:            to.Ptr(armdevtestlabs.ManagedIdentityType("{identityType}")),
			ClientSecretURL: to.Ptr("{identityClientSecretUrl}"),
			PrincipalID:     to.Ptr("{identityPrincipalId}"),
			TenantID:        to.Ptr("{identityTenantId}"),
		},
	}, 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.ServiceRunner = armdevtestlabs.ServiceRunner{
	// 	Identity: &armdevtestlabs.IdentityProperties{
	// 		Type: to.Ptr(armdevtestlabs.ManagedIdentityType("{identityType}")),
	// 		ClientSecretURL: to.Ptr("{identityClientSecretUrl}"),
	// 		PrincipalID: to.Ptr("{identityPrincipalId}"),
	// 		TenantID: to.Ptr("{identityTenantId}"),
	// 	},
	// }
}
Output:

func (*ServiceRunnersClient) Delete

func (client *ServiceRunnersClient) Delete(ctx context.Context, resourceGroupName string, labName string, name string, options *ServiceRunnersClientDeleteOptions) (ServiceRunnersClientDeleteResponse, error)

Delete - Delete service runner. If the operation fails it returns an *azcore.ResponseError type.

Generated from API version 2018-09-15

  • resourceGroupName - The name of the resource group.
  • labName - The name of the lab.
  • name - The name of the service runner.
  • options - ServiceRunnersClientDeleteOptions contains the optional parameters for the ServiceRunnersClient.Delete method.
Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/d55b8005f05b040b852c15e74a0f3e36494a15e1/specification/devtestlabs/resource-manager/Microsoft.DevTestLab/stable/2018-09-15/examples/ServiceRunners_Delete.json

package main

import (
	"context"
	"log"

	"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
	"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/devtestlabs/armdevtestlabs"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armdevtestlabs.NewClientFactory("<subscription-id>", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	_, err = clientFactory.NewServiceRunnersClient().Delete(ctx, "resourceGroupName", "{devtestlabName}", "{servicerunnerName}", nil)
	if err != nil {
		log.Fatalf("failed to finish the request: %v", err)
	}
}
Output:

func (*ServiceRunnersClient) Get

func (client *ServiceRunnersClient) Get(ctx context.Context, resourceGroupName string, labName string, name string, options *ServiceRunnersClientGetOptions) (ServiceRunnersClientGetResponse, error)

Get - Get service runner. If the operation fails it returns an *azcore.ResponseError type.

Generated from API version 2018-09-15

  • resourceGroupName - The name of the resource group.
  • labName - The name of the lab.
  • name - The name of the service runner.
  • options - ServiceRunnersClientGetOptions contains the optional parameters for the ServiceRunnersClient.Get method.
Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/d55b8005f05b040b852c15e74a0f3e36494a15e1/specification/devtestlabs/resource-manager/Microsoft.DevTestLab/stable/2018-09-15/examples/ServiceRunners_Get.json

package main

import (
	"context"
	"log"

	"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
	"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/devtestlabs/armdevtestlabs"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armdevtestlabs.NewClientFactory("<subscription-id>", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	res, err := clientFactory.NewServiceRunnersClient().Get(ctx, "resourceGroupName", "{devtestlabName}", "{servicerunnerName}", 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.ServiceRunner = armdevtestlabs.ServiceRunner{
	// 	Name: to.Ptr("{serviceRunnerName}"),
	// 	Type: to.Ptr("Microsoft.DevTestLab/labs/serviceRunners"),
	// 	ID: to.Ptr("/subscriptions/{subscriptionId}/resourceGroups/resourceGroupName/providers/Microsoft.DevTestLab/labs/{labName}/serviceRunners/{serviceRunnerName}"),
	// 	Location: to.Ptr("{location}"),
	// 	Tags: map[string]*string{
	// 		"tagName1": to.Ptr("tagValue1"),
	// 	},
	// 	Identity: &armdevtestlabs.IdentityProperties{
	// 		Type: to.Ptr(armdevtestlabs.ManagedIdentityType("{identityType}")),
	// 		ClientSecretURL: to.Ptr("{identityClientSecretUrl}"),
	// 		PrincipalID: to.Ptr("{identityPrincipalId}"),
	// 		TenantID: to.Ptr("{identityTenantId}"),
	// 	},
	// }
}
Output:

type ServiceRunnersClientCreateOrUpdateOptions added in v0.2.0

type ServiceRunnersClientCreateOrUpdateOptions struct {
}

ServiceRunnersClientCreateOrUpdateOptions contains the optional parameters for the ServiceRunnersClient.CreateOrUpdate method.

type ServiceRunnersClientCreateOrUpdateResponse added in v0.2.0

type ServiceRunnersClientCreateOrUpdateResponse struct {
	// A container for a managed identity to execute DevTest lab services.
	ServiceRunner
}

ServiceRunnersClientCreateOrUpdateResponse contains the response from method ServiceRunnersClient.CreateOrUpdate.

type ServiceRunnersClientDeleteOptions added in v0.2.0

type ServiceRunnersClientDeleteOptions struct {
}

ServiceRunnersClientDeleteOptions contains the optional parameters for the ServiceRunnersClient.Delete method.

type ServiceRunnersClientDeleteResponse added in v0.2.0

type ServiceRunnersClientDeleteResponse struct {
}

ServiceRunnersClientDeleteResponse contains the response from method ServiceRunnersClient.Delete.

type ServiceRunnersClientGetOptions added in v0.2.0

type ServiceRunnersClientGetOptions struct {
}

ServiceRunnersClientGetOptions contains the optional parameters for the ServiceRunnersClient.Get method.

type ServiceRunnersClientGetResponse added in v0.2.0

type ServiceRunnersClientGetResponse struct {
	// A container for a managed identity to execute DevTest lab services.
	ServiceRunner
}

ServiceRunnersClientGetResponse contains the response from method ServiceRunnersClient.Get.

type SharedPublicIPAddressConfiguration

type SharedPublicIPAddressConfiguration struct {
	// The incoming NAT rules
	InboundNatRules []*InboundNatRule
}

SharedPublicIPAddressConfiguration - Properties of a virtual machine that determine how it is connected to a load balancer.

func (SharedPublicIPAddressConfiguration) MarshalJSON

func (s SharedPublicIPAddressConfiguration) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.Marshaller interface for type SharedPublicIPAddressConfiguration.

func (*SharedPublicIPAddressConfiguration) UnmarshalJSON added in v1.1.0

func (s *SharedPublicIPAddressConfiguration) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the json.Unmarshaller interface for type SharedPublicIPAddressConfiguration.

type ShutdownNotificationContent

type ShutdownNotificationContent struct {
	// The URL to delay shutdown by 2 hours.
	DelayUrl120 *string

	// The URL to delay shutdown by 60 minutes.
	DelayUrl60 *string

	// The event for which a notification will be sent.
	EventType *string

	// The GUID for the virtual machine to be shut down.
	GUID *string

	// The lab for the schedule.
	LabName *string

	// Minutes remaining until shutdown
	MinutesUntilShutdown *string

	// The owner of the virtual machine.
	Owner *string

	// The resource group name for the schedule.
	ResourceGroupName *string

	// The URL to skip auto-shutdown.
	SkipURL *string

	// The subscription ID for the schedule.
	SubscriptionID *string

	// The text for the notification.
	Text *string

	// The virtual machine to be shut down.
	VMName *string

	// The URL of the virtual machine.
	VMURL *string
}

ShutdownNotificationContent - The contents of a shutdown notification. Webhooks can use this type to deserialize the request body when they get notified of an imminent shutdown.

func (ShutdownNotificationContent) MarshalJSON added in v1.1.0

func (s ShutdownNotificationContent) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.Marshaller interface for type ShutdownNotificationContent.

func (*ShutdownNotificationContent) UnmarshalJSON added in v1.1.0

func (s *ShutdownNotificationContent) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the json.Unmarshaller interface for type ShutdownNotificationContent.

type SourceControlType

type SourceControlType string

SourceControlType - The artifact source's type.

const (
	SourceControlTypeGitHub         SourceControlType = "GitHub"
	SourceControlTypeStorageAccount SourceControlType = "StorageAccount"
	SourceControlTypeVsoGit         SourceControlType = "VsoGit"
)

func PossibleSourceControlTypeValues

func PossibleSourceControlTypeValues() []SourceControlType

PossibleSourceControlTypeValues returns the possible values for the SourceControlType const type.

type StorageType

type StorageType string

StorageType - The storage type for the disk (i.e. Standard, Premium).

const (
	StorageTypePremium     StorageType = "Premium"
	StorageTypeStandard    StorageType = "Standard"
	StorageTypeStandardSSD StorageType = "StandardSSD"
)

func PossibleStorageTypeValues

func PossibleStorageTypeValues() []StorageType

PossibleStorageTypeValues returns the possible values for the StorageType const type.

type Subnet

type Subnet struct {
	// The permission policy of the subnet for allowing public IP addresses (i.e. Allow, Deny)).
	AllowPublicIP *UsagePermissionType

	// The name of the subnet as seen in the lab.
	LabSubnetName *string

	// The resource ID of the subnet.
	ResourceID *string
}

Subnet information.

func (Subnet) MarshalJSON added in v1.1.0

func (s Subnet) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.Marshaller interface for type Subnet.

func (*Subnet) UnmarshalJSON added in v1.1.0

func (s *Subnet) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the json.Unmarshaller interface for type Subnet.

type SubnetOverride

type SubnetOverride struct {
	// The name given to the subnet within the lab.
	LabSubnetName *string

	// The resource ID of the subnet.
	ResourceID *string

	// Properties that virtual machines on this subnet will share.
	SharedPublicIPAddressConfiguration *SubnetSharedPublicIPAddressConfiguration

	// Indicates whether this subnet can be used during virtual machine creation (i.e. Allow, Deny).
	UseInVMCreationPermission *UsagePermissionType

	// Indicates whether public IP addresses can be assigned to virtual machines on this subnet (i.e. Allow, Deny).
	UsePublicIPAddressPermission *UsagePermissionType

	// The virtual network pool associated with this subnet.
	VirtualNetworkPoolName *string
}

SubnetOverride - Property overrides on a subnet of a virtual network.

func (SubnetOverride) MarshalJSON added in v1.1.0

func (s SubnetOverride) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.Marshaller interface for type SubnetOverride.

func (*SubnetOverride) UnmarshalJSON added in v1.1.0

func (s *SubnetOverride) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the json.Unmarshaller interface for type SubnetOverride.

type SubnetSharedPublicIPAddressConfiguration

type SubnetSharedPublicIPAddressConfiguration struct {
	// Backend ports that virtual machines on this subnet are allowed to expose
	AllowedPorts []*Port
}

SubnetSharedPublicIPAddressConfiguration - Configuration for public IP address sharing.

func (SubnetSharedPublicIPAddressConfiguration) MarshalJSON

MarshalJSON implements the json.Marshaller interface for type SubnetSharedPublicIPAddressConfiguration.

func (*SubnetSharedPublicIPAddressConfiguration) UnmarshalJSON added in v1.1.0

func (s *SubnetSharedPublicIPAddressConfiguration) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the json.Unmarshaller interface for type SubnetSharedPublicIPAddressConfiguration.

type TargetCostProperties

type TargetCostProperties struct {
	// Cost thresholds.
	CostThresholds []*CostThresholdProperties

	// Reporting cycle end date.
	CycleEndDateTime *time.Time

	// Reporting cycle start date.
	CycleStartDateTime *time.Time

	// Reporting cycle type.
	CycleType *ReportingCycleType

	// Target cost status
	Status *TargetCostStatus

	// Lab target cost
	Target *int32
}

TargetCostProperties - Properties of a cost target.

func (TargetCostProperties) MarshalJSON

func (t TargetCostProperties) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.Marshaller interface for type TargetCostProperties.

func (*TargetCostProperties) UnmarshalJSON

func (t *TargetCostProperties) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the json.Unmarshaller interface for type TargetCostProperties.

type TargetCostStatus

type TargetCostStatus string

TargetCostStatus - Target cost status

const (
	TargetCostStatusDisabled TargetCostStatus = "Disabled"
	TargetCostStatusEnabled  TargetCostStatus = "Enabled"
)

func PossibleTargetCostStatusValues

func PossibleTargetCostStatusValues() []TargetCostStatus

PossibleTargetCostStatusValues returns the possible values for the TargetCostStatus const type.

type TransportProtocol

type TransportProtocol string

TransportProtocol - The transport protocol for the endpoint.

const (
	TransportProtocolTCP TransportProtocol = "Tcp"
	TransportProtocolUDP TransportProtocol = "Udp"
)

func PossibleTransportProtocolValues

func PossibleTransportProtocolValues() []TransportProtocol

PossibleTransportProtocolValues returns the possible values for the TransportProtocol const type.

type UpdateResource

type UpdateResource struct {
	// The tags of the resource.
	Tags map[string]*string
}

UpdateResource - Represents an update resource

func (UpdateResource) MarshalJSON

func (u UpdateResource) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.Marshaller interface for type UpdateResource.

func (*UpdateResource) UnmarshalJSON added in v1.1.0

func (u *UpdateResource) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the json.Unmarshaller interface for type UpdateResource.

type UsagePermissionType

type UsagePermissionType string

UsagePermissionType - The permission policy of the subnet for allowing public IP addresses (i.e. Allow, Deny)).

const (
	UsagePermissionTypeAllow   UsagePermissionType = "Allow"
	UsagePermissionTypeDefault UsagePermissionType = "Default"
	UsagePermissionTypeDeny    UsagePermissionType = "Deny"
)

func PossibleUsagePermissionTypeValues

func PossibleUsagePermissionTypeValues() []UsagePermissionType

PossibleUsagePermissionTypeValues returns the possible values for the UsagePermissionType const type.

type User

type User struct {
	// The location of the resource.
	Location *string

	// The properties of the resource.
	Properties *UserProperties

	// The tags of the resource.
	Tags map[string]*string

	// READ-ONLY; The identifier of the resource.
	ID *string

	// READ-ONLY; The name of the resource.
	Name *string

	// READ-ONLY; The type of the resource.
	Type *string
}

User - Profile of a lab user.

func (User) MarshalJSON

func (u User) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.Marshaller interface for type User.

func (*User) UnmarshalJSON added in v1.1.0

func (u *User) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the json.Unmarshaller interface for type User.

type UserFragment

type UserFragment struct {
	// The tags of the resource.
	Tags map[string]*string
}

UserFragment - Profile of a lab user.

func (UserFragment) MarshalJSON added in v0.2.0

func (u UserFragment) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.Marshaller interface for type UserFragment.

func (*UserFragment) UnmarshalJSON added in v1.1.0

func (u *UserFragment) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the json.Unmarshaller interface for type UserFragment.

type UserIdentity

type UserIdentity struct {
	// Set to the app Id of the client JWT making the request.
	AppID *string

	// Set to the object Id of the client JWT making the request. Not all users have object Id. For CSP (reseller) scenarios for
	// example, object Id is not available.
	ObjectID *string

	// Set to the principal Id of the client JWT making the request. Service principal will not have the principal Id.
	PrincipalID *string

	// Set to the principal name / UPN of the client JWT making the request.
	PrincipalName *string

	// Set to the tenant ID of the client JWT making the request.
	TenantID *string
}

UserIdentity - Identity attributes of a lab user.

func (UserIdentity) MarshalJSON added in v1.1.0

func (u UserIdentity) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.Marshaller interface for type UserIdentity.

func (*UserIdentity) UnmarshalJSON added in v1.1.0

func (u *UserIdentity) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the json.Unmarshaller interface for type UserIdentity.

type UserList

type UserList struct {
	// Link for next set of results.
	NextLink *string

	// Results of the list operation.
	Value []*User
}

UserList - The response of a list operation.

func (UserList) MarshalJSON

func (u UserList) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.Marshaller interface for type UserList.

func (*UserList) UnmarshalJSON added in v1.1.0

func (u *UserList) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the json.Unmarshaller interface for type UserList.

type UserProperties

type UserProperties struct {
	// The identity of the user.
	Identity *UserIdentity

	// The secret store of the user.
	SecretStore *UserSecretStore

	// READ-ONLY; The creation date of the user profile.
	CreatedDate *time.Time

	// READ-ONLY; The provisioning status of the resource.
	ProvisioningState *string

	// READ-ONLY; The unique immutable identifier of a resource (Guid).
	UniqueIdentifier *string
}

UserProperties - Properties of a lab user profile.

func (UserProperties) MarshalJSON

func (u UserProperties) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.Marshaller interface for type UserProperties.

func (*UserProperties) UnmarshalJSON

func (u *UserProperties) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the json.Unmarshaller interface for type UserProperties.

type UserSecretStore

type UserSecretStore struct {
	// The ID of the user's Key vault.
	KeyVaultID *string

	// The URI of the user's Key vault.
	KeyVaultURI *string
}

UserSecretStore - Properties of a user's secret store.

func (UserSecretStore) MarshalJSON added in v1.1.0

func (u UserSecretStore) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.Marshaller interface for type UserSecretStore.

func (*UserSecretStore) UnmarshalJSON added in v1.1.0

func (u *UserSecretStore) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the json.Unmarshaller interface for type UserSecretStore.

type UsersClient

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

UsersClient contains the methods for the Users group. Don't use this type directly, use NewUsersClient() instead.

func NewUsersClient

func NewUsersClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*UsersClient, error)

NewUsersClient creates a new instance of UsersClient with the specified values.

  • subscriptionID - The subscription ID.
  • credential - used to authorize requests. Usually a credential from azidentity.
  • options - pass nil to accept the default values.

func (*UsersClient) BeginCreateOrUpdate

func (client *UsersClient) BeginCreateOrUpdate(ctx context.Context, resourceGroupName string, labName string, name string, userParam User, options *UsersClientBeginCreateOrUpdateOptions) (*runtime.Poller[UsersClientCreateOrUpdateResponse], error)

BeginCreateOrUpdate - Create or replace an existing user profile. This operation can take a while to complete. If the operation fails it returns an *azcore.ResponseError type.

Generated from API version 2018-09-15

  • resourceGroupName - The name of the resource group.
  • labName - The name of the lab.
  • name - The name of the user profile.
  • userParam - Profile of a lab user.
  • options - UsersClientBeginCreateOrUpdateOptions contains the optional parameters for the UsersClient.BeginCreateOrUpdate method.
Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/d55b8005f05b040b852c15e74a0f3e36494a15e1/specification/devtestlabs/resource-manager/Microsoft.DevTestLab/stable/2018-09-15/examples/Users_CreateOrUpdate.json

package main

import (
	"context"
	"log"

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

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armdevtestlabs.NewClientFactory("<subscription-id>", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	poller, err := clientFactory.NewUsersClient().BeginCreateOrUpdate(ctx, "resourceGroupName", "{devtestlabName}", "{userName}", armdevtestlabs.User{
		Location: to.Ptr("{location}"),
		Tags: map[string]*string{
			"tagName1": to.Ptr("tagValue1"),
		},
		Properties: &armdevtestlabs.UserProperties{
			Identity: &armdevtestlabs.UserIdentity{
				AppID:         to.Ptr("{appId}"),
				ObjectID:      to.Ptr("{objectId}"),
				PrincipalID:   to.Ptr("{principalId}"),
				PrincipalName: to.Ptr("{principalName}"),
				TenantID:      to.Ptr("{tenantId}"),
			},
			SecretStore: &armdevtestlabs.UserSecretStore{
				KeyVaultID:  to.Ptr("{keyVaultId}"),
				KeyVaultURI: to.Ptr("{keyVaultUri}"),
			},
		},
	}, 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.User = armdevtestlabs.User{
	// 	Properties: &armdevtestlabs.UserProperties{
	// 		CreatedDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2018-10-02T01:40:48.173Z"); return t}()),
	// 		Identity: &armdevtestlabs.UserIdentity{
	// 			AppID: to.Ptr("{appId}"),
	// 			ObjectID: to.Ptr("{objectId}"),
	// 			PrincipalID: to.Ptr("{principalId}"),
	// 			PrincipalName: to.Ptr("{principalName}"),
	// 			TenantID: to.Ptr("{tenantId}"),
	// 		},
	// 		ProvisioningState: to.Ptr("Succeeded"),
	// 		SecretStore: &armdevtestlabs.UserSecretStore{
	// 			KeyVaultID: to.Ptr("{keyVaultId}"),
	// 			KeyVaultURI: to.Ptr("{keyVaultUri}"),
	// 		},
	// 		UniqueIdentifier: to.Ptr("{uniqueIdentifier}"),
	// 	},
	// }
}
Output:

func (*UsersClient) BeginDelete

func (client *UsersClient) BeginDelete(ctx context.Context, resourceGroupName string, labName string, name string, options *UsersClientBeginDeleteOptions) (*runtime.Poller[UsersClientDeleteResponse], error)

BeginDelete - Delete user profile. This operation can take a while to complete. If the operation fails it returns an *azcore.ResponseError type.

Generated from API version 2018-09-15

  • resourceGroupName - The name of the resource group.
  • labName - The name of the lab.
  • name - The name of the user profile.
  • options - UsersClientBeginDeleteOptions contains the optional parameters for the UsersClient.BeginDelete method.
Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/d55b8005f05b040b852c15e74a0f3e36494a15e1/specification/devtestlabs/resource-manager/Microsoft.DevTestLab/stable/2018-09-15/examples/Users_Delete.json

package main

import (
	"context"
	"log"

	"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
	"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/devtestlabs/armdevtestlabs"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armdevtestlabs.NewClientFactory("<subscription-id>", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	poller, err := clientFactory.NewUsersClient().BeginDelete(ctx, "resourceGroupName", "{devtestlabName}", "{userName}", 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 (*UsersClient) Get

func (client *UsersClient) Get(ctx context.Context, resourceGroupName string, labName string, name string, options *UsersClientGetOptions) (UsersClientGetResponse, error)

Get - Get user profile. If the operation fails it returns an *azcore.ResponseError type.

Generated from API version 2018-09-15

  • resourceGroupName - The name of the resource group.
  • labName - The name of the lab.
  • name - The name of the user profile.
  • options - UsersClientGetOptions contains the optional parameters for the UsersClient.Get method.
Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/d55b8005f05b040b852c15e74a0f3e36494a15e1/specification/devtestlabs/resource-manager/Microsoft.DevTestLab/stable/2018-09-15/examples/Users_Get.json

package main

import (
	"context"
	"log"

	"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
	"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/devtestlabs/armdevtestlabs"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armdevtestlabs.NewClientFactory("<subscription-id>", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	res, err := clientFactory.NewUsersClient().Get(ctx, "resourceGroupName", "{devtestlabName}", "{userName}", &armdevtestlabs.UsersClientGetOptions{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.User = armdevtestlabs.User{
	// 	Name: to.Ptr("{userName}"),
	// 	Type: to.Ptr("Microsoft.DevTestLab/labs/users"),
	// 	ID: to.Ptr("/subscriptions/{subscriptionId}/resourceGroups/resourceGroupName/providers/Microsoft.DevTestLab/labs/{labName}/users/{userName}"),
	// 	Location: to.Ptr("{location}"),
	// 	Tags: map[string]*string{
	// 		"tagName1": to.Ptr("tagValue1"),
	// 	},
	// 	Properties: &armdevtestlabs.UserProperties{
	// 		CreatedDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2018-10-02T01:40:48.173Z"); return t}()),
	// 		Identity: &armdevtestlabs.UserIdentity{
	// 			AppID: to.Ptr("{appId}"),
	// 			ObjectID: to.Ptr("{objectId}"),
	// 			PrincipalID: to.Ptr("{principalId}"),
	// 			PrincipalName: to.Ptr("{principalName}"),
	// 			TenantID: to.Ptr("{tenantId}"),
	// 		},
	// 		ProvisioningState: to.Ptr("Succeeded"),
	// 		SecretStore: &armdevtestlabs.UserSecretStore{
	// 			KeyVaultID: to.Ptr("{keyVaultId}"),
	// 			KeyVaultURI: to.Ptr("{keyVaultUri}"),
	// 		},
	// 		UniqueIdentifier: to.Ptr("{uniqueIdentifier}"),
	// 	},
	// }
}
Output:

func (*UsersClient) NewListPager added in v0.4.0

func (client *UsersClient) NewListPager(resourceGroupName string, labName string, options *UsersClientListOptions) *runtime.Pager[UsersClientListResponse]

NewListPager - List user profiles in a given lab.

Generated from API version 2018-09-15

  • resourceGroupName - The name of the resource group.
  • labName - The name of the lab.
  • options - UsersClientListOptions contains the optional parameters for the UsersClient.NewListPager method.
Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/d55b8005f05b040b852c15e74a0f3e36494a15e1/specification/devtestlabs/resource-manager/Microsoft.DevTestLab/stable/2018-09-15/examples/Users_List.json

package main

import (
	"context"
	"log"

	"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
	"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/devtestlabs/armdevtestlabs"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armdevtestlabs.NewClientFactory("<subscription-id>", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	pager := clientFactory.NewUsersClient().NewListPager("resourceGroupName", "{devtestlabName}", &armdevtestlabs.UsersClientListOptions{Expand: nil,
		Filter:  nil,
		Top:     nil,
		Orderby: 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.UserList = armdevtestlabs.UserList{
		// 	Value: []*armdevtestlabs.User{
		// 		{
		// 			Name: to.Ptr("{userName}"),
		// 			Type: to.Ptr("Microsoft.DevTestLab/labs/users"),
		// 			ID: to.Ptr("/subscriptions/{subscriptionId}/resourceGroups/resourceGroupName/providers/Microsoft.DevTestLab/labs/{labName}/users/{userName}"),
		// 			Location: to.Ptr("{location}"),
		// 			Tags: map[string]*string{
		// 				"tagName1": to.Ptr("tagValue1"),
		// 			},
		// 			Properties: &armdevtestlabs.UserProperties{
		// 				CreatedDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2018-10-02T01:40:48.173Z"); return t}()),
		// 				Identity: &armdevtestlabs.UserIdentity{
		// 					AppID: to.Ptr("{appId}"),
		// 					ObjectID: to.Ptr("{objectId}"),
		// 					PrincipalID: to.Ptr("{principalId}"),
		// 					PrincipalName: to.Ptr("{principalName}"),
		// 					TenantID: to.Ptr("{tenantId}"),
		// 				},
		// 				ProvisioningState: to.Ptr("Succeeded"),
		// 				SecretStore: &armdevtestlabs.UserSecretStore{
		// 					KeyVaultID: to.Ptr("{keyVaultId}"),
		// 					KeyVaultURI: to.Ptr("{keyVaultUri}"),
		// 				},
		// 				UniqueIdentifier: to.Ptr("{uniqueIdentifier}"),
		// 			},
		// 	}},
		// }
	}
}
Output:

func (*UsersClient) Update

func (client *UsersClient) Update(ctx context.Context, resourceGroupName string, labName string, name string, userParam UserFragment, options *UsersClientUpdateOptions) (UsersClientUpdateResponse, error)

Update - Allows modifying tags of user profiles. All other properties will be ignored. If the operation fails it returns an *azcore.ResponseError type.

Generated from API version 2018-09-15

  • resourceGroupName - The name of the resource group.
  • labName - The name of the lab.
  • name - The name of the user profile.
  • userParam - Profile of a lab user.
  • options - UsersClientUpdateOptions contains the optional parameters for the UsersClient.Update method.
Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/d55b8005f05b040b852c15e74a0f3e36494a15e1/specification/devtestlabs/resource-manager/Microsoft.DevTestLab/stable/2018-09-15/examples/Users_Update.json

package main

import (
	"context"
	"log"

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

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armdevtestlabs.NewClientFactory("<subscription-id>", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	res, err := clientFactory.NewUsersClient().Update(ctx, "resourceGroupName", "{devtestlabName}", "{userName}", armdevtestlabs.UserFragment{
		Tags: map[string]*string{
			"tagName1": to.Ptr("tagValue1"),
		},
	}, 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.User = armdevtestlabs.User{
	// 	Properties: &armdevtestlabs.UserProperties{
	// 		CreatedDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2018-10-02T01:40:48.173Z"); return t}()),
	// 		Identity: &armdevtestlabs.UserIdentity{
	// 			AppID: to.Ptr("{appId}"),
	// 			ObjectID: to.Ptr("{objectId}"),
	// 			PrincipalID: to.Ptr("{principalId}"),
	// 			PrincipalName: to.Ptr("{principalName}"),
	// 			TenantID: to.Ptr("{tenantId}"),
	// 		},
	// 		ProvisioningState: to.Ptr("Succeeded"),
	// 		SecretStore: &armdevtestlabs.UserSecretStore{
	// 			KeyVaultID: to.Ptr("{keyVaultId}"),
	// 			KeyVaultURI: to.Ptr("users/{userName}"),
	// 		},
	// 		UniqueIdentifier: to.Ptr("{uniqueIdentifier}"),
	// 	},
	// }
}
Output:

type UsersClientBeginCreateOrUpdateOptions added in v0.2.0

type UsersClientBeginCreateOrUpdateOptions struct {
	// Resumes the LRO from the provided token.
	ResumeToken string
}

UsersClientBeginCreateOrUpdateOptions contains the optional parameters for the UsersClient.BeginCreateOrUpdate method.

type UsersClientBeginDeleteOptions added in v0.2.0

type UsersClientBeginDeleteOptions struct {
	// Resumes the LRO from the provided token.
	ResumeToken string
}

UsersClientBeginDeleteOptions contains the optional parameters for the UsersClient.BeginDelete method.

type UsersClientCreateOrUpdateResponse added in v0.2.0

type UsersClientCreateOrUpdateResponse struct {
	// Profile of a lab user.
	User
}

UsersClientCreateOrUpdateResponse contains the response from method UsersClient.BeginCreateOrUpdate.

type UsersClientDeleteResponse added in v0.2.0

type UsersClientDeleteResponse struct {
}

UsersClientDeleteResponse contains the response from method UsersClient.BeginDelete.

type UsersClientGetOptions added in v0.2.0

type UsersClientGetOptions struct {
	// Specify the $expand query. Example: 'properties($select=identity)'
	Expand *string
}

UsersClientGetOptions contains the optional parameters for the UsersClient.Get method.

type UsersClientGetResponse added in v0.2.0

type UsersClientGetResponse struct {
	// Profile of a lab user.
	User
}

UsersClientGetResponse contains the response from method UsersClient.Get.

type UsersClientListOptions added in v0.2.0

type UsersClientListOptions struct {
	// Specify the $expand query. Example: 'properties($select=identity)'
	Expand *string

	// The filter to apply to the operation. Example: '$filter=contains(name,'myName')
	Filter *string

	// The ordering expression for the results, using OData notation. Example: '$orderby=name desc'
	Orderby *string

	// The maximum number of resources to return from the operation. Example: '$top=10'
	Top *int32
}

UsersClientListOptions contains the optional parameters for the UsersClient.NewListPager method.

type UsersClientListResponse added in v0.2.0

type UsersClientListResponse struct {
	// The response of a list operation.
	UserList
}

UsersClientListResponse contains the response from method UsersClient.NewListPager.

type UsersClientUpdateOptions added in v0.2.0

type UsersClientUpdateOptions struct {
}

UsersClientUpdateOptions contains the optional parameters for the UsersClient.Update method.

type UsersClientUpdateResponse added in v0.2.0

type UsersClientUpdateResponse struct {
	// Profile of a lab user.
	User
}

UsersClientUpdateResponse contains the response from method UsersClient.Update.

type VirtualMachineCreationSource

type VirtualMachineCreationSource string

VirtualMachineCreationSource - Tells source of creation of lab virtual machine. Output property only.

const (
	VirtualMachineCreationSourceFromCustomImage        VirtualMachineCreationSource = "FromCustomImage"
	VirtualMachineCreationSourceFromGalleryImage       VirtualMachineCreationSource = "FromGalleryImage"
	VirtualMachineCreationSourceFromSharedGalleryImage VirtualMachineCreationSource = "FromSharedGalleryImage"
)

func PossibleVirtualMachineCreationSourceValues

func PossibleVirtualMachineCreationSourceValues() []VirtualMachineCreationSource

PossibleVirtualMachineCreationSourceValues returns the possible values for the VirtualMachineCreationSource const type.

type VirtualMachineSchedulesClient

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

VirtualMachineSchedulesClient contains the methods for the VirtualMachineSchedules group. Don't use this type directly, use NewVirtualMachineSchedulesClient() instead.

func NewVirtualMachineSchedulesClient

func NewVirtualMachineSchedulesClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*VirtualMachineSchedulesClient, error)

NewVirtualMachineSchedulesClient creates a new instance of VirtualMachineSchedulesClient with the specified values.

  • subscriptionID - The subscription ID.
  • credential - used to authorize requests. Usually a credential from azidentity.
  • options - pass nil to accept the default values.

func (*VirtualMachineSchedulesClient) BeginExecute

BeginExecute - Execute a schedule. This operation can take a while to complete. If the operation fails it returns an *azcore.ResponseError type.

Generated from API version 2018-09-15

  • resourceGroupName - The name of the resource group.
  • labName - The name of the lab.
  • virtualMachineName - The name of the virtual machine.
  • name - The name of the schedule.
  • options - VirtualMachineSchedulesClientBeginExecuteOptions contains the optional parameters for the VirtualMachineSchedulesClient.BeginExecute method.
Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/d55b8005f05b040b852c15e74a0f3e36494a15e1/specification/devtestlabs/resource-manager/Microsoft.DevTestLab/stable/2018-09-15/examples/VirtualMachineSchedules_Execute.json

package main

import (
	"context"
	"log"

	"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
	"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/devtestlabs/armdevtestlabs"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armdevtestlabs.NewClientFactory("<subscription-id>", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	poller, err := clientFactory.NewVirtualMachineSchedulesClient().BeginExecute(ctx, "resourceGroupName", "{labName}", "{vmName}", "LabVmsShutdown", 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 (*VirtualMachineSchedulesClient) CreateOrUpdate

func (client *VirtualMachineSchedulesClient) CreateOrUpdate(ctx context.Context, resourceGroupName string, labName string, virtualMachineName string, name string, schedule Schedule, options *VirtualMachineSchedulesClientCreateOrUpdateOptions) (VirtualMachineSchedulesClientCreateOrUpdateResponse, error)

CreateOrUpdate - Create or replace an existing schedule. If the operation fails it returns an *azcore.ResponseError type.

Generated from API version 2018-09-15

  • resourceGroupName - The name of the resource group.
  • labName - The name of the lab.
  • virtualMachineName - The name of the virtual machine.
  • name - The name of the schedule.
  • schedule - A schedule.
  • options - VirtualMachineSchedulesClientCreateOrUpdateOptions contains the optional parameters for the VirtualMachineSchedulesClient.CreateOrUpdate method.
Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/d55b8005f05b040b852c15e74a0f3e36494a15e1/specification/devtestlabs/resource-manager/Microsoft.DevTestLab/stable/2018-09-15/examples/VirtualMachineSchedules_CreateOrUpdate.json

package main

import (
	"context"
	"log"

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

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armdevtestlabs.NewClientFactory("<subscription-id>", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	res, err := clientFactory.NewVirtualMachineSchedulesClient().CreateOrUpdate(ctx, "resourceGroupName", "{labName}", "{vmName}", "LabVmsShutdown", armdevtestlabs.Schedule{
		Location: to.Ptr("{location}"),
		Tags: map[string]*string{
			"tagName1": to.Ptr("tagValue1"),
		},
		Properties: &armdevtestlabs.ScheduleProperties{
			DailyRecurrence: &armdevtestlabs.DayDetails{
				Time: to.Ptr("1900"),
			},
			HourlyRecurrence: &armdevtestlabs.HourDetails{
				Minute: to.Ptr[int32](30),
			},
			NotificationSettings: &armdevtestlabs.NotificationSettings{
				EmailRecipient:     to.Ptr("{email}"),
				NotificationLocale: to.Ptr("EN"),
				Status:             to.Ptr(armdevtestlabs.EnableStatusEnabled),
				TimeInMinutes:      to.Ptr[int32](30),
				WebhookURL:         to.Ptr("{webhookUrl}"),
			},
			Status:           to.Ptr(armdevtestlabs.EnableStatusEnabled),
			TargetResourceID: to.Ptr("/subscriptions/{subscriptionId}/resourcegroups/resourceGroupName/providers/microsoft.devtestlab/labs/{labName}/virtualMachines/{vmName}"),
			TaskType:         to.Ptr("LabVmsShutdownTask"),
			TimeZoneID:       to.Ptr("Pacific Standard Time"),
			WeeklyRecurrence: &armdevtestlabs.WeekDetails{
				Time: to.Ptr("1700"),
				Weekdays: []*string{
					to.Ptr("Friday"),
					to.Ptr("Saturday"),
					to.Ptr("Sunday")},
			},
		},
	}, 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.Schedule = armdevtestlabs.Schedule{
	// 	Name: to.Ptr("LabVmsShutdown"),
	// 	Type: to.Ptr("Microsoft.DevTestLab/labs/virtualMachines/schedules"),
	// 	ID: to.Ptr("/subscriptions/{subscriptionId}/resourcegroups/resourceGroupName/providers/microsoft.devtestlab/labs/{labName}/virtualMachines/{vmName}/schedules/LabVmsShutdown"),
	// 	Location: to.Ptr("{location}"),
	// 	Tags: map[string]*string{
	// 		"tagName1": to.Ptr("tagValue1"),
	// 	},
	// 	Properties: &armdevtestlabs.ScheduleProperties{
	// 		CreatedDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-01-01T01:40:48.173Z"); return t}()),
	// 		DailyRecurrence: &armdevtestlabs.DayDetails{
	// 			Time: to.Ptr("1900"),
	// 		},
	// 		HourlyRecurrence: &armdevtestlabs.HourDetails{
	// 			Minute: to.Ptr[int32](30),
	// 		},
	// 		NotificationSettings: &armdevtestlabs.NotificationSettings{
	// 			EmailRecipient: to.Ptr("{email}"),
	// 			NotificationLocale: to.Ptr("EN"),
	// 			Status: to.Ptr(armdevtestlabs.EnableStatusEnabled),
	// 			TimeInMinutes: to.Ptr[int32](30),
	// 			WebhookURL: to.Ptr("{webhookUrl}"),
	// 		},
	// 		ProvisioningState: to.Ptr("Succeeded"),
	// 		Status: to.Ptr(armdevtestlabs.EnableStatusEnabled),
	// 		TargetResourceID: to.Ptr("/subscriptions/{subscriptionId}/resourcegroups/resourceGroupName/providers/microsoft.devtestlab/labs/{labName}/virtualMachines/{vmName}"),
	// 		TaskType: to.Ptr("LabVmsShutdownTask"),
	// 		TimeZoneID: to.Ptr("Pacific Standard Time"),
	// 		WeeklyRecurrence: &armdevtestlabs.WeekDetails{
	// 			Time: to.Ptr("1700"),
	// 			Weekdays: []*string{
	// 				to.Ptr("Friday"),
	// 				to.Ptr("Saturday"),
	// 				to.Ptr("Sunday")},
	// 			},
	// 		},
	// 	}
}
Output:

func (*VirtualMachineSchedulesClient) Delete

func (client *VirtualMachineSchedulesClient) Delete(ctx context.Context, resourceGroupName string, labName string, virtualMachineName string, name string, options *VirtualMachineSchedulesClientDeleteOptions) (VirtualMachineSchedulesClientDeleteResponse, error)

Delete - Delete schedule. If the operation fails it returns an *azcore.ResponseError type.

Generated from API version 2018-09-15

  • resourceGroupName - The name of the resource group.
  • labName - The name of the lab.
  • virtualMachineName - The name of the virtual machine.
  • name - The name of the schedule.
  • options - VirtualMachineSchedulesClientDeleteOptions contains the optional parameters for the VirtualMachineSchedulesClient.Delete method.
Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/d55b8005f05b040b852c15e74a0f3e36494a15e1/specification/devtestlabs/resource-manager/Microsoft.DevTestLab/stable/2018-09-15/examples/VirtualMachineSchedules_Delete.json

package main

import (
	"context"
	"log"

	"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
	"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/devtestlabs/armdevtestlabs"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armdevtestlabs.NewClientFactory("<subscription-id>", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	_, err = clientFactory.NewVirtualMachineSchedulesClient().Delete(ctx, "resourceGroupName", "{labName}", "{vmName}", "LabVmsShutdown", nil)
	if err != nil {
		log.Fatalf("failed to finish the request: %v", err)
	}
}
Output:

func (*VirtualMachineSchedulesClient) Get

func (client *VirtualMachineSchedulesClient) Get(ctx context.Context, resourceGroupName string, labName string, virtualMachineName string, name string, options *VirtualMachineSchedulesClientGetOptions) (VirtualMachineSchedulesClientGetResponse, error)

Get - Get schedule. If the operation fails it returns an *azcore.ResponseError type.

Generated from API version 2018-09-15

  • resourceGroupName - The name of the resource group.
  • labName - The name of the lab.
  • virtualMachineName - The name of the virtual machine.
  • name - The name of the schedule.
  • options - VirtualMachineSchedulesClientGetOptions contains the optional parameters for the VirtualMachineSchedulesClient.Get method.
Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/d55b8005f05b040b852c15e74a0f3e36494a15e1/specification/devtestlabs/resource-manager/Microsoft.DevTestLab/stable/2018-09-15/examples/VirtualMachineSchedules_Get.json

package main

import (
	"context"
	"log"

	"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
	"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/devtestlabs/armdevtestlabs"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armdevtestlabs.NewClientFactory("<subscription-id>", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	res, err := clientFactory.NewVirtualMachineSchedulesClient().Get(ctx, "resourceGroupName", "{labName}", "{vmName}", "LabVmsShutdown", &armdevtestlabs.VirtualMachineSchedulesClientGetOptions{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.Schedule = armdevtestlabs.Schedule{
	// 	Name: to.Ptr("LabVmsShutdown"),
	// 	Type: to.Ptr("Microsoft.DevTestLab/labs/virtualMachines/schedules"),
	// 	ID: to.Ptr("/subscriptions/{subscriptionId}/resourcegroups/resourceGroupName/providers/microsoft.devtestlab/labs/{labName}/virtualMachines/{vmName}/schedules/mySchedule"),
	// 	Location: to.Ptr("{location}"),
	// 	Tags: map[string]*string{
	// 		"tagName1": to.Ptr("tagValue1"),
	// 	},
	// 	Properties: &armdevtestlabs.ScheduleProperties{
	// 		CreatedDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-01-01T01:40:48.173Z"); return t}()),
	// 		DailyRecurrence: &armdevtestlabs.DayDetails{
	// 			Time: to.Ptr("1900"),
	// 		},
	// 		HourlyRecurrence: &armdevtestlabs.HourDetails{
	// 			Minute: to.Ptr[int32](30),
	// 		},
	// 		NotificationSettings: &armdevtestlabs.NotificationSettings{
	// 			EmailRecipient: to.Ptr("{email}"),
	// 			NotificationLocale: to.Ptr("EN"),
	// 			Status: to.Ptr(armdevtestlabs.EnableStatusEnabled),
	// 			TimeInMinutes: to.Ptr[int32](30),
	// 			WebhookURL: to.Ptr("{webhookUrl}"),
	// 		},
	// 		ProvisioningState: to.Ptr("Succeeded"),
	// 		Status: to.Ptr(armdevtestlabs.EnableStatusEnabled),
	// 		TargetResourceID: to.Ptr("/subscriptions/{subscriptionId}/resourcegroups/resourceGroupName/providers/microsoft.devtestlab/labs/{labName}/virtualMachines/{vmName}"),
	// 		TaskType: to.Ptr("LabVmsShutdownTask"),
	// 		TimeZoneID: to.Ptr("Pacific Standard Time"),
	// 		WeeklyRecurrence: &armdevtestlabs.WeekDetails{
	// 			Time: to.Ptr("1700"),
	// 			Weekdays: []*string{
	// 				to.Ptr("Friday"),
	// 				to.Ptr("Saturday"),
	// 				to.Ptr("Sunday")},
	// 			},
	// 		},
	// 	}
}
Output:

func (*VirtualMachineSchedulesClient) NewListPager added in v0.4.0

func (client *VirtualMachineSchedulesClient) NewListPager(resourceGroupName string, labName string, virtualMachineName string, options *VirtualMachineSchedulesClientListOptions) *runtime.Pager[VirtualMachineSchedulesClientListResponse]

NewListPager - List schedules in a given virtual machine.

Generated from API version 2018-09-15

  • resourceGroupName - The name of the resource group.
  • labName - The name of the lab.
  • virtualMachineName - The name of the virtual machine.
  • options - VirtualMachineSchedulesClientListOptions contains the optional parameters for the VirtualMachineSchedulesClient.NewListPager method.
Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/d55b8005f05b040b852c15e74a0f3e36494a15e1/specification/devtestlabs/resource-manager/Microsoft.DevTestLab/stable/2018-09-15/examples/VirtualMachineSchedules_List.json

package main

import (
	"context"
	"log"

	"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
	"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/devtestlabs/armdevtestlabs"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armdevtestlabs.NewClientFactory("<subscription-id>", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	pager := clientFactory.NewVirtualMachineSchedulesClient().NewListPager("resourceGroupName", "{labName}", "{vmName}", &armdevtestlabs.VirtualMachineSchedulesClientListOptions{Expand: nil,
		Filter:  nil,
		Top:     nil,
		Orderby: 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.ScheduleList = armdevtestlabs.ScheduleList{
		// 	Value: []*armdevtestlabs.Schedule{
		// 		{
		// 			Name: to.Ptr("LabVmsShutdown"),
		// 			Type: to.Ptr("Microsoft.DevTestLab/labs/virtualMachines/schedules"),
		// 			ID: to.Ptr("/subscriptions/{subscriptionId}/resourcegroups/resourceGroupName/providers/microsoft.devtestlab/labs/{labName}/virtualMachines/{vmName}/schedules/mySchedule"),
		// 			Location: to.Ptr("{location}"),
		// 			Tags: map[string]*string{
		// 				"tagName1": to.Ptr("tagValue1"),
		// 			},
		// 			Properties: &armdevtestlabs.ScheduleProperties{
		// 				CreatedDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-01-01T01:40:48.173Z"); return t}()),
		// 				DailyRecurrence: &armdevtestlabs.DayDetails{
		// 					Time: to.Ptr("1900"),
		// 				},
		// 				HourlyRecurrence: &armdevtestlabs.HourDetails{
		// 					Minute: to.Ptr[int32](30),
		// 				},
		// 				NotificationSettings: &armdevtestlabs.NotificationSettings{
		// 					EmailRecipient: to.Ptr("{email}"),
		// 					NotificationLocale: to.Ptr("EN"),
		// 					Status: to.Ptr(armdevtestlabs.EnableStatusEnabled),
		// 					TimeInMinutes: to.Ptr[int32](30),
		// 					WebhookURL: to.Ptr("{webhookUrl}"),
		// 				},
		// 				ProvisioningState: to.Ptr("Succeeded"),
		// 				Status: to.Ptr(armdevtestlabs.EnableStatusEnabled),
		// 				TargetResourceID: to.Ptr("/subscriptions/{subscriptionId}/resourcegroups/resourceGroupName/providers/microsoft.devtestlab/labs/labName}/virtualMachines/{vmName}"),
		// 				TaskType: to.Ptr("LabVmsShutdownTask"),
		// 				TimeZoneID: to.Ptr("Pacific Standard Time"),
		// 				WeeklyRecurrence: &armdevtestlabs.WeekDetails{
		// 					Time: to.Ptr("1700"),
		// 					Weekdays: []*string{
		// 						to.Ptr("Friday"),
		// 						to.Ptr("Saturday"),
		// 						to.Ptr("Sunday")},
		// 					},
		// 				},
		// 		}},
		// 	}
	}
}
Output:

func (*VirtualMachineSchedulesClient) Update

func (client *VirtualMachineSchedulesClient) Update(ctx context.Context, resourceGroupName string, labName string, virtualMachineName string, name string, schedule ScheduleFragment, options *VirtualMachineSchedulesClientUpdateOptions) (VirtualMachineSchedulesClientUpdateResponse, error)

Update - Allows modifying tags of schedules. All other properties will be ignored. If the operation fails it returns an *azcore.ResponseError type.

Generated from API version 2018-09-15

  • resourceGroupName - The name of the resource group.
  • labName - The name of the lab.
  • virtualMachineName - The name of the virtual machine.
  • name - The name of the schedule.
  • schedule - A schedule.
  • options - VirtualMachineSchedulesClientUpdateOptions contains the optional parameters for the VirtualMachineSchedulesClient.Update method.
Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/d55b8005f05b040b852c15e74a0f3e36494a15e1/specification/devtestlabs/resource-manager/Microsoft.DevTestLab/stable/2018-09-15/examples/VirtualMachineSchedules_Update.json

package main

import (
	"context"
	"log"

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

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armdevtestlabs.NewClientFactory("<subscription-id>", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	res, err := clientFactory.NewVirtualMachineSchedulesClient().Update(ctx, "resourceGroupName", "{labName}", "{vmName}", "LabVmsShutdown", armdevtestlabs.ScheduleFragment{
		Tags: map[string]*string{
			"tagName1": to.Ptr("tagValue1"),
		},
	}, 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.Schedule = armdevtestlabs.Schedule{
	// 	Name: to.Ptr("LabVmsShutdown"),
	// 	Type: to.Ptr("Microsoft.DevTestLab/labs/virtualMachines/schedules"),
	// 	ID: to.Ptr("/subscriptions/{subscriptionId}/resourcegroups/resourceGroupName/providers/microsoft.devtestlab/labs/{labName}/virtualMachines/{vmName}/schedules/mySchedule"),
	// 	Location: to.Ptr("{location}"),
	// 	Tags: map[string]*string{
	// 		"tagName1": to.Ptr("tagValue1"),
	// 	},
	// 	Properties: &armdevtestlabs.ScheduleProperties{
	// 		CreatedDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-01-01T01:40:48.173Z"); return t}()),
	// 		DailyRecurrence: &armdevtestlabs.DayDetails{
	// 			Time: to.Ptr("1900"),
	// 		},
	// 		HourlyRecurrence: &armdevtestlabs.HourDetails{
	// 			Minute: to.Ptr[int32](30),
	// 		},
	// 		NotificationSettings: &armdevtestlabs.NotificationSettings{
	// 			EmailRecipient: to.Ptr("{email}"),
	// 			NotificationLocale: to.Ptr("EN"),
	// 			Status: to.Ptr(armdevtestlabs.EnableStatusEnabled),
	// 			TimeInMinutes: to.Ptr[int32](30),
	// 			WebhookURL: to.Ptr("{webhookUrl}"),
	// 		},
	// 		ProvisioningState: to.Ptr("Succeeded"),
	// 		Status: to.Ptr(armdevtestlabs.EnableStatusEnabled),
	// 		TargetResourceID: to.Ptr("/subscriptions/{subscriptionId}/resourcegroups/resourceGroupName/providers/microsoft.devtestlab/labs/{labName}/virtualMachines/{vmName}"),
	// 		TaskType: to.Ptr("LabVmsShutdownTask"),
	// 		TimeZoneID: to.Ptr("Pacific Standard Time"),
	// 		WeeklyRecurrence: &armdevtestlabs.WeekDetails{
	// 			Time: to.Ptr("1700"),
	// 			Weekdays: []*string{
	// 				to.Ptr("Friday"),
	// 				to.Ptr("Saturday"),
	// 				to.Ptr("Sunday")},
	// 			},
	// 		},
	// 	}
}
Output:

type VirtualMachineSchedulesClientBeginExecuteOptions added in v0.2.0

type VirtualMachineSchedulesClientBeginExecuteOptions struct {
	// Resumes the LRO from the provided token.
	ResumeToken string
}

VirtualMachineSchedulesClientBeginExecuteOptions contains the optional parameters for the VirtualMachineSchedulesClient.BeginExecute method.

type VirtualMachineSchedulesClientCreateOrUpdateOptions added in v0.2.0

type VirtualMachineSchedulesClientCreateOrUpdateOptions struct {
}

VirtualMachineSchedulesClientCreateOrUpdateOptions contains the optional parameters for the VirtualMachineSchedulesClient.CreateOrUpdate method.

type VirtualMachineSchedulesClientCreateOrUpdateResponse added in v0.2.0

type VirtualMachineSchedulesClientCreateOrUpdateResponse struct {
	// A schedule.
	Schedule
}

VirtualMachineSchedulesClientCreateOrUpdateResponse contains the response from method VirtualMachineSchedulesClient.CreateOrUpdate.

type VirtualMachineSchedulesClientDeleteOptions added in v0.2.0

type VirtualMachineSchedulesClientDeleteOptions struct {
}

VirtualMachineSchedulesClientDeleteOptions contains the optional parameters for the VirtualMachineSchedulesClient.Delete method.

type VirtualMachineSchedulesClientDeleteResponse added in v0.2.0

type VirtualMachineSchedulesClientDeleteResponse struct {
}

VirtualMachineSchedulesClientDeleteResponse contains the response from method VirtualMachineSchedulesClient.Delete.

type VirtualMachineSchedulesClientExecuteResponse added in v0.2.0

type VirtualMachineSchedulesClientExecuteResponse struct {
}

VirtualMachineSchedulesClientExecuteResponse contains the response from method VirtualMachineSchedulesClient.BeginExecute.

type VirtualMachineSchedulesClientGetOptions added in v0.2.0

type VirtualMachineSchedulesClientGetOptions struct {
	// Specify the $expand query. Example: 'properties($select=status)'
	Expand *string
}

VirtualMachineSchedulesClientGetOptions contains the optional parameters for the VirtualMachineSchedulesClient.Get method.

type VirtualMachineSchedulesClientGetResponse added in v0.2.0

type VirtualMachineSchedulesClientGetResponse struct {
	// A schedule.
	Schedule
}

VirtualMachineSchedulesClientGetResponse contains the response from method VirtualMachineSchedulesClient.Get.

type VirtualMachineSchedulesClientListOptions added in v0.2.0

type VirtualMachineSchedulesClientListOptions struct {
	// Specify the $expand query. Example: 'properties($select=status)'
	Expand *string

	// The filter to apply to the operation. Example: '$filter=contains(name,'myName')
	Filter *string

	// The ordering expression for the results, using OData notation. Example: '$orderby=name desc'
	Orderby *string

	// The maximum number of resources to return from the operation. Example: '$top=10'
	Top *int32
}

VirtualMachineSchedulesClientListOptions contains the optional parameters for the VirtualMachineSchedulesClient.NewListPager method.

type VirtualMachineSchedulesClientListResponse added in v0.2.0

type VirtualMachineSchedulesClientListResponse struct {
	// The response of a list operation.
	ScheduleList
}

VirtualMachineSchedulesClientListResponse contains the response from method VirtualMachineSchedulesClient.NewListPager.

type VirtualMachineSchedulesClientUpdateOptions added in v0.2.0

type VirtualMachineSchedulesClientUpdateOptions struct {
}

VirtualMachineSchedulesClientUpdateOptions contains the optional parameters for the VirtualMachineSchedulesClient.Update method.

type VirtualMachineSchedulesClientUpdateResponse added in v0.2.0

type VirtualMachineSchedulesClientUpdateResponse struct {
	// A schedule.
	Schedule
}

VirtualMachineSchedulesClientUpdateResponse contains the response from method VirtualMachineSchedulesClient.Update.

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 - The subscription ID.
  • credential - used to authorize requests. Usually a credential from azidentity.
  • options - pass nil to accept the default values.

func (*VirtualMachinesClient) BeginAddDataDisk

func (client *VirtualMachinesClient) BeginAddDataDisk(ctx context.Context, resourceGroupName string, labName string, name string, dataDiskProperties DataDiskProperties, options *VirtualMachinesClientBeginAddDataDiskOptions) (*runtime.Poller[VirtualMachinesClientAddDataDiskResponse], error)

BeginAddDataDisk - Attach a new or existing data disk to virtual machine. This operation can take a while to complete. If the operation fails it returns an *azcore.ResponseError type.

Generated from API version 2018-09-15

  • resourceGroupName - The name of the resource group.
  • labName - The name of the lab.
  • name - The name of the virtual machine.
  • dataDiskProperties - Request body for adding a new or existing data disk to a virtual machine.
  • options - VirtualMachinesClientBeginAddDataDiskOptions contains the optional parameters for the VirtualMachinesClient.BeginAddDataDisk method.
Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/d55b8005f05b040b852c15e74a0f3e36494a15e1/specification/devtestlabs/resource-manager/Microsoft.DevTestLab/stable/2018-09-15/examples/VirtualMachines_AddDataDisk.json

package main

import (
	"context"
	"log"

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

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armdevtestlabs.NewClientFactory("<subscription-id>", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	poller, err := clientFactory.NewVirtualMachinesClient().BeginAddDataDisk(ctx, "resourceGroupName", "{labName}", "{virtualMachineName}", armdevtestlabs.DataDiskProperties{
		AttachNewDataDiskOptions: &armdevtestlabs.AttachNewDataDiskOptions{
			DiskName:    to.Ptr("{diskName}"),
			DiskSizeGiB: to.Ptr[int32](127),
			DiskType:    to.Ptr(armdevtestlabs.StorageType("{diskType}")),
		},
	}, 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) BeginApplyArtifacts

func (client *VirtualMachinesClient) BeginApplyArtifacts(ctx context.Context, resourceGroupName string, labName string, name string, applyArtifactsRequest ApplyArtifactsRequest, options *VirtualMachinesClientBeginApplyArtifactsOptions) (*runtime.Poller[VirtualMachinesClientApplyArtifactsResponse], error)

BeginApplyArtifacts - Apply artifacts to virtual machine. This operation can take a while to complete. If the operation fails it returns an *azcore.ResponseError type.

Generated from API version 2018-09-15

  • resourceGroupName - The name of the resource group.
  • labName - The name of the lab.
  • name - The name of the virtual machine.
  • applyArtifactsRequest - Request body for applying artifacts to a virtual machine.
  • options - VirtualMachinesClientBeginApplyArtifactsOptions contains the optional parameters for the VirtualMachinesClient.BeginApplyArtifacts method.
Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/d55b8005f05b040b852c15e74a0f3e36494a15e1/specification/devtestlabs/resource-manager/Microsoft.DevTestLab/stable/2018-09-15/examples/VirtualMachines_ApplyArtifacts.json

package main

import (
	"context"
	"log"

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

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armdevtestlabs.NewClientFactory("<subscription-id>", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	poller, err := clientFactory.NewVirtualMachinesClient().BeginApplyArtifacts(ctx, "resourceGroupName", "{labName}", "{vmName}", armdevtestlabs.ApplyArtifactsRequest{
		Artifacts: []*armdevtestlabs.ArtifactInstallProperties{
			{
				ArtifactID: to.Ptr("/subscriptions/{subscriptionId}/resourceGroups/resourceGroupName/providers/Microsoft.DevTestLab/labs/{labName}/artifactSources/public repo/artifacts/windows-restart"),
			}},
	}, 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) BeginClaim

BeginClaim - Take ownership of an existing virtual machine This operation can take a while to complete. If the operation fails it returns an *azcore.ResponseError type.

Generated from API version 2018-09-15

  • resourceGroupName - The name of the resource group.
  • labName - The name of the lab.
  • name - The name of the virtual machine.
  • options - VirtualMachinesClientBeginClaimOptions contains the optional parameters for the VirtualMachinesClient.BeginClaim method.
Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/d55b8005f05b040b852c15e74a0f3e36494a15e1/specification/devtestlabs/resource-manager/Microsoft.DevTestLab/stable/2018-09-15/examples/VirtualMachines_Claim.json

package main

import (
	"context"
	"log"

	"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
	"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/devtestlabs/armdevtestlabs"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armdevtestlabs.NewClientFactory("<subscription-id>", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	poller, err := clientFactory.NewVirtualMachinesClient().BeginClaim(ctx, "resourceGroupName", "{labName}", "{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) BeginCreateOrUpdate

func (client *VirtualMachinesClient) BeginCreateOrUpdate(ctx context.Context, resourceGroupName string, labName string, name string, labVirtualMachine LabVirtualMachine, options *VirtualMachinesClientBeginCreateOrUpdateOptions) (*runtime.Poller[VirtualMachinesClientCreateOrUpdateResponse], error)

BeginCreateOrUpdate - Create or replace an existing virtual machine. This operation can take a while to complete. If the operation fails it returns an *azcore.ResponseError type.

Generated from API version 2018-09-15

  • resourceGroupName - The name of the resource group.
  • labName - The name of the lab.
  • name - The name of the virtual machine.
  • labVirtualMachine - A virtual machine.
  • options - VirtualMachinesClientBeginCreateOrUpdateOptions contains the optional parameters for the VirtualMachinesClient.BeginCreateOrUpdate method.
Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/d55b8005f05b040b852c15e74a0f3e36494a15e1/specification/devtestlabs/resource-manager/Microsoft.DevTestLab/stable/2018-09-15/examples/VirtualMachines_CreateOrUpdate.json

package main

import (
	"context"
	"log"

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

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armdevtestlabs.NewClientFactory("<subscription-id>", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	poller, err := clientFactory.NewVirtualMachinesClient().BeginCreateOrUpdate(ctx, "resourceGroupName", "{labName}", "{vmName}", armdevtestlabs.LabVirtualMachine{
		Location: to.Ptr("{location}"),
		Tags: map[string]*string{
			"tagName1": to.Ptr("tagValue1"),
		},
		Properties: &armdevtestlabs.LabVirtualMachineProperties{
			AllowClaim:              to.Ptr(true),
			DisallowPublicIPAddress: to.Ptr(true),
			GalleryImageReference: &armdevtestlabs.GalleryImageReference{
				Offer:     to.Ptr("UbuntuServer"),
				OSType:    to.Ptr("Linux"),
				Publisher: to.Ptr("Canonical"),
				SKU:       to.Ptr("16.04-LTS"),
				Version:   to.Ptr("Latest"),
			},
			LabSubnetName:       to.Ptr("{virtualNetworkName}Subnet"),
			LabVirtualNetworkID: to.Ptr("/subscriptions/{subscriptionId}/resourcegroups/resourceGroupName/providers/microsoft.devtestlab/labs/{labName}/virtualnetworks/{virtualNetworkName}"),
			Password:            to.Ptr("{userPassword}"),
			Size:                to.Ptr("Standard_A2_v2"),
			StorageType:         to.Ptr("Standard"),
			UserName:            to.Ptr("{userName}"),
		},
	}, 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.LabVirtualMachine = armdevtestlabs.LabVirtualMachine{
	// 	Name: to.Ptr("{vmName}"),
	// 	Type: to.Ptr("Microsoft.DevTestLab/labs/virtualMachines"),
	// 	ID: to.Ptr("/subscriptions/{subscriptionId}/resourcegroups/resourceGroupName/providers/microsoft.devtestlab/labs/{labName}/virtualmachines/{vmName}"),
	// 	Location: to.Ptr("{location}"),
	// 	Tags: map[string]*string{
	// 		"tagName1": to.Ptr("tagValue1"),
	// 	},
	// 	Properties: &armdevtestlabs.LabVirtualMachineProperties{
	// 		AllowClaim: to.Ptr(true),
	// 		ArtifactDeploymentStatus: &armdevtestlabs.ArtifactDeploymentStatusProperties{
	// 			ArtifactsApplied: to.Ptr[int32](0),
	// 			TotalArtifacts: to.Ptr[int32](0),
	// 		},
	// 		CreatedByUser: to.Ptr(""),
	// 		CreatedByUserID: to.Ptr(""),
	// 		CreatedDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2018-10-01T23:53:02.483Z"); return t}()),
	// 		DataDiskParameters: []*armdevtestlabs.DataDiskProperties{
	// 		},
	// 		DisallowPublicIPAddress: to.Ptr(true),
	// 		GalleryImageReference: &armdevtestlabs.GalleryImageReference{
	// 			Offer: to.Ptr("UbuntuServer"),
	// 			OSType: to.Ptr("Linux"),
	// 			Publisher: to.Ptr("Canonical"),
	// 			SKU: to.Ptr("16.04-LTS"),
	// 			Version: to.Ptr("Latest"),
	// 		},
	// 		LabSubnetName: to.Ptr("{virtualNetworkName}Subnet"),
	// 		LabVirtualNetworkID: to.Ptr("/subscriptions/{subscriptionId}/resourcegroups/resourceGroupName/providers/microsoft.devtestlab/labs/{labName}/virtualnetworks/{virtualNetworkName}"),
	// 		NetworkInterface: &armdevtestlabs.NetworkInterfaceProperties{
	// 		},
	// 		OwnerObjectID: to.Ptr(""),
	// 		OwnerUserPrincipalName: to.Ptr(""),
	// 		ProvisioningState: to.Ptr("Succeeded"),
	// 		Size: to.Ptr("Standard_A2_v2"),
	// 		StorageType: to.Ptr("Standard"),
	// 		UniqueIdentifier: to.Ptr("{uniqueIdentifier}"),
	// 		UserName: to.Ptr("{userName}"),
	// 		VirtualMachineCreationSource: to.Ptr(armdevtestlabs.VirtualMachineCreationSourceFromGalleryImage),
	// 	},
	// }
}
Output:

func (*VirtualMachinesClient) BeginDelete

BeginDelete - Delete virtual machine. This operation can take a while to complete. If the operation fails it returns an *azcore.ResponseError type.

Generated from API version 2018-09-15

  • resourceGroupName - The name of the resource group.
  • labName - The name of the lab.
  • name - 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/d55b8005f05b040b852c15e74a0f3e36494a15e1/specification/devtestlabs/resource-manager/Microsoft.DevTestLab/stable/2018-09-15/examples/VirtualMachines_Delete.json

package main

import (
	"context"
	"log"

	"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
	"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/devtestlabs/armdevtestlabs"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armdevtestlabs.NewClientFactory("<subscription-id>", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	poller, err := clientFactory.NewVirtualMachinesClient().BeginDelete(ctx, "resourceGroupName", "{labName}", "{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) BeginDetachDataDisk

func (client *VirtualMachinesClient) BeginDetachDataDisk(ctx context.Context, resourceGroupName string, labName string, name string, detachDataDiskProperties DetachDataDiskProperties, options *VirtualMachinesClientBeginDetachDataDiskOptions) (*runtime.Poller[VirtualMachinesClientDetachDataDiskResponse], error)

BeginDetachDataDisk - Detach the specified disk from the virtual machine. This operation can take a while to complete. If the operation fails it returns an *azcore.ResponseError type.

Generated from API version 2018-09-15

  • resourceGroupName - The name of the resource group.
  • labName - The name of the lab.
  • name - The name of the virtual machine.
  • detachDataDiskProperties - Request body for detaching data disk from a virtual machine.
  • options - VirtualMachinesClientBeginDetachDataDiskOptions contains the optional parameters for the VirtualMachinesClient.BeginDetachDataDisk method.
Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/d55b8005f05b040b852c15e74a0f3e36494a15e1/specification/devtestlabs/resource-manager/Microsoft.DevTestLab/stable/2018-09-15/examples/VirtualMachines_DetachDataDisk.json

package main

import (
	"context"
	"log"

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

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armdevtestlabs.NewClientFactory("<subscription-id>", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	poller, err := clientFactory.NewVirtualMachinesClient().BeginDetachDataDisk(ctx, "resourceGroupName", "{labName}", "{virtualMachineName}", armdevtestlabs.DetachDataDiskProperties{
		ExistingLabDiskID: to.Ptr("/subscriptions/{subscriptionId}/resourcegroups/resourceGroupName/providers/microsoft.devtestlab/labs/{labName}/virtualmachines/{virtualMachineName}"),
	}, 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

BeginRedeploy - Redeploy a virtual machine This operation can take a while to complete. If the operation fails it returns an *azcore.ResponseError type.

Generated from API version 2018-09-15

  • resourceGroupName - The name of the resource group.
  • labName - The name of the lab.
  • name - The name of the virtual machine.
  • options - VirtualMachinesClientBeginRedeployOptions contains the optional parameters for the VirtualMachinesClient.BeginRedeploy method.
Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/d55b8005f05b040b852c15e74a0f3e36494a15e1/specification/devtestlabs/resource-manager/Microsoft.DevTestLab/stable/2018-09-15/examples/VirtualMachines_Redeploy.json

package main

import (
	"context"
	"log"

	"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
	"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/devtestlabs/armdevtestlabs"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armdevtestlabs.NewClientFactory("<subscription-id>", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	poller, err := clientFactory.NewVirtualMachinesClient().BeginRedeploy(ctx, "resourceGroupName", "{labName}", "{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) BeginResize

func (client *VirtualMachinesClient) BeginResize(ctx context.Context, resourceGroupName string, labName string, name string, resizeLabVirtualMachineProperties ResizeLabVirtualMachineProperties, options *VirtualMachinesClientBeginResizeOptions) (*runtime.Poller[VirtualMachinesClientResizeResponse], error)

BeginResize - Resize Virtual Machine. This operation can take a while to complete. If the operation fails it returns an *azcore.ResponseError type.

Generated from API version 2018-09-15

  • resourceGroupName - The name of the resource group.
  • labName - The name of the lab.
  • name - The name of the virtual machine.
  • resizeLabVirtualMachineProperties - Request body for resizing a virtual machine.
  • options - VirtualMachinesClientBeginResizeOptions contains the optional parameters for the VirtualMachinesClient.BeginResize method.
Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/d55b8005f05b040b852c15e74a0f3e36494a15e1/specification/devtestlabs/resource-manager/Microsoft.DevTestLab/stable/2018-09-15/examples/VirtualMachines_Resize.json

package main

import (
	"context"
	"log"

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

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armdevtestlabs.NewClientFactory("<subscription-id>", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	poller, err := clientFactory.NewVirtualMachinesClient().BeginResize(ctx, "resourceGroupName", "{labName}", "{vmName}", armdevtestlabs.ResizeLabVirtualMachineProperties{
		Size: to.Ptr("Standard_A4_v2"),
	}, 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) BeginRestart

BeginRestart - Restart a virtual machine. This operation can take a while to complete. If the operation fails it returns an *azcore.ResponseError type.

Generated from API version 2018-09-15

  • resourceGroupName - The name of the resource group.
  • labName - The name of the lab.
  • name - The name of the virtual machine.
  • options - VirtualMachinesClientBeginRestartOptions contains the optional parameters for the VirtualMachinesClient.BeginRestart method.
Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/d55b8005f05b040b852c15e74a0f3e36494a15e1/specification/devtestlabs/resource-manager/Microsoft.DevTestLab/stable/2018-09-15/examples/VirtualMachines_Restart.json

package main

import (
	"context"
	"log"

	"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
	"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/devtestlabs/armdevtestlabs"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armdevtestlabs.NewClientFactory("<subscription-id>", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	poller, err := clientFactory.NewVirtualMachinesClient().BeginRestart(ctx, "resourceGroupName", "{labName}", "{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) BeginStart

BeginStart - Start a virtual machine. This operation can take a while to complete. If the operation fails it returns an *azcore.ResponseError type.

Generated from API version 2018-09-15

  • resourceGroupName - The name of the resource group.
  • labName - The name of the lab.
  • name - The name of the virtual machine.
  • options - VirtualMachinesClientBeginStartOptions contains the optional parameters for the VirtualMachinesClient.BeginStart method.
Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/d55b8005f05b040b852c15e74a0f3e36494a15e1/specification/devtestlabs/resource-manager/Microsoft.DevTestLab/stable/2018-09-15/examples/VirtualMachines_Start.json

package main

import (
	"context"
	"log"

	"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
	"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/devtestlabs/armdevtestlabs"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armdevtestlabs.NewClientFactory("<subscription-id>", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	poller, err := clientFactory.NewVirtualMachinesClient().BeginStart(ctx, "resourceGroupName", "{labName}", "{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) BeginStop

BeginStop - Stop a virtual machine This operation can take a while to complete. If the operation fails it returns an *azcore.ResponseError type.

Generated from API version 2018-09-15

  • resourceGroupName - The name of the resource group.
  • labName - The name of the lab.
  • name - The name of the virtual machine.
  • options - VirtualMachinesClientBeginStopOptions contains the optional parameters for the VirtualMachinesClient.BeginStop method.
Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/d55b8005f05b040b852c15e74a0f3e36494a15e1/specification/devtestlabs/resource-manager/Microsoft.DevTestLab/stable/2018-09-15/examples/VirtualMachines_Stop.json

package main

import (
	"context"
	"log"

	"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
	"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/devtestlabs/armdevtestlabs"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armdevtestlabs.NewClientFactory("<subscription-id>", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	poller, err := clientFactory.NewVirtualMachinesClient().BeginStop(ctx, "resourceGroupName", "{labName}", "{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) BeginTransferDisks

BeginTransferDisks - Transfers all data disks attached to the virtual machine to be owned by the current user. This operation can take a while to complete. If the operation fails it returns an *azcore.ResponseError type.

Generated from API version 2018-09-15

  • resourceGroupName - The name of the resource group.
  • labName - The name of the lab.
  • name - The name of the virtual machine.
  • options - VirtualMachinesClientBeginTransferDisksOptions contains the optional parameters for the VirtualMachinesClient.BeginTransferDisks method.
Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/d55b8005f05b040b852c15e74a0f3e36494a15e1/specification/devtestlabs/resource-manager/Microsoft.DevTestLab/stable/2018-09-15/examples/VirtualMachines_TransferDisks.json

package main

import (
	"context"
	"log"

	"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
	"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/devtestlabs/armdevtestlabs"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armdevtestlabs.NewClientFactory("<subscription-id>", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	poller, err := clientFactory.NewVirtualMachinesClient().BeginTransferDisks(ctx, "resourceGroupName", "{labName}", "{virtualmachineName}", 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) BeginUnClaim

BeginUnClaim - Release ownership of an existing virtual machine This operation can take a while to complete. If the operation fails it returns an *azcore.ResponseError type.

Generated from API version 2018-09-15

  • resourceGroupName - The name of the resource group.
  • labName - The name of the lab.
  • name - The name of the virtual machine.
  • options - VirtualMachinesClientBeginUnClaimOptions contains the optional parameters for the VirtualMachinesClient.BeginUnClaim method.
Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/d55b8005f05b040b852c15e74a0f3e36494a15e1/specification/devtestlabs/resource-manager/Microsoft.DevTestLab/stable/2018-09-15/examples/VirtualMachines_UnClaim.json

package main

import (
	"context"
	"log"

	"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
	"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/devtestlabs/armdevtestlabs"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armdevtestlabs.NewClientFactory("<subscription-id>", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	poller, err := clientFactory.NewVirtualMachinesClient().BeginUnClaim(ctx, "resourceGroupName", "{labName}", "{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) Get

func (client *VirtualMachinesClient) Get(ctx context.Context, resourceGroupName string, labName string, name string, options *VirtualMachinesClientGetOptions) (VirtualMachinesClientGetResponse, error)

Get - Get virtual machine. If the operation fails it returns an *azcore.ResponseError type.

Generated from API version 2018-09-15

  • resourceGroupName - The name of the resource group.
  • labName - The name of the lab.
  • name - The name of the virtual machine.
  • options - VirtualMachinesClientGetOptions contains the optional parameters for the VirtualMachinesClient.Get method.
Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/d55b8005f05b040b852c15e74a0f3e36494a15e1/specification/devtestlabs/resource-manager/Microsoft.DevTestLab/stable/2018-09-15/examples/VirtualMachines_Get.json

package main

import (
	"context"
	"log"

	"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
	"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/devtestlabs/armdevtestlabs"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armdevtestlabs.NewClientFactory("<subscription-id>", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	res, err := clientFactory.NewVirtualMachinesClient().Get(ctx, "resourceGroupName", "{labName}", "{vmName}", &armdevtestlabs.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.LabVirtualMachine = armdevtestlabs.LabVirtualMachine{
	// 	Name: to.Ptr("{vmName}"),
	// 	Type: to.Ptr("Microsoft.DevTestLab/labs/virtualMachines"),
	// 	ID: to.Ptr("/subscriptions/{subscriptionId}/resourcegroups/resourceGroupName/providers/microsoft.devtestlab/labs/{labName}/virtualmachines/{vmName}"),
	// 	Location: to.Ptr("{location}"),
	// 	Tags: map[string]*string{
	// 		"tagName1": to.Ptr("tagValue1"),
	// 	},
	// 	Properties: &armdevtestlabs.LabVirtualMachineProperties{
	// 		AllowClaim: to.Ptr(true),
	// 		ArtifactDeploymentStatus: &armdevtestlabs.ArtifactDeploymentStatusProperties{
	// 			ArtifactsApplied: to.Ptr[int32](0),
	// 			TotalArtifacts: to.Ptr[int32](0),
	// 		},
	// 		ComputeID: to.Ptr("/subscriptions/{subscriptionId}/resourceGroups/{labName}-{vmName}-{randomSuffix}/providers/Microsoft.Compute/virtualMachines/{vmName}"),
	// 		CreatedByUser: to.Ptr(""),
	// 		CreatedByUserID: to.Ptr(""),
	// 		CreatedDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2018-10-01T23:53:02.483Z"); return t}()),
	// 		DataDiskParameters: []*armdevtestlabs.DataDiskProperties{
	// 		},
	// 		DisallowPublicIPAddress: to.Ptr(true),
	// 		GalleryImageReference: &armdevtestlabs.GalleryImageReference{
	// 			Offer: to.Ptr("UbuntuServer"),
	// 			OSType: to.Ptr("Linux"),
	// 			Publisher: to.Ptr("Canonical"),
	// 			SKU: to.Ptr("16.04-LTS"),
	// 			Version: to.Ptr("Latest"),
	// 		},
	// 		LabSubnetName: to.Ptr("{virtualNetworkName}Subnet"),
	// 		LabVirtualNetworkID: to.Ptr("/subscriptions/{subscriptionId}/resourcegroups/resourceGroupName/providers/microsoft.devtestlab/labs/{labName}/virtualnetworks/{virtualNetworkName}"),
	// 		NetworkInterface: &armdevtestlabs.NetworkInterfaceProperties{
	// 		},
	// 		OSType: to.Ptr("Linux"),
	// 		OwnerObjectID: to.Ptr(""),
	// 		OwnerUserPrincipalName: to.Ptr(""),
	// 		ProvisioningState: to.Ptr("Succeeded"),
	// 		Size: to.Ptr("Standard_A2_v2"),
	// 		StorageType: to.Ptr("Standard"),
	// 		UniqueIdentifier: to.Ptr("{uniqueIdentifier}"),
	// 		UserName: to.Ptr("{userName}"),
	// 		VirtualMachineCreationSource: to.Ptr(armdevtestlabs.VirtualMachineCreationSourceFromGalleryImage),
	// 	},
	// }
}
Output:

func (*VirtualMachinesClient) GetRdpFileContents

GetRdpFileContents - Gets a string that represents the contents of the RDP file for the virtual machine If the operation fails it returns an *azcore.ResponseError type.

Generated from API version 2018-09-15

  • resourceGroupName - The name of the resource group.
  • labName - The name of the lab.
  • name - The name of the virtual machine.
  • options - VirtualMachinesClientGetRdpFileContentsOptions contains the optional parameters for the VirtualMachinesClient.GetRdpFileContents method.
Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/d55b8005f05b040b852c15e74a0f3e36494a15e1/specification/devtestlabs/resource-manager/Microsoft.DevTestLab/stable/2018-09-15/examples/VirtualMachines_GetRdpFileContents.json

package main

import (
	"context"
	"log"

	"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
	"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/devtestlabs/armdevtestlabs"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armdevtestlabs.NewClientFactory("<subscription-id>", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	res, err := clientFactory.NewVirtualMachinesClient().GetRdpFileContents(ctx, "resourceGroupName", "{labName}", "{vmName}", 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.RdpConnection = armdevtestlabs.RdpConnection{
	// 	Contents: to.Ptr("full address:s:10.0.0.4\r\nprompt for credentials:i:1\r\nusername:s:{vmName}\\{userName}\r\n"),
	// }
}
Output:

func (*VirtualMachinesClient) ListApplicableSchedules

ListApplicableSchedules - Lists the applicable start/stop schedules, if any. If the operation fails it returns an *azcore.ResponseError type.

Generated from API version 2018-09-15

  • resourceGroupName - The name of the resource group.
  • labName - The name of the lab.
  • name - The name of the virtual machine.
  • options - VirtualMachinesClientListApplicableSchedulesOptions contains the optional parameters for the VirtualMachinesClient.ListApplicableSchedules method.
Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/d55b8005f05b040b852c15e74a0f3e36494a15e1/specification/devtestlabs/resource-manager/Microsoft.DevTestLab/stable/2018-09-15/examples/VirtualMachines_ListApplicableSchedules.json

package main

import (
	"context"
	"log"

	"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
	"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/devtestlabs/armdevtestlabs"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armdevtestlabs.NewClientFactory("<subscription-id>", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	res, err := clientFactory.NewVirtualMachinesClient().ListApplicableSchedules(ctx, "resourceGroupName", "{labName}", "{vmName}", 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.ApplicableSchedule = armdevtestlabs.ApplicableSchedule{
	// 	Properties: &armdevtestlabs.ApplicableScheduleProperties{
	// 		LabVMsShutdown: &armdevtestlabs.Schedule{
	// 			Name: to.Ptr("LabVmsShutdown"),
	// 			Type: to.Ptr("Microsoft.DevTestLab/labs/virtualMachines/schedules"),
	// 			ID: to.Ptr("/subscriptions/{subscriptionId}/resourcegroups/resourceGroupName/providers/Microsoft.DevTestLab/labs/{labName}/schedules/myAutoShutdownSchedule"),
	// 			Location: to.Ptr("{location}"),
	// 			Properties: &armdevtestlabs.ScheduleProperties{
	// 				CreatedDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-12-29T21:48:14.136Z"); return t}()),
	// 				DailyRecurrence: &armdevtestlabs.DayDetails{
	// 					Time: to.Ptr("1900"),
	// 				},
	// 				HourlyRecurrence: &armdevtestlabs.HourDetails{
	// 					Minute: to.Ptr[int32](30),
	// 				},
	// 				NotificationSettings: &armdevtestlabs.NotificationSettings{
	// 					EmailRecipient: to.Ptr("{email}"),
	// 					NotificationLocale: to.Ptr("EN"),
	// 					Status: to.Ptr(armdevtestlabs.EnableStatusEnabled),
	// 					TimeInMinutes: to.Ptr[int32](30),
	// 					WebhookURL: to.Ptr("{webhookUrl}"),
	// 				},
	// 				ProvisioningState: to.Ptr("Succeeded"),
	// 				Status: to.Ptr(armdevtestlabs.EnableStatusEnabled),
	// 				TargetResourceID: to.Ptr("/subscriptions/{subscriptionId}/resourcegroups/resourceGroupName/providers/Microsoft.DevTestLab/labs/{labName}/virtualmachines/{vmName}"),
	// 				TaskType: to.Ptr("LabVmsShutdownTask"),
	// 				TimeZoneID: to.Ptr("Pacific Standard Time"),
	// 				UniqueIdentifier: to.Ptr("4acf0408-1c10-49cb-96b7-28ce655c8320"),
	// 				WeeklyRecurrence: &armdevtestlabs.WeekDetails{
	// 					Time: to.Ptr("1700"),
	// 					Weekdays: []*string{
	// 						to.Ptr("Friday"),
	// 						to.Ptr("Saturday"),
	// 						to.Ptr("Sunday")},
	// 					},
	// 				},
	// 			},
	// 			LabVMsStartup: &armdevtestlabs.Schedule{
	// 				Name: to.Ptr("LabVmAutoStart"),
	// 				Type: to.Ptr("Microsoft.DevTestLab/labs/virtualMachines/schedules"),
	// 				ID: to.Ptr("/subscriptions/{subscriptionId}/resourcegroups/resourceGroupName/providers/Microsoft.DevTestLab/labs/{labName}/schedules/myAutoStartSchedule"),
	// 				Location: to.Ptr("{location}"),
	// 				Properties: &armdevtestlabs.ScheduleProperties{
	// 					CreatedDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-12-29T21:46:37.047Z"); return t}()),
	// 					DailyRecurrence: &armdevtestlabs.DayDetails{
	// 						Time: to.Ptr("0900"),
	// 					},
	// 					HourlyRecurrence: &armdevtestlabs.HourDetails{
	// 						Minute: to.Ptr[int32](30),
	// 					},
	// 					NotificationSettings: &armdevtestlabs.NotificationSettings{
	// 						EmailRecipient: to.Ptr("{email}"),
	// 						NotificationLocale: to.Ptr("EN"),
	// 						Status: to.Ptr(armdevtestlabs.EnableStatusEnabled),
	// 						TimeInMinutes: to.Ptr[int32](30),
	// 						WebhookURL: to.Ptr("{webhookUrl}"),
	// 					},
	// 					ProvisioningState: to.Ptr("Succeeded"),
	// 					Status: to.Ptr(armdevtestlabs.EnableStatusEnabled),
	// 					TargetResourceID: to.Ptr("/subscriptions/{subscriptionId}/resourcegroups/resourceGroupName/providers/Microsoft.DevTestLab/labs/{labName}/virtualmachines/{vmName}"),
	// 					TaskType: to.Ptr("LabVmsStartupTask"),
	// 					TimeZoneID: to.Ptr("Pacific Standard Time"),
	// 					WeeklyRecurrence: &armdevtestlabs.WeekDetails{
	// 						Time: to.Ptr("1000"),
	// 						Weekdays: []*string{
	// 							to.Ptr("Friday"),
	// 							to.Ptr("Saturday"),
	// 							to.Ptr("Sunday")},
	// 						},
	// 					},
	// 				},
	// 			},
	// 		}
}
Output:

func (*VirtualMachinesClient) NewListPager added in v0.4.0

func (client *VirtualMachinesClient) NewListPager(resourceGroupName string, labName string, options *VirtualMachinesClientListOptions) *runtime.Pager[VirtualMachinesClientListResponse]

NewListPager - List virtual machines in a given lab.

Generated from API version 2018-09-15

  • resourceGroupName - The name of the resource group.
  • labName - The name of the lab.
  • options - VirtualMachinesClientListOptions contains the optional parameters for the VirtualMachinesClient.NewListPager method.
Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/d55b8005f05b040b852c15e74a0f3e36494a15e1/specification/devtestlabs/resource-manager/Microsoft.DevTestLab/stable/2018-09-15/examples/VirtualMachines_List.json

package main

import (
	"context"
	"log"

	"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
	"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/devtestlabs/armdevtestlabs"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armdevtestlabs.NewClientFactory("<subscription-id>", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	pager := clientFactory.NewVirtualMachinesClient().NewListPager("resourceGroupName", "{labName}", &armdevtestlabs.VirtualMachinesClientListOptions{Expand: nil,
		Filter:  nil,
		Top:     nil,
		Orderby: 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.LabVirtualMachineList = armdevtestlabs.LabVirtualMachineList{
		// 	Value: []*armdevtestlabs.LabVirtualMachine{
		// 		{
		// 			Name: to.Ptr("{vmName}"),
		// 			Type: to.Ptr("Microsoft.DevTestLab/labs/virtualMachines"),
		// 			ID: to.Ptr("/subscriptions/{subscriptionId}/resourcegroups/resourceGroupName/providers/microsoft.devtestlab/labs/{labName}/virtualmachines/{vmName}"),
		// 			Location: to.Ptr("{location}"),
		// 			Tags: map[string]*string{
		// 				"tagName1": to.Ptr("tagValue1"),
		// 			},
		// 			Properties: &armdevtestlabs.LabVirtualMachineProperties{
		// 				AllowClaim: to.Ptr(true),
		// 				ArtifactDeploymentStatus: &armdevtestlabs.ArtifactDeploymentStatusProperties{
		// 					ArtifactsApplied: to.Ptr[int32](0),
		// 					TotalArtifacts: to.Ptr[int32](0),
		// 				},
		// 				ComputeID: to.Ptr("/subscriptions/{subscriptionId}/resourceGroups/{labName}-{vmName}-{randomSuffix}/providers/Microsoft.Compute/virtualMachines/{vmName}"),
		// 				CreatedByUser: to.Ptr(""),
		// 				CreatedByUserID: to.Ptr(""),
		// 				CreatedDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2018-10-01T23:53:02.483Z"); return t}()),
		// 				DataDiskParameters: []*armdevtestlabs.DataDiskProperties{
		// 				},
		// 				DisallowPublicIPAddress: to.Ptr(true),
		// 				GalleryImageReference: &armdevtestlabs.GalleryImageReference{
		// 					Offer: to.Ptr("UbuntuServer"),
		// 					OSType: to.Ptr("Linux"),
		// 					Publisher: to.Ptr("Canonical"),
		// 					SKU: to.Ptr("16.04-LTS"),
		// 					Version: to.Ptr("Latest"),
		// 				},
		// 				LabSubnetName: to.Ptr("{virtualNetworkName}Subnet"),
		// 				LabVirtualNetworkID: to.Ptr("/subscriptions/{subscriptionId}/resourcegroups/resourceGroupName/providers/microsoft.devtestlab/labs/{labName}/virtualnetworks/{virtualNetworkName}"),
		// 				NetworkInterface: &armdevtestlabs.NetworkInterfaceProperties{
		// 				},
		// 				OSType: to.Ptr("Linux"),
		// 				OwnerObjectID: to.Ptr(""),
		// 				OwnerUserPrincipalName: to.Ptr(""),
		// 				ProvisioningState: to.Ptr("Succeeded"),
		// 				Size: to.Ptr("Standard_A2_v2"),
		// 				StorageType: to.Ptr("Standard"),
		// 				UniqueIdentifier: to.Ptr("{uniqueIdentifier}"),
		// 				UserName: to.Ptr("{userName}"),
		// 				VirtualMachineCreationSource: to.Ptr(armdevtestlabs.VirtualMachineCreationSourceFromGalleryImage),
		// 			},
		// 	}},
		// }
	}
}
Output:

func (*VirtualMachinesClient) Update

func (client *VirtualMachinesClient) Update(ctx context.Context, resourceGroupName string, labName string, name string, labVirtualMachine LabVirtualMachineFragment, options *VirtualMachinesClientUpdateOptions) (VirtualMachinesClientUpdateResponse, error)

Update - Allows modifying tags of virtual machines. All other properties will be ignored. If the operation fails it returns an *azcore.ResponseError type.

Generated from API version 2018-09-15

  • resourceGroupName - The name of the resource group.
  • labName - The name of the lab.
  • name - The name of the virtual machine.
  • labVirtualMachine - A virtual machine.
  • options - VirtualMachinesClientUpdateOptions contains the optional parameters for the VirtualMachinesClient.Update method.
Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/d55b8005f05b040b852c15e74a0f3e36494a15e1/specification/devtestlabs/resource-manager/Microsoft.DevTestLab/stable/2018-09-15/examples/VirtualMachines_Update.json

package main

import (
	"context"
	"log"

	"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
	"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/devtestlabs/armdevtestlabs"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armdevtestlabs.NewClientFactory("<subscription-id>", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	res, err := clientFactory.NewVirtualMachinesClient().Update(ctx, "resourceGroupName", "{labName}", "{vmName}", armdevtestlabs.LabVirtualMachineFragment{}, 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.LabVirtualMachine = armdevtestlabs.LabVirtualMachine{
	// 	Name: to.Ptr("{vmName}"),
	// 	Type: to.Ptr("Microsoft.DevTestLab/labs/virtualMachines"),
	// 	ID: to.Ptr("/subscriptions/{subscriptionId}/resourcegroups/resourceGroupName/providers/microsoft.devtestlab/labs/{labName}/virtualmachines/{vmName}"),
	// 	Location: to.Ptr("{location}"),
	// 	Tags: map[string]*string{
	// 		"tagName1": to.Ptr("tagValue1"),
	// 	},
	// 	Properties: &armdevtestlabs.LabVirtualMachineProperties{
	// 		AllowClaim: to.Ptr(true),
	// 		ArtifactDeploymentStatus: &armdevtestlabs.ArtifactDeploymentStatusProperties{
	// 			ArtifactsApplied: to.Ptr[int32](0),
	// 			TotalArtifacts: to.Ptr[int32](0),
	// 		},
	// 		ComputeID: to.Ptr("/subscriptions/{subscriptionId}/resourceGroups/{labName}-{vmName}-{randomSuffix}/providers/Microsoft.Compute/virtualMachines/{vmName}"),
	// 		CreatedByUser: to.Ptr(""),
	// 		CreatedByUserID: to.Ptr(""),
	// 		CreatedDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2018-10-01T23:53:02.483Z"); return t}()),
	// 		DataDiskParameters: []*armdevtestlabs.DataDiskProperties{
	// 		},
	// 		DisallowPublicIPAddress: to.Ptr(true),
	// 		GalleryImageReference: &armdevtestlabs.GalleryImageReference{
	// 			Offer: to.Ptr("UbuntuServer"),
	// 			OSType: to.Ptr("Linux"),
	// 			Publisher: to.Ptr("Canonical"),
	// 			SKU: to.Ptr("16.04-LTS"),
	// 			Version: to.Ptr("Latest"),
	// 		},
	// 		LabSubnetName: to.Ptr("{virtualNetworkName}Subnet"),
	// 		LabVirtualNetworkID: to.Ptr("/subscriptions/{subscriptionId}/resourcegroups/resourceGroupName/providers/microsoft.devtestlab/labs/{labName}/virtualnetworks/{virtualNetworkName}"),
	// 		NetworkInterface: &armdevtestlabs.NetworkInterfaceProperties{
	// 		},
	// 		OSType: to.Ptr("Linux"),
	// 		OwnerObjectID: to.Ptr(""),
	// 		OwnerUserPrincipalName: to.Ptr(""),
	// 		ProvisioningState: to.Ptr("Succeeded"),
	// 		Size: to.Ptr("Standard_A2_v2"),
	// 		StorageType: to.Ptr("Standard"),
	// 		UniqueIdentifier: to.Ptr("{uniqueIdentifier}"),
	// 		UserName: to.Ptr("{userName}"),
	// 		VirtualMachineCreationSource: to.Ptr(armdevtestlabs.VirtualMachineCreationSourceFromGalleryImage),
	// 	},
	// }
}
Output:

type VirtualMachinesClientAddDataDiskResponse added in v0.2.0

type VirtualMachinesClientAddDataDiskResponse struct {
}

VirtualMachinesClientAddDataDiskResponse contains the response from method VirtualMachinesClient.BeginAddDataDisk.

type VirtualMachinesClientApplyArtifactsResponse added in v0.2.0

type VirtualMachinesClientApplyArtifactsResponse struct {
}

VirtualMachinesClientApplyArtifactsResponse contains the response from method VirtualMachinesClient.BeginApplyArtifacts.

type VirtualMachinesClientBeginAddDataDiskOptions added in v0.2.0

type VirtualMachinesClientBeginAddDataDiskOptions struct {
	// Resumes the LRO from the provided token.
	ResumeToken string
}

VirtualMachinesClientBeginAddDataDiskOptions contains the optional parameters for the VirtualMachinesClient.BeginAddDataDisk method.

type VirtualMachinesClientBeginApplyArtifactsOptions added in v0.2.0

type VirtualMachinesClientBeginApplyArtifactsOptions struct {
	// Resumes the LRO from the provided token.
	ResumeToken string
}

VirtualMachinesClientBeginApplyArtifactsOptions contains the optional parameters for the VirtualMachinesClient.BeginApplyArtifacts method.

type VirtualMachinesClientBeginClaimOptions added in v0.2.0

type VirtualMachinesClientBeginClaimOptions struct {
	// Resumes the LRO from the provided token.
	ResumeToken string
}

VirtualMachinesClientBeginClaimOptions contains the optional parameters for the VirtualMachinesClient.BeginClaim method.

type VirtualMachinesClientBeginCreateOrUpdateOptions added in v0.2.0

type VirtualMachinesClientBeginCreateOrUpdateOptions struct {
	// Resumes the LRO from the provided token.
	ResumeToken string
}

VirtualMachinesClientBeginCreateOrUpdateOptions contains the optional parameters for the VirtualMachinesClient.BeginCreateOrUpdate method.

type VirtualMachinesClientBeginDeleteOptions added in v0.2.0

type VirtualMachinesClientBeginDeleteOptions struct {
	// Resumes the LRO from the provided token.
	ResumeToken string
}

VirtualMachinesClientBeginDeleteOptions contains the optional parameters for the VirtualMachinesClient.BeginDelete method.

type VirtualMachinesClientBeginDetachDataDiskOptions added in v0.2.0

type VirtualMachinesClientBeginDetachDataDiskOptions struct {
	// Resumes the LRO from the provided token.
	ResumeToken string
}

VirtualMachinesClientBeginDetachDataDiskOptions contains the optional parameters for the VirtualMachinesClient.BeginDetachDataDisk method.

type VirtualMachinesClientBeginRedeployOptions added in v0.2.0

type VirtualMachinesClientBeginRedeployOptions struct {
	// Resumes the LRO from the provided token.
	ResumeToken string
}

VirtualMachinesClientBeginRedeployOptions contains the optional parameters for the VirtualMachinesClient.BeginRedeploy method.

type VirtualMachinesClientBeginResizeOptions added in v0.2.0

type VirtualMachinesClientBeginResizeOptions struct {
	// Resumes the LRO from the provided token.
	ResumeToken string
}

VirtualMachinesClientBeginResizeOptions contains the optional parameters for the VirtualMachinesClient.BeginResize method.

type VirtualMachinesClientBeginRestartOptions added in v0.2.0

type VirtualMachinesClientBeginRestartOptions struct {
	// Resumes the LRO from the provided token.
	ResumeToken string
}

VirtualMachinesClientBeginRestartOptions contains the optional parameters for the VirtualMachinesClient.BeginRestart method.

type VirtualMachinesClientBeginStartOptions added in v0.2.0

type VirtualMachinesClientBeginStartOptions struct {
	// Resumes the LRO from the provided token.
	ResumeToken string
}

VirtualMachinesClientBeginStartOptions contains the optional parameters for the VirtualMachinesClient.BeginStart method.

type VirtualMachinesClientBeginStopOptions added in v0.2.0

type VirtualMachinesClientBeginStopOptions struct {
	// Resumes the LRO from the provided token.
	ResumeToken string
}

VirtualMachinesClientBeginStopOptions contains the optional parameters for the VirtualMachinesClient.BeginStop method.

type VirtualMachinesClientBeginTransferDisksOptions added in v0.2.0

type VirtualMachinesClientBeginTransferDisksOptions struct {
	// Resumes the LRO from the provided token.
	ResumeToken string
}

VirtualMachinesClientBeginTransferDisksOptions contains the optional parameters for the VirtualMachinesClient.BeginTransferDisks method.

type VirtualMachinesClientBeginUnClaimOptions added in v0.2.0

type VirtualMachinesClientBeginUnClaimOptions struct {
	// Resumes the LRO from the provided token.
	ResumeToken string
}

VirtualMachinesClientBeginUnClaimOptions contains the optional parameters for the VirtualMachinesClient.BeginUnClaim method.

type VirtualMachinesClientClaimResponse added in v0.2.0

type VirtualMachinesClientClaimResponse struct {
}

VirtualMachinesClientClaimResponse contains the response from method VirtualMachinesClient.BeginClaim.

type VirtualMachinesClientCreateOrUpdateResponse added in v0.2.0

type VirtualMachinesClientCreateOrUpdateResponse struct {
	// A virtual machine.
	LabVirtualMachine
}

VirtualMachinesClientCreateOrUpdateResponse contains the response from method VirtualMachinesClient.BeginCreateOrUpdate.

type VirtualMachinesClientDeleteResponse added in v0.2.0

type VirtualMachinesClientDeleteResponse struct {
}

VirtualMachinesClientDeleteResponse contains the response from method VirtualMachinesClient.BeginDelete.

type VirtualMachinesClientDetachDataDiskResponse added in v0.2.0

type VirtualMachinesClientDetachDataDiskResponse struct {
}

VirtualMachinesClientDetachDataDiskResponse contains the response from method VirtualMachinesClient.BeginDetachDataDisk.

type VirtualMachinesClientGetOptions added in v0.2.0

type VirtualMachinesClientGetOptions struct {
	// Specify the $expand query. Example: 'properties($expand=artifacts,computeVm,networkInterface,applicableSchedule)'
	Expand *string
}

VirtualMachinesClientGetOptions contains the optional parameters for the VirtualMachinesClient.Get method.

type VirtualMachinesClientGetRdpFileContentsOptions added in v0.2.0

type VirtualMachinesClientGetRdpFileContentsOptions struct {
}

VirtualMachinesClientGetRdpFileContentsOptions contains the optional parameters for the VirtualMachinesClient.GetRdpFileContents method.

type VirtualMachinesClientGetRdpFileContentsResponse added in v0.2.0

type VirtualMachinesClientGetRdpFileContentsResponse struct {
	// Represents a .rdp file
	RdpConnection
}

VirtualMachinesClientGetRdpFileContentsResponse contains the response from method VirtualMachinesClient.GetRdpFileContents.

type VirtualMachinesClientGetResponse added in v0.2.0

type VirtualMachinesClientGetResponse struct {
	// A virtual machine.
	LabVirtualMachine
}

VirtualMachinesClientGetResponse contains the response from method VirtualMachinesClient.Get.

type VirtualMachinesClientListApplicableSchedulesOptions added in v0.2.0

type VirtualMachinesClientListApplicableSchedulesOptions struct {
}

VirtualMachinesClientListApplicableSchedulesOptions contains the optional parameters for the VirtualMachinesClient.ListApplicableSchedules method.

type VirtualMachinesClientListApplicableSchedulesResponse added in v0.2.0

type VirtualMachinesClientListApplicableSchedulesResponse struct {
	// Schedules applicable to a virtual machine. The schedules may have been defined on a VM or on lab level.
	ApplicableSchedule
}

VirtualMachinesClientListApplicableSchedulesResponse contains the response from method VirtualMachinesClient.ListApplicableSchedules.

type VirtualMachinesClientListOptions added in v0.2.0

type VirtualMachinesClientListOptions struct {
	// Specify the $expand query. Example: 'properties($expand=artifacts,computeVm,networkInterface,applicableSchedule)'
	Expand *string

	// The filter to apply to the operation. Example: '$filter=contains(name,'myName')
	Filter *string

	// The ordering expression for the results, using OData notation. Example: '$orderby=name desc'
	Orderby *string

	// The maximum number of resources to return from the operation. Example: '$top=10'
	Top *int32
}

VirtualMachinesClientListOptions contains the optional parameters for the VirtualMachinesClient.NewListPager method.

type VirtualMachinesClientListResponse added in v0.2.0

type VirtualMachinesClientListResponse struct {
	// The response of a list operation.
	LabVirtualMachineList
}

VirtualMachinesClientListResponse contains the response from method VirtualMachinesClient.NewListPager.

type VirtualMachinesClientRedeployResponse added in v0.2.0

type VirtualMachinesClientRedeployResponse struct {
}

VirtualMachinesClientRedeployResponse contains the response from method VirtualMachinesClient.BeginRedeploy.

type VirtualMachinesClientResizeResponse added in v0.2.0

type VirtualMachinesClientResizeResponse struct {
}

VirtualMachinesClientResizeResponse contains the response from method VirtualMachinesClient.BeginResize.

type VirtualMachinesClientRestartResponse added in v0.2.0

type VirtualMachinesClientRestartResponse struct {
}

VirtualMachinesClientRestartResponse contains the response from method VirtualMachinesClient.BeginRestart.

type VirtualMachinesClientStartResponse added in v0.2.0

type VirtualMachinesClientStartResponse struct {
}

VirtualMachinesClientStartResponse contains the response from method VirtualMachinesClient.BeginStart.

type VirtualMachinesClientStopResponse added in v0.2.0

type VirtualMachinesClientStopResponse struct {
}

VirtualMachinesClientStopResponse contains the response from method VirtualMachinesClient.BeginStop.

type VirtualMachinesClientTransferDisksResponse added in v0.2.0

type VirtualMachinesClientTransferDisksResponse struct {
}

VirtualMachinesClientTransferDisksResponse contains the response from method VirtualMachinesClient.BeginTransferDisks.

type VirtualMachinesClientUnClaimResponse added in v0.2.0

type VirtualMachinesClientUnClaimResponse struct {
}

VirtualMachinesClientUnClaimResponse contains the response from method VirtualMachinesClient.BeginUnClaim.

type VirtualMachinesClientUpdateOptions added in v0.2.0

type VirtualMachinesClientUpdateOptions struct {
}

VirtualMachinesClientUpdateOptions contains the optional parameters for the VirtualMachinesClient.Update method.

type VirtualMachinesClientUpdateResponse added in v0.2.0

type VirtualMachinesClientUpdateResponse struct {
	// A virtual machine.
	LabVirtualMachine
}

VirtualMachinesClientUpdateResponse contains the response from method VirtualMachinesClient.Update.

type VirtualNetwork

type VirtualNetwork struct {
	// The location of the resource.
	Location *string

	// The properties of the resource.
	Properties *VirtualNetworkProperties

	// The tags of the resource.
	Tags map[string]*string

	// READ-ONLY; The identifier of the resource.
	ID *string

	// READ-ONLY; The name of the resource.
	Name *string

	// READ-ONLY; The type of the resource.
	Type *string
}

VirtualNetwork - A virtual network.

func (VirtualNetwork) MarshalJSON

func (v VirtualNetwork) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.Marshaller interface for type VirtualNetwork.

func (*VirtualNetwork) UnmarshalJSON added in v1.1.0

func (v *VirtualNetwork) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the json.Unmarshaller interface for type VirtualNetwork.

type VirtualNetworkFragment

type VirtualNetworkFragment struct {
	// The tags of the resource.
	Tags map[string]*string
}

VirtualNetworkFragment - A virtual network.

func (VirtualNetworkFragment) MarshalJSON added in v0.2.0

func (v VirtualNetworkFragment) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.Marshaller interface for type VirtualNetworkFragment.

func (*VirtualNetworkFragment) UnmarshalJSON added in v1.1.0

func (v *VirtualNetworkFragment) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the json.Unmarshaller interface for type VirtualNetworkFragment.

type VirtualNetworkList

type VirtualNetworkList struct {
	// Link for next set of results.
	NextLink *string

	// Results of the list operation.
	Value []*VirtualNetwork
}

VirtualNetworkList - The response of a list operation.

func (VirtualNetworkList) MarshalJSON

func (v VirtualNetworkList) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.Marshaller interface for type VirtualNetworkList.

func (*VirtualNetworkList) UnmarshalJSON added in v1.1.0

func (v *VirtualNetworkList) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the json.Unmarshaller interface for type VirtualNetworkList.

type VirtualNetworkProperties

type VirtualNetworkProperties struct {
	// The allowed subnets of the virtual network.
	AllowedSubnets []*Subnet

	// The description of the virtual network.
	Description *string

	// The Microsoft.Network resource identifier of the virtual network.
	ExternalProviderResourceID *string

	// The subnet overrides of the virtual network.
	SubnetOverrides []*SubnetOverride

	// READ-ONLY; The creation date of the virtual network.
	CreatedDate *time.Time

	// READ-ONLY; The external subnet properties.
	ExternalSubnets []*ExternalSubnet

	// READ-ONLY; The provisioning status of the resource.
	ProvisioningState *string

	// READ-ONLY; The unique immutable identifier of a resource (Guid).
	UniqueIdentifier *string
}

VirtualNetworkProperties - Properties of a virtual network.

func (VirtualNetworkProperties) MarshalJSON

func (v VirtualNetworkProperties) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.Marshaller interface for type VirtualNetworkProperties.

func (*VirtualNetworkProperties) UnmarshalJSON

func (v *VirtualNetworkProperties) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the json.Unmarshaller interface for type VirtualNetworkProperties.

type VirtualNetworksClient

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

VirtualNetworksClient contains the methods for the VirtualNetworks group. Don't use this type directly, use NewVirtualNetworksClient() instead.

func NewVirtualNetworksClient

func NewVirtualNetworksClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*VirtualNetworksClient, error)

NewVirtualNetworksClient creates a new instance of VirtualNetworksClient with the specified values.

  • subscriptionID - The subscription ID.
  • credential - used to authorize requests. Usually a credential from azidentity.
  • options - pass nil to accept the default values.

func (*VirtualNetworksClient) BeginCreateOrUpdate

func (client *VirtualNetworksClient) BeginCreateOrUpdate(ctx context.Context, resourceGroupName string, labName string, name string, virtualNetwork VirtualNetwork, options *VirtualNetworksClientBeginCreateOrUpdateOptions) (*runtime.Poller[VirtualNetworksClientCreateOrUpdateResponse], error)

BeginCreateOrUpdate - Create or replace an existing virtual network. This operation can take a while to complete. If the operation fails it returns an *azcore.ResponseError type.

Generated from API version 2018-09-15

  • resourceGroupName - The name of the resource group.
  • labName - The name of the lab.
  • name - The name of the virtual network.
  • virtualNetwork - A virtual network.
  • options - VirtualNetworksClientBeginCreateOrUpdateOptions contains the optional parameters for the VirtualNetworksClient.BeginCreateOrUpdate method.
Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/d55b8005f05b040b852c15e74a0f3e36494a15e1/specification/devtestlabs/resource-manager/Microsoft.DevTestLab/stable/2018-09-15/examples/VirtualNetworks_CreateOrUpdate.json

package main

import (
	"context"
	"log"

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

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armdevtestlabs.NewClientFactory("<subscription-id>", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	poller, err := clientFactory.NewVirtualNetworksClient().BeginCreateOrUpdate(ctx, "resourceGroupName", "{labName}", "{virtualNetworkName}", armdevtestlabs.VirtualNetwork{
		Location: to.Ptr("{location}"),
		Tags: map[string]*string{
			"tagName1": to.Ptr("tagValue1"),
		},
	}, 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.VirtualNetwork = armdevtestlabs.VirtualNetwork{
	// 	Name: to.Ptr("{virtualNetworkName}"),
	// 	Type: to.Ptr("Microsoft.DevTestLab/labs/virtualNetworks"),
	// 	ID: to.Ptr("/subscriptions/{subscriptionId}/resourcegroups/resourceGroupName/providers/microsoft.devtestlab/labs/{labName}/virtualnetworks/{virtualNetworkName}"),
	// 	Tags: map[string]*string{
	// 		"tagName1": to.Ptr("tagValue1"),
	// 	},
	// 	Properties: &armdevtestlabs.VirtualNetworkProperties{
	// 		CreatedDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2018-10-01T20:01:44.600Z"); return t}()),
	// 		ProvisioningState: to.Ptr("Succeeded"),
	// 		UniqueIdentifier: to.Ptr("{uniqueIdentifier}"),
	// 	},
	// }
}
Output:

func (*VirtualNetworksClient) BeginDelete

BeginDelete - Delete virtual network. This operation can take a while to complete. If the operation fails it returns an *azcore.ResponseError type.

Generated from API version 2018-09-15

  • resourceGroupName - The name of the resource group.
  • labName - The name of the lab.
  • name - The name of the virtual network.
  • options - VirtualNetworksClientBeginDeleteOptions contains the optional parameters for the VirtualNetworksClient.BeginDelete method.
Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/d55b8005f05b040b852c15e74a0f3e36494a15e1/specification/devtestlabs/resource-manager/Microsoft.DevTestLab/stable/2018-09-15/examples/VirtualNetworks_Delete.json

package main

import (
	"context"
	"log"

	"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
	"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/devtestlabs/armdevtestlabs"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armdevtestlabs.NewClientFactory("<subscription-id>", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	poller, err := clientFactory.NewVirtualNetworksClient().BeginDelete(ctx, "resourceGroupName", "{labName}", "{virtualNetworkName}", 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 (*VirtualNetworksClient) Get

func (client *VirtualNetworksClient) Get(ctx context.Context, resourceGroupName string, labName string, name string, options *VirtualNetworksClientGetOptions) (VirtualNetworksClientGetResponse, error)

Get - Get virtual network. If the operation fails it returns an *azcore.ResponseError type.

Generated from API version 2018-09-15

  • resourceGroupName - The name of the resource group.
  • labName - The name of the lab.
  • name - The name of the virtual network.
  • options - VirtualNetworksClientGetOptions contains the optional parameters for the VirtualNetworksClient.Get method.
Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/d55b8005f05b040b852c15e74a0f3e36494a15e1/specification/devtestlabs/resource-manager/Microsoft.DevTestLab/stable/2018-09-15/examples/VirtualNetworks_Get.json

package main

import (
	"context"
	"log"

	"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
	"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/devtestlabs/armdevtestlabs"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armdevtestlabs.NewClientFactory("<subscription-id>", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	res, err := clientFactory.NewVirtualNetworksClient().Get(ctx, "resourceGroupName", "{labName}", "{virtualNetworkName}", &armdevtestlabs.VirtualNetworksClientGetOptions{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.VirtualNetwork = armdevtestlabs.VirtualNetwork{
	// 	Name: to.Ptr("{virtualNetworkName}"),
	// 	Type: to.Ptr("Microsoft.DevTestLab/labs/virtualNetworks"),
	// 	ID: to.Ptr("/subscriptions/{subscriptionId}/resourcegroups/resourceGroupName/providers/microsoft.devtestlab/labs/{labName}/virtualnetworks/{virtualNetworkName}"),
	// 	Tags: map[string]*string{
	// 		"tagName1": to.Ptr("tagValue1"),
	// 	},
	// 	Properties: &armdevtestlabs.VirtualNetworkProperties{
	// 		AllowedSubnets: []*armdevtestlabs.Subnet{
	// 			{
	// 				AllowPublicIP: to.Ptr(armdevtestlabs.UsagePermissionTypeAllow),
	// 				LabSubnetName: to.Ptr("{virtualNetworkName}Subnet"),
	// 				ResourceID: to.Ptr("/subscriptions/{subscriptionId}/resourceGroups/resourceGroupName/providers/Microsoft.Network/virtualNetworks/{virtualNetworkName}/subnets/{virtualNetworkName}Subnet"),
	// 		}},
	// 		CreatedDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2018-10-01T20:01:44.600Z"); return t}()),
	// 		ExternalProviderResourceID: to.Ptr("/subscriptions/{subscriptionId}/resourceGroups/resourceGroupName/providers/Microsoft.Network/virtualNetworks/{virtualNetworkName}"),
	// 		ProvisioningState: to.Ptr("Succeeded"),
	// 		SubnetOverrides: []*armdevtestlabs.SubnetOverride{
	// 			{
	// 				LabSubnetName: to.Ptr("{virtualNetworkName}Subnet"),
	// 				ResourceID: to.Ptr("/subscriptions/{subscriptionId}/resourceGroups/resourceGroupName/providers/Microsoft.Network/virtualNetworks/{virtualNetworkName}/subnets/{virtualNetworkName}Subnet"),
	// 				SharedPublicIPAddressConfiguration: &armdevtestlabs.SubnetSharedPublicIPAddressConfiguration{
	// 					AllowedPorts: []*armdevtestlabs.Port{
	// 						{
	// 							BackendPort: to.Ptr[int32](3389),
	// 							TransportProtocol: to.Ptr(armdevtestlabs.TransportProtocolTCP),
	// 						},
	// 						{
	// 							BackendPort: to.Ptr[int32](22),
	// 							TransportProtocol: to.Ptr(armdevtestlabs.TransportProtocolTCP),
	// 					}},
	// 				},
	// 				UseInVMCreationPermission: to.Ptr(armdevtestlabs.UsagePermissionTypeAllow),
	// 				UsePublicIPAddressPermission: to.Ptr(armdevtestlabs.UsagePermissionTypeAllow),
	// 		}},
	// 		UniqueIdentifier: to.Ptr("{uniqueIdentifier}"),
	// 	},
	// }
}
Output:

func (*VirtualNetworksClient) NewListPager added in v0.4.0

func (client *VirtualNetworksClient) NewListPager(resourceGroupName string, labName string, options *VirtualNetworksClientListOptions) *runtime.Pager[VirtualNetworksClientListResponse]

NewListPager - List virtual networks in a given lab.

Generated from API version 2018-09-15

  • resourceGroupName - The name of the resource group.
  • labName - The name of the lab.
  • options - VirtualNetworksClientListOptions contains the optional parameters for the VirtualNetworksClient.NewListPager method.
Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/d55b8005f05b040b852c15e74a0f3e36494a15e1/specification/devtestlabs/resource-manager/Microsoft.DevTestLab/stable/2018-09-15/examples/VirtualNetworks_List.json

package main

import (
	"context"
	"log"

	"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
	"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/devtestlabs/armdevtestlabs"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armdevtestlabs.NewClientFactory("<subscription-id>", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	pager := clientFactory.NewVirtualNetworksClient().NewListPager("resourceGroupName", "{labName}", &armdevtestlabs.VirtualNetworksClientListOptions{Expand: nil,
		Filter:  nil,
		Top:     nil,
		Orderby: 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.VirtualNetworkList = armdevtestlabs.VirtualNetworkList{
		// 	Value: []*armdevtestlabs.VirtualNetwork{
		// 		{
		// 			Name: to.Ptr("{virtualNetworkName}"),
		// 			Type: to.Ptr("Microsoft.DevTestLab/labs/virtualNetworks"),
		// 			ID: to.Ptr("/subscriptions/{subscriptionId}/resourcegroups/resourceGroupName/providers/microsoft.devtestlab/labs/{labName}/virtualnetworks/{virtualNetworkName}"),
		// 			Tags: map[string]*string{
		// 				"tagName1": to.Ptr("tagValue1"),
		// 			},
		// 			Properties: &armdevtestlabs.VirtualNetworkProperties{
		// 				AllowedSubnets: []*armdevtestlabs.Subnet{
		// 					{
		// 						AllowPublicIP: to.Ptr(armdevtestlabs.UsagePermissionTypeAllow),
		// 						LabSubnetName: to.Ptr("{virtualNetworkName}Subnet"),
		// 						ResourceID: to.Ptr("/subscriptions/{subscriptionId}/resourceGroups/resourceGroupName/providers/Microsoft.Network/virtualNetworks/{virtualNetworkName}/subnets/{virtualNetworkName}Subnet"),
		// 				}},
		// 				CreatedDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2018-10-01T20:01:44.600Z"); return t}()),
		// 				ExternalProviderResourceID: to.Ptr("/subscriptions/{subscriptionId}/resourceGroups/resourceGroupName/providers/Microsoft.Network/virtualNetworks/{virtualNetworkName}"),
		// 				ProvisioningState: to.Ptr("Succeeded"),
		// 				SubnetOverrides: []*armdevtestlabs.SubnetOverride{
		// 					{
		// 						LabSubnetName: to.Ptr("{virtualNetworkName}Subnet"),
		// 						ResourceID: to.Ptr("/subscriptions/{subscriptionId}/resourceGroups/resourceGroupName/providers/Microsoft.Network/virtualNetworks/{virtualNetworkName}/subnets/{virtualNetworkName}Subnet"),
		// 						SharedPublicIPAddressConfiguration: &armdevtestlabs.SubnetSharedPublicIPAddressConfiguration{
		// 							AllowedPorts: []*armdevtestlabs.Port{
		// 								{
		// 									BackendPort: to.Ptr[int32](3389),
		// 									TransportProtocol: to.Ptr(armdevtestlabs.TransportProtocolTCP),
		// 								},
		// 								{
		// 									BackendPort: to.Ptr[int32](22),
		// 									TransportProtocol: to.Ptr(armdevtestlabs.TransportProtocolTCP),
		// 							}},
		// 						},
		// 						UseInVMCreationPermission: to.Ptr(armdevtestlabs.UsagePermissionTypeAllow),
		// 						UsePublicIPAddressPermission: to.Ptr(armdevtestlabs.UsagePermissionTypeAllow),
		// 				}},
		// 				UniqueIdentifier: to.Ptr("{uniqueIdentifier}"),
		// 			},
		// 	}},
		// }
	}
}
Output:

func (*VirtualNetworksClient) Update

func (client *VirtualNetworksClient) Update(ctx context.Context, resourceGroupName string, labName string, name string, virtualNetwork VirtualNetworkFragment, options *VirtualNetworksClientUpdateOptions) (VirtualNetworksClientUpdateResponse, error)

Update - Allows modifying tags of virtual networks. All other properties will be ignored. If the operation fails it returns an *azcore.ResponseError type.

Generated from API version 2018-09-15

  • resourceGroupName - The name of the resource group.
  • labName - The name of the lab.
  • name - The name of the virtual network.
  • virtualNetwork - A virtual network.
  • options - VirtualNetworksClientUpdateOptions contains the optional parameters for the VirtualNetworksClient.Update method.
Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/d55b8005f05b040b852c15e74a0f3e36494a15e1/specification/devtestlabs/resource-manager/Microsoft.DevTestLab/stable/2018-09-15/examples/VirtualNetworks_Update.json

package main

import (
	"context"
	"log"

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

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armdevtestlabs.NewClientFactory("<subscription-id>", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	res, err := clientFactory.NewVirtualNetworksClient().Update(ctx, "resourceGroupName", "{labName}", "{virtualNetworkName}", armdevtestlabs.VirtualNetworkFragment{
		Tags: map[string]*string{
			"tagName1": to.Ptr("tagValue1"),
		},
	}, 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.VirtualNetwork = armdevtestlabs.VirtualNetwork{
	// 	Name: to.Ptr("{virtualNetworkName}"),
	// 	Type: to.Ptr("Microsoft.DevTestLab/labs/virtualNetworks"),
	// 	ID: to.Ptr("/subscriptions/{subscriptionId}/resourcegroups/resourceGroupName/providers/microsoft.devtestlab/labs/{labName}/virtualnetworks/{virtualNetworkName}"),
	// 	Tags: map[string]*string{
	// 		"tagName1": to.Ptr("tagValue1"),
	// 	},
	// 	Properties: &armdevtestlabs.VirtualNetworkProperties{
	// 		CreatedDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2018-10-01T20:01:44.600Z"); return t}()),
	// 		ExternalProviderResourceID: to.Ptr("/subscriptions/{subscriptionId}/resourceGroups/resourceGroupName/providers/Microsoft.Network/virtualNetworks/{virtualNetworkName}"),
	// 		ProvisioningState: to.Ptr("Succeeded"),
	// 		SubnetOverrides: []*armdevtestlabs.SubnetOverride{
	// 			{
	// 				LabSubnetName: to.Ptr("{virtualNetworkName}Subnet"),
	// 				ResourceID: to.Ptr("/subscriptions/{subscriptionId}/resourceGroups/resourceGroupName/providers/Microsoft.Network/virtualNetworks/{virtualNetworkName}/subnets/{virtualNetworkName}Subnet"),
	// 				SharedPublicIPAddressConfiguration: &armdevtestlabs.SubnetSharedPublicIPAddressConfiguration{
	// 					AllowedPorts: []*armdevtestlabs.Port{
	// 						{
	// 							BackendPort: to.Ptr[int32](3389),
	// 							TransportProtocol: to.Ptr(armdevtestlabs.TransportProtocolTCP),
	// 						},
	// 						{
	// 							BackendPort: to.Ptr[int32](22),
	// 							TransportProtocol: to.Ptr(armdevtestlabs.TransportProtocolTCP),
	// 					}},
	// 				},
	// 				UseInVMCreationPermission: to.Ptr(armdevtestlabs.UsagePermissionTypeAllow),
	// 				UsePublicIPAddressPermission: to.Ptr(armdevtestlabs.UsagePermissionTypeAllow),
	// 		}},
	// 		UniqueIdentifier: to.Ptr("{uniqueIdentifier}"),
	// 	},
	// }
}
Output:

type VirtualNetworksClientBeginCreateOrUpdateOptions added in v0.2.0

type VirtualNetworksClientBeginCreateOrUpdateOptions struct {
	// Resumes the LRO from the provided token.
	ResumeToken string
}

VirtualNetworksClientBeginCreateOrUpdateOptions contains the optional parameters for the VirtualNetworksClient.BeginCreateOrUpdate method.

type VirtualNetworksClientBeginDeleteOptions added in v0.2.0

type VirtualNetworksClientBeginDeleteOptions struct {
	// Resumes the LRO from the provided token.
	ResumeToken string
}

VirtualNetworksClientBeginDeleteOptions contains the optional parameters for the VirtualNetworksClient.BeginDelete method.

type VirtualNetworksClientCreateOrUpdateResponse added in v0.2.0

type VirtualNetworksClientCreateOrUpdateResponse struct {
	// A virtual network.
	VirtualNetwork
}

VirtualNetworksClientCreateOrUpdateResponse contains the response from method VirtualNetworksClient.BeginCreateOrUpdate.

type VirtualNetworksClientDeleteResponse added in v0.2.0

type VirtualNetworksClientDeleteResponse struct {
}

VirtualNetworksClientDeleteResponse contains the response from method VirtualNetworksClient.BeginDelete.

type VirtualNetworksClientGetOptions added in v0.2.0

type VirtualNetworksClientGetOptions struct {
	// Specify the $expand query. Example: 'properties($expand=externalSubnets)'
	Expand *string
}

VirtualNetworksClientGetOptions contains the optional parameters for the VirtualNetworksClient.Get method.

type VirtualNetworksClientGetResponse added in v0.2.0

type VirtualNetworksClientGetResponse struct {
	// A virtual network.
	VirtualNetwork
}

VirtualNetworksClientGetResponse contains the response from method VirtualNetworksClient.Get.

type VirtualNetworksClientListOptions added in v0.2.0

type VirtualNetworksClientListOptions struct {
	// Specify the $expand query. Example: 'properties($expand=externalSubnets)'
	Expand *string

	// The filter to apply to the operation. Example: '$filter=contains(name,'myName')
	Filter *string

	// The ordering expression for the results, using OData notation. Example: '$orderby=name desc'
	Orderby *string

	// The maximum number of resources to return from the operation. Example: '$top=10'
	Top *int32
}

VirtualNetworksClientListOptions contains the optional parameters for the VirtualNetworksClient.NewListPager method.

type VirtualNetworksClientListResponse added in v0.2.0

type VirtualNetworksClientListResponse struct {
	// The response of a list operation.
	VirtualNetworkList
}

VirtualNetworksClientListResponse contains the response from method VirtualNetworksClient.NewListPager.

type VirtualNetworksClientUpdateOptions added in v0.2.0

type VirtualNetworksClientUpdateOptions struct {
}

VirtualNetworksClientUpdateOptions contains the optional parameters for the VirtualNetworksClient.Update method.

type VirtualNetworksClientUpdateResponse added in v0.2.0

type VirtualNetworksClientUpdateResponse struct {
	// A virtual network.
	VirtualNetwork
}

VirtualNetworksClientUpdateResponse contains the response from method VirtualNetworksClient.Update.

type WeekDetails

type WeekDetails struct {
	// The time of the day the schedule will occur.
	Time *string

	// The days of the week for which the schedule is set (e.g. Sunday, Monday, Tuesday, etc.).
	Weekdays []*string
}

WeekDetails - Properties of a weekly schedule.

func (WeekDetails) MarshalJSON

func (w WeekDetails) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.Marshaller interface for type WeekDetails.

func (*WeekDetails) UnmarshalJSON added in v1.1.0

func (w *WeekDetails) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the json.Unmarshaller interface for type WeekDetails.

type WindowsOsInfo

type WindowsOsInfo struct {
	// The state of the Windows OS (i.e. NonSysprepped, SysprepRequested, SysprepApplied).
	WindowsOsState *WindowsOsState
}

WindowsOsInfo - Information about a Windows OS.

func (WindowsOsInfo) MarshalJSON added in v1.1.0

func (w WindowsOsInfo) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.Marshaller interface for type WindowsOsInfo.

func (*WindowsOsInfo) UnmarshalJSON added in v1.1.0

func (w *WindowsOsInfo) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the json.Unmarshaller interface for type WindowsOsInfo.

type WindowsOsState

type WindowsOsState string

WindowsOsState - The state of the Windows OS (i.e. NonSysprepped, SysprepRequested, SysprepApplied).

const (
	WindowsOsStateNonSysprepped    WindowsOsState = "NonSysprepped"
	WindowsOsStateSysprepApplied   WindowsOsState = "SysprepApplied"
	WindowsOsStateSysprepRequested WindowsOsState = "SysprepRequested"
)

func PossibleWindowsOsStateValues

func PossibleWindowsOsStateValues() []WindowsOsState

PossibleWindowsOsStateValues returns the possible values for the WindowsOsState const type.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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