armscvmm

package module
v0.4.0 Latest Latest
Warning

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

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

README

Azure Scvmm Module for Go

PkgGoDev

The armscvmm module provides operations for working with Azure Scvmm.

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 Scvmm module:

go get github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/scvmm/armscvmm

Authorization

When creating a client, you will need to provide a credential for authenticating with Azure Scvmm. 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 Scvmm 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 := armscvmm.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 := armscvmm.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.NewCloudsClient()

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 Scvmm 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 AllocationMethod

type AllocationMethod string

AllocationMethod - Allocation method.

const (
	AllocationMethodDynamic AllocationMethod = "Dynamic"
	AllocationMethodStatic  AllocationMethod = "Static"
)

func PossibleAllocationMethodValues

func PossibleAllocationMethodValues() []AllocationMethod

PossibleAllocationMethodValues returns the possible values for the AllocationMethod const type.

type AvailabilitySet

type AvailabilitySet struct {
	// The extended location.
	ExtendedLocation *ExtendedLocation

	// Gets or sets the location.
	Location *string

	// Resource properties.
	Properties *AvailabilitySetProperties

	// Resource tags
	Tags map[string]*string

	// READ-ONLY; Resource Id
	ID *string

	// READ-ONLY; Resource Name
	Name *string

	// READ-ONLY; The system data.
	SystemData *SystemData

	// READ-ONLY; Resource Type
	Type *string
}

AvailabilitySet - The AvailabilitySets resource definition.

func (AvailabilitySet) MarshalJSON

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

MarshalJSON implements the json.Marshaller interface for type AvailabilitySet.

func (*AvailabilitySet) UnmarshalJSON added in v0.3.0

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

UnmarshalJSON implements the json.Unmarshaller interface for type AvailabilitySet.

type AvailabilitySetListItem

type AvailabilitySetListItem struct {
	// Gets the ARM Id of the microsoft.scvmm/availabilitySets resource.
	ID *string

	// Gets or sets the name of the availability set.
	Name *string
}

AvailabilitySetListItem - Availability Set model

func (AvailabilitySetListItem) MarshalJSON added in v0.3.0

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

MarshalJSON implements the json.Marshaller interface for type AvailabilitySetListItem.

func (*AvailabilitySetListItem) UnmarshalJSON added in v0.3.0

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

UnmarshalJSON implements the json.Unmarshaller interface for type AvailabilitySetListItem.

type AvailabilitySetListResult

type AvailabilitySetListResult struct {
	// Url to follow for getting next page of resources.
	NextLink *string

	// List of AvailabilitySets.
	Value []*AvailabilitySet
}

AvailabilitySetListResult - List of AvailabilitySets.

func (AvailabilitySetListResult) MarshalJSON

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

MarshalJSON implements the json.Marshaller interface for type AvailabilitySetListResult.

func (*AvailabilitySetListResult) UnmarshalJSON added in v0.3.0

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

UnmarshalJSON implements the json.Unmarshaller interface for type AvailabilitySetListResult.

type AvailabilitySetProperties

type AvailabilitySetProperties struct {
	// Name of the availability set.
	AvailabilitySetName *string

	// ARM Id of the vmmServer resource in which this resource resides.
	VmmServerID *string

	// READ-ONLY; Gets or sets the provisioning state.
	ProvisioningState *string
}

AvailabilitySetProperties - Defines the resource properties.

func (AvailabilitySetProperties) MarshalJSON added in v0.3.0

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

MarshalJSON implements the json.Marshaller interface for type AvailabilitySetProperties.

func (*AvailabilitySetProperties) UnmarshalJSON added in v0.3.0

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

UnmarshalJSON implements the json.Unmarshaller interface for type AvailabilitySetProperties.

type AvailabilitySetsClient

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

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

func NewAvailabilitySetsClient

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

NewAvailabilitySetsClient creates a new instance of AvailabilitySetsClient with the specified values.

  • subscriptionID - The Azure subscription ID. This is a GUID-formatted string (e.g. 00000000-0000-0000-0000-000000000000).
  • credential - used to authorize requests. Usually a credential from azidentity.
  • options - pass nil to accept the default values.

func (*AvailabilitySetsClient) BeginCreateOrUpdate

BeginCreateOrUpdate - Onboards the ScVmm availability set as an Azure resource. If the operation fails it returns an *azcore.ResponseError type.

Generated from API version 2020-06-05-preview

  • resourceGroupName - The name of the resource group.
  • availabilitySetName - Name of the AvailabilitySet.
  • body - Request payload.
  • options - AvailabilitySetsClientBeginCreateOrUpdateOptions contains the optional parameters for the AvailabilitySetsClient.BeginCreateOrUpdate method.
Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/d55b8005f05b040b852c15e74a0f3e36494a15e1/specification/scvmm/resource-manager/Microsoft.ScVmm/preview/2020-06-05-preview/examples/CreateAvailabilitySet.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/scvmm/armscvmm"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armscvmm.NewClientFactory("<subscription-id>", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	poller, err := clientFactory.NewAvailabilitySetsClient().BeginCreateOrUpdate(ctx, "testrg", "HRAvailabilitySet", armscvmm.AvailabilitySet{
		ExtendedLocation: &armscvmm.ExtendedLocation{
			Name: to.Ptr("/subscriptions/a5015e1c-867f-4533-8541-85cd470d0cfb/resourceGroups/demoRG/providers/Microsoft.Arc/customLocations/contoso"),
			Type: to.Ptr("customLocation"),
		},
		Location: to.Ptr("East US"),
		Properties: &armscvmm.AvailabilitySetProperties{
			AvailabilitySetName: to.Ptr("hr-avset"),
			VmmServerID:         to.Ptr("/subscriptions/fd3c3665-1729-4b7b-9a38-238e83b0f98b/resourceGroups/testrg/providers/Microsoft.ScVmm/VMMServers/ContosoVMMServer"),
		},
	}, 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.AvailabilitySet = armscvmm.AvailabilitySet{
	// 	Name: to.Ptr("HRAvailabilitySet"),
	// 	Type: to.Ptr("Microsoft.ScVmm/AvailabilitySets"),
	// 	ExtendedLocation: &armscvmm.ExtendedLocation{
	// 		Name: to.Ptr("/subscriptions/a5015e1c-867f-4533-8541-85cd470d0cfb/resourceGroups/demoRG/providers/Microsoft.Arc/customLocations/contoso"),
	// 		Type: to.Ptr("customLocation"),
	// 	},
	// 	ID: to.Ptr("/subscriptions/fd3c3665-1729-4b7b-9a38-238e83b0f98b/resourceGroups/testrg/providers/Microsoft.ScVmm/AvailabilitySets/HRAvailabilitySet"),
	// 	Location: to.Ptr("East US"),
	// 	Properties: &armscvmm.AvailabilitySetProperties{
	// 		AvailabilitySetName: to.Ptr("hr-avset"),
	// 		ProvisioningState: to.Ptr("Succeeded"),
	// 		VmmServerID: to.Ptr("/subscriptions/fd3c3665-1729-4b7b-9a38-238e83b0f98b/resourceGroups/testrg/providers/Microsoft.ScVmm/VMMServers/ContosoVMMServer"),
	// 	},
	// }
}
Output:

func (*AvailabilitySetsClient) BeginDelete

func (client *AvailabilitySetsClient) BeginDelete(ctx context.Context, resourceGroupName string, availabilitySetName string, options *AvailabilitySetsClientBeginDeleteOptions) (*runtime.Poller[AvailabilitySetsClientDeleteResponse], error)

BeginDelete - Deregisters the ScVmm availability set from Azure. If the operation fails it returns an *azcore.ResponseError type.

Generated from API version 2020-06-05-preview

  • resourceGroupName - The name of the resource group.
  • availabilitySetName - Name of the AvailabilitySet.
  • options - AvailabilitySetsClientBeginDeleteOptions contains the optional parameters for the AvailabilitySetsClient.BeginDelete method.
Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/d55b8005f05b040b852c15e74a0f3e36494a15e1/specification/scvmm/resource-manager/Microsoft.ScVmm/preview/2020-06-05-preview/examples/DeleteAvailabilitySet.json

package main

import (
	"context"
	"log"

	"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
	"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/scvmm/armscvmm"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armscvmm.NewClientFactory("<subscription-id>", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	poller, err := clientFactory.NewAvailabilitySetsClient().BeginDelete(ctx, "testrg", "HRAvailabilitySet", &armscvmm.AvailabilitySetsClientBeginDeleteOptions{Force: 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 (*AvailabilitySetsClient) BeginUpdate

func (client *AvailabilitySetsClient) BeginUpdate(ctx context.Context, resourceGroupName string, availabilitySetName string, body ResourcePatch, options *AvailabilitySetsClientBeginUpdateOptions) (*runtime.Poller[AvailabilitySetsClientUpdateResponse], error)

BeginUpdate - Updates the AvailabilitySets resource. If the operation fails it returns an *azcore.ResponseError type.

Generated from API version 2020-06-05-preview

  • resourceGroupName - The name of the resource group.
  • availabilitySetName - Name of the AvailabilitySet.
  • body - AvailabilitySets patch payload.
  • options - AvailabilitySetsClientBeginUpdateOptions contains the optional parameters for the AvailabilitySetsClient.BeginUpdate method.
Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/d55b8005f05b040b852c15e74a0f3e36494a15e1/specification/scvmm/resource-manager/Microsoft.ScVmm/preview/2020-06-05-preview/examples/UpdateAvailabilitySet.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/scvmm/armscvmm"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armscvmm.NewClientFactory("<subscription-id>", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	poller, err := clientFactory.NewAvailabilitySetsClient().BeginUpdate(ctx, "testrg", "HRAvailabilitySet", armscvmm.ResourcePatch{
		Tags: map[string]*string{
			"tag1": to.Ptr("value1"),
			"tag2": to.Ptr("value2"),
		},
	}, 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.AvailabilitySet = armscvmm.AvailabilitySet{
	// 	Name: to.Ptr("HRAvailabilitySet"),
	// 	Type: to.Ptr("Microsoft.ScVmm/AvailabilitySets"),
	// 	ExtendedLocation: &armscvmm.ExtendedLocation{
	// 		Name: to.Ptr("/subscriptions/a5015e1c-867f-4533-8541-85cd470d0cfb/resourceGroups/demoRG/providers/Microsoft.Arc/customLocations/contoso"),
	// 		Type: to.Ptr("customLocation"),
	// 	},
	// 	ID: to.Ptr("/subscriptions/fd3c3665-1729-4b7b-9a38-238e83b0f98b/resourceGroups/testrg/providers/Microsoft.ScVmm/AvailabilitySets/HRAvailabilitySet"),
	// 	Location: to.Ptr("East US"),
	// 	Properties: &armscvmm.AvailabilitySetProperties{
	// 		AvailabilitySetName: to.Ptr("hr-avset"),
	// 		ProvisioningState: to.Ptr("Succeeded"),
	// 		VmmServerID: to.Ptr("/subscriptions/fd3c3665-1729-4b7b-9a38-238e83b0f98b/resourceGroups/testrg/providers/Microsoft.ScVmm/VMMServers/ContosoVMMServer"),
	// 	},
	// 	Tags: map[string]*string{
	// 		"tag1": to.Ptr("value1"),
	// 		"tag2": to.Ptr("value2"),
	// 	},
	// }
}
Output:

func (*AvailabilitySetsClient) Get

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

Get - Implements AvailabilitySet GET method. If the operation fails it returns an *azcore.ResponseError type.

Generated from API version 2020-06-05-preview

  • resourceGroupName - The name of the resource group.
  • availabilitySetName - Name of the AvailabilitySet.
  • options - AvailabilitySetsClientGetOptions contains the optional parameters for the AvailabilitySetsClient.Get method.
Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/d55b8005f05b040b852c15e74a0f3e36494a15e1/specification/scvmm/resource-manager/Microsoft.ScVmm/preview/2020-06-05-preview/examples/GetAvailabilitySet.json

package main

import (
	"context"
	"log"

	"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
	"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/scvmm/armscvmm"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armscvmm.NewClientFactory("<subscription-id>", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	res, err := clientFactory.NewAvailabilitySetsClient().Get(ctx, "testrg", "HRAvailabilitySet", nil)
	if err != nil {
		log.Fatalf("failed to finish the request: %v", err)
	}
	// You could use response here. We use blank identifier for just demo purposes.
	_ = res
	// If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes.
	// res.AvailabilitySet = armscvmm.AvailabilitySet{
	// 	Name: to.Ptr("HRAvailabilitySet"),
	// 	Type: to.Ptr("Microsoft.ScVmm/AvailabilitySets"),
	// 	ExtendedLocation: &armscvmm.ExtendedLocation{
	// 		Name: to.Ptr("/subscriptions/a5015e1c-867f-4533-8541-85cd470d0cfb/resourceGroups/demoRG/providers/Microsoft.Arc/customLocations/contoso"),
	// 		Type: to.Ptr("customLocation"),
	// 	},
	// 	ID: to.Ptr("/subscriptions/fd3c3665-1729-4b7b-9a38-238e83b0f98b/resourceGroups/testrg/providers/Microsoft.ScVmm/AvailabilitySets/HRAvailabilitySet"),
	// 	Location: to.Ptr("East US"),
	// 	Properties: &armscvmm.AvailabilitySetProperties{
	// 		AvailabilitySetName: to.Ptr("hr-avset"),
	// 		ProvisioningState: to.Ptr("Succeeded"),
	// 		VmmServerID: to.Ptr("/subscriptions/fd3c3665-1729-4b7b-9a38-238e83b0f98b/resourceGroups/testrg/providers/Microsoft.ScVmm/VMMServers/ContosoVMMServer"),
	// 	},
	// }
}
Output:

func (*AvailabilitySetsClient) NewListByResourceGroupPager

NewListByResourceGroupPager - List of AvailabilitySets in a resource group.

Generated from API version 2020-06-05-preview

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

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/d55b8005f05b040b852c15e74a0f3e36494a15e1/specification/scvmm/resource-manager/Microsoft.ScVmm/preview/2020-06-05-preview/examples/ListAvailabilitySetsByResourceGroup.json

package main

import (
	"context"
	"log"

	"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
	"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/scvmm/armscvmm"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armscvmm.NewClientFactory("<subscription-id>", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	pager := clientFactory.NewAvailabilitySetsClient().NewListByResourceGroupPager("testrg", nil)
	for pager.More() {
		page, err := pager.NextPage(ctx)
		if err != nil {
			log.Fatalf("failed to advance page: %v", err)
		}
		for _, v := range page.Value {
			// You could use page here. We use blank identifier for just demo purposes.
			_ = v
		}
		// If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes.
		// page.AvailabilitySetListResult = armscvmm.AvailabilitySetListResult{
		// 	Value: []*armscvmm.AvailabilitySet{
		// 		{
		// 			Name: to.Ptr("HRAvailabilitySet"),
		// 			Type: to.Ptr("Microsoft.ScVmm/AvailabilitySets"),
		// 			ExtendedLocation: &armscvmm.ExtendedLocation{
		// 				Name: to.Ptr("/subscriptions/a5015e1c-867f-4533-8541-85cd470d0cfb/resourceGroups/demoRG/providers/Microsoft.Arc/customLocations/contoso"),
		// 				Type: to.Ptr("customLocation"),
		// 			},
		// 			ID: to.Ptr("/subscriptions/fd3c3665-1729-4b7b-9a38-238e83b0f98b/resourceGroups/testrg/providers/Microsoft.ScVmm/AvailabilitySets/HRAvailabilitySet"),
		// 			Location: to.Ptr("East US"),
		// 			Properties: &armscvmm.AvailabilitySetProperties{
		// 				AvailabilitySetName: to.Ptr("hr-avset"),
		// 				ProvisioningState: to.Ptr("Succeeded"),
		// 				VmmServerID: to.Ptr("/subscriptions/fd3c3665-1729-4b7b-9a38-238e83b0f98b/resourceGroups/testrg/providers/Microsoft.ScVmm/VMMServers/ContosoVMMServer"),
		// 			},
		// 	}},
		// }
	}
}
Output:

func (*AvailabilitySetsClient) NewListBySubscriptionPager

NewListBySubscriptionPager - List of AvailabilitySets in a subscription.

Generated from API version 2020-06-05-preview

  • options - AvailabilitySetsClientListBySubscriptionOptions contains the optional parameters for the AvailabilitySetsClient.NewListBySubscriptionPager method.
Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/d55b8005f05b040b852c15e74a0f3e36494a15e1/specification/scvmm/resource-manager/Microsoft.ScVmm/preview/2020-06-05-preview/examples/ListAvailabilitySetsBySubscription.json

package main

import (
	"context"
	"log"

	"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
	"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/scvmm/armscvmm"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armscvmm.NewClientFactory("<subscription-id>", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	pager := clientFactory.NewAvailabilitySetsClient().NewListBySubscriptionPager(nil)
	for pager.More() {
		page, err := pager.NextPage(ctx)
		if err != nil {
			log.Fatalf("failed to advance page: %v", err)
		}
		for _, v := range page.Value {
			// You could use page here. We use blank identifier for just demo purposes.
			_ = v
		}
		// If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes.
		// page.AvailabilitySetListResult = armscvmm.AvailabilitySetListResult{
		// 	Value: []*armscvmm.AvailabilitySet{
		// 		{
		// 			Name: to.Ptr("HRAvailabilitySet"),
		// 			Type: to.Ptr("Microsoft.ScVmm/AvailabilitySets"),
		// 			ExtendedLocation: &armscvmm.ExtendedLocation{
		// 				Name: to.Ptr("/subscriptions/a5015e1c-867f-4533-8541-85cd470d0cfb/resourceGroups/demoRG/providers/Microsoft.Arc/customLocations/contoso"),
		// 				Type: to.Ptr("customLocation"),
		// 			},
		// 			ID: to.Ptr("/subscriptions/fd3c3665-1729-4b7b-9a38-238e83b0f98b/resourceGroups/testrg/providers/Microsoft.ScVmm/AvailabilitySets/HRAvailabilitySet"),
		// 			Location: to.Ptr("East US"),
		// 			Properties: &armscvmm.AvailabilitySetProperties{
		// 				AvailabilitySetName: to.Ptr("hr-avset"),
		// 				ProvisioningState: to.Ptr("Succeeded"),
		// 				VmmServerID: to.Ptr("/subscriptions/fd3c3665-1729-4b7b-9a38-238e83b0f98b/resourceGroups/testrg/providers/Microsoft.ScVmm/VMMServers/ContosoVMMServer"),
		// 			},
		// 	}},
		// }
	}
}
Output:

type AvailabilitySetsClientBeginCreateOrUpdateOptions

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

AvailabilitySetsClientBeginCreateOrUpdateOptions contains the optional parameters for the AvailabilitySetsClient.BeginCreateOrUpdate method.

type AvailabilitySetsClientBeginDeleteOptions

type AvailabilitySetsClientBeginDeleteOptions struct {
	// Forces the resource to be deleted from azure. The corresponding CR would be attempted to be deleted too.
	Force *bool

	// Resumes the LRO from the provided token.
	ResumeToken string
}

AvailabilitySetsClientBeginDeleteOptions contains the optional parameters for the AvailabilitySetsClient.BeginDelete method.

type AvailabilitySetsClientBeginUpdateOptions

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

AvailabilitySetsClientBeginUpdateOptions contains the optional parameters for the AvailabilitySetsClient.BeginUpdate method.

type AvailabilitySetsClientCreateOrUpdateResponse

type AvailabilitySetsClientCreateOrUpdateResponse struct {
	// The AvailabilitySets resource definition.
	AvailabilitySet
}

AvailabilitySetsClientCreateOrUpdateResponse contains the response from method AvailabilitySetsClient.BeginCreateOrUpdate.

type AvailabilitySetsClientDeleteResponse

type AvailabilitySetsClientDeleteResponse struct {
}

AvailabilitySetsClientDeleteResponse contains the response from method AvailabilitySetsClient.BeginDelete.

type AvailabilitySetsClientGetOptions

type AvailabilitySetsClientGetOptions struct {
}

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

type AvailabilitySetsClientGetResponse

type AvailabilitySetsClientGetResponse struct {
	// The AvailabilitySets resource definition.
	AvailabilitySet
}

AvailabilitySetsClientGetResponse contains the response from method AvailabilitySetsClient.Get.

type AvailabilitySetsClientListByResourceGroupOptions

type AvailabilitySetsClientListByResourceGroupOptions struct {
}

AvailabilitySetsClientListByResourceGroupOptions contains the optional parameters for the AvailabilitySetsClient.NewListByResourceGroupPager method.

type AvailabilitySetsClientListByResourceGroupResponse

type AvailabilitySetsClientListByResourceGroupResponse struct {
	// List of AvailabilitySets.
	AvailabilitySetListResult
}

AvailabilitySetsClientListByResourceGroupResponse contains the response from method AvailabilitySetsClient.NewListByResourceGroupPager.

type AvailabilitySetsClientListBySubscriptionOptions

type AvailabilitySetsClientListBySubscriptionOptions struct {
}

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

type AvailabilitySetsClientListBySubscriptionResponse

type AvailabilitySetsClientListBySubscriptionResponse struct {
	// List of AvailabilitySets.
	AvailabilitySetListResult
}

AvailabilitySetsClientListBySubscriptionResponse contains the response from method AvailabilitySetsClient.NewListBySubscriptionPager.

type AvailabilitySetsClientUpdateResponse

type AvailabilitySetsClientUpdateResponse struct {
	// The AvailabilitySets resource definition.
	AvailabilitySet
}

AvailabilitySetsClientUpdateResponse contains the response from method AvailabilitySetsClient.BeginUpdate.

type Checkpoint

type Checkpoint struct {
	// Gets ID of the checkpoint.
	CheckpointID *string

	// Gets description of the checkpoint.
	Description *string

	// Gets name of the checkpoint.
	Name *string

	// Gets ID of parent of the checkpoint.
	ParentCheckpointID *string
}

Checkpoint - Defines the resource properties.

func (Checkpoint) MarshalJSON added in v0.3.0

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

MarshalJSON implements the json.Marshaller interface for type Checkpoint.

func (*Checkpoint) UnmarshalJSON added in v0.3.0

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

UnmarshalJSON implements the json.Unmarshaller interface for type Checkpoint.

type ClientFactory added in v0.3.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 v0.3.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 Azure subscription ID. This is a GUID-formatted string (e.g. 00000000-0000-0000-0000-000000000000).
  • credential - used to authorize requests. Usually a credential from azidentity.
  • options - pass nil to accept the default values.

func (*ClientFactory) NewAvailabilitySetsClient added in v0.3.0

func (c *ClientFactory) NewAvailabilitySetsClient() *AvailabilitySetsClient

NewAvailabilitySetsClient creates a new instance of AvailabilitySetsClient.

func (*ClientFactory) NewCloudsClient added in v0.3.0

func (c *ClientFactory) NewCloudsClient() *CloudsClient

NewCloudsClient creates a new instance of CloudsClient.

func (*ClientFactory) NewInventoryItemsClient added in v0.3.0

func (c *ClientFactory) NewInventoryItemsClient() *InventoryItemsClient

NewInventoryItemsClient creates a new instance of InventoryItemsClient.

func (*ClientFactory) NewOperationsClient added in v0.3.0

func (c *ClientFactory) NewOperationsClient() *OperationsClient

NewOperationsClient creates a new instance of OperationsClient.

func (*ClientFactory) NewVirtualMachineTemplatesClient added in v0.3.0

func (c *ClientFactory) NewVirtualMachineTemplatesClient() *VirtualMachineTemplatesClient

NewVirtualMachineTemplatesClient creates a new instance of VirtualMachineTemplatesClient.

func (*ClientFactory) NewVirtualMachinesClient added in v0.3.0

func (c *ClientFactory) NewVirtualMachinesClient() *VirtualMachinesClient

NewVirtualMachinesClient creates a new instance of VirtualMachinesClient.

func (*ClientFactory) NewVirtualNetworksClient added in v0.3.0

func (c *ClientFactory) NewVirtualNetworksClient() *VirtualNetworksClient

NewVirtualNetworksClient creates a new instance of VirtualNetworksClient.

func (*ClientFactory) NewVmmServersClient added in v0.3.0

func (c *ClientFactory) NewVmmServersClient() *VmmServersClient

NewVmmServersClient creates a new instance of VmmServersClient.

type Cloud

type Cloud struct {
	// REQUIRED; The extended location.
	ExtendedLocation *ExtendedLocation

	// REQUIRED; Gets or sets the location.
	Location *string

	// REQUIRED; Resource properties.
	Properties *CloudProperties

	// Resource tags
	Tags map[string]*string

	// READ-ONLY; Resource Id
	ID *string

	// READ-ONLY; Resource Name
	Name *string

	// READ-ONLY; The system data.
	SystemData *SystemData

	// READ-ONLY; Resource Type
	Type *string
}

Cloud - The Clouds resource definition.

func (Cloud) MarshalJSON

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

MarshalJSON implements the json.Marshaller interface for type Cloud.

func (*Cloud) UnmarshalJSON added in v0.3.0

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

UnmarshalJSON implements the json.Unmarshaller interface for type Cloud.

type CloudCapacity

type CloudCapacity struct {
	// CPUCount specifies the maximum number of CPUs that can be allocated in the cloud.
	CPUCount *int64

	// MemoryMB specifies a memory usage limit in megabytes.
	MemoryMB *int64

	// VMCount gives the max number of VMs that can be deployed in the cloud.
	VMCount *int64
}

CloudCapacity - Cloud Capacity model

func (CloudCapacity) MarshalJSON added in v0.3.0

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

MarshalJSON implements the json.Marshaller interface for type CloudCapacity.

func (*CloudCapacity) UnmarshalJSON added in v0.3.0

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

UnmarshalJSON implements the json.Unmarshaller interface for type CloudCapacity.

type CloudInventoryItem

type CloudInventoryItem struct {
	// REQUIRED; They inventory type.
	InventoryType *InventoryType

	// READ-ONLY; Gets the Managed Object name in VMM for the inventory item.
	InventoryItemName *string

	// READ-ONLY; Gets the tracked resource id corresponding to the inventory resource.
	ManagedResourceID *string

	// READ-ONLY; Gets the provisioning state.
	ProvisioningState *string

	// READ-ONLY; Gets the UUID (which is assigned by VMM) for the inventory item.
	UUID *string
}

CloudInventoryItem - The Cloud inventory item.

func (*CloudInventoryItem) GetInventoryItemProperties

func (c *CloudInventoryItem) GetInventoryItemProperties() *InventoryItemProperties

GetInventoryItemProperties implements the InventoryItemPropertiesClassification interface for type CloudInventoryItem.

func (CloudInventoryItem) MarshalJSON

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

MarshalJSON implements the json.Marshaller interface for type CloudInventoryItem.

func (*CloudInventoryItem) UnmarshalJSON

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

UnmarshalJSON implements the json.Unmarshaller interface for type CloudInventoryItem.

type CloudListResult

type CloudListResult struct {
	// Url to follow for getting next page of resources.
	NextLink *string

	// List of Clouds.
	Value []*Cloud
}

CloudListResult - List of Clouds.

func (CloudListResult) MarshalJSON

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

MarshalJSON implements the json.Marshaller interface for type CloudListResult.

func (*CloudListResult) UnmarshalJSON added in v0.3.0

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

UnmarshalJSON implements the json.Unmarshaller interface for type CloudListResult.

type CloudProperties

type CloudProperties struct {
	// Gets or sets the inventory Item ID for the resource.
	InventoryItemID *string

	// Unique ID of the cloud.
	UUID *string

	// ARM Id of the vmmServer resource in which this resource resides.
	VmmServerID *string

	// READ-ONLY; Capacity of the cloud.
	CloudCapacity *CloudCapacity

	// READ-ONLY; Name of the cloud in VMMServer.
	CloudName *string

	// READ-ONLY; Gets or sets the provisioning state.
	ProvisioningState *string

	// READ-ONLY; List of QoS policies available for the cloud.
	StorageQoSPolicies []*StorageQoSPolicy
}

CloudProperties - Defines the resource properties.

func (CloudProperties) MarshalJSON

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

MarshalJSON implements the json.Marshaller interface for type CloudProperties.

func (*CloudProperties) UnmarshalJSON added in v0.3.0

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

UnmarshalJSON implements the json.Unmarshaller interface for type CloudProperties.

type CloudsClient

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

CloudsClient contains the methods for the Clouds group. Don't use this type directly, use NewCloudsClient() instead.

func NewCloudsClient

func NewCloudsClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*CloudsClient, error)

NewCloudsClient creates a new instance of CloudsClient with the specified values.

  • subscriptionID - The Azure subscription ID. This is a GUID-formatted string (e.g. 00000000-0000-0000-0000-000000000000).
  • credential - used to authorize requests. Usually a credential from azidentity.
  • options - pass nil to accept the default values.

func (*CloudsClient) BeginCreateOrUpdate

func (client *CloudsClient) BeginCreateOrUpdate(ctx context.Context, resourceGroupName string, cloudName string, body Cloud, options *CloudsClientBeginCreateOrUpdateOptions) (*runtime.Poller[CloudsClientCreateOrUpdateResponse], error)

BeginCreateOrUpdate - Onboards the ScVmm fabric cloud as an Azure cloud resource. If the operation fails it returns an *azcore.ResponseError type.

Generated from API version 2020-06-05-preview

  • resourceGroupName - The name of the resource group.
  • cloudName - Name of the Cloud.
  • body - Request payload.
  • options - CloudsClientBeginCreateOrUpdateOptions contains the optional parameters for the CloudsClient.BeginCreateOrUpdate method.
Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/d55b8005f05b040b852c15e74a0f3e36494a15e1/specification/scvmm/resource-manager/Microsoft.ScVmm/preview/2020-06-05-preview/examples/CreateCloud.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/scvmm/armscvmm"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armscvmm.NewClientFactory("<subscription-id>", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	poller, err := clientFactory.NewCloudsClient().BeginCreateOrUpdate(ctx, "testrg", "HRCloud", armscvmm.Cloud{
		ExtendedLocation: &armscvmm.ExtendedLocation{
			Name: to.Ptr("/subscriptions/a5015e1c-867f-4533-8541-85cd470d0cfb/resourceGroups/demoRG/providers/Microsoft.Arc/customLocations/contoso"),
			Type: to.Ptr("customLocation"),
		},
		Location: to.Ptr("East US"),
		Properties: &armscvmm.CloudProperties{
			UUID:        to.Ptr("aaaaaaa-bbbb-cccc-dddd-eeeeeeeeeeee"),
			VmmServerID: to.Ptr("/subscriptions/fd3c3665-1729-4b7b-9a38-238e83b0f98b/resourceGroups/testrg/providers/Microsoft.SCVMM/VMMServers/ContosoVMMServer"),
		},
	}, 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.Cloud = armscvmm.Cloud{
	// 	Name: to.Ptr("HRCloud"),
	// 	Type: to.Ptr("Microsoft.SCVMM/Clouds"),
	// 	ExtendedLocation: &armscvmm.ExtendedLocation{
	// 		Name: to.Ptr("/subscriptions/a5015e1c-867f-4533-8541-85cd470d0cfb/resourceGroups/demoRG/providers/Microsoft.Arc/customLocations/contoso"),
	// 		Type: to.Ptr("customLocation"),
	// 	},
	// 	ID: to.Ptr("/subscriptions/fd3c3665-1729-4b7b-9a38-238e83b0f98b/resourceGroups/testrg/providers/Microsoft.SCVMM/Clouds/HRCloud"),
	// 	Location: to.Ptr("East US"),
	// 	Properties: &armscvmm.CloudProperties{
	// 		ProvisioningState: to.Ptr("Succeeded"),
	// 		UUID: to.Ptr("aaaaaaa-bbbb-cccc-dddd-eeeeeeeeeeee"),
	// 		VmmServerID: to.Ptr("/subscriptions/fd3c3665-1729-4b7b-9a38-238e83b0f98b/resourceGroups/testrg/providers/Microsoft.SCVMM/VMMServers/ContosoVMMServer"),
	// 	},
	// }
}
Output:

func (*CloudsClient) BeginDelete

func (client *CloudsClient) BeginDelete(ctx context.Context, resourceGroupName string, cloudName string, options *CloudsClientBeginDeleteOptions) (*runtime.Poller[CloudsClientDeleteResponse], error)

BeginDelete - Deregisters the ScVmm fabric cloud from Azure. If the operation fails it returns an *azcore.ResponseError type.

Generated from API version 2020-06-05-preview

  • resourceGroupName - The name of the resource group.
  • cloudName - Name of the Cloud.
  • options - CloudsClientBeginDeleteOptions contains the optional parameters for the CloudsClient.BeginDelete method.
Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/d55b8005f05b040b852c15e74a0f3e36494a15e1/specification/scvmm/resource-manager/Microsoft.ScVmm/preview/2020-06-05-preview/examples/DeleteCloud.json

package main

import (
	"context"
	"log"

	"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
	"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/scvmm/armscvmm"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armscvmm.NewClientFactory("<subscription-id>", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	poller, err := clientFactory.NewCloudsClient().BeginDelete(ctx, "testrg", "HRCloud", &armscvmm.CloudsClientBeginDeleteOptions{Force: 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 (*CloudsClient) BeginUpdate

func (client *CloudsClient) BeginUpdate(ctx context.Context, resourceGroupName string, cloudName string, body ResourcePatch, options *CloudsClientBeginUpdateOptions) (*runtime.Poller[CloudsClientUpdateResponse], error)

BeginUpdate - Updates the Clouds resource. If the operation fails it returns an *azcore.ResponseError type.

Generated from API version 2020-06-05-preview

  • resourceGroupName - The name of the resource group.
  • cloudName - Name of the Cloud.
  • body - Clouds patch payload.
  • options - CloudsClientBeginUpdateOptions contains the optional parameters for the CloudsClient.BeginUpdate method.
Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/d55b8005f05b040b852c15e74a0f3e36494a15e1/specification/scvmm/resource-manager/Microsoft.ScVmm/preview/2020-06-05-preview/examples/UpdateCloud.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/scvmm/armscvmm"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armscvmm.NewClientFactory("<subscription-id>", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	poller, err := clientFactory.NewCloudsClient().BeginUpdate(ctx, "testrg", "HRCloud", armscvmm.ResourcePatch{
		Tags: map[string]*string{
			"tag1": to.Ptr("value1"),
			"tag2": to.Ptr("value2"),
		},
	}, 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.Cloud = armscvmm.Cloud{
	// 	Name: to.Ptr("HRCloud"),
	// 	Type: to.Ptr("Microsoft.SCVMM/Clouds"),
	// 	ExtendedLocation: &armscvmm.ExtendedLocation{
	// 		Name: to.Ptr("/subscriptions/a5015e1c-867f-4533-8541-85cd470d0cfb/resourceGroups/demoRG/providers/Microsoft.Arc/customLocations/contoso"),
	// 		Type: to.Ptr("customLocation"),
	// 	},
	// 	ID: to.Ptr("/subscriptions/fd3c3665-1729-4b7b-9a38-238e83b0f98b/resourceGroups/testrg/providers/Microsoft.SCVMM/Clouds/HRCloud"),
	// 	Location: to.Ptr("East US"),
	// 	Properties: &armscvmm.CloudProperties{
	// 		ProvisioningState: to.Ptr("Succeeded"),
	// 		UUID: to.Ptr("aaaaaaa-bbbb-cccc-dddd-eeeeeeeeeeee"),
	// 		VmmServerID: to.Ptr("/subscriptions/fd3c3665-1729-4b7b-9a38-238e83b0f98b/resourceGroups/testrg/providers/Microsoft.SCVMM/VMMServers/ContosoVMMServer"),
	// 	},
	// 	Tags: map[string]*string{
	// 		"tag1": to.Ptr("value1"),
	// 		"tag2": to.Ptr("value2"),
	// 	},
	// }
}
Output:

func (*CloudsClient) Get

func (client *CloudsClient) Get(ctx context.Context, resourceGroupName string, cloudName string, options *CloudsClientGetOptions) (CloudsClientGetResponse, error)

Get - Implements Cloud GET method. If the operation fails it returns an *azcore.ResponseError type.

Generated from API version 2020-06-05-preview

  • resourceGroupName - The name of the resource group.
  • cloudName - Name of the Cloud.
  • options - CloudsClientGetOptions contains the optional parameters for the CloudsClient.Get method.
Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/d55b8005f05b040b852c15e74a0f3e36494a15e1/specification/scvmm/resource-manager/Microsoft.ScVmm/preview/2020-06-05-preview/examples/GetCloud.json

package main

import (
	"context"
	"log"

	"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
	"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/scvmm/armscvmm"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armscvmm.NewClientFactory("<subscription-id>", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	res, err := clientFactory.NewCloudsClient().Get(ctx, "testrg", "HRCloud", 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.Cloud = armscvmm.Cloud{
	// 	Name: to.Ptr("HRCloud"),
	// 	Type: to.Ptr("Microsoft.SCVMM/Clouds"),
	// 	ExtendedLocation: &armscvmm.ExtendedLocation{
	// 		Name: to.Ptr("/subscriptions/a5015e1c-867f-4533-8541-85cd470d0cfb/resourceGroups/demoRG/providers/Microsoft.Arc/customLocations/contoso"),
	// 		Type: to.Ptr("customLocation"),
	// 	},
	// 	ID: to.Ptr("/subscriptions/fd3c3665-1729-4b7b-9a38-238e83b0f98b/resourceGroups/testrg/providers/Microsoft.SCVMM/Clouds/HRCloud"),
	// 	Location: to.Ptr("East US"),
	// 	Properties: &armscvmm.CloudProperties{
	// 		ProvisioningState: to.Ptr("Succeeded"),
	// 		UUID: to.Ptr("aaaaaaa-bbbb-cccc-dddd-eeeeeeeeeeee"),
	// 		VmmServerID: to.Ptr("/subscriptions/fd3c3665-1729-4b7b-9a38-238e83b0f98b/resourceGroups/testrg/providers/Microsoft.SCVMM/VMMServers/ContosoVMMServer"),
	// 	},
	// }
}
Output:

func (*CloudsClient) NewListByResourceGroupPager

func (client *CloudsClient) NewListByResourceGroupPager(resourceGroupName string, options *CloudsClientListByResourceGroupOptions) *runtime.Pager[CloudsClientListByResourceGroupResponse]

NewListByResourceGroupPager - List of Clouds in a resource group.

Generated from API version 2020-06-05-preview

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

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/d55b8005f05b040b852c15e74a0f3e36494a15e1/specification/scvmm/resource-manager/Microsoft.ScVmm/preview/2020-06-05-preview/examples/ListCloudsByResourceGroup.json

package main

import (
	"context"
	"log"

	"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
	"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/scvmm/armscvmm"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armscvmm.NewClientFactory("<subscription-id>", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	pager := clientFactory.NewCloudsClient().NewListByResourceGroupPager("testrg", 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.CloudListResult = armscvmm.CloudListResult{
		// 	Value: []*armscvmm.Cloud{
		// 		{
		// 			Name: to.Ptr("HRCloud"),
		// 			Type: to.Ptr("Microsoft.SCVMM/Clouds"),
		// 			ExtendedLocation: &armscvmm.ExtendedLocation{
		// 				Name: to.Ptr("/subscriptions/a5015e1c-867f-4533-8541-85cd470d0cfb/resourceGroups/demoRG/providers/Microsoft.Arc/customLocations/contoso"),
		// 				Type: to.Ptr("customLocation"),
		// 			},
		// 			ID: to.Ptr("/subscriptions/fd3c3665-1729-4b7b-9a38-238e83b0f98b/resourceGroups/testrg/providers/Microsoft.SCVMM/Clouds/HRCloud"),
		// 			Location: to.Ptr("East US"),
		// 			Properties: &armscvmm.CloudProperties{
		// 				ProvisioningState: to.Ptr("Succeeded"),
		// 				UUID: to.Ptr("aaaaaaa-bbbb-cccc-dddd-eeeeeeeeeeee"),
		// 				VmmServerID: to.Ptr("/subscriptions/fd3c3665-1729-4b7b-9a38-238e83b0f98b/resourceGroups/testrg/providers/Microsoft.SCVMM/VMMServers/ContosoVMMServer"),
		// 			},
		// 	}},
		// }
	}
}
Output:

func (*CloudsClient) NewListBySubscriptionPager

NewListBySubscriptionPager - List of Clouds in a subscription.

Generated from API version 2020-06-05-preview

  • options - CloudsClientListBySubscriptionOptions contains the optional parameters for the CloudsClient.NewListBySubscriptionPager method.
Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/d55b8005f05b040b852c15e74a0f3e36494a15e1/specification/scvmm/resource-manager/Microsoft.ScVmm/preview/2020-06-05-preview/examples/ListCloudsBySubscription.json

package main

import (
	"context"
	"log"

	"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
	"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/scvmm/armscvmm"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armscvmm.NewClientFactory("<subscription-id>", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	pager := clientFactory.NewCloudsClient().NewListBySubscriptionPager(nil)
	for pager.More() {
		page, err := pager.NextPage(ctx)
		if err != nil {
			log.Fatalf("failed to advance page: %v", err)
		}
		for _, v := range page.Value {
			// You could use page here. We use blank identifier for just demo purposes.
			_ = v
		}
		// If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes.
		// page.CloudListResult = armscvmm.CloudListResult{
		// 	Value: []*armscvmm.Cloud{
		// 		{
		// 			Name: to.Ptr("HRCloud"),
		// 			Type: to.Ptr("Microsoft.SCVMM/Clouds"),
		// 			ExtendedLocation: &armscvmm.ExtendedLocation{
		// 				Name: to.Ptr("/subscriptions/a5015e1c-867f-4533-8541-85cd470d0cfb/resourceGroups/demoRG/providers/Microsoft.Arc/customLocations/contoso"),
		// 				Type: to.Ptr("customLocation"),
		// 			},
		// 			ID: to.Ptr("/subscriptions/fd3c3665-1729-4b7b-9a38-238e83b0f98b/resourceGroups/testrg/providers/Microsoft.SCVMM/Clouds/HRCloud"),
		// 			Location: to.Ptr("East US"),
		// 			Properties: &armscvmm.CloudProperties{
		// 				ProvisioningState: to.Ptr("Succeeded"),
		// 				UUID: to.Ptr("aaaaaaa-bbbb-cccc-dddd-eeeeeeeeeeee"),
		// 				VmmServerID: to.Ptr("/subscriptions/fd3c3665-1729-4b7b-9a38-238e83b0f98b/resourceGroups/testrg/providers/Microsoft.SCVMM/VMMServers/ContosoVMMServer"),
		// 			},
		// 	}},
		// }
	}
}
Output:

type CloudsClientBeginCreateOrUpdateOptions

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

CloudsClientBeginCreateOrUpdateOptions contains the optional parameters for the CloudsClient.BeginCreateOrUpdate method.

type CloudsClientBeginDeleteOptions

type CloudsClientBeginDeleteOptions struct {
	// Forces the resource to be deleted from azure. The corresponding CR would be attempted to be deleted too.
	Force *bool

	// Resumes the LRO from the provided token.
	ResumeToken string
}

CloudsClientBeginDeleteOptions contains the optional parameters for the CloudsClient.BeginDelete method.

type CloudsClientBeginUpdateOptions

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

CloudsClientBeginUpdateOptions contains the optional parameters for the CloudsClient.BeginUpdate method.

type CloudsClientCreateOrUpdateResponse

type CloudsClientCreateOrUpdateResponse struct {
	// The Clouds resource definition.
	Cloud
}

CloudsClientCreateOrUpdateResponse contains the response from method CloudsClient.BeginCreateOrUpdate.

type CloudsClientDeleteResponse

type CloudsClientDeleteResponse struct {
}

CloudsClientDeleteResponse contains the response from method CloudsClient.BeginDelete.

type CloudsClientGetOptions

type CloudsClientGetOptions struct {
}

CloudsClientGetOptions contains the optional parameters for the CloudsClient.Get method.

type CloudsClientGetResponse

type CloudsClientGetResponse struct {
	// The Clouds resource definition.
	Cloud
}

CloudsClientGetResponse contains the response from method CloudsClient.Get.

type CloudsClientListByResourceGroupOptions

type CloudsClientListByResourceGroupOptions struct {
}

CloudsClientListByResourceGroupOptions contains the optional parameters for the CloudsClient.NewListByResourceGroupPager method.

type CloudsClientListByResourceGroupResponse

type CloudsClientListByResourceGroupResponse struct {
	// List of Clouds.
	CloudListResult
}

CloudsClientListByResourceGroupResponse contains the response from method CloudsClient.NewListByResourceGroupPager.

type CloudsClientListBySubscriptionOptions

type CloudsClientListBySubscriptionOptions struct {
}

CloudsClientListBySubscriptionOptions contains the optional parameters for the CloudsClient.NewListBySubscriptionPager method.

type CloudsClientListBySubscriptionResponse

type CloudsClientListBySubscriptionResponse struct {
	// List of Clouds.
	CloudListResult
}

CloudsClientListBySubscriptionResponse contains the response from method CloudsClient.NewListBySubscriptionPager.

type CloudsClientUpdateResponse

type CloudsClientUpdateResponse struct {
	// The Clouds resource definition.
	Cloud
}

CloudsClientUpdateResponse contains the response from method CloudsClient.BeginUpdate.

type CreateDiffDisk

type CreateDiffDisk string

CreateDiffDisk - Gets or sets a value indicating diff disk.

const (
	CreateDiffDiskFalse CreateDiffDisk = "false"
	CreateDiffDiskTrue  CreateDiffDisk = "true"
)

func PossibleCreateDiffDiskValues

func PossibleCreateDiffDiskValues() []CreateDiffDisk

PossibleCreateDiffDiskValues returns the possible values for the CreateDiffDisk const type.

type CreatedByType

type CreatedByType string

CreatedByType - The type of identity that created the resource.

const (
	CreatedByTypeApplication     CreatedByType = "Application"
	CreatedByTypeKey             CreatedByType = "Key"
	CreatedByTypeManagedIdentity CreatedByType = "ManagedIdentity"
	CreatedByTypeUser            CreatedByType = "User"
)

func PossibleCreatedByTypeValues

func PossibleCreatedByTypeValues() []CreatedByType

PossibleCreatedByTypeValues returns the possible values for the CreatedByType const type.

type DynamicMemoryEnabled

type DynamicMemoryEnabled string

DynamicMemoryEnabled - Gets or sets a value indicating whether to enable dynamic memory or not.

const (
	DynamicMemoryEnabledFalse DynamicMemoryEnabled = "false"
	DynamicMemoryEnabledTrue  DynamicMemoryEnabled = "true"
)

func PossibleDynamicMemoryEnabledValues

func PossibleDynamicMemoryEnabledValues() []DynamicMemoryEnabled

PossibleDynamicMemoryEnabledValues returns the possible values for the DynamicMemoryEnabled const type.

type ErrorDefinition

type ErrorDefinition struct {
	// READ-ONLY; Service specific error code which serves as the substatus for the HTTP error code.
	Code *string

	// READ-ONLY; Internal error details.
	Details []*ErrorDefinition

	// READ-ONLY; Description of the error.
	Message *string
}

ErrorDefinition - Error definition.

func (ErrorDefinition) MarshalJSON

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

MarshalJSON implements the json.Marshaller interface for type ErrorDefinition.

func (*ErrorDefinition) UnmarshalJSON added in v0.3.0

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

UnmarshalJSON implements the json.Unmarshaller interface for type ErrorDefinition.

type ErrorResponse

type ErrorResponse struct {
	// The error details.
	Error *ErrorDefinition
}

ErrorResponse - Error response.

func (ErrorResponse) MarshalJSON added in v0.3.0

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

MarshalJSON implements the json.Marshaller interface for type ErrorResponse.

func (*ErrorResponse) UnmarshalJSON added in v0.3.0

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

UnmarshalJSON implements the json.Unmarshaller interface for type ErrorResponse.

type ExtendedLocation

type ExtendedLocation struct {
	// The extended location name.
	Name *string

	// The extended location type.
	Type *string
}

ExtendedLocation - The extended location.

func (ExtendedLocation) MarshalJSON added in v0.3.0

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

MarshalJSON implements the json.Marshaller interface for type ExtendedLocation.

func (*ExtendedLocation) UnmarshalJSON added in v0.3.0

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

UnmarshalJSON implements the json.Unmarshaller interface for type ExtendedLocation.

type HardwareProfile

type HardwareProfile struct {
	// Gets or sets the number of vCPUs for the vm.
	CPUCount *int32

	// Gets or sets a value indicating whether to enable dynamic memory or not.
	DynamicMemoryEnabled *DynamicMemoryEnabled

	// Gets or sets the max dynamic memory for the vm.
	DynamicMemoryMaxMB *int32

	// Gets or sets the min dynamic memory for the vm.
	DynamicMemoryMinMB *int32

	// Gets highly available property.
	IsHighlyAvailable *string

	// Gets or sets a value indicating whether to enable processor compatibility mode for live migration of VMs.
	LimitCPUForMigration *LimitCPUForMigration

	// MemoryMB is the size of a virtual machine's memory, in MB.
	MemoryMB *int32
}

HardwareProfile - Defines the resource properties.

func (HardwareProfile) MarshalJSON added in v0.3.0

func (h HardwareProfile) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.Marshaller interface for type HardwareProfile.

func (*HardwareProfile) UnmarshalJSON added in v0.3.0

func (h *HardwareProfile) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the json.Unmarshaller interface for type HardwareProfile.

type HardwareProfileUpdate

type HardwareProfileUpdate struct {
	// Gets or sets the number of vCPUs for the vm.
	CPUCount *int32

	// Gets or sets a value indicating whether to enable dynamic memory or not.
	DynamicMemoryEnabled *DynamicMemoryEnabled

	// Gets or sets the max dynamic memory for the vm.
	DynamicMemoryMaxMB *int32

	// Gets or sets the min dynamic memory for the vm.
	DynamicMemoryMinMB *int32

	// Gets or sets a value indicating whether to enable processor compatibility mode for live migration of VMs.
	LimitCPUForMigration *LimitCPUForMigration

	// MemoryMB is the size of a virtual machine's memory, in MB.
	MemoryMB *int32
}

HardwareProfileUpdate - Defines the resource properties.

func (HardwareProfileUpdate) MarshalJSON added in v0.3.0

func (h HardwareProfileUpdate) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.Marshaller interface for type HardwareProfileUpdate.

func (*HardwareProfileUpdate) UnmarshalJSON added in v0.3.0

func (h *HardwareProfileUpdate) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the json.Unmarshaller interface for type HardwareProfileUpdate.

type InventoryItem

type InventoryItem struct {
	// REQUIRED; Resource properties.
	Properties InventoryItemPropertiesClassification

	// Metadata used by portal/tooling/etc to render different UX experiences for resources of the same type; e.g. ApiApps are
	// a kind of Microsoft.Web/sites type. If supported, the resource provider must
	// validate and persist this value.
	Kind *string

	// READ-ONLY; Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}
	ID *string

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

	// READ-ONLY; The system data.
	SystemData *SystemData

	// READ-ONLY; The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts"
	Type *string
}

InventoryItem - Defines the inventory item.

func (InventoryItem) MarshalJSON

func (i InventoryItem) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.Marshaller interface for type InventoryItem.

func (*InventoryItem) UnmarshalJSON

func (i *InventoryItem) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the json.Unmarshaller interface for type InventoryItem.

type InventoryItemDetails

type InventoryItemDetails struct {
	// Gets or sets the inventory Item ID for the resource.
	InventoryItemID *string

	// Gets or sets the Managed Object name in VMM for the resource.
	InventoryItemName *string
}

InventoryItemDetails - Defines the resource properties.

func (InventoryItemDetails) MarshalJSON added in v0.3.0

func (i InventoryItemDetails) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.Marshaller interface for type InventoryItemDetails.

func (*InventoryItemDetails) UnmarshalJSON added in v0.3.0

func (i *InventoryItemDetails) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the json.Unmarshaller interface for type InventoryItemDetails.

type InventoryItemProperties

type InventoryItemProperties struct {
	// REQUIRED; They inventory type.
	InventoryType *InventoryType

	// READ-ONLY; Gets the Managed Object name in VMM for the inventory item.
	InventoryItemName *string

	// READ-ONLY; Gets the tracked resource id corresponding to the inventory resource.
	ManagedResourceID *string

	// READ-ONLY; Gets the provisioning state.
	ProvisioningState *string

	// READ-ONLY; Gets the UUID (which is assigned by VMM) for the inventory item.
	UUID *string
}

InventoryItemProperties - Defines the resource properties.

func (*InventoryItemProperties) GetInventoryItemProperties

func (i *InventoryItemProperties) GetInventoryItemProperties() *InventoryItemProperties

GetInventoryItemProperties implements the InventoryItemPropertiesClassification interface for type InventoryItemProperties.

func (InventoryItemProperties) MarshalJSON added in v0.3.0

func (i InventoryItemProperties) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.Marshaller interface for type InventoryItemProperties.

func (*InventoryItemProperties) UnmarshalJSON added in v0.3.0

func (i *InventoryItemProperties) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the json.Unmarshaller interface for type InventoryItemProperties.

type InventoryItemPropertiesClassification

type InventoryItemPropertiesClassification interface {
	// GetInventoryItemProperties returns the InventoryItemProperties content of the underlying type.
	GetInventoryItemProperties() *InventoryItemProperties
}

InventoryItemPropertiesClassification provides polymorphic access to related types. Call the interface's GetInventoryItemProperties() method to access the common type. Use a type switch to determine the concrete type. The possible types are: - *CloudInventoryItem, *InventoryItemProperties, *VirtualMachineInventoryItem, *VirtualMachineTemplateInventoryItem, *VirtualNetworkInventoryItem

type InventoryItemsClient

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

InventoryItemsClient contains the methods for the InventoryItems group. Don't use this type directly, use NewInventoryItemsClient() instead.

func NewInventoryItemsClient

func NewInventoryItemsClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*InventoryItemsClient, error)

NewInventoryItemsClient creates a new instance of InventoryItemsClient with the specified values.

  • subscriptionID - The Azure subscription ID. This is a GUID-formatted string (e.g. 00000000-0000-0000-0000-000000000000).
  • credential - used to authorize requests. Usually a credential from azidentity.
  • options - pass nil to accept the default values.

func (*InventoryItemsClient) Create

func (client *InventoryItemsClient) Create(ctx context.Context, resourceGroupName string, vmmServerName string, inventoryItemName string, options *InventoryItemsClientCreateOptions) (InventoryItemsClientCreateResponse, error)

Create - Create Or Update InventoryItem. If the operation fails it returns an *azcore.ResponseError type.

Generated from API version 2020-06-05-preview

  • resourceGroupName - The name of the resource group.
  • vmmServerName - Name of the VMMServer.
  • inventoryItemName - Name of the inventoryItem.
  • options - InventoryItemsClientCreateOptions contains the optional parameters for the InventoryItemsClient.Create method.
Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/d55b8005f05b040b852c15e74a0f3e36494a15e1/specification/scvmm/resource-manager/Microsoft.ScVmm/preview/2020-06-05-preview/examples/CreateInventoryItem.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/scvmm/armscvmm"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armscvmm.NewClientFactory("<subscription-id>", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	res, err := clientFactory.NewInventoryItemsClient().Create(ctx, "testrg", "ContosoVMMServer", "12345678-1234-1234-1234-123456789abc", &armscvmm.InventoryItemsClientCreateOptions{Body: &armscvmm.InventoryItem{
		Properties: &armscvmm.CloudInventoryItem{
			InventoryType: to.Ptr(armscvmm.InventoryTypeCloud),
		},
	},
	})
	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.InventoryItem = armscvmm.InventoryItem{
	// 	Name: to.Ptr("12345678-1234-1234-1234-123456789abc"),
	// 	Type: to.Ptr("Microsoft.SCVMM/VMMServers/InventoryItems"),
	// 	ID: to.Ptr("/subscriptions/fd3c3665-1729-4b7b-9a38-238e83b0f98b/resourceGroups/testrg/providers/Microsoft.SCVMM/VMMServers/ContosoVMMServer/InventoryItems/12345678-1234-1234-1234-123456789abc"),
	// 	Properties: &armscvmm.CloudInventoryItem{
	// 		InventoryItemName: to.Ptr("contoso-cloud"),
	// 		InventoryType: to.Ptr(armscvmm.InventoryTypeCloud),
	// 		ManagedResourceID: to.Ptr("/subscriptions/fd3c3665-1729-4b7b-9a38-238e83b0f98b/resourceGroups/testrg/providers/Microsoft.SCVMM/Clouds/contoso-cloud"),
	// 		ProvisioningState: to.Ptr("Succeeded"),
	// 		UUID: to.Ptr("12345678-1234-1234-1234-123456789abc"),
	// 	},
	// }
}
Output:

func (*InventoryItemsClient) Delete

func (client *InventoryItemsClient) Delete(ctx context.Context, resourceGroupName string, vmmServerName string, inventoryItemName string, options *InventoryItemsClientDeleteOptions) (InventoryItemsClientDeleteResponse, error)

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

Generated from API version 2020-06-05-preview

  • resourceGroupName - The name of the resource group.
  • vmmServerName - Name of the VMMServer.
  • inventoryItemName - Name of the inventoryItem.
  • options - InventoryItemsClientDeleteOptions contains the optional parameters for the InventoryItemsClient.Delete method.
Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/d55b8005f05b040b852c15e74a0f3e36494a15e1/specification/scvmm/resource-manager/Microsoft.ScVmm/preview/2020-06-05-preview/examples/DeleteInventoryItem.json

package main

import (
	"context"
	"log"

	"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
	"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/scvmm/armscvmm"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armscvmm.NewClientFactory("<subscription-id>", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	_, err = clientFactory.NewInventoryItemsClient().Delete(ctx, "testrg", "ContosoVMMServer", "12345678-1234-1234-1234-123456789abc", nil)
	if err != nil {
		log.Fatalf("failed to finish the request: %v", err)
	}
}
Output:

func (*InventoryItemsClient) Get

func (client *InventoryItemsClient) Get(ctx context.Context, resourceGroupName string, vmmServerName string, inventoryItemName string, options *InventoryItemsClientGetOptions) (InventoryItemsClientGetResponse, error)

Get - Shows an inventory item. If the operation fails it returns an *azcore.ResponseError type.

Generated from API version 2020-06-05-preview

  • resourceGroupName - The name of the resource group.
  • vmmServerName - Name of the VMMServer.
  • inventoryItemName - Name of the inventoryItem.
  • options - InventoryItemsClientGetOptions contains the optional parameters for the InventoryItemsClient.Get method.
Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/d55b8005f05b040b852c15e74a0f3e36494a15e1/specification/scvmm/resource-manager/Microsoft.ScVmm/preview/2020-06-05-preview/examples/GetInventoryItem.json

package main

import (
	"context"
	"log"

	"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
	"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/scvmm/armscvmm"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armscvmm.NewClientFactory("<subscription-id>", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	res, err := clientFactory.NewInventoryItemsClient().Get(ctx, "testrg", "ContosoVMMServer", "12345678-1234-1234-1234-123456789abc", 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.InventoryItem = armscvmm.InventoryItem{
	// 	Name: to.Ptr("12345678-1234-1234-1234-123456789abc"),
	// 	Type: to.Ptr("Microsoft.SCVMM/VMMServers/InventoryItems"),
	// 	ID: to.Ptr("/subscriptions/fd3c3665-1729-4b7b-9a38-238e83b0f98b/resourceGroups/testrg/providers/Microsoft.SCVMM/VMMServers/ContosoVMMServer/InventoryItems/12345678-1234-1234-1234-123456789abc"),
	// 	Properties: &armscvmm.CloudInventoryItem{
	// 		InventoryItemName: to.Ptr("contoso-cloud"),
	// 		InventoryType: to.Ptr(armscvmm.InventoryTypeCloud),
	// 		ManagedResourceID: to.Ptr("/subscriptions/fd3c3665-1729-4b7b-9a38-238e83b0f98b/resourceGroups/testrg/providers/Microsoft.SCVMM/Clouds/contoso-cloud"),
	// 		ProvisioningState: to.Ptr("Succeeded"),
	// 		UUID: to.Ptr("12345678-1234-1234-1234-123456789abc"),
	// 	},
	// }
}
Output:

func (*InventoryItemsClient) NewListByVMMServerPager

func (client *InventoryItemsClient) NewListByVMMServerPager(resourceGroupName string, vmmServerName string, options *InventoryItemsClientListByVMMServerOptions) *runtime.Pager[InventoryItemsClientListByVMMServerResponse]

NewListByVMMServerPager - Returns the list of inventoryItems in the given VMMServer.

Generated from API version 2020-06-05-preview

  • resourceGroupName - The name of the resource group.
  • vmmServerName - Name of the VMMServer.
  • options - InventoryItemsClientListByVMMServerOptions contains the optional parameters for the InventoryItemsClient.NewListByVMMServerPager method.
Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/d55b8005f05b040b852c15e74a0f3e36494a15e1/specification/scvmm/resource-manager/Microsoft.ScVmm/preview/2020-06-05-preview/examples/ListInventoryItemsByVMMServer.json

package main

import (
	"context"
	"log"

	"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
	"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/scvmm/armscvmm"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armscvmm.NewClientFactory("<subscription-id>", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	pager := clientFactory.NewInventoryItemsClient().NewListByVMMServerPager("testrg", "ContosoVMMServer", 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.InventoryItemsList = armscvmm.InventoryItemsList{
		// 	Value: []*armscvmm.InventoryItem{
		// 		{
		// 			Name: to.Ptr("12345678-1234-1234-1234-123456789abc"),
		// 			Type: to.Ptr("Microsoft.SCVMM/VMMServers/InventoryItems"),
		// 			ID: to.Ptr("/subscriptions/fd3c3665-1729-4b7b-9a38-238e83b0f98b/resourceGroups/testrg/providers/Microsoft.SCVMM/VMMServers/ContosoVMMServer/InventoryItems/12345678-1234-1234-1234-123456789abc"),
		// 			Properties: &armscvmm.CloudInventoryItem{
		// 				InventoryItemName: to.Ptr("contoso-cloud"),
		// 				InventoryType: to.Ptr(armscvmm.InventoryTypeCloud),
		// 				ManagedResourceID: to.Ptr("/subscriptions/fd3c3665-1729-4b7b-9a38-238e83b0f98b/resourceGroups/testrg/providers/Microsoft.SCVMM/Clouds/contoso-cloud"),
		// 				ProvisioningState: to.Ptr("Succeeded"),
		// 				UUID: to.Ptr("12345678-1234-1234-1234-123456789abc"),
		// 			},
		// 	}},
		// }
	}
}
Output:

type InventoryItemsClientCreateOptions

type InventoryItemsClientCreateOptions struct {
	// Request payload.
	Body *InventoryItem
}

InventoryItemsClientCreateOptions contains the optional parameters for the InventoryItemsClient.Create method.

type InventoryItemsClientCreateResponse

type InventoryItemsClientCreateResponse struct {
	// Defines the inventory item.
	InventoryItem
}

InventoryItemsClientCreateResponse contains the response from method InventoryItemsClient.Create.

type InventoryItemsClientDeleteOptions

type InventoryItemsClientDeleteOptions struct {
}

InventoryItemsClientDeleteOptions contains the optional parameters for the InventoryItemsClient.Delete method.

type InventoryItemsClientDeleteResponse

type InventoryItemsClientDeleteResponse struct {
}

InventoryItemsClientDeleteResponse contains the response from method InventoryItemsClient.Delete.

type InventoryItemsClientGetOptions

type InventoryItemsClientGetOptions struct {
}

InventoryItemsClientGetOptions contains the optional parameters for the InventoryItemsClient.Get method.

type InventoryItemsClientGetResponse

type InventoryItemsClientGetResponse struct {
	// Defines the inventory item.
	InventoryItem
}

InventoryItemsClientGetResponse contains the response from method InventoryItemsClient.Get.

type InventoryItemsClientListByVMMServerOptions

type InventoryItemsClientListByVMMServerOptions struct {
}

InventoryItemsClientListByVMMServerOptions contains the optional parameters for the InventoryItemsClient.NewListByVMMServerPager method.

type InventoryItemsClientListByVMMServerResponse

type InventoryItemsClientListByVMMServerResponse struct {
	// List of InventoryItems.
	InventoryItemsList
}

InventoryItemsClientListByVMMServerResponse contains the response from method InventoryItemsClient.NewListByVMMServerPager.

type InventoryItemsList

type InventoryItemsList struct {
	// REQUIRED; Array of InventoryItems
	Value []*InventoryItem

	// Url to follow for getting next page of InventoryItems.
	NextLink *string
}

InventoryItemsList - List of InventoryItems.

func (InventoryItemsList) MarshalJSON

func (i InventoryItemsList) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.Marshaller interface for type InventoryItemsList.

func (*InventoryItemsList) UnmarshalJSON added in v0.3.0

func (i *InventoryItemsList) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the json.Unmarshaller interface for type InventoryItemsList.

type InventoryType

type InventoryType string

InventoryType - The inventory type.

const (
	InventoryTypeCloud                  InventoryType = "Cloud"
	InventoryTypeVirtualMachine         InventoryType = "VirtualMachine"
	InventoryTypeVirtualMachineTemplate InventoryType = "VirtualMachineTemplate"
	InventoryTypeVirtualNetwork         InventoryType = "VirtualNetwork"
)

func PossibleInventoryTypeValues

func PossibleInventoryTypeValues() []InventoryType

PossibleInventoryTypeValues returns the possible values for the InventoryType const type.

type IsCustomizable

type IsCustomizable string

IsCustomizable - Gets or sets a value indicating whether the vm template is customizable or not.

const (
	IsCustomizableFalse IsCustomizable = "false"
	IsCustomizableTrue  IsCustomizable = "true"
)

func PossibleIsCustomizableValues

func PossibleIsCustomizableValues() []IsCustomizable

PossibleIsCustomizableValues returns the possible values for the IsCustomizable const type.

type LimitCPUForMigration

type LimitCPUForMigration string

LimitCPUForMigration - Gets or sets a value indicating whether to enable processor compatibility mode for live migration of VMs.

const (
	LimitCPUForMigrationFalse LimitCPUForMigration = "false"
	LimitCPUForMigrationTrue  LimitCPUForMigration = "true"
)

func PossibleLimitCPUForMigrationValues

func PossibleLimitCPUForMigrationValues() []LimitCPUForMigration

PossibleLimitCPUForMigrationValues returns the possible values for the LimitCPUForMigration const type.

type NetworkInterfaces

type NetworkInterfaces struct {
	// Gets or sets the ipv4 address type.
	IPv4AddressType *AllocationMethod

	// Gets or sets the ipv6 address type.
	IPv6AddressType *AllocationMethod

	// Gets or sets the nic MAC address.
	MacAddress *string

	// Gets or sets the mac address type.
	MacAddressType *AllocationMethod

	// Gets or sets the name of the network interface.
	Name *string

	// Gets or sets the nic id.
	NicID *string

	// Gets or sets the ARM Id of the Microsoft.ScVmm/virtualNetwork resource to connect the nic.
	VirtualNetworkID *string

	// READ-ONLY; Gets the display name of the network interface as shown in the vmmServer. This is the fallback label for a NIC
	// when the name is not set.
	DisplayName *string

	// READ-ONLY; Gets or sets the nic ipv4 addresses.
	IPv4Addresses []*string

	// READ-ONLY; Gets or sets the nic ipv6 addresses.
	IPv6Addresses []*string

	// READ-ONLY; Gets or sets the name of the virtual network in vmmServer that the nic is connected to.
	NetworkName *string
}

NetworkInterfaces - Network Interface model

func (NetworkInterfaces) MarshalJSON

func (n NetworkInterfaces) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.Marshaller interface for type NetworkInterfaces.

func (*NetworkInterfaces) UnmarshalJSON added in v0.3.0

func (n *NetworkInterfaces) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the json.Unmarshaller interface for type NetworkInterfaces.

type NetworkInterfacesUpdate

type NetworkInterfacesUpdate struct {
	// Gets or sets the ipv4 address type.
	IPv4AddressType *AllocationMethod

	// Gets or sets the ipv6 address type.
	IPv6AddressType *AllocationMethod

	// Gets or sets the nic MAC address.
	MacAddress *string

	// Gets or sets the mac address type.
	MacAddressType *AllocationMethod

	// Gets or sets the name of the network interface.
	Name *string

	// Gets or sets the nic id.
	NicID *string

	// Gets or sets the ARM Id of the Microsoft.ScVmm/virtualNetwork resource to connect the nic.
	VirtualNetworkID *string
}

NetworkInterfacesUpdate - Network Interface model

func (NetworkInterfacesUpdate) MarshalJSON added in v0.3.0

func (n NetworkInterfacesUpdate) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.Marshaller interface for type NetworkInterfacesUpdate.

func (*NetworkInterfacesUpdate) UnmarshalJSON added in v0.3.0

func (n *NetworkInterfacesUpdate) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the json.Unmarshaller interface for type NetworkInterfacesUpdate.

type NetworkProfile

type NetworkProfile struct {
	// Gets or sets the list of network interfaces associated with the virtual machine.
	NetworkInterfaces []*NetworkInterfaces
}

NetworkProfile - Defines the resource properties.

func (NetworkProfile) MarshalJSON

func (n NetworkProfile) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.Marshaller interface for type NetworkProfile.

func (*NetworkProfile) UnmarshalJSON added in v0.3.0

func (n *NetworkProfile) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the json.Unmarshaller interface for type NetworkProfile.

type NetworkProfileUpdate

type NetworkProfileUpdate struct {
	// Gets or sets the list of network interfaces associated with the virtual machine.
	NetworkInterfaces []*NetworkInterfacesUpdate
}

NetworkProfileUpdate - Defines the resource properties.

func (NetworkProfileUpdate) MarshalJSON

func (n NetworkProfileUpdate) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.Marshaller interface for type NetworkProfileUpdate.

func (*NetworkProfileUpdate) UnmarshalJSON added in v0.3.0

func (n *NetworkProfileUpdate) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the json.Unmarshaller interface for type NetworkProfileUpdate.

type OperationsClient

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

OperationsClient contains the methods for the Operations group. Don't use this type directly, use NewOperationsClient() instead.

func NewOperationsClient

func NewOperationsClient(credential azcore.TokenCredential, options *arm.ClientOptions) (*OperationsClient, error)

NewOperationsClient creates a new instance of OperationsClient with the specified values.

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

func (*OperationsClient) NewListPager

NewListPager - Returns list of all operations.

Generated from API version 2020-06-05-preview

  • options - OperationsClientListOptions contains the optional parameters for the OperationsClient.NewListPager method.
Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/d55b8005f05b040b852c15e74a0f3e36494a15e1/specification/scvmm/resource-manager/Microsoft.ScVmm/preview/2020-06-05-preview/examples/ListOperations.json

package main

import (
	"context"
	"log"

	"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
	"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/scvmm/armscvmm"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armscvmm.NewClientFactory("<subscription-id>", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	pager := clientFactory.NewOperationsClient().NewListPager(nil)
	for pager.More() {
		page, err := pager.NextPage(ctx)
		if err != nil {
			log.Fatalf("failed to advance page: %v", err)
		}
		for _, v := range page.Value {
			// You could use page here. We use blank identifier for just demo purposes.
			_ = v
		}
		// If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes.
		// page.ResourceProviderOperationList = armscvmm.ResourceProviderOperationList{
		// 	Value: []*armscvmm.ResourceProviderOperation{
		// 		{
		// 			Name: to.Ptr("Microsoft.ScVmm/VmmServers/Read"),
		// 			Display: &armscvmm.ResourceProviderOperationDisplay{
		// 				Description: to.Ptr("Gets/List the VmmServer resource data."),
		// 				Operation: to.Ptr("Gets/List VmmServer resources."),
		// 				Provider: to.Ptr("Microsoft.ScVmm resource provider"),
		// 				Resource: to.Ptr("VmmServers"),
		// 			},
		// 		},
		// 		{
		// 			Name: to.Ptr("Microsoft.ScVmm/VmmServers/Write"),
		// 			Display: &armscvmm.ResourceProviderOperationDisplay{
		// 				Description: to.Ptr("Read VmmServer."),
		// 				Operation: to.Ptr("Create or Update VmmServer resource."),
		// 				Provider: to.Ptr("Microsoft.ScVmm resource provider"),
		// 				Resource: to.Ptr("VmmServers"),
		// 			},
		// 		},
		// 		{
		// 			Name: to.Ptr("Microsoft.ScVmm/VmmServers/Delete"),
		// 			Display: &armscvmm.ResourceProviderOperationDisplay{
		// 				Description: to.Ptr("Deletes the VmmServer resource."),
		// 				Operation: to.Ptr("Deletes the VmmServer resource."),
		// 				Provider: to.Ptr("Microsoft.ScVmm resource provider"),
		// 				Resource: to.Ptr("VmmServers"),
		// 			},
		// 		},
		// 		{
		// 			Name: to.Ptr("Microsoft.ScVmm/Clouds/Read"),
		// 			Display: &armscvmm.ResourceProviderOperationDisplay{
		// 				Description: to.Ptr("Gets/List the Cloud resource data."),
		// 				Operation: to.Ptr("Gets/List Cloud resources."),
		// 				Provider: to.Ptr("Microsoft.ScVmm resource provider"),
		// 				Resource: to.Ptr("Clouds"),
		// 			},
		// 		},
		// 		{
		// 			Name: to.Ptr("Microsoft.ScVmm/Clouds/Write"),
		// 			Display: &armscvmm.ResourceProviderOperationDisplay{
		// 				Description: to.Ptr("Create or Update Cloud resource data."),
		// 				Operation: to.Ptr("Create or Update Cloud resource."),
		// 				Provider: to.Ptr("Microsoft.ScVmm resource provider"),
		// 				Resource: to.Ptr("Clouds"),
		// 			},
		// 		},
		// 		{
		// 			Name: to.Ptr("Microsoft.ScVmm/Clouds/Delete"),
		// 			Display: &armscvmm.ResourceProviderOperationDisplay{
		// 				Description: to.Ptr("Deletes the Cloud resource."),
		// 				Operation: to.Ptr("Deletes the Cloud resource."),
		// 				Provider: to.Ptr("Microsoft.ScVmm resource provider"),
		// 				Resource: to.Ptr("Clouds"),
		// 			},
		// 		},
		// 		{
		// 			Name: to.Ptr("Microsoft.ScVmm/VirtualNetworks/Read"),
		// 			Display: &armscvmm.ResourceProviderOperationDisplay{
		// 				Description: to.Ptr("Gets/List the VirtualNetwork resource data."),
		// 				Operation: to.Ptr("Gets/List VirtualNetwork resources."),
		// 				Provider: to.Ptr("Microsoft.ScVmm resource provider"),
		// 				Resource: to.Ptr("VirtualNetworks"),
		// 			},
		// 		},
		// 		{
		// 			Name: to.Ptr("Microsoft.ScVmm/VirtualNetworks/Write"),
		// 			Display: &armscvmm.ResourceProviderOperationDisplay{
		// 				Description: to.Ptr("Create or Update VirtualNetwork resource data."),
		// 				Operation: to.Ptr("Create or Update VirtualNetwork resource."),
		// 				Provider: to.Ptr("Microsoft.ScVmm resource provider"),
		// 				Resource: to.Ptr("VirtualNetworks"),
		// 			},
		// 		},
		// 		{
		// 			Name: to.Ptr("Microsoft.ScVmm/VirtualNetworks/Delete"),
		// 			Display: &armscvmm.ResourceProviderOperationDisplay{
		// 				Description: to.Ptr("Deletes the VirtualNetwork resource."),
		// 				Operation: to.Ptr("Deletes the VirtualNetwork resource."),
		// 				Provider: to.Ptr("Microsoft.ScVmm resource provider"),
		// 				Resource: to.Ptr("VirtualNetworks"),
		// 			},
		// 		},
		// 		{
		// 			Name: to.Ptr("Microsoft.ScVmm/VirtualMachineTemplates/Read"),
		// 			Display: &armscvmm.ResourceProviderOperationDisplay{
		// 				Description: to.Ptr("Gets/List the VirtualMachineTemplate resource data."),
		// 				Operation: to.Ptr("Gets/List VirtualMachineTemplate resources."),
		// 				Provider: to.Ptr("Microsoft.ScVmm resource provider"),
		// 				Resource: to.Ptr("VirtualMachineTemplates"),
		// 			},
		// 		},
		// 		{
		// 			Name: to.Ptr("Microsoft.ScVmm/VirtualMachineTemplates/Write"),
		// 			Display: &armscvmm.ResourceProviderOperationDisplay{
		// 				Description: to.Ptr("Create or Update VirtualMachineTemplate resource data."),
		// 				Operation: to.Ptr("Create or Update VirtualMachineTemplate resource."),
		// 				Provider: to.Ptr("Microsoft.ScVmm resource provider"),
		// 				Resource: to.Ptr("VirtualMachineTemplates"),
		// 			},
		// 		},
		// 		{
		// 			Name: to.Ptr("Microsoft.ScVmm/VirtualMachineTemplates/Delete"),
		// 			Display: &armscvmm.ResourceProviderOperationDisplay{
		// 				Description: to.Ptr("Deletes the VirtualMachineTemplate resource."),
		// 				Operation: to.Ptr("Deletes the VirtualMachineTemplate resource."),
		// 				Provider: to.Ptr("Microsoft.ScVmm resource provider"),
		// 				Resource: to.Ptr("VirtualMachineTemplates"),
		// 			},
		// 		},
		// 		{
		// 			Name: to.Ptr("Microsoft.ScVmm/VirtualMachines/Read"),
		// 			Display: &armscvmm.ResourceProviderOperationDisplay{
		// 				Description: to.Ptr("Gets/List the VirtualMachine resource data."),
		// 				Operation: to.Ptr("Gets/List VirtualMachine resources."),
		// 				Provider: to.Ptr("Microsoft.ScVmm resource provider"),
		// 				Resource: to.Ptr("VirtualMachines"),
		// 			},
		// 		},
		// 		{
		// 			Name: to.Ptr("Microsoft.ScVmm/VirtualMachines/Write"),
		// 			Display: &armscvmm.ResourceProviderOperationDisplay{
		// 				Description: to.Ptr("Create or Update VirtualMachine resource data."),
		// 				Operation: to.Ptr("Create or Update VirtualMachine resource."),
		// 				Provider: to.Ptr("Microsoft.ScVmm resource provider"),
		// 				Resource: to.Ptr("VirtualMachines"),
		// 			},
		// 		},
		// 		{
		// 			Name: to.Ptr("Microsoft.ScVmm/VirtualMachines/Delete"),
		// 			Display: &armscvmm.ResourceProviderOperationDisplay{
		// 				Description: to.Ptr("Deletes the VirtualMachine resource."),
		// 				Operation: to.Ptr("Deletes the VirtualMachine resource."),
		// 				Provider: to.Ptr("Microsoft.ScVmm resource provider"),
		// 				Resource: to.Ptr("VirtualMachines"),
		// 			},
		// 	}},
		// }
	}
}
Output:

type OperationsClientListOptions

type OperationsClientListOptions struct {
}

OperationsClientListOptions contains the optional parameters for the OperationsClient.NewListPager method.

type OperationsClientListResponse

type OperationsClientListResponse struct {
	// Results of the request to list operations.
	ResourceProviderOperationList
}

OperationsClientListResponse contains the response from method OperationsClient.NewListPager.

type OsProfile

type OsProfile struct {
	// Admin password of the virtual machine.
	AdminPassword *string

	// Gets or sets computer name.
	ComputerName *string

	// READ-ONLY; Gets or sets os name.
	OSName *string

	// READ-ONLY; Gets or sets the type of the os.
	OSType *OsType
}

OsProfile - Defines the resource properties.

func (OsProfile) MarshalJSON added in v0.3.0

func (o OsProfile) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.Marshaller interface for type OsProfile.

func (*OsProfile) UnmarshalJSON added in v0.3.0

func (o *OsProfile) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the json.Unmarshaller interface for type OsProfile.

type OsType

type OsType string

OsType - Defines the different types of VM guest operating systems.

const (
	OsTypeLinux   OsType = "Linux"
	OsTypeOther   OsType = "Other"
	OsTypeWindows OsType = "Windows"
)

func PossibleOsTypeValues

func PossibleOsTypeValues() []OsType

PossibleOsTypeValues returns the possible values for the OsType const type.

type ProxyResource

type ProxyResource struct {
	// READ-ONLY; Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}
	ID *string

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

	// READ-ONLY; The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts"
	Type *string
}

ProxyResource - The resource model definition for a Azure Resource Manager proxy resource. It will not have tags and a location

func (ProxyResource) MarshalJSON added in v0.3.0

func (p ProxyResource) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.Marshaller interface for type ProxyResource.

func (*ProxyResource) UnmarshalJSON added in v0.3.0

func (p *ProxyResource) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the json.Unmarshaller interface for type ProxyResource.

type Resource

type Resource struct {
	// READ-ONLY; Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}
	ID *string

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

	// READ-ONLY; The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts"
	Type *string
}

Resource - Common fields that are returned in the response for all Azure Resource Manager resources

func (Resource) MarshalJSON added in v0.3.0

func (r Resource) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.Marshaller interface for type Resource.

func (*Resource) UnmarshalJSON added in v0.3.0

func (r *Resource) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the json.Unmarshaller interface for type Resource.

type ResourcePatch

type ResourcePatch struct {
	// Resource tags.
	Tags map[string]*string
}

ResourcePatch - Object containing tags updates for patch operations.

func (ResourcePatch) MarshalJSON

func (r ResourcePatch) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.Marshaller interface for type ResourcePatch.

func (*ResourcePatch) UnmarshalJSON added in v0.3.0

func (r *ResourcePatch) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the json.Unmarshaller interface for type ResourcePatch.

type ResourceProviderOperation

type ResourceProviderOperation struct {
	// Display metadata associated with the operation.
	Display *ResourceProviderOperationDisplay

	// Indicates whether the operation applies to data-plane.
	IsDataAction *string

	// Operation name, in format of {provider}/{resource}/{operation}.
	Name *string
}

ResourceProviderOperation - Results of the request to list operations.

func (ResourceProviderOperation) MarshalJSON added in v0.3.0

func (r ResourceProviderOperation) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.Marshaller interface for type ResourceProviderOperation.

func (*ResourceProviderOperation) UnmarshalJSON added in v0.3.0

func (r *ResourceProviderOperation) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the json.Unmarshaller interface for type ResourceProviderOperation.

type ResourceProviderOperationDisplay

type ResourceProviderOperationDisplay struct {
	// Description of this operation.
	Description *string

	// Type of operation: read, write, delete, etc.
	Operation *string

	// The resource provider.
	Provider *string

	// Resource on which the operation is performed.
	Resource *string
}

ResourceProviderOperationDisplay - Display metadata associated with the operation.

func (ResourceProviderOperationDisplay) MarshalJSON added in v0.3.0

func (r ResourceProviderOperationDisplay) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.Marshaller interface for type ResourceProviderOperationDisplay.

func (*ResourceProviderOperationDisplay) UnmarshalJSON added in v0.3.0

func (r *ResourceProviderOperationDisplay) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the json.Unmarshaller interface for type ResourceProviderOperationDisplay.

type ResourceProviderOperationList

type ResourceProviderOperationList struct {
	// Url to follow for getting next page of resources.
	NextLink *string

	// List of Operations.
	Value []*ResourceProviderOperation
}

ResourceProviderOperationList - Results of the request to list operations.

func (ResourceProviderOperationList) MarshalJSON

func (r ResourceProviderOperationList) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.Marshaller interface for type ResourceProviderOperationList.

func (*ResourceProviderOperationList) UnmarshalJSON added in v0.3.0

func (r *ResourceProviderOperationList) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the json.Unmarshaller interface for type ResourceProviderOperationList.

type StopVirtualMachineOptions

type StopVirtualMachineOptions struct {
	// Gets or sets a value indicating whether to request non-graceful VM shutdown. True value for this flag indicates non-graceful
	// shutdown whereas false indicates otherwise. Defaults to false.
	SkipShutdown *bool
}

StopVirtualMachineOptions - Defines the stop action properties.

func (StopVirtualMachineOptions) MarshalJSON added in v0.3.0

func (s StopVirtualMachineOptions) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.Marshaller interface for type StopVirtualMachineOptions.

func (*StopVirtualMachineOptions) UnmarshalJSON added in v0.3.0

func (s *StopVirtualMachineOptions) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the json.Unmarshaller interface for type StopVirtualMachineOptions.

type StorageProfile

type StorageProfile struct {
	// Gets or sets the list of virtual disks associated with the virtual machine.
	Disks []*VirtualDisk
}

StorageProfile - Defines the resource properties.

func (StorageProfile) MarshalJSON

func (s StorageProfile) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.Marshaller interface for type StorageProfile.

func (*StorageProfile) UnmarshalJSON added in v0.3.0

func (s *StorageProfile) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the json.Unmarshaller interface for type StorageProfile.

type StorageProfileUpdate

type StorageProfileUpdate struct {
	// Gets or sets the list of virtual disks associated with the virtual machine.
	Disks []*VirtualDiskUpdate
}

StorageProfileUpdate - Defines the resource properties.

func (StorageProfileUpdate) MarshalJSON

func (s StorageProfileUpdate) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.Marshaller interface for type StorageProfileUpdate.

func (*StorageProfileUpdate) UnmarshalJSON added in v0.3.0

func (s *StorageProfileUpdate) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the json.Unmarshaller interface for type StorageProfileUpdate.

type StorageQoSPolicy

type StorageQoSPolicy struct {
	// The Bandwidth Limit for internet traffic.
	BandwidthLimit *int64

	// The ID of the QoS policy.
	ID *string

	// The maximum IO operations per second.
	IopsMaximum *int64

	// The minimum IO operations per second.
	IopsMinimum *int64

	// The name of the policy.
	Name *string

	// The underlying policy.
	PolicyID *string
}

StorageQoSPolicy - The StorageQoSPolicy definition.

func (StorageQoSPolicy) MarshalJSON added in v0.3.0

func (s StorageQoSPolicy) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.Marshaller interface for type StorageQoSPolicy.

func (*StorageQoSPolicy) UnmarshalJSON added in v0.3.0

func (s *StorageQoSPolicy) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the json.Unmarshaller interface for type StorageQoSPolicy.

type StorageQoSPolicyDetails

type StorageQoSPolicyDetails struct {
	// The ID of the QoS policy.
	ID *string

	// The name of the policy.
	Name *string
}

StorageQoSPolicyDetails - The StorageQoSPolicyDetails definition.

func (StorageQoSPolicyDetails) MarshalJSON added in v0.3.0

func (s StorageQoSPolicyDetails) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.Marshaller interface for type StorageQoSPolicyDetails.

func (*StorageQoSPolicyDetails) UnmarshalJSON added in v0.3.0

func (s *StorageQoSPolicyDetails) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the json.Unmarshaller interface for type StorageQoSPolicyDetails.

type SystemData

type SystemData struct {
	// The timestamp of resource creation (UTC).
	CreatedAt *time.Time

	// The identity that created the resource.
	CreatedBy *string

	// The type of identity that created the resource.
	CreatedByType *CreatedByType

	// The timestamp of resource last modification (UTC)
	LastModifiedAt *time.Time

	// The identity that last modified the resource.
	LastModifiedBy *string

	// The type of identity that last modified the resource.
	LastModifiedByType *CreatedByType
}

SystemData - Metadata pertaining to creation and last modification of the resource.

func (SystemData) MarshalJSON

func (s SystemData) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.Marshaller interface for type SystemData.

func (*SystemData) UnmarshalJSON

func (s *SystemData) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the json.Unmarshaller interface for type SystemData.

type VMMServer

type VMMServer struct {
	// REQUIRED; The extended location.
	ExtendedLocation *ExtendedLocation

	// REQUIRED; Gets or sets the location.
	Location *string

	// REQUIRED; Resource properties.
	Properties *VMMServerProperties

	// Resource tags
	Tags map[string]*string

	// READ-ONLY; Resource Id
	ID *string

	// READ-ONLY; Resource Name
	Name *string

	// READ-ONLY; The system data.
	SystemData *SystemData

	// READ-ONLY; Resource Type
	Type *string
}

VMMServer - The VmmServers resource definition.

func (VMMServer) MarshalJSON

func (v VMMServer) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.Marshaller interface for type VMMServer.

func (*VMMServer) UnmarshalJSON added in v0.3.0

func (v *VMMServer) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the json.Unmarshaller interface for type VMMServer.

type VMMServerListResult

type VMMServerListResult struct {
	// Url to follow for getting next page of resources.
	NextLink *string

	// List of VmmServers.
	Value []*VMMServer
}

VMMServerListResult - List of VmmServers.

func (VMMServerListResult) MarshalJSON

func (v VMMServerListResult) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.Marshaller interface for type VMMServerListResult.

func (*VMMServerListResult) UnmarshalJSON added in v0.3.0

func (v *VMMServerListResult) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the json.Unmarshaller interface for type VMMServerListResult.

type VMMServerProperties

type VMMServerProperties struct {
	// REQUIRED; Fqdn is the hostname/ip of the vmmServer.
	Fqdn *string

	// Credentials to connect to VMMServer.
	Credentials *VMMServerPropertiesCredentials

	// Port is the port on which the vmmServer is listening.
	Port *int32

	// READ-ONLY; Gets or sets the connection status to the vmmServer.
	ConnectionStatus *string

	// READ-ONLY; Gets or sets any error message if connection to vmmServer is having any issue.
	ErrorMessage *string

	// READ-ONLY; Gets or sets the provisioning state.
	ProvisioningState *string

	// READ-ONLY; Unique ID of vmmServer.
	UUID *string

	// READ-ONLY; Version is the version of the vmmSever.
	Version *string
}

VMMServerProperties - Defines the resource properties.

func (VMMServerProperties) MarshalJSON added in v0.3.0

func (v VMMServerProperties) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.Marshaller interface for type VMMServerProperties.

func (*VMMServerProperties) UnmarshalJSON added in v0.3.0

func (v *VMMServerProperties) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the json.Unmarshaller interface for type VMMServerProperties.

type VMMServerPropertiesCredentials

type VMMServerPropertiesCredentials struct {
	// Credentials to use to connect to VMMServer.
	Password *string

	// Username to use to connect to VMMServer.
	Username *string
}

VMMServerPropertiesCredentials - Credentials to connect to VMMServer.

func (VMMServerPropertiesCredentials) MarshalJSON added in v0.3.0

func (v VMMServerPropertiesCredentials) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.Marshaller interface for type VMMServerPropertiesCredentials.

func (*VMMServerPropertiesCredentials) UnmarshalJSON added in v0.3.0

func (v *VMMServerPropertiesCredentials) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the json.Unmarshaller interface for type VMMServerPropertiesCredentials.

type VirtualDisk

type VirtualDisk struct {
	// Gets or sets the disk bus.
	Bus *int32

	// Gets or sets the disk bus type.
	BusType *string

	// Gets or sets a value indicating diff disk.
	CreateDiffDisk *CreateDiffDisk

	// Gets or sets the disk id.
	DiskID *string

	// Gets or sets the disk total size.
	DiskSizeGB *int32

	// Gets or sets the disk lun.
	Lun *int32

	// Gets or sets the name of the disk.
	Name *string

	// The QoS policy for the disk.
	StorageQoSPolicy *StorageQoSPolicyDetails

	// Gets or sets the disk id in the template.
	TemplateDiskID *string

	// Gets or sets the disk vhd type.
	VhdType *string

	// READ-ONLY; Gets the display name of the virtual disk as shown in the vmmServer. This is the fallback label for a disk when
	// the name is not set.
	DisplayName *string

	// READ-ONLY; Gets or sets the max disk size.
	MaxDiskSizeGB *int32

	// READ-ONLY; Gets the disk vhd format type.
	VhdFormatType *string

	// READ-ONLY; Gets or sets the disk volume type.
	VolumeType *string
}

VirtualDisk - Virtual disk model

func (VirtualDisk) MarshalJSON added in v0.3.0

func (v VirtualDisk) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.Marshaller interface for type VirtualDisk.

func (*VirtualDisk) UnmarshalJSON added in v0.3.0

func (v *VirtualDisk) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the json.Unmarshaller interface for type VirtualDisk.

type VirtualDiskUpdate

type VirtualDiskUpdate struct {
	// Gets or sets the disk bus.
	Bus *int32

	// Gets or sets the disk bus type.
	BusType *string

	// Gets or sets the disk id.
	DiskID *string

	// Gets or sets the disk total size.
	DiskSizeGB *int32

	// Gets or sets the disk lun.
	Lun *int32

	// Gets or sets the name of the disk.
	Name *string

	// The QoS policy for the disk.
	StorageQoSPolicy *StorageQoSPolicyDetails

	// Gets or sets the disk vhd type.
	VhdType *string
}

VirtualDiskUpdate - Virtual disk model

func (VirtualDiskUpdate) MarshalJSON added in v0.3.0

func (v VirtualDiskUpdate) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.Marshaller interface for type VirtualDiskUpdate.

func (*VirtualDiskUpdate) UnmarshalJSON added in v0.3.0

func (v *VirtualDiskUpdate) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the json.Unmarshaller interface for type VirtualDiskUpdate.

type VirtualMachine

type VirtualMachine struct {
	// REQUIRED; The extended location.
	ExtendedLocation *ExtendedLocation

	// REQUIRED; Gets or sets the location.
	Location *string

	// REQUIRED; Resource properties.
	Properties *VirtualMachineProperties

	// Resource tags
	Tags map[string]*string

	// READ-ONLY; Resource Id
	ID *string

	// READ-ONLY; Resource Name
	Name *string

	// READ-ONLY; The system data.
	SystemData *SystemData

	// READ-ONLY; Resource Type
	Type *string
}

VirtualMachine - The VirtualMachines resource definition.

func (VirtualMachine) MarshalJSON

func (v VirtualMachine) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.Marshaller interface for type VirtualMachine.

func (*VirtualMachine) UnmarshalJSON added in v0.3.0

func (v *VirtualMachine) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the json.Unmarshaller interface for type VirtualMachine.

type VirtualMachineCreateCheckpoint

type VirtualMachineCreateCheckpoint struct {
	// Description of the checkpoint.
	Description *string

	// Name of the checkpoint.
	Name *string
}

VirtualMachineCreateCheckpoint - Defines the create checkpoint action properties.

func (VirtualMachineCreateCheckpoint) MarshalJSON added in v0.3.0

func (v VirtualMachineCreateCheckpoint) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.Marshaller interface for type VirtualMachineCreateCheckpoint.

func (*VirtualMachineCreateCheckpoint) UnmarshalJSON added in v0.3.0

func (v *VirtualMachineCreateCheckpoint) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the json.Unmarshaller interface for type VirtualMachineCreateCheckpoint.

type VirtualMachineDeleteCheckpoint

type VirtualMachineDeleteCheckpoint struct {
	// ID of the checkpoint to be deleted.
	ID *string
}

VirtualMachineDeleteCheckpoint - Defines the delete checkpoint action properties.

func (VirtualMachineDeleteCheckpoint) MarshalJSON added in v0.3.0

func (v VirtualMachineDeleteCheckpoint) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.Marshaller interface for type VirtualMachineDeleteCheckpoint.

func (*VirtualMachineDeleteCheckpoint) UnmarshalJSON added in v0.3.0

func (v *VirtualMachineDeleteCheckpoint) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the json.Unmarshaller interface for type VirtualMachineDeleteCheckpoint.

type VirtualMachineInventoryItem

type VirtualMachineInventoryItem struct {
	// REQUIRED; They inventory type.
	InventoryType *InventoryType

	// Cloud inventory resource details where the VM is present.
	Cloud *InventoryItemDetails

	// Gets or sets the nic ip addresses.
	IPAddresses []*string

	// READ-ONLY; Gets the Managed Object name in VMM for the inventory item.
	InventoryItemName *string

	// READ-ONLY; Gets the tracked resource id corresponding to the inventory resource.
	ManagedResourceID *string

	// READ-ONLY; Gets or sets os name.
	OSName *string

	// READ-ONLY; Gets or sets the type of the os.
	OSType *OsType

	// READ-ONLY; Gets the power state of the virtual machine.
	PowerState *string

	// READ-ONLY; Gets the provisioning state.
	ProvisioningState *string

	// READ-ONLY; Gets the UUID (which is assigned by VMM) for the inventory item.
	UUID *string
}

VirtualMachineInventoryItem - The Virtual machine inventory item.

func (*VirtualMachineInventoryItem) GetInventoryItemProperties

func (v *VirtualMachineInventoryItem) GetInventoryItemProperties() *InventoryItemProperties

GetInventoryItemProperties implements the InventoryItemPropertiesClassification interface for type VirtualMachineInventoryItem.

func (VirtualMachineInventoryItem) MarshalJSON

func (v VirtualMachineInventoryItem) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.Marshaller interface for type VirtualMachineInventoryItem.

func (*VirtualMachineInventoryItem) UnmarshalJSON

func (v *VirtualMachineInventoryItem) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the json.Unmarshaller interface for type VirtualMachineInventoryItem.

type VirtualMachineListResult

type VirtualMachineListResult struct {
	// Url to follow for getting next page of resources.
	NextLink *string

	// List of VirtualMachines.
	Value []*VirtualMachine
}

VirtualMachineListResult - List of VirtualMachines.

func (VirtualMachineListResult) MarshalJSON

func (v VirtualMachineListResult) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.Marshaller interface for type VirtualMachineListResult.

func (*VirtualMachineListResult) UnmarshalJSON added in v0.3.0

func (v *VirtualMachineListResult) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the json.Unmarshaller interface for type VirtualMachineListResult.

type VirtualMachineProperties

type VirtualMachineProperties struct {
	// Availability Sets in vm.
	AvailabilitySets []*AvailabilitySetListItem

	// Type of checkpoint supported for the vm.
	CheckpointType *string

	// Checkpoints in the vm.
	Checkpoints []*Checkpoint

	// ARM Id of the cloud resource to use for deploying the vm.
	CloudID *string

	// Gets or sets the generation for the vm.
	Generation *int32

	// Hardware properties.
	HardwareProfile *HardwareProfile

	// Gets or sets the inventory Item ID for the resource.
	InventoryItemID *string

	// Network properties.
	NetworkProfile *NetworkProfile

	// OS properties.
	OSProfile *OsProfile

	// Storage properties.
	StorageProfile *StorageProfile

	// ARM Id of the template resource to use for deploying the vm.
	TemplateID *string

	// Unique ID of the virtual machine.
	UUID *string

	// VMName is the name of VM on the SCVMM server.
	VMName *string

	// ARM Id of the vmmServer resource in which this resource resides.
	VmmServerID *string

	// READ-ONLY; Gets the power state of the virtual machine.
	PowerState *string

	// READ-ONLY; Gets or sets the provisioning state.
	ProvisioningState *string
}

VirtualMachineProperties - Defines the resource properties.

func (VirtualMachineProperties) MarshalJSON

func (v VirtualMachineProperties) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.Marshaller interface for type VirtualMachineProperties.

func (*VirtualMachineProperties) UnmarshalJSON added in v0.3.0

func (v *VirtualMachineProperties) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the json.Unmarshaller interface for type VirtualMachineProperties.

type VirtualMachineRestoreCheckpoint

type VirtualMachineRestoreCheckpoint struct {
	// ID of the checkpoint to be restored to.
	ID *string
}

VirtualMachineRestoreCheckpoint - Defines the restore checkpoint action properties.

func (VirtualMachineRestoreCheckpoint) MarshalJSON added in v0.3.0

func (v VirtualMachineRestoreCheckpoint) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.Marshaller interface for type VirtualMachineRestoreCheckpoint.

func (*VirtualMachineRestoreCheckpoint) UnmarshalJSON added in v0.3.0

func (v *VirtualMachineRestoreCheckpoint) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the json.Unmarshaller interface for type VirtualMachineRestoreCheckpoint.

type VirtualMachineTemplate

type VirtualMachineTemplate struct {
	// REQUIRED; The extended location.
	ExtendedLocation *ExtendedLocation

	// REQUIRED; Gets or sets the location.
	Location *string

	// REQUIRED; Resource properties.
	Properties *VirtualMachineTemplateProperties

	// Resource tags
	Tags map[string]*string

	// READ-ONLY; Resource Id
	ID *string

	// READ-ONLY; Resource Name
	Name *string

	// READ-ONLY; The system data.
	SystemData *SystemData

	// READ-ONLY; Resource Type
	Type *string
}

VirtualMachineTemplate - The VirtualMachineTemplates resource definition.

func (VirtualMachineTemplate) MarshalJSON

func (v VirtualMachineTemplate) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.Marshaller interface for type VirtualMachineTemplate.

func (*VirtualMachineTemplate) UnmarshalJSON added in v0.3.0

func (v *VirtualMachineTemplate) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the json.Unmarshaller interface for type VirtualMachineTemplate.

type VirtualMachineTemplateInventoryItem

type VirtualMachineTemplateInventoryItem struct {
	// REQUIRED; They inventory type.
	InventoryType *InventoryType

	// READ-ONLY; Gets or sets the desired number of vCPUs for the vm.
	CPUCount *int32

	// READ-ONLY; Gets the Managed Object name in VMM for the inventory item.
	InventoryItemName *string

	// READ-ONLY; Gets the tracked resource id corresponding to the inventory resource.
	ManagedResourceID *string

	// READ-ONLY; MemoryMB is the desired size of a virtual machine's memory, in MB.
	MemoryMB *int32

	// READ-ONLY; Gets or sets os name.
	OSName *string

	// READ-ONLY; Gets or sets the type of the os.
	OSType *OsType

	// READ-ONLY; Gets the provisioning state.
	ProvisioningState *string

	// READ-ONLY; Gets the UUID (which is assigned by VMM) for the inventory item.
	UUID *string
}

VirtualMachineTemplateInventoryItem - The Virtual machine template inventory item.

func (*VirtualMachineTemplateInventoryItem) GetInventoryItemProperties

func (v *VirtualMachineTemplateInventoryItem) GetInventoryItemProperties() *InventoryItemProperties

GetInventoryItemProperties implements the InventoryItemPropertiesClassification interface for type VirtualMachineTemplateInventoryItem.

func (VirtualMachineTemplateInventoryItem) MarshalJSON

func (v VirtualMachineTemplateInventoryItem) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.Marshaller interface for type VirtualMachineTemplateInventoryItem.

func (*VirtualMachineTemplateInventoryItem) UnmarshalJSON

func (v *VirtualMachineTemplateInventoryItem) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the json.Unmarshaller interface for type VirtualMachineTemplateInventoryItem.

type VirtualMachineTemplateListResult

type VirtualMachineTemplateListResult struct {
	// Url to follow for getting next page of resources.
	NextLink *string

	// List of VirtualMachineTemplates.
	Value []*VirtualMachineTemplate
}

VirtualMachineTemplateListResult - List of VirtualMachineTemplates.

func (VirtualMachineTemplateListResult) MarshalJSON

func (v VirtualMachineTemplateListResult) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.Marshaller interface for type VirtualMachineTemplateListResult.

func (*VirtualMachineTemplateListResult) UnmarshalJSON added in v0.3.0

func (v *VirtualMachineTemplateListResult) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the json.Unmarshaller interface for type VirtualMachineTemplateListResult.

type VirtualMachineTemplateProperties

type VirtualMachineTemplateProperties struct {
	// Gets or sets the inventory Item ID for the resource.
	InventoryItemID *string

	// Unique ID of the virtual machine template.
	UUID *string

	// ARM Id of the vmmServer resource in which this resource resides.
	VmmServerID *string

	// READ-ONLY; Gets or sets the desired number of vCPUs for the vm.
	CPUCount *int32

	// READ-ONLY; Gets or sets computer name.
	ComputerName *string

	// READ-ONLY; Gets or sets the disks of the template.
	Disks []*VirtualDisk

	// READ-ONLY; Gets or sets a value indicating whether to enable dynamic memory or not.
	DynamicMemoryEnabled *DynamicMemoryEnabled

	// READ-ONLY; Gets or sets the max dynamic memory for the vm.
	DynamicMemoryMaxMB *int32

	// READ-ONLY; Gets or sets the min dynamic memory for the vm.
	DynamicMemoryMinMB *int32

	// READ-ONLY; Gets or sets the generation for the vm.
	Generation *int32

	// READ-ONLY; Gets or sets a value indicating whether the vm template is customizable or not.
	IsCustomizable *IsCustomizable

	// READ-ONLY; Gets highly available property.
	IsHighlyAvailable *string

	// READ-ONLY; Gets or sets a value indicating whether to enable processor compatibility mode for live migration of VMs.
	LimitCPUForMigration *LimitCPUForMigration

	// READ-ONLY; MemoryMB is the desired size of a virtual machine's memory, in MB.
	MemoryMB *int32

	// READ-ONLY; Gets or sets the network interfaces of the template.
	NetworkInterfaces []*NetworkInterfaces

	// READ-ONLY; Gets or sets os name.
	OSName *string

	// READ-ONLY; Gets or sets the type of the os.
	OSType *OsType

	// READ-ONLY; Gets or sets the provisioning state.
	ProvisioningState *string
}

VirtualMachineTemplateProperties - Defines the resource properties.

func (VirtualMachineTemplateProperties) MarshalJSON

func (v VirtualMachineTemplateProperties) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.Marshaller interface for type VirtualMachineTemplateProperties.

func (*VirtualMachineTemplateProperties) UnmarshalJSON added in v0.3.0

func (v *VirtualMachineTemplateProperties) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the json.Unmarshaller interface for type VirtualMachineTemplateProperties.

type VirtualMachineTemplatesClient

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

VirtualMachineTemplatesClient contains the methods for the VirtualMachineTemplates group. Don't use this type directly, use NewVirtualMachineTemplatesClient() instead.

func NewVirtualMachineTemplatesClient

func NewVirtualMachineTemplatesClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*VirtualMachineTemplatesClient, error)

NewVirtualMachineTemplatesClient creates a new instance of VirtualMachineTemplatesClient with the specified values.

  • subscriptionID - The Azure subscription ID. This is a GUID-formatted string (e.g. 00000000-0000-0000-0000-000000000000).
  • credential - used to authorize requests. Usually a credential from azidentity.
  • options - pass nil to accept the default values.

func (*VirtualMachineTemplatesClient) BeginCreateOrUpdate

BeginCreateOrUpdate - Onboards the ScVmm VM Template as an Azure VM Template resource. If the operation fails it returns an *azcore.ResponseError type.

Generated from API version 2020-06-05-preview

  • resourceGroupName - The name of the resource group.
  • virtualMachineTemplateName - Name of the VirtualMachineTemplate.
  • body - Request payload.
  • options - VirtualMachineTemplatesClientBeginCreateOrUpdateOptions contains the optional parameters for the VirtualMachineTemplatesClient.BeginCreateOrUpdate method.
Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/d55b8005f05b040b852c15e74a0f3e36494a15e1/specification/scvmm/resource-manager/Microsoft.ScVmm/preview/2020-06-05-preview/examples/CreateVirtualMachineTemplate.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/scvmm/armscvmm"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armscvmm.NewClientFactory("<subscription-id>", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	poller, err := clientFactory.NewVirtualMachineTemplatesClient().BeginCreateOrUpdate(ctx, "testrg", "HRVirtualMachineTemplate", armscvmm.VirtualMachineTemplate{
		ExtendedLocation: &armscvmm.ExtendedLocation{
			Name: to.Ptr("/subscriptions/a5015e1c-867f-4533-8541-85cd470d0cfb/resourceGroups/demoRG/providers/Microsoft.Arc/customLocations/contoso"),
			Type: to.Ptr("customLocation"),
		},
		Location: to.Ptr("East US"),
		Properties: &armscvmm.VirtualMachineTemplateProperties{
			UUID:        to.Ptr("aaaaaaa-bbbb-cccc-dddd-eeeeeeeeeeee"),
			VmmServerID: to.Ptr("/subscriptions/fd3c3665-1729-4b7b-9a38-238e83b0f98b/resourceGroups/testrg/providers/Microsoft.SCVMM/VMMServers/ContosoVMMServer"),
		},
	}, 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.VirtualMachineTemplate = armscvmm.VirtualMachineTemplate{
	// 	Name: to.Ptr("HRVirtualMachineTemplate"),
	// 	Type: to.Ptr("Microsoft.SCVMM/VirtualMachineTemplates"),
	// 	ExtendedLocation: &armscvmm.ExtendedLocation{
	// 		Name: to.Ptr("/subscriptions/a5015e1c-867f-4533-8541-85cd470d0cfb/resourceGroups/demoRG/providers/Microsoft.Arc/customLocations/contoso"),
	// 		Type: to.Ptr("customLocation"),
	// 	},
	// 	ID: to.Ptr("/subscriptions/fd3c3665-1729-4b7b-9a38-238e83b0f98b/resourceGroups/testrg/providers/Microsoft.SCVMM/VirtualMachineTemplates/HRVirtualMachineTemplate"),
	// 	Location: to.Ptr("East US"),
	// 	Properties: &armscvmm.VirtualMachineTemplateProperties{
	// 		ProvisioningState: to.Ptr("Succeeded"),
	// 		UUID: to.Ptr("aaaaaaa-bbbb-cccc-dddd-eeeeeeeeeeee"),
	// 		VmmServerID: to.Ptr("/subscriptions/fd3c3665-1729-4b7b-9a38-238e83b0f98b/resourceGroups/testrg/providers/Microsoft.SCVMM/VMMServers/ContosoVMMServer"),
	// 	},
	// }
}
Output:

func (*VirtualMachineTemplatesClient) BeginDelete

BeginDelete - Deregisters the ScVmm VM Template from Azure. If the operation fails it returns an *azcore.ResponseError type.

Generated from API version 2020-06-05-preview

  • resourceGroupName - The name of the resource group.
  • virtualMachineTemplateName - Name of the VirtualMachineTemplate.
  • options - VirtualMachineTemplatesClientBeginDeleteOptions contains the optional parameters for the VirtualMachineTemplatesClient.BeginDelete method.
Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/d55b8005f05b040b852c15e74a0f3e36494a15e1/specification/scvmm/resource-manager/Microsoft.ScVmm/preview/2020-06-05-preview/examples/DeleteVirtualMachineTemplate.json

package main

import (
	"context"
	"log"

	"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
	"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/scvmm/armscvmm"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armscvmm.NewClientFactory("<subscription-id>", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	poller, err := clientFactory.NewVirtualMachineTemplatesClient().BeginDelete(ctx, "testrg", "HRVirtualMachineTemplate", &armscvmm.VirtualMachineTemplatesClientBeginDeleteOptions{Force: 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 (*VirtualMachineTemplatesClient) BeginUpdate

BeginUpdate - Updates the VirtualMachineTemplate resource. If the operation fails it returns an *azcore.ResponseError type.

Generated from API version 2020-06-05-preview

  • resourceGroupName - The name of the resource group.
  • virtualMachineTemplateName - Name of the VirtualMachineTemplate.
  • body - VirtualMachineTemplates patch details.
  • options - VirtualMachineTemplatesClientBeginUpdateOptions contains the optional parameters for the VirtualMachineTemplatesClient.BeginUpdate method.
Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/d55b8005f05b040b852c15e74a0f3e36494a15e1/specification/scvmm/resource-manager/Microsoft.ScVmm/preview/2020-06-05-preview/examples/UpdateVirtualMachineTemplate.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/scvmm/armscvmm"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armscvmm.NewClientFactory("<subscription-id>", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	poller, err := clientFactory.NewVirtualMachineTemplatesClient().BeginUpdate(ctx, "testrg", "HRVirtualMachineTemplate", armscvmm.ResourcePatch{
		Tags: map[string]*string{
			"tag1": to.Ptr("value1"),
			"tag2": to.Ptr("value2"),
		},
	}, 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.VirtualMachineTemplate = armscvmm.VirtualMachineTemplate{
	// 	Name: to.Ptr("HRVirtualMachineTemplate"),
	// 	Type: to.Ptr("Microsoft.SCVMM/VirtualMachineTemplates"),
	// 	ExtendedLocation: &armscvmm.ExtendedLocation{
	// 		Name: to.Ptr("/subscriptions/a5015e1c-867f-4533-8541-85cd470d0cfb/resourceGroups/demoRG/providers/Microsoft.Arc/customLocations/contoso"),
	// 		Type: to.Ptr("customLocation"),
	// 	},
	// 	ID: to.Ptr("/subscriptions/fd3c3665-1729-4b7b-9a38-238e83b0f98b/resourceGroups/testrg/providers/Microsoft.SCVMM/VirtualMachineTemplates/HRVirtualMachineTemplate"),
	// 	Location: to.Ptr("East US"),
	// 	Properties: &armscvmm.VirtualMachineTemplateProperties{
	// 		ProvisioningState: to.Ptr("Succeeded"),
	// 		UUID: to.Ptr("aaaaaaa-bbbb-cccc-dddd-eeeeeeeeeeee"),
	// 		VmmServerID: to.Ptr("/subscriptions/fd3c3665-1729-4b7b-9a38-238e83b0f98b/resourceGroups/testrg/providers/Microsoft.SCVMM/VMMServers/ContosoVMMServer"),
	// 	},
	// 	Tags: map[string]*string{
	// 		"tag1": to.Ptr("value1"),
	// 		"tag2": to.Ptr("value2"),
	// 	},
	// }
}
Output:

func (*VirtualMachineTemplatesClient) Get

func (client *VirtualMachineTemplatesClient) Get(ctx context.Context, resourceGroupName string, virtualMachineTemplateName string, options *VirtualMachineTemplatesClientGetOptions) (VirtualMachineTemplatesClientGetResponse, error)

Get - Implements VirtualMachineTemplate GET method. If the operation fails it returns an *azcore.ResponseError type.

Generated from API version 2020-06-05-preview

  • resourceGroupName - The name of the resource group.
  • virtualMachineTemplateName - Name of the VirtualMachineTemplate.
  • options - VirtualMachineTemplatesClientGetOptions contains the optional parameters for the VirtualMachineTemplatesClient.Get method.
Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/d55b8005f05b040b852c15e74a0f3e36494a15e1/specification/scvmm/resource-manager/Microsoft.ScVmm/preview/2020-06-05-preview/examples/GetVirtualMachineTemplate.json

package main

import (
	"context"
	"log"

	"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
	"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/scvmm/armscvmm"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armscvmm.NewClientFactory("<subscription-id>", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	res, err := clientFactory.NewVirtualMachineTemplatesClient().Get(ctx, "testrg", "HRVirtualMachineTemplate", 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.VirtualMachineTemplate = armscvmm.VirtualMachineTemplate{
	// 	Name: to.Ptr("HRVirtualMachineTemplate"),
	// 	Type: to.Ptr("Microsoft.SCVMM/VirtualMachineTemplates"),
	// 	ExtendedLocation: &armscvmm.ExtendedLocation{
	// 		Name: to.Ptr("/subscriptions/a5015e1c-867f-4533-8541-85cd470d0cfb/resourceGroups/demoRG/providers/Microsoft.Arc/customLocations/contoso"),
	// 		Type: to.Ptr("customLocation"),
	// 	},
	// 	ID: to.Ptr("/subscriptions/fd3c3665-1729-4b7b-9a38-238e83b0f98b/resourceGroups/testrg/providers/Microsoft.SCVMM/VirtualMachineTemplates/HRVirtualMachineTemplate"),
	// 	Location: to.Ptr("East US"),
	// 	Properties: &armscvmm.VirtualMachineTemplateProperties{
	// 		ProvisioningState: to.Ptr("Succeeded"),
	// 		UUID: to.Ptr("aaaaaaa-bbbb-cccc-dddd-eeeeeeeeeeee"),
	// 		VmmServerID: to.Ptr("/subscriptions/fd3c3665-1729-4b7b-9a38-238e83b0f98b/resourceGroups/testrg/providers/Microsoft.SCVMM/VMMServers/ContosoVMMServer"),
	// 	},
	// }
}
Output:

func (*VirtualMachineTemplatesClient) NewListByResourceGroupPager

NewListByResourceGroupPager - List of VirtualMachineTemplates in a resource group.

Generated from API version 2020-06-05-preview

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

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/d55b8005f05b040b852c15e74a0f3e36494a15e1/specification/scvmm/resource-manager/Microsoft.ScVmm/preview/2020-06-05-preview/examples/ListVirtualMachineTemplatesByResourceGroup.json

package main

import (
	"context"
	"log"

	"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
	"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/scvmm/armscvmm"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armscvmm.NewClientFactory("<subscription-id>", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	pager := clientFactory.NewVirtualMachineTemplatesClient().NewListByResourceGroupPager("testrg", 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.VirtualMachineTemplateListResult = armscvmm.VirtualMachineTemplateListResult{
		// 	Value: []*armscvmm.VirtualMachineTemplate{
		// 		{
		// 			Name: to.Ptr("HRVirtualMachineTemplate"),
		// 			Type: to.Ptr("Microsoft.SCVMM/VirtualMachineTemplates"),
		// 			ExtendedLocation: &armscvmm.ExtendedLocation{
		// 				Name: to.Ptr("/subscriptions/a5015e1c-867f-4533-8541-85cd470d0cfb/resourceGroups/demoRG/providers/Microsoft.Arc/customLocations/contoso"),
		// 				Type: to.Ptr("customLocation"),
		// 			},
		// 			ID: to.Ptr("/subscriptions/fd3c3665-1729-4b7b-9a38-238e83b0f98b/resourceGroups/testrg/providers/Microsoft.SCVMM/VirtualMachineTemplates/HRVirtualMachineTemplate"),
		// 			Location: to.Ptr("East US"),
		// 			Properties: &armscvmm.VirtualMachineTemplateProperties{
		// 				ProvisioningState: to.Ptr("Succeeded"),
		// 				UUID: to.Ptr("aaaaaaa-bbbb-cccc-dddd-eeeeeeeeeeee"),
		// 				VmmServerID: to.Ptr("/subscriptions/fd3c3665-1729-4b7b-9a38-238e83b0f98b/resourceGroups/testrg/providers/Microsoft.SCVMM/VMMServers/ContosoVMMServer"),
		// 			},
		// 	}},
		// }
	}
}
Output:

func (*VirtualMachineTemplatesClient) NewListBySubscriptionPager

NewListBySubscriptionPager - List of VirtualMachineTemplates in a subscription.

Generated from API version 2020-06-05-preview

  • options - VirtualMachineTemplatesClientListBySubscriptionOptions contains the optional parameters for the VirtualMachineTemplatesClient.NewListBySubscriptionPager method.
Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/d55b8005f05b040b852c15e74a0f3e36494a15e1/specification/scvmm/resource-manager/Microsoft.ScVmm/preview/2020-06-05-preview/examples/ListVirtualMachineTemplatesBySubscription.json

package main

import (
	"context"
	"log"

	"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
	"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/scvmm/armscvmm"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armscvmm.NewClientFactory("<subscription-id>", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	pager := clientFactory.NewVirtualMachineTemplatesClient().NewListBySubscriptionPager(nil)
	for pager.More() {
		page, err := pager.NextPage(ctx)
		if err != nil {
			log.Fatalf("failed to advance page: %v", err)
		}
		for _, v := range page.Value {
			// You could use page here. We use blank identifier for just demo purposes.
			_ = v
		}
		// If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes.
		// page.VirtualMachineTemplateListResult = armscvmm.VirtualMachineTemplateListResult{
		// 	Value: []*armscvmm.VirtualMachineTemplate{
		// 		{
		// 			Name: to.Ptr("HRVirtualMachineTemplate"),
		// 			Type: to.Ptr("Microsoft.SCVMM/VirtualMachineTemplates"),
		// 			ExtendedLocation: &armscvmm.ExtendedLocation{
		// 				Name: to.Ptr("/subscriptions/a5015e1c-867f-4533-8541-85cd470d0cfb/resourceGroups/demoRG/providers/Microsoft.Arc/customLocations/contoso"),
		// 				Type: to.Ptr("customLocation"),
		// 			},
		// 			ID: to.Ptr("/subscriptions/fd3c3665-1729-4b7b-9a38-238e83b0f98b/resourceGroups/testrg/providers/Microsoft.SCVMM/VirtualMachineTemplates/HRVirtualMachineTemplate"),
		// 			Location: to.Ptr("East US"),
		// 			Properties: &armscvmm.VirtualMachineTemplateProperties{
		// 				ProvisioningState: to.Ptr("Succeeded"),
		// 				UUID: to.Ptr("aaaaaaa-bbbb-cccc-dddd-eeeeeeeeeeee"),
		// 				VmmServerID: to.Ptr("/subscriptions/fd3c3665-1729-4b7b-9a38-238e83b0f98b/resourceGroups/testrg/providers/Microsoft.SCVMM/VMMServers/ContosoVMMServer"),
		// 			},
		// 	}},
		// }
	}
}
Output:

type VirtualMachineTemplatesClientBeginCreateOrUpdateOptions

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

VirtualMachineTemplatesClientBeginCreateOrUpdateOptions contains the optional parameters for the VirtualMachineTemplatesClient.BeginCreateOrUpdate method.

type VirtualMachineTemplatesClientBeginDeleteOptions

type VirtualMachineTemplatesClientBeginDeleteOptions struct {
	// Forces the resource to be deleted from azure. The corresponding CR would be attempted to be deleted too.
	Force *bool

	// Resumes the LRO from the provided token.
	ResumeToken string
}

VirtualMachineTemplatesClientBeginDeleteOptions contains the optional parameters for the VirtualMachineTemplatesClient.BeginDelete method.

type VirtualMachineTemplatesClientBeginUpdateOptions

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

VirtualMachineTemplatesClientBeginUpdateOptions contains the optional parameters for the VirtualMachineTemplatesClient.BeginUpdate method.

type VirtualMachineTemplatesClientCreateOrUpdateResponse

type VirtualMachineTemplatesClientCreateOrUpdateResponse struct {
	// The VirtualMachineTemplates resource definition.
	VirtualMachineTemplate
}

VirtualMachineTemplatesClientCreateOrUpdateResponse contains the response from method VirtualMachineTemplatesClient.BeginCreateOrUpdate.

type VirtualMachineTemplatesClientDeleteResponse

type VirtualMachineTemplatesClientDeleteResponse struct {
}

VirtualMachineTemplatesClientDeleteResponse contains the response from method VirtualMachineTemplatesClient.BeginDelete.

type VirtualMachineTemplatesClientGetOptions

type VirtualMachineTemplatesClientGetOptions struct {
}

VirtualMachineTemplatesClientGetOptions contains the optional parameters for the VirtualMachineTemplatesClient.Get method.

type VirtualMachineTemplatesClientGetResponse

type VirtualMachineTemplatesClientGetResponse struct {
	// The VirtualMachineTemplates resource definition.
	VirtualMachineTemplate
}

VirtualMachineTemplatesClientGetResponse contains the response from method VirtualMachineTemplatesClient.Get.

type VirtualMachineTemplatesClientListByResourceGroupOptions

type VirtualMachineTemplatesClientListByResourceGroupOptions struct {
}

VirtualMachineTemplatesClientListByResourceGroupOptions contains the optional parameters for the VirtualMachineTemplatesClient.NewListByResourceGroupPager method.

type VirtualMachineTemplatesClientListByResourceGroupResponse

type VirtualMachineTemplatesClientListByResourceGroupResponse struct {
	// List of VirtualMachineTemplates.
	VirtualMachineTemplateListResult
}

VirtualMachineTemplatesClientListByResourceGroupResponse contains the response from method VirtualMachineTemplatesClient.NewListByResourceGroupPager.

type VirtualMachineTemplatesClientListBySubscriptionOptions

type VirtualMachineTemplatesClientListBySubscriptionOptions struct {
}

VirtualMachineTemplatesClientListBySubscriptionOptions contains the optional parameters for the VirtualMachineTemplatesClient.NewListBySubscriptionPager method.

type VirtualMachineTemplatesClientListBySubscriptionResponse

type VirtualMachineTemplatesClientListBySubscriptionResponse struct {
	// List of VirtualMachineTemplates.
	VirtualMachineTemplateListResult
}

VirtualMachineTemplatesClientListBySubscriptionResponse contains the response from method VirtualMachineTemplatesClient.NewListBySubscriptionPager.

type VirtualMachineTemplatesClientUpdateResponse

type VirtualMachineTemplatesClientUpdateResponse struct {
	// The VirtualMachineTemplates resource definition.
	VirtualMachineTemplate
}

VirtualMachineTemplatesClientUpdateResponse contains the response from method VirtualMachineTemplatesClient.BeginUpdate.

type VirtualMachineUpdate

type VirtualMachineUpdate struct {
	// Defines the resource properties.
	Properties *VirtualMachineUpdateProperties

	// Gets or sets the Resource tags.
	Tags map[string]*string
}

VirtualMachineUpdate - Defines the virtualMachineUpdate.

func (VirtualMachineUpdate) MarshalJSON

func (v VirtualMachineUpdate) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.Marshaller interface for type VirtualMachineUpdate.

func (*VirtualMachineUpdate) UnmarshalJSON added in v0.3.0

func (v *VirtualMachineUpdate) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the json.Unmarshaller interface for type VirtualMachineUpdate.

type VirtualMachineUpdateProperties

type VirtualMachineUpdateProperties struct {
	// Availability Sets in vm.
	AvailabilitySets []*AvailabilitySetListItem

	// Defines the resource properties.
	HardwareProfile *HardwareProfileUpdate

	// Defines the resource properties.
	NetworkProfile *NetworkProfileUpdate

	// Defines the resource properties.
	StorageProfile *StorageProfileUpdate
}

VirtualMachineUpdateProperties - Defines the resource properties.

func (VirtualMachineUpdateProperties) MarshalJSON

func (v VirtualMachineUpdateProperties) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.Marshaller interface for type VirtualMachineUpdateProperties.

func (*VirtualMachineUpdateProperties) UnmarshalJSON added in v0.3.0

func (v *VirtualMachineUpdateProperties) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the json.Unmarshaller interface for type VirtualMachineUpdateProperties.

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 Azure subscription ID. This is a GUID-formatted string (e.g. 00000000-0000-0000-0000-000000000000).
  • credential - used to authorize requests. Usually a credential from azidentity.
  • options - pass nil to accept the default values.

func (*VirtualMachinesClient) BeginCreateCheckpoint

func (client *VirtualMachinesClient) BeginCreateCheckpoint(ctx context.Context, resourceGroupName string, virtualMachineName string, options *VirtualMachinesClientBeginCreateCheckpointOptions) (*runtime.Poller[VirtualMachinesClientCreateCheckpointResponse], error)

BeginCreateCheckpoint - Creates a checkpoint in virtual machine. If the operation fails it returns an *azcore.ResponseError type.

Generated from API version 2020-06-05-preview

  • resourceGroupName - The name of the resource group.
  • virtualMachineName - Name of the VirtualMachine.
  • options - VirtualMachinesClientBeginCreateCheckpointOptions contains the optional parameters for the VirtualMachinesClient.BeginCreateCheckpoint method.
Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/d55b8005f05b040b852c15e74a0f3e36494a15e1/specification/scvmm/resource-manager/Microsoft.ScVmm/preview/2020-06-05-preview/examples/CreateCheckpointVirtualMachine.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/scvmm/armscvmm"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armscvmm.NewClientFactory("<subscription-id>", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	poller, err := clientFactory.NewVirtualMachinesClient().BeginCreateCheckpoint(ctx, "testrg", "DemoVM", &armscvmm.VirtualMachinesClientBeginCreateCheckpointOptions{Body: &armscvmm.VirtualMachineCreateCheckpoint{
		Name:        to.Ptr("Demo Checkpoint name"),
		Description: to.Ptr("Demo Checkpoint description"),
	},
	})
	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

BeginCreateOrUpdate - Creates Or Updates virtual machines deployed on scvmm fabric. If the operation fails it returns an *azcore.ResponseError type.

Generated from API version 2020-06-05-preview

  • resourceGroupName - The name of the resource group.
  • virtualMachineName - Name of the VirtualMachine.
  • body - Request payload.
  • 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/scvmm/resource-manager/Microsoft.ScVmm/preview/2020-06-05-preview/examples/CreateVirtualMachine.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/scvmm/armscvmm"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armscvmm.NewClientFactory("<subscription-id>", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	poller, err := clientFactory.NewVirtualMachinesClient().BeginCreateOrUpdate(ctx, "testrg", "DemoVM", armscvmm.VirtualMachine{
		ExtendedLocation: &armscvmm.ExtendedLocation{
			Name: to.Ptr("/subscriptions/a5015e1c-867f-4533-8541-85cd470d0cfb/resourceGroups/demoRG/providers/Microsoft.Arc/customLocations/contoso"),
			Type: to.Ptr("customLocation"),
		},
		Location: to.Ptr("East US"),
		Properties: &armscvmm.VirtualMachineProperties{
			CloudID: to.Ptr("/subscriptions/fd3c3665-1729-4b7b-9a38-238e83b0f98b/resourceGroups/testrg/providers/Microsoft.SCVMM/Clouds/HRCloud"),
			HardwareProfile: &armscvmm.HardwareProfile{
				CPUCount: to.Ptr[int32](4),
				MemoryMB: to.Ptr[int32](4096),
			},
			TemplateID:  to.Ptr("/subscriptions/fd3c3665-1729-4b7b-9a38-238e83b0f98b/resourceGroups/testrg/providers/Microsoft.SCVMM/VirtualMachineTemplates/HRVirtualMachineTemplate"),
			VmmServerID: to.Ptr("/subscriptions/fd3c3665-1729-4b7b-9a38-238e83b0f98b/resourceGroups/testrg/providers/Microsoft.SCVMM/VMMServers/ContosoVMMServer"),
		},
	}, nil)
	if err != nil {
		log.Fatalf("failed to finish the request: %v", err)
	}
	res, err := poller.PollUntilDone(ctx, nil)
	if err != nil {
		log.Fatalf("failed to pull the result: %v", err)
	}
	// You could use response here. We use blank identifier for just demo purposes.
	_ = res
	// If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes.
	// res.VirtualMachine = armscvmm.VirtualMachine{
	// 	Name: to.Ptr("DemoVM"),
	// 	Type: to.Ptr("Microsoft.SCVMM/VirtualMachines"),
	// 	ExtendedLocation: &armscvmm.ExtendedLocation{
	// 		Name: to.Ptr("/subscriptions/a5015e1c-867f-4533-8541-85cd470d0cfb/resourceGroups/demoRG/providers/Microsoft.Arc/customLocations/contoso"),
	// 		Type: to.Ptr("customLocation"),
	// 	},
	// 	ID: to.Ptr("/subscriptions/fd3c3665-1729-4b7b-9a38-238e83b0f98b/resourceGroups/testrg/providers/Microsoft.SCVMM/VirtualMachines/DemoVM"),
	// 	Location: to.Ptr("East US"),
	// 	Properties: &armscvmm.VirtualMachineProperties{
	// 		CloudID: to.Ptr("/subscriptions/fd3c3665-1729-4b7b-9a38-238e83b0f98b/resourceGroups/testrg/providers/Microsoft.SCVMM/Clouds/HRCloud"),
	// 		HardwareProfile: &armscvmm.HardwareProfile{
	// 			CPUCount: to.Ptr[int32](4),
	// 			MemoryMB: to.Ptr[int32](4096),
	// 		},
	// 		OSProfile: &armscvmm.OsProfile{
	// 			ComputerName: to.Ptr("DemoVM"),
	// 			OSType: to.Ptr(armscvmm.OsTypeWindows),
	// 		},
	// 		ProvisioningState: to.Ptr("Succeeded"),
	// 		TemplateID: to.Ptr("/subscriptions/fd3c3665-1729-4b7b-9a38-238e83b0f98b/resourceGroups/testrg/providers/Microsoft.SCVMM/VirtualMachineTemplates/HRVirtualMachineTemplate"),
	// 		VmmServerID: to.Ptr("/subscriptions/fd3c3665-1729-4b7b-9a38-238e83b0f98b/resourceGroups/testrg/providers/Microsoft.SCVMM/VMMServers/ContosoVMMServer"),
	// 	},
	// }
}
Output:

func (*VirtualMachinesClient) BeginDelete

func (client *VirtualMachinesClient) BeginDelete(ctx context.Context, resourceGroupName string, virtualMachineName string, options *VirtualMachinesClientBeginDeleteOptions) (*runtime.Poller[VirtualMachinesClientDeleteResponse], error)

BeginDelete - Deletes a VirtualMachine deployed on ScVmm fabric. If the operation fails it returns an *azcore.ResponseError type.

Generated from API version 2020-06-05-preview

  • resourceGroupName - The name of the resource group.
  • virtualMachineName - Name of the VirtualMachine.
  • 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/scvmm/resource-manager/Microsoft.ScVmm/preview/2020-06-05-preview/examples/DeleteVirtualMachine.json

package main

import (
	"context"
	"log"

	"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
	"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/scvmm/armscvmm"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armscvmm.NewClientFactory("<subscription-id>", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	poller, err := clientFactory.NewVirtualMachinesClient().BeginDelete(ctx, "testrg", "DemoVM", &armscvmm.VirtualMachinesClientBeginDeleteOptions{Retain: nil,
		Force: 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) BeginDeleteCheckpoint

func (client *VirtualMachinesClient) BeginDeleteCheckpoint(ctx context.Context, resourceGroupName string, virtualMachineName string, options *VirtualMachinesClientBeginDeleteCheckpointOptions) (*runtime.Poller[VirtualMachinesClientDeleteCheckpointResponse], error)

BeginDeleteCheckpoint - Deletes a checkpoint in virtual machine. If the operation fails it returns an *azcore.ResponseError type.

Generated from API version 2020-06-05-preview

  • resourceGroupName - The name of the resource group.
  • virtualMachineName - Name of the VirtualMachine.
  • options - VirtualMachinesClientBeginDeleteCheckpointOptions contains the optional parameters for the VirtualMachinesClient.BeginDeleteCheckpoint method.
Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/d55b8005f05b040b852c15e74a0f3e36494a15e1/specification/scvmm/resource-manager/Microsoft.ScVmm/preview/2020-06-05-preview/examples/DeleteCheckpointVirtualMachine.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/scvmm/armscvmm"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armscvmm.NewClientFactory("<subscription-id>", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	poller, err := clientFactory.NewVirtualMachinesClient().BeginDeleteCheckpoint(ctx, "testrg", "DemoVM", &armscvmm.VirtualMachinesClientBeginDeleteCheckpointOptions{Body: &armscvmm.VirtualMachineDeleteCheckpoint{
		ID: to.Ptr("Demo CheckpointID"),
	},
	})
	if err != nil {
		log.Fatalf("failed to finish the request: %v", err)
	}
	_, err = poller.PollUntilDone(ctx, nil)
	if err != nil {
		log.Fatalf("failed to pull the result: %v", err)
	}
}
Output:

func (*VirtualMachinesClient) BeginRestart

func (client *VirtualMachinesClient) BeginRestart(ctx context.Context, resourceGroupName string, virtualMachineName string, options *VirtualMachinesClientBeginRestartOptions) (*runtime.Poller[VirtualMachinesClientRestartResponse], error)

BeginRestart - Restart virtual machine. If the operation fails it returns an *azcore.ResponseError type.

Generated from API version 2020-06-05-preview

  • resourceGroupName - The name of the resource group.
  • virtualMachineName - Name of the VirtualMachine.
  • 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/scvmm/resource-manager/Microsoft.ScVmm/preview/2020-06-05-preview/examples/RestartVirtualMachine.json

package main

import (
	"context"
	"log"

	"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
	"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/scvmm/armscvmm"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armscvmm.NewClientFactory("<subscription-id>", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	poller, err := clientFactory.NewVirtualMachinesClient().BeginRestart(ctx, "testrg", "DemoVM", 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) BeginRestoreCheckpoint

func (client *VirtualMachinesClient) BeginRestoreCheckpoint(ctx context.Context, resourceGroupName string, virtualMachineName string, options *VirtualMachinesClientBeginRestoreCheckpointOptions) (*runtime.Poller[VirtualMachinesClientRestoreCheckpointResponse], error)

BeginRestoreCheckpoint - Restores to a checkpoint in virtual machine. If the operation fails it returns an *azcore.ResponseError type.

Generated from API version 2020-06-05-preview

  • resourceGroupName - The name of the resource group.
  • virtualMachineName - Name of the VirtualMachine.
  • options - VirtualMachinesClientBeginRestoreCheckpointOptions contains the optional parameters for the VirtualMachinesClient.BeginRestoreCheckpoint method.
Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/d55b8005f05b040b852c15e74a0f3e36494a15e1/specification/scvmm/resource-manager/Microsoft.ScVmm/preview/2020-06-05-preview/examples/RestoreCheckpointVirtualMachine.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/scvmm/armscvmm"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armscvmm.NewClientFactory("<subscription-id>", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	poller, err := clientFactory.NewVirtualMachinesClient().BeginRestoreCheckpoint(ctx, "testrg", "DemoVM", &armscvmm.VirtualMachinesClientBeginRestoreCheckpointOptions{Body: &armscvmm.VirtualMachineRestoreCheckpoint{
		ID: to.Ptr("Demo CheckpointID"),
	},
	})
	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

func (client *VirtualMachinesClient) BeginStart(ctx context.Context, resourceGroupName string, virtualMachineName string, options *VirtualMachinesClientBeginStartOptions) (*runtime.Poller[VirtualMachinesClientStartResponse], error)

BeginStart - Start virtual machine. If the operation fails it returns an *azcore.ResponseError type.

Generated from API version 2020-06-05-preview

  • resourceGroupName - The name of the resource group.
  • virtualMachineName - Name of the VirtualMachine.
  • 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/scvmm/resource-manager/Microsoft.ScVmm/preview/2020-06-05-preview/examples/StartVirtualMachine.json

package main

import (
	"context"
	"log"

	"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
	"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/scvmm/armscvmm"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armscvmm.NewClientFactory("<subscription-id>", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	poller, err := clientFactory.NewVirtualMachinesClient().BeginStart(ctx, "testrg", "DemoVM", 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

func (client *VirtualMachinesClient) BeginStop(ctx context.Context, resourceGroupName string, virtualMachineName string, options *VirtualMachinesClientBeginStopOptions) (*runtime.Poller[VirtualMachinesClientStopResponse], error)

BeginStop - Stop virtual machine. If the operation fails it returns an *azcore.ResponseError type.

Generated from API version 2020-06-05-preview

  • resourceGroupName - The name of the resource group.
  • virtualMachineName - Name of the VirtualMachine.
  • 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/scvmm/resource-manager/Microsoft.ScVmm/preview/2020-06-05-preview/examples/StopVirtualMachine.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/scvmm/armscvmm"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armscvmm.NewClientFactory("<subscription-id>", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	poller, err := clientFactory.NewVirtualMachinesClient().BeginStop(ctx, "testrg", "DemoVM", &armscvmm.VirtualMachinesClientBeginStopOptions{Body: &armscvmm.StopVirtualMachineOptions{
		SkipShutdown: to.Ptr(true),
	},
	})
	if err != nil {
		log.Fatalf("failed to finish the request: %v", err)
	}
	_, err = poller.PollUntilDone(ctx, nil)
	if err != nil {
		log.Fatalf("failed to pull the result: %v", err)
	}
}
Output:

func (*VirtualMachinesClient) BeginUpdate

BeginUpdate - Updates the VirtualMachines resource. If the operation fails it returns an *azcore.ResponseError type.

Generated from API version 2020-06-05-preview

  • resourceGroupName - The name of the resource group.
  • virtualMachineName - Name of the VirtualMachine.
  • body - VirtualMachines patch payload.
  • options - VirtualMachinesClientBeginUpdateOptions contains the optional parameters for the VirtualMachinesClient.BeginUpdate method.
Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/d55b8005f05b040b852c15e74a0f3e36494a15e1/specification/scvmm/resource-manager/Microsoft.ScVmm/preview/2020-06-05-preview/examples/UpdateVirtualMachine.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/scvmm/armscvmm"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armscvmm.NewClientFactory("<subscription-id>", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	poller, err := clientFactory.NewVirtualMachinesClient().BeginUpdate(ctx, "testrg", "DemoVM", armscvmm.VirtualMachineUpdate{
		Properties: &armscvmm.VirtualMachineUpdateProperties{
			HardwareProfile: &armscvmm.HardwareProfileUpdate{
				CPUCount: to.Ptr[int32](4),
				MemoryMB: to.Ptr[int32](4096),
			},
			NetworkProfile: &armscvmm.NetworkProfileUpdate{
				NetworkInterfaces: []*armscvmm.NetworkInterfacesUpdate{
					{
						Name:            to.Ptr("test"),
						IPv4AddressType: to.Ptr(armscvmm.AllocationMethodDynamic),
						IPv6AddressType: to.Ptr(armscvmm.AllocationMethodDynamic),
						MacAddressType:  to.Ptr(armscvmm.AllocationMethodStatic),
					}},
			},
			StorageProfile: &armscvmm.StorageProfileUpdate{
				Disks: []*armscvmm.VirtualDiskUpdate{
					{
						Name:       to.Ptr("test"),
						DiskSizeGB: to.Ptr[int32](10),
					}},
			},
		},
		Tags: map[string]*string{
			"tag1": to.Ptr("value1"),
			"tag2": to.Ptr("value2"),
		},
	}, nil)
	if err != nil {
		log.Fatalf("failed to finish the request: %v", err)
	}
	res, err := poller.PollUntilDone(ctx, nil)
	if err != nil {
		log.Fatalf("failed to pull the result: %v", err)
	}
	// You could use response here. We use blank identifier for just demo purposes.
	_ = res
	// If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes.
	// res.VirtualMachine = armscvmm.VirtualMachine{
	// 	Name: to.Ptr("DemoVM"),
	// 	Type: to.Ptr("Microsoft.SCVMM/VirtualMachines"),
	// 	ExtendedLocation: &armscvmm.ExtendedLocation{
	// 		Name: to.Ptr("/subscriptions/a5015e1c-867f-4533-8541-85cd470d0cfb/resourceGroups/demoRG/providers/Microsoft.Arc/customLocations/contoso"),
	// 		Type: to.Ptr("customLocation"),
	// 	},
	// 	ID: to.Ptr("/subscriptions/fd3c3665-1729-4b7b-9a38-238e83b0f98b/resourceGroups/testrg/providers/Microsoft.SCVMM/VirtualMachines/DemoVM"),
	// 	Location: to.Ptr("East US"),
	// 	Properties: &armscvmm.VirtualMachineProperties{
	// 		CloudID: to.Ptr("/subscriptions/fd3c3665-1729-4b7b-9a38-238e83b0f98b/resourceGroups/testrg/providers/Microsoft.SCVMM/Clouds/HRCloud"),
	// 		Generation: to.Ptr[int32](0),
	// 		HardwareProfile: &armscvmm.HardwareProfile{
	// 			CPUCount: to.Ptr[int32](4),
	// 			DynamicMemoryEnabled: to.Ptr(armscvmm.DynamicMemoryEnabledFalse),
	// 			DynamicMemoryMaxMB: to.Ptr[int32](0),
	// 			DynamicMemoryMinMB: to.Ptr[int32](0),
	// 			IsHighlyAvailable: to.Ptr("string"),
	// 			MemoryMB: to.Ptr[int32](4096),
	// 		},
	// 		NetworkProfile: &armscvmm.NetworkProfile{
	// 			NetworkInterfaces: []*armscvmm.NetworkInterfaces{
	// 				{
	// 					Name: to.Ptr("test"),
	// 					DisplayName: to.Ptr("string"),
	// 					IPv4AddressType: to.Ptr(armscvmm.AllocationMethodDynamic),
	// 					IPv4Addresses: []*string{
	// 						to.Ptr("string")},
	// 						IPv6AddressType: to.Ptr(armscvmm.AllocationMethodDynamic),
	// 						IPv6Addresses: []*string{
	// 							to.Ptr("string")},
	// 							MacAddress: to.Ptr("string"),
	// 							MacAddressType: to.Ptr(armscvmm.AllocationMethodStatic),
	// 							NetworkName: to.Ptr("string"),
	// 							NicID: to.Ptr("string"),
	// 							VirtualNetworkID: to.Ptr("string"),
	// 					}},
	// 				},
	// 				OSProfile: &armscvmm.OsProfile{
	// 					ComputerName: to.Ptr("DemoVM"),
	// 					OSName: to.Ptr("string"),
	// 					OSType: to.Ptr(armscvmm.OsTypeWindows),
	// 				},
	// 				PowerState: to.Ptr("string"),
	// 				ProvisioningState: to.Ptr("Succeeded"),
	// 				StorageProfile: &armscvmm.StorageProfile{
	// 					Disks: []*armscvmm.VirtualDisk{
	// 						{
	// 							Name: to.Ptr("test"),
	// 							Bus: to.Ptr[int32](0),
	// 							BusType: to.Ptr("string"),
	// 							CreateDiffDisk: to.Ptr(armscvmm.CreateDiffDiskFalse),
	// 							DiskID: to.Ptr("string"),
	// 							DiskSizeGB: to.Ptr[int32](10),
	// 							DisplayName: to.Ptr("string"),
	// 							Lun: to.Ptr[int32](0),
	// 							MaxDiskSizeGB: to.Ptr[int32](10),
	// 							StorageQoSPolicy: &armscvmm.StorageQoSPolicyDetails{
	// 								Name: to.Ptr("string"),
	// 								ID: to.Ptr("string"),
	// 							},
	// 							TemplateDiskID: to.Ptr("string"),
	// 							VhdFormatType: to.Ptr("string"),
	// 							VhdType: to.Ptr("string"),
	// 							VolumeType: to.Ptr("string"),
	// 					}},
	// 				},
	// 				TemplateID: to.Ptr("/subscriptions/fd3c3665-1729-4b7b-9a38-238e83b0f98b/resourceGroups/testrg/providers/Microsoft.SCVMM/VirtualMachineTemplates/HRVirtualMachineTemplate"),
	// 				UUID: to.Ptr("string"),
	// 				VMName: to.Ptr("string"),
	// 				VmmServerID: to.Ptr("/subscriptions/fd3c3665-1729-4b7b-9a38-238e83b0f98b/resourceGroups/testrg/providers/Microsoft.SCVMM/VMMServers/ContosoVMMServer"),
	// 			},
	// 			Tags: map[string]*string{
	// 				"tag1": to.Ptr("value1"),
	// 				"tag2": to.Ptr("value2"),
	// 			},
	// 		}
}
Output:

func (*VirtualMachinesClient) Get

func (client *VirtualMachinesClient) Get(ctx context.Context, resourceGroupName string, virtualMachineName string, options *VirtualMachinesClientGetOptions) (VirtualMachinesClientGetResponse, error)

Get - Implements VirtualMachine GET method. If the operation fails it returns an *azcore.ResponseError type.

Generated from API version 2020-06-05-preview

  • resourceGroupName - The name of the resource group.
  • virtualMachineName - Name of the VirtualMachine.
  • 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/scvmm/resource-manager/Microsoft.ScVmm/preview/2020-06-05-preview/examples/GetVirtualMachine.json

package main

import (
	"context"
	"log"

	"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
	"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/scvmm/armscvmm"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armscvmm.NewClientFactory("<subscription-id>", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	res, err := clientFactory.NewVirtualMachinesClient().Get(ctx, "testrg", "DemoVM", nil)
	if err != nil {
		log.Fatalf("failed to finish the request: %v", err)
	}
	// You could use response here. We use blank identifier for just demo purposes.
	_ = res
	// If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes.
	// res.VirtualMachine = armscvmm.VirtualMachine{
	// 	Name: to.Ptr("DemoVM"),
	// 	Type: to.Ptr("Microsoft.SCVMM/VirtualMachines"),
	// 	ExtendedLocation: &armscvmm.ExtendedLocation{
	// 		Name: to.Ptr("/subscriptions/a5015e1c-867f-4533-8541-85cd470d0cfb/resourceGroups/demoRG/providers/Microsoft.Arc/customLocations/contoso"),
	// 		Type: to.Ptr("customLocation"),
	// 	},
	// 	ID: to.Ptr("/subscriptions/fd3c3665-1729-4b7b-9a38-238e83b0f98b/resourceGroups/testrg/providers/Microsoft.SCVMM/VirtualMachines/DemoVM"),
	// 	Location: to.Ptr("East US"),
	// 	Properties: &armscvmm.VirtualMachineProperties{
	// 		CloudID: to.Ptr("/subscriptions/fd3c3665-1729-4b7b-9a38-238e83b0f98b/resourceGroups/testrg/providers/Microsoft.SCVMM/Clouds/HRCloud"),
	// 		HardwareProfile: &armscvmm.HardwareProfile{
	// 			CPUCount: to.Ptr[int32](4),
	// 			MemoryMB: to.Ptr[int32](4096),
	// 		},
	// 		OSProfile: &armscvmm.OsProfile{
	// 			ComputerName: to.Ptr("DemoVM"),
	// 			OSType: to.Ptr(armscvmm.OsTypeWindows),
	// 		},
	// 		ProvisioningState: to.Ptr("Succeeded"),
	// 		TemplateID: to.Ptr("/subscriptions/fd3c3665-1729-4b7b-9a38-238e83b0f98b/resourceGroups/testrg/providers/Microsoft.SCVMM/VirtualMachineTemplates/HRVirtualMachineTemplate"),
	// 		VmmServerID: to.Ptr("/subscriptions/fd3c3665-1729-4b7b-9a38-238e83b0f98b/resourceGroups/testrg/providers/Microsoft.SCVMM/VMMServers/ContosoVMMServer"),
	// 	},
	// }
}
Output:

func (*VirtualMachinesClient) NewListByResourceGroupPager

NewListByResourceGroupPager - List of VirtualMachines in a resource group.

Generated from API version 2020-06-05-preview

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

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/d55b8005f05b040b852c15e74a0f3e36494a15e1/specification/scvmm/resource-manager/Microsoft.ScVmm/preview/2020-06-05-preview/examples/ListVirtualMachinesByResourceGroup.json

package main

import (
	"context"
	"log"

	"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
	"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/scvmm/armscvmm"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armscvmm.NewClientFactory("<subscription-id>", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	pager := clientFactory.NewVirtualMachinesClient().NewListByResourceGroupPager("testrg", nil)
	for pager.More() {
		page, err := pager.NextPage(ctx)
		if err != nil {
			log.Fatalf("failed to advance page: %v", err)
		}
		for _, v := range page.Value {
			// You could use page here. We use blank identifier for just demo purposes.
			_ = v
		}
		// If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes.
		// page.VirtualMachineListResult = armscvmm.VirtualMachineListResult{
		// 	Value: []*armscvmm.VirtualMachine{
		// 		{
		// 			Name: to.Ptr("DemoVM"),
		// 			Type: to.Ptr("Microsoft.SCVMM/VirtualMachines"),
		// 			ExtendedLocation: &armscvmm.ExtendedLocation{
		// 				Name: to.Ptr("/subscriptions/a5015e1c-867f-4533-8541-85cd470d0cfb/resourceGroups/demoRG/providers/Microsoft.Arc/customLocations/contoso"),
		// 				Type: to.Ptr("customLocation"),
		// 			},
		// 			ID: to.Ptr("/subscriptions/fd3c3665-1729-4b7b-9a38-238e83b0f98b/resourceGroups/testrg/providers/Microsoft.SCVMM/VirtualMachines/DemoVM"),
		// 			Location: to.Ptr("East US"),
		// 			Properties: &armscvmm.VirtualMachineProperties{
		// 				CloudID: to.Ptr("/subscriptions/fd3c3665-1729-4b7b-9a38-238e83b0f98b/resourceGroups/testrg/providers/Microsoft.SCVMM/Clouds/HRCloud"),
		// 				HardwareProfile: &armscvmm.HardwareProfile{
		// 					CPUCount: to.Ptr[int32](4),
		// 					MemoryMB: to.Ptr[int32](4096),
		// 				},
		// 				OSProfile: &armscvmm.OsProfile{
		// 					ComputerName: to.Ptr("DemoVM"),
		// 					OSType: to.Ptr(armscvmm.OsTypeWindows),
		// 				},
		// 				ProvisioningState: to.Ptr("Succeeded"),
		// 				TemplateID: to.Ptr("/subscriptions/fd3c3665-1729-4b7b-9a38-238e83b0f98b/resourceGroups/testrg/providers/Microsoft.SCVMM/VirtualMachineTemplates/HRVirtualMachineTemplate"),
		// 				VmmServerID: to.Ptr("/subscriptions/fd3c3665-1729-4b7b-9a38-238e83b0f98b/resourceGroups/testrg/providers/Microsoft.SCVMM/VMMServers/ContosoVMMServer"),
		// 			},
		// 	}},
		// }
	}
}
Output:

func (*VirtualMachinesClient) NewListBySubscriptionPager

NewListBySubscriptionPager - List of VirtualMachines in a subscription.

Generated from API version 2020-06-05-preview

  • options - VirtualMachinesClientListBySubscriptionOptions contains the optional parameters for the VirtualMachinesClient.NewListBySubscriptionPager method.
Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/d55b8005f05b040b852c15e74a0f3e36494a15e1/specification/scvmm/resource-manager/Microsoft.ScVmm/preview/2020-06-05-preview/examples/ListVirtualMachinesBySubscription.json

package main

import (
	"context"
	"log"

	"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
	"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/scvmm/armscvmm"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armscvmm.NewClientFactory("<subscription-id>", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	pager := clientFactory.NewVirtualMachinesClient().NewListBySubscriptionPager(nil)
	for pager.More() {
		page, err := pager.NextPage(ctx)
		if err != nil {
			log.Fatalf("failed to advance page: %v", err)
		}
		for _, v := range page.Value {
			// You could use page here. We use blank identifier for just demo purposes.
			_ = v
		}
		// If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes.
		// page.VirtualMachineListResult = armscvmm.VirtualMachineListResult{
		// 	Value: []*armscvmm.VirtualMachine{
		// 		{
		// 			Name: to.Ptr("DemoVM"),
		// 			Type: to.Ptr("Microsoft.SCVMM/VirtualMachines"),
		// 			ExtendedLocation: &armscvmm.ExtendedLocation{
		// 				Name: to.Ptr("/subscriptions/a5015e1c-867f-4533-8541-85cd470d0cfb/resourceGroups/demoRG/providers/Microsoft.Arc/customLocations/contoso"),
		// 				Type: to.Ptr("customLocation"),
		// 			},
		// 			ID: to.Ptr("/subscriptions/fd3c3665-1729-4b7b-9a38-238e83b0f98b/resourceGroups/testrg/providers/Microsoft.SCVMM/VirtualMachines/DemoVM"),
		// 			Location: to.Ptr("East US"),
		// 			Properties: &armscvmm.VirtualMachineProperties{
		// 				CloudID: to.Ptr("/subscriptions/fd3c3665-1729-4b7b-9a38-238e83b0f98b/resourceGroups/testrg/providers/Microsoft.SCVMM/Clouds/HRCloud"),
		// 				HardwareProfile: &armscvmm.HardwareProfile{
		// 					CPUCount: to.Ptr[int32](4),
		// 					MemoryMB: to.Ptr[int32](4096),
		// 				},
		// 				OSProfile: &armscvmm.OsProfile{
		// 					ComputerName: to.Ptr("DemoVM"),
		// 					OSType: to.Ptr(armscvmm.OsTypeWindows),
		// 				},
		// 				ProvisioningState: to.Ptr("Succeeded"),
		// 				TemplateID: to.Ptr("/subscriptions/fd3c3665-1729-4b7b-9a38-238e83b0f98b/resourceGroups/testrg/providers/Microsoft.SCVMM/VirtualMachineTemplates/HRVirtualMachineTemplate"),
		// 				VmmServerID: to.Ptr("/subscriptions/fd3c3665-1729-4b7b-9a38-238e83b0f98b/resourceGroups/testrg/providers/Microsoft.SCVMM/VMMServers/ContosoVMMServer"),
		// 			},
		// 	}},
		// }
	}
}
Output:

type VirtualMachinesClientBeginCreateCheckpointOptions

type VirtualMachinesClientBeginCreateCheckpointOptions struct {
	// Virtualmachine create checkpoint action payload.
	Body *VirtualMachineCreateCheckpoint

	// Resumes the LRO from the provided token.
	ResumeToken string
}

VirtualMachinesClientBeginCreateCheckpointOptions contains the optional parameters for the VirtualMachinesClient.BeginCreateCheckpoint method.

type VirtualMachinesClientBeginCreateOrUpdateOptions

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

VirtualMachinesClientBeginCreateOrUpdateOptions contains the optional parameters for the VirtualMachinesClient.BeginCreateOrUpdate method.

type VirtualMachinesClientBeginDeleteCheckpointOptions

type VirtualMachinesClientBeginDeleteCheckpointOptions struct {
	// Virtualmachine delete checkpoint action payload.
	Body *VirtualMachineDeleteCheckpoint

	// Resumes the LRO from the provided token.
	ResumeToken string
}

VirtualMachinesClientBeginDeleteCheckpointOptions contains the optional parameters for the VirtualMachinesClient.BeginDeleteCheckpoint method.

type VirtualMachinesClientBeginDeleteOptions

type VirtualMachinesClientBeginDeleteOptions struct {
	// Forces the resource to be deleted from azure. The corresponding CR would be attempted to be deleted too.
	Force *bool

	// Resumes the LRO from the provided token.
	ResumeToken string

	// Whether to just disable the VM from azure and retain the VM in the VMM.
	Retain *bool
}

VirtualMachinesClientBeginDeleteOptions contains the optional parameters for the VirtualMachinesClient.BeginDelete method.

type VirtualMachinesClientBeginRestartOptions

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

VirtualMachinesClientBeginRestartOptions contains the optional parameters for the VirtualMachinesClient.BeginRestart method.

type VirtualMachinesClientBeginRestoreCheckpointOptions

type VirtualMachinesClientBeginRestoreCheckpointOptions struct {
	// Virtualmachine restore checkpoint action payload.
	Body *VirtualMachineRestoreCheckpoint

	// Resumes the LRO from the provided token.
	ResumeToken string
}

VirtualMachinesClientBeginRestoreCheckpointOptions contains the optional parameters for the VirtualMachinesClient.BeginRestoreCheckpoint method.

type VirtualMachinesClientBeginStartOptions

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

VirtualMachinesClientBeginStartOptions contains the optional parameters for the VirtualMachinesClient.BeginStart method.

type VirtualMachinesClientBeginStopOptions

type VirtualMachinesClientBeginStopOptions struct {
	// Virtualmachine stop action payload.
	Body *StopVirtualMachineOptions

	// Resumes the LRO from the provided token.
	ResumeToken string
}

VirtualMachinesClientBeginStopOptions contains the optional parameters for the VirtualMachinesClient.BeginStop method.

type VirtualMachinesClientBeginUpdateOptions

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

VirtualMachinesClientBeginUpdateOptions contains the optional parameters for the VirtualMachinesClient.BeginUpdate method.

type VirtualMachinesClientCreateCheckpointResponse

type VirtualMachinesClientCreateCheckpointResponse struct {
}

VirtualMachinesClientCreateCheckpointResponse contains the response from method VirtualMachinesClient.BeginCreateCheckpoint.

type VirtualMachinesClientCreateOrUpdateResponse

type VirtualMachinesClientCreateOrUpdateResponse struct {
	// The VirtualMachines resource definition.
	VirtualMachine
}

VirtualMachinesClientCreateOrUpdateResponse contains the response from method VirtualMachinesClient.BeginCreateOrUpdate.

type VirtualMachinesClientDeleteCheckpointResponse

type VirtualMachinesClientDeleteCheckpointResponse struct {
}

VirtualMachinesClientDeleteCheckpointResponse contains the response from method VirtualMachinesClient.BeginDeleteCheckpoint.

type VirtualMachinesClientDeleteResponse

type VirtualMachinesClientDeleteResponse struct {
}

VirtualMachinesClientDeleteResponse contains the response from method VirtualMachinesClient.BeginDelete.

type VirtualMachinesClientGetOptions

type VirtualMachinesClientGetOptions struct {
}

VirtualMachinesClientGetOptions contains the optional parameters for the VirtualMachinesClient.Get method.

type VirtualMachinesClientGetResponse

type VirtualMachinesClientGetResponse struct {
	// The VirtualMachines resource definition.
	VirtualMachine
}

VirtualMachinesClientGetResponse contains the response from method VirtualMachinesClient.Get.

type VirtualMachinesClientListByResourceGroupOptions

type VirtualMachinesClientListByResourceGroupOptions struct {
}

VirtualMachinesClientListByResourceGroupOptions contains the optional parameters for the VirtualMachinesClient.NewListByResourceGroupPager method.

type VirtualMachinesClientListByResourceGroupResponse

type VirtualMachinesClientListByResourceGroupResponse struct {
	// List of VirtualMachines.
	VirtualMachineListResult
}

VirtualMachinesClientListByResourceGroupResponse contains the response from method VirtualMachinesClient.NewListByResourceGroupPager.

type VirtualMachinesClientListBySubscriptionOptions

type VirtualMachinesClientListBySubscriptionOptions struct {
}

VirtualMachinesClientListBySubscriptionOptions contains the optional parameters for the VirtualMachinesClient.NewListBySubscriptionPager method.

type VirtualMachinesClientListBySubscriptionResponse

type VirtualMachinesClientListBySubscriptionResponse struct {
	// List of VirtualMachines.
	VirtualMachineListResult
}

VirtualMachinesClientListBySubscriptionResponse contains the response from method VirtualMachinesClient.NewListBySubscriptionPager.

type VirtualMachinesClientRestartResponse

type VirtualMachinesClientRestartResponse struct {
}

VirtualMachinesClientRestartResponse contains the response from method VirtualMachinesClient.BeginRestart.

type VirtualMachinesClientRestoreCheckpointResponse

type VirtualMachinesClientRestoreCheckpointResponse struct {
}

VirtualMachinesClientRestoreCheckpointResponse contains the response from method VirtualMachinesClient.BeginRestoreCheckpoint.

type VirtualMachinesClientStartResponse

type VirtualMachinesClientStartResponse struct {
}

VirtualMachinesClientStartResponse contains the response from method VirtualMachinesClient.BeginStart.

type VirtualMachinesClientStopResponse

type VirtualMachinesClientStopResponse struct {
}

VirtualMachinesClientStopResponse contains the response from method VirtualMachinesClient.BeginStop.

type VirtualMachinesClientUpdateResponse

type VirtualMachinesClientUpdateResponse struct {
	// The VirtualMachines resource definition.
	VirtualMachine
}

VirtualMachinesClientUpdateResponse contains the response from method VirtualMachinesClient.BeginUpdate.

type VirtualNetwork

type VirtualNetwork struct {
	// REQUIRED; The extended location.
	ExtendedLocation *ExtendedLocation

	// REQUIRED; Gets or sets the location.
	Location *string

	// REQUIRED; Resource properties.
	Properties *VirtualNetworkProperties

	// Resource tags
	Tags map[string]*string

	// READ-ONLY; Resource Id
	ID *string

	// READ-ONLY; Resource Name
	Name *string

	// READ-ONLY; The system data.
	SystemData *SystemData

	// READ-ONLY; Resource Type
	Type *string
}

VirtualNetwork - The VirtualNetworks resource definition.

func (VirtualNetwork) MarshalJSON

func (v VirtualNetwork) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.Marshaller interface for type VirtualNetwork.

func (*VirtualNetwork) UnmarshalJSON added in v0.3.0

func (v *VirtualNetwork) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the json.Unmarshaller interface for type VirtualNetwork.

type VirtualNetworkInventoryItem

type VirtualNetworkInventoryItem struct {
	// REQUIRED; They inventory type.
	InventoryType *InventoryType

	// READ-ONLY; Gets the Managed Object name in VMM for the inventory item.
	InventoryItemName *string

	// READ-ONLY; Gets the tracked resource id corresponding to the inventory resource.
	ManagedResourceID *string

	// READ-ONLY; Gets the provisioning state.
	ProvisioningState *string

	// READ-ONLY; Gets the UUID (which is assigned by VMM) for the inventory item.
	UUID *string
}

VirtualNetworkInventoryItem - The Virtual network inventory item.

func (*VirtualNetworkInventoryItem) GetInventoryItemProperties

func (v *VirtualNetworkInventoryItem) GetInventoryItemProperties() *InventoryItemProperties

GetInventoryItemProperties implements the InventoryItemPropertiesClassification interface for type VirtualNetworkInventoryItem.

func (VirtualNetworkInventoryItem) MarshalJSON

func (v VirtualNetworkInventoryItem) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.Marshaller interface for type VirtualNetworkInventoryItem.

func (*VirtualNetworkInventoryItem) UnmarshalJSON

func (v *VirtualNetworkInventoryItem) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the json.Unmarshaller interface for type VirtualNetworkInventoryItem.

type VirtualNetworkListResult

type VirtualNetworkListResult struct {
	// Url to follow for getting next page of resources.
	NextLink *string

	// List of VirtualNetworks.
	Value []*VirtualNetwork
}

VirtualNetworkListResult - List of VirtualNetworks.

func (VirtualNetworkListResult) MarshalJSON

func (v VirtualNetworkListResult) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.Marshaller interface for type VirtualNetworkListResult.

func (*VirtualNetworkListResult) UnmarshalJSON added in v0.3.0

func (v *VirtualNetworkListResult) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the json.Unmarshaller interface for type VirtualNetworkListResult.

type VirtualNetworkProperties

type VirtualNetworkProperties struct {
	// Gets or sets the inventory Item ID for the resource.
	InventoryItemID *string

	// Unique ID of the virtual network.
	UUID *string

	// ARM Id of the vmmServer resource in which this resource resides.
	VmmServerID *string

	// READ-ONLY; Name of the virtual network in vmmServer.
	NetworkName *string

	// READ-ONLY; Gets or sets the provisioning state.
	ProvisioningState *string
}

VirtualNetworkProperties - Defines the resource properties.

func (VirtualNetworkProperties) MarshalJSON added in v0.3.0

func (v VirtualNetworkProperties) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.Marshaller interface for type VirtualNetworkProperties.

func (*VirtualNetworkProperties) UnmarshalJSON added in v0.3.0

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 Azure subscription ID. This is a GUID-formatted string (e.g. 00000000-0000-0000-0000-000000000000).
  • credential - used to authorize requests. Usually a credential from azidentity.
  • options - pass nil to accept the default values.

func (*VirtualNetworksClient) BeginCreateOrUpdate

BeginCreateOrUpdate - Onboards the ScVmm virtual network as an Azure virtual network resource. If the operation fails it returns an *azcore.ResponseError type.

Generated from API version 2020-06-05-preview

  • resourceGroupName - The name of the resource group.
  • virtualNetworkName - Name of the VirtualNetwork.
  • body - Request payload.
  • 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/scvmm/resource-manager/Microsoft.ScVmm/preview/2020-06-05-preview/examples/CreateVirtualNetwork.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/scvmm/armscvmm"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armscvmm.NewClientFactory("<subscription-id>", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	poller, err := clientFactory.NewVirtualNetworksClient().BeginCreateOrUpdate(ctx, "testrg", "HRVirtualNetwork", armscvmm.VirtualNetwork{
		ExtendedLocation: &armscvmm.ExtendedLocation{
			Name: to.Ptr("/subscriptions/a5015e1c-867f-4533-8541-85cd470d0cfb/resourceGroups/demoRG/providers/Microsoft.Arc/customLocations/contoso"),
			Type: to.Ptr("customLocation"),
		},
		Location: to.Ptr("East US"),
		Properties: &armscvmm.VirtualNetworkProperties{
			UUID:        to.Ptr("aaaaaaa-bbbb-cccc-dddd-eeeeeeeeeeee"),
			VmmServerID: to.Ptr("/subscriptions/fd3c3665-1729-4b7b-9a38-238e83b0f98b/resourceGroups/testrg/providers/Microsoft.SCVMM/VMMServers/ContosoVMMServer"),
		},
	}, 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 = armscvmm.VirtualNetwork{
	// 	Name: to.Ptr("HRVirtualNetwork"),
	// 	Type: to.Ptr("Microsoft.SCVMM/VirtualNetworks"),
	// 	ExtendedLocation: &armscvmm.ExtendedLocation{
	// 		Name: to.Ptr("/subscriptions/a5015e1c-867f-4533-8541-85cd470d0cfb/resourceGroups/demoRG/providers/Microsoft.Arc/customLocations/contoso"),
	// 		Type: to.Ptr("customLocation"),
	// 	},
	// 	ID: to.Ptr("/subscriptions/fd3c3665-1729-4b7b-9a38-238e83b0f98b/resourceGroups/testrg/providers/Microsoft.SCVMM/VirtualNetworks/HRVirtualNetwork"),
	// 	Location: to.Ptr("East US"),
	// 	Properties: &armscvmm.VirtualNetworkProperties{
	// 		ProvisioningState: to.Ptr("Succeeded"),
	// 		UUID: to.Ptr("aaaaaaa-bbbb-cccc-dddd-eeeeeeeeeeee"),
	// 		VmmServerID: to.Ptr("/subscriptions/fd3c3665-1729-4b7b-9a38-238e83b0f98b/resourceGroups/testrg/providers/Microsoft.SCVMM/VMMServers/ContosoVMMServer"),
	// 	},
	// }
}
Output:

func (*VirtualNetworksClient) BeginDelete

func (client *VirtualNetworksClient) BeginDelete(ctx context.Context, resourceGroupName string, virtualNetworkName string, options *VirtualNetworksClientBeginDeleteOptions) (*runtime.Poller[VirtualNetworksClientDeleteResponse], error)

BeginDelete - Deregisters the ScVmm virtual network from Azure. If the operation fails it returns an *azcore.ResponseError type.

Generated from API version 2020-06-05-preview

  • resourceGroupName - The name of the resource group.
  • virtualNetworkName - Name of the VirtualNetwork.
  • 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/scvmm/resource-manager/Microsoft.ScVmm/preview/2020-06-05-preview/examples/DeleteVirtualNetwork.json

package main

import (
	"context"
	"log"

	"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
	"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/scvmm/armscvmm"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armscvmm.NewClientFactory("<subscription-id>", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	poller, err := clientFactory.NewVirtualNetworksClient().BeginDelete(ctx, "testrg", "HRVirtualNetwork", &armscvmm.VirtualNetworksClientBeginDeleteOptions{Force: 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) BeginUpdate

func (client *VirtualNetworksClient) BeginUpdate(ctx context.Context, resourceGroupName string, virtualNetworkName string, body ResourcePatch, options *VirtualNetworksClientBeginUpdateOptions) (*runtime.Poller[VirtualNetworksClientUpdateResponse], error)

BeginUpdate - Updates the VirtualNetworks resource. If the operation fails it returns an *azcore.ResponseError type.

Generated from API version 2020-06-05-preview

  • resourceGroupName - The name of the resource group.
  • virtualNetworkName - Name of the VirtualNetwork.
  • body - VirtualNetworks patch payload.
  • options - VirtualNetworksClientBeginUpdateOptions contains the optional parameters for the VirtualNetworksClient.BeginUpdate method.
Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/d55b8005f05b040b852c15e74a0f3e36494a15e1/specification/scvmm/resource-manager/Microsoft.ScVmm/preview/2020-06-05-preview/examples/UpdateVirtualNetwork.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/scvmm/armscvmm"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armscvmm.NewClientFactory("<subscription-id>", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	poller, err := clientFactory.NewVirtualNetworksClient().BeginUpdate(ctx, "testrg", "HRVirtualNetwork", armscvmm.ResourcePatch{
		Tags: map[string]*string{
			"tag1": to.Ptr("value1"),
			"tag2": to.Ptr("value2"),
		},
	}, 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 = armscvmm.VirtualNetwork{
	// 	Name: to.Ptr("HRVirtualNetwork"),
	// 	Type: to.Ptr("Microsoft.SCVMM/VirtualNetworks"),
	// 	ExtendedLocation: &armscvmm.ExtendedLocation{
	// 		Name: to.Ptr("/subscriptions/a5015e1c-867f-4533-8541-85cd470d0cfb/resourceGroups/demoRG/providers/Microsoft.Arc/customLocations/contoso"),
	// 		Type: to.Ptr("customLocation"),
	// 	},
	// 	ID: to.Ptr("/subscriptions/fd3c3665-1729-4b7b-9a38-238e83b0f98b/resourceGroups/testrg/providers/Microsoft.SCVMM/VirtualNetworks/HRVirtualNetwork"),
	// 	Location: to.Ptr("East US"),
	// 	Properties: &armscvmm.VirtualNetworkProperties{
	// 		ProvisioningState: to.Ptr("Succeeded"),
	// 		UUID: to.Ptr("aaaaaaa-bbbb-cccc-dddd-eeeeeeeeeeee"),
	// 		VmmServerID: to.Ptr("/subscriptions/fd3c3665-1729-4b7b-9a38-238e83b0f98b/resourceGroups/testrg/providers/Microsoft.SCVMM/VMMServers/ContosoVMMServer"),
	// 	},
	// 	Tags: map[string]*string{
	// 		"tag1": to.Ptr("value1"),
	// 		"tag2": to.Ptr("value2"),
	// 	},
	// }
}
Output:

func (*VirtualNetworksClient) Get

func (client *VirtualNetworksClient) Get(ctx context.Context, resourceGroupName string, virtualNetworkName string, options *VirtualNetworksClientGetOptions) (VirtualNetworksClientGetResponse, error)

Get - Implements VirtualNetwork GET method. If the operation fails it returns an *azcore.ResponseError type.

Generated from API version 2020-06-05-preview

  • resourceGroupName - The name of the resource group.
  • virtualNetworkName - Name of the VirtualNetwork.
  • 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/scvmm/resource-manager/Microsoft.ScVmm/preview/2020-06-05-preview/examples/GetVirtualNetwork.json

package main

import (
	"context"
	"log"

	"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
	"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/scvmm/armscvmm"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armscvmm.NewClientFactory("<subscription-id>", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	res, err := clientFactory.NewVirtualNetworksClient().Get(ctx, "testrg", "HRVirtualNetwork", 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 = armscvmm.VirtualNetwork{
	// 	Name: to.Ptr("HRVirtualNetwork"),
	// 	Type: to.Ptr("Microsoft.SCVMM/VirtualNetworks"),
	// 	ExtendedLocation: &armscvmm.ExtendedLocation{
	// 		Name: to.Ptr("/subscriptions/a5015e1c-867f-4533-8541-85cd470d0cfb/resourceGroups/demoRG/providers/Microsoft.Arc/customLocations/contoso"),
	// 		Type: to.Ptr("customLocation"),
	// 	},
	// 	ID: to.Ptr("/subscriptions/fd3c3665-1729-4b7b-9a38-238e83b0f98b/resourceGroups/testrg/providers/Microsoft.SCVMM/VirtualNetworks/HRVirtualNetwork"),
	// 	Location: to.Ptr("East US"),
	// 	Properties: &armscvmm.VirtualNetworkProperties{
	// 		ProvisioningState: to.Ptr("Succeeded"),
	// 		UUID: to.Ptr("aaaaaaa-bbbb-cccc-dddd-eeeeeeeeeeee"),
	// 		VmmServerID: to.Ptr("/subscriptions/fd3c3665-1729-4b7b-9a38-238e83b0f98b/resourceGroups/testrg/providers/Microsoft.SCVMM/VMMServers/ContosoVMMServer"),
	// 	},
	// }
}
Output:

func (*VirtualNetworksClient) NewListByResourceGroupPager

NewListByResourceGroupPager - List of VirtualNetworks in a resource group.

Generated from API version 2020-06-05-preview

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

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/d55b8005f05b040b852c15e74a0f3e36494a15e1/specification/scvmm/resource-manager/Microsoft.ScVmm/preview/2020-06-05-preview/examples/ListVirtualNetworksByResourceGroup.json

package main

import (
	"context"
	"log"

	"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
	"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/scvmm/armscvmm"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armscvmm.NewClientFactory("<subscription-id>", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	pager := clientFactory.NewVirtualNetworksClient().NewListByResourceGroupPager("testrg", 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.VirtualNetworkListResult = armscvmm.VirtualNetworkListResult{
		// 	Value: []*armscvmm.VirtualNetwork{
		// 		{
		// 			Name: to.Ptr("HRVirtualNetwork"),
		// 			Type: to.Ptr("Microsoft.SCVMM/VirtualNetworks"),
		// 			ExtendedLocation: &armscvmm.ExtendedLocation{
		// 				Name: to.Ptr("/subscriptions/a5015e1c-867f-4533-8541-85cd470d0cfb/resourceGroups/demoRG/providers/Microsoft.Arc/customLocations/contoso"),
		// 				Type: to.Ptr("customLocation"),
		// 			},
		// 			ID: to.Ptr("/subscriptions/fd3c3665-1729-4b7b-9a38-238e83b0f98b/resourceGroups/testrg/providers/Microsoft.SCVMM/VirtualNetworks/HRVirtualNetwork"),
		// 			Location: to.Ptr("East US"),
		// 			Properties: &armscvmm.VirtualNetworkProperties{
		// 				ProvisioningState: to.Ptr("Succeeded"),
		// 				UUID: to.Ptr("aaaaaaa-bbbb-cccc-dddd-eeeeeeeeeeee"),
		// 				VmmServerID: to.Ptr("/subscriptions/fd3c3665-1729-4b7b-9a38-238e83b0f98b/resourceGroups/testrg/providers/Microsoft.SCVMM/VMMServers/ContosoVMMServer"),
		// 			},
		// 	}},
		// }
	}
}
Output:

func (*VirtualNetworksClient) NewListBySubscriptionPager

NewListBySubscriptionPager - List of VirtualNetworks in a subscription.

Generated from API version 2020-06-05-preview

  • options - VirtualNetworksClientListBySubscriptionOptions contains the optional parameters for the VirtualNetworksClient.NewListBySubscriptionPager method.
Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/d55b8005f05b040b852c15e74a0f3e36494a15e1/specification/scvmm/resource-manager/Microsoft.ScVmm/preview/2020-06-05-preview/examples/ListVirtualNetworksBySubscription.json

package main

import (
	"context"
	"log"

	"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
	"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/scvmm/armscvmm"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armscvmm.NewClientFactory("<subscription-id>", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	pager := clientFactory.NewVirtualNetworksClient().NewListBySubscriptionPager(nil)
	for pager.More() {
		page, err := pager.NextPage(ctx)
		if err != nil {
			log.Fatalf("failed to advance page: %v", err)
		}
		for _, v := range page.Value {
			// You could use page here. We use blank identifier for just demo purposes.
			_ = v
		}
		// If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes.
		// page.VirtualNetworkListResult = armscvmm.VirtualNetworkListResult{
		// 	Value: []*armscvmm.VirtualNetwork{
		// 		{
		// 			Name: to.Ptr("HRVirtualNetwork"),
		// 			Type: to.Ptr("Microsoft.SCVMM/VirtualNetworks"),
		// 			ExtendedLocation: &armscvmm.ExtendedLocation{
		// 				Name: to.Ptr("/subscriptions/a5015e1c-867f-4533-8541-85cd470d0cfb/resourceGroups/demoRG/providers/Microsoft.Arc/customLocations/contoso"),
		// 				Type: to.Ptr("customLocation"),
		// 			},
		// 			ID: to.Ptr("/subscriptions/fd3c3665-1729-4b7b-9a38-238e83b0f98b/resourceGroups/testrg/providers/Microsoft.SCVMM/VirtualNetworks/HRVirtualNetwork"),
		// 			Location: to.Ptr("East US"),
		// 			Properties: &armscvmm.VirtualNetworkProperties{
		// 				ProvisioningState: to.Ptr("Succeeded"),
		// 				UUID: to.Ptr("aaaaaaa-bbbb-cccc-dddd-eeeeeeeeeeee"),
		// 				VmmServerID: to.Ptr("/subscriptions/fd3c3665-1729-4b7b-9a38-238e83b0f98b/resourceGroups/testrg/providers/Microsoft.SCVMM/VMMServers/ContosoVMMServer"),
		// 			},
		// 	}},
		// }
	}
}
Output:

type VirtualNetworksClientBeginCreateOrUpdateOptions

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

VirtualNetworksClientBeginCreateOrUpdateOptions contains the optional parameters for the VirtualNetworksClient.BeginCreateOrUpdate method.

type VirtualNetworksClientBeginDeleteOptions

type VirtualNetworksClientBeginDeleteOptions struct {
	// Forces the resource to be deleted from azure. The corresponding CR would be attempted to be deleted too.
	Force *bool

	// Resumes the LRO from the provided token.
	ResumeToken string
}

VirtualNetworksClientBeginDeleteOptions contains the optional parameters for the VirtualNetworksClient.BeginDelete method.

type VirtualNetworksClientBeginUpdateOptions

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

VirtualNetworksClientBeginUpdateOptions contains the optional parameters for the VirtualNetworksClient.BeginUpdate method.

type VirtualNetworksClientCreateOrUpdateResponse

type VirtualNetworksClientCreateOrUpdateResponse struct {
	// The VirtualNetworks resource definition.
	VirtualNetwork
}

VirtualNetworksClientCreateOrUpdateResponse contains the response from method VirtualNetworksClient.BeginCreateOrUpdate.

type VirtualNetworksClientDeleteResponse

type VirtualNetworksClientDeleteResponse struct {
}

VirtualNetworksClientDeleteResponse contains the response from method VirtualNetworksClient.BeginDelete.

type VirtualNetworksClientGetOptions

type VirtualNetworksClientGetOptions struct {
}

VirtualNetworksClientGetOptions contains the optional parameters for the VirtualNetworksClient.Get method.

type VirtualNetworksClientGetResponse

type VirtualNetworksClientGetResponse struct {
	// The VirtualNetworks resource definition.
	VirtualNetwork
}

VirtualNetworksClientGetResponse contains the response from method VirtualNetworksClient.Get.

type VirtualNetworksClientListByResourceGroupOptions

type VirtualNetworksClientListByResourceGroupOptions struct {
}

VirtualNetworksClientListByResourceGroupOptions contains the optional parameters for the VirtualNetworksClient.NewListByResourceGroupPager method.

type VirtualNetworksClientListByResourceGroupResponse

type VirtualNetworksClientListByResourceGroupResponse struct {
	// List of VirtualNetworks.
	VirtualNetworkListResult
}

VirtualNetworksClientListByResourceGroupResponse contains the response from method VirtualNetworksClient.NewListByResourceGroupPager.

type VirtualNetworksClientListBySubscriptionOptions

type VirtualNetworksClientListBySubscriptionOptions struct {
}

VirtualNetworksClientListBySubscriptionOptions contains the optional parameters for the VirtualNetworksClient.NewListBySubscriptionPager method.

type VirtualNetworksClientListBySubscriptionResponse

type VirtualNetworksClientListBySubscriptionResponse struct {
	// List of VirtualNetworks.
	VirtualNetworkListResult
}

VirtualNetworksClientListBySubscriptionResponse contains the response from method VirtualNetworksClient.NewListBySubscriptionPager.

type VirtualNetworksClientUpdateResponse

type VirtualNetworksClientUpdateResponse struct {
	// The VirtualNetworks resource definition.
	VirtualNetwork
}

VirtualNetworksClientUpdateResponse contains the response from method VirtualNetworksClient.BeginUpdate.

type VmmServersClient

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

VmmServersClient contains the methods for the VmmServers group. Don't use this type directly, use NewVmmServersClient() instead.

func NewVmmServersClient

func NewVmmServersClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*VmmServersClient, error)

NewVmmServersClient creates a new instance of VmmServersClient with the specified values.

  • subscriptionID - The Azure subscription ID. This is a GUID-formatted string (e.g. 00000000-0000-0000-0000-000000000000).
  • credential - used to authorize requests. Usually a credential from azidentity.
  • options - pass nil to accept the default values.

func (*VmmServersClient) BeginCreateOrUpdate

func (client *VmmServersClient) BeginCreateOrUpdate(ctx context.Context, resourceGroupName string, vmmServerName string, body VMMServer, options *VmmServersClientBeginCreateOrUpdateOptions) (*runtime.Poller[VmmServersClientCreateOrUpdateResponse], error)

BeginCreateOrUpdate - Onboards the SCVMM fabric as an Azure VmmServer resource. If the operation fails it returns an *azcore.ResponseError type.

Generated from API version 2020-06-05-preview

  • resourceGroupName - The name of the resource group.
  • vmmServerName - Name of the VMMServer.
  • body - Request payload.
  • options - VmmServersClientBeginCreateOrUpdateOptions contains the optional parameters for the VmmServersClient.BeginCreateOrUpdate method.
Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/d55b8005f05b040b852c15e74a0f3e36494a15e1/specification/scvmm/resource-manager/Microsoft.ScVmm/preview/2020-06-05-preview/examples/CreateVMMServer.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/scvmm/armscvmm"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armscvmm.NewClientFactory("<subscription-id>", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	poller, err := clientFactory.NewVmmServersClient().BeginCreateOrUpdate(ctx, "testrg", "ContosoVMMServer", armscvmm.VMMServer{
		ExtendedLocation: &armscvmm.ExtendedLocation{
			Name: to.Ptr("/subscriptions/a5015e1c-867f-4533-8541-85cd470d0cfb/resourceGroups/demoRG/providers/Microsoft.Arc/customLocations/contoso"),
			Type: to.Ptr("customLocation"),
		},
		Location: to.Ptr("East US"),
		Properties: &armscvmm.VMMServerProperties{
			Credentials: &armscvmm.VMMServerPropertiesCredentials{
				Password: to.Ptr("password"),
				Username: to.Ptr("testuser"),
			},
			Fqdn: to.Ptr("VMM.contoso.com"),
			Port: to.Ptr[int32](1234),
		},
	}, 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.VMMServer = armscvmm.VMMServer{
	// 	Name: to.Ptr("ContosoVMMServer"),
	// 	Type: to.Ptr("Microsoft.SCVMM/VMMServers"),
	// 	ExtendedLocation: &armscvmm.ExtendedLocation{
	// 		Name: to.Ptr("/subscriptions/a5015e1c-867f-4533-8541-85cd470d0cfb/resourceGroups/demoRG/providers/Microsoft.Arc/customLocations/contoso"),
	// 		Type: to.Ptr("customLocation"),
	// 	},
	// 	ID: to.Ptr("/subscriptions/fd3c3665-1729-4b7b-9a38-238e83b0f98b/resourceGroups/testrg/providers/Microsoft.SCVMM/VMMServers/ContosoVMMServer"),
	// 	Location: to.Ptr("East US"),
	// 	Properties: &armscvmm.VMMServerProperties{
	// 		ConnectionStatus: to.Ptr("Connected"),
	// 		Fqdn: to.Ptr("VMM.contoso.com"),
	// 		Port: to.Ptr[int32](1234),
	// 		ProvisioningState: to.Ptr("Succeeded"),
	// 		UUID: to.Ptr("fd3c3665-1729-4b7b-9a38-238e83b0f98b"),
	// 		Version: to.Ptr("2.0"),
	// 	},
	// }
}
Output:

func (*VmmServersClient) BeginDelete

func (client *VmmServersClient) BeginDelete(ctx context.Context, resourceGroupName string, vmmServerName string, options *VmmServersClientBeginDeleteOptions) (*runtime.Poller[VmmServersClientDeleteResponse], error)

BeginDelete - Deboards the SCVMM fabric from Azure. If the operation fails it returns an *azcore.ResponseError type.

Generated from API version 2020-06-05-preview

  • resourceGroupName - The name of the resource group.
  • vmmServerName - Name of the VMMServer.
  • options - VmmServersClientBeginDeleteOptions contains the optional parameters for the VmmServersClient.BeginDelete method.
Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/d55b8005f05b040b852c15e74a0f3e36494a15e1/specification/scvmm/resource-manager/Microsoft.ScVmm/preview/2020-06-05-preview/examples/DeleteVMMServer.json

package main

import (
	"context"
	"log"

	"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
	"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/scvmm/armscvmm"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armscvmm.NewClientFactory("<subscription-id>", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	poller, err := clientFactory.NewVmmServersClient().BeginDelete(ctx, "testrg", "ContosoVMMServer", &armscvmm.VmmServersClientBeginDeleteOptions{Force: 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 (*VmmServersClient) BeginUpdate

func (client *VmmServersClient) BeginUpdate(ctx context.Context, resourceGroupName string, vmmServerName string, body ResourcePatch, options *VmmServersClientBeginUpdateOptions) (*runtime.Poller[VmmServersClientUpdateResponse], error)

BeginUpdate - Updates the VmmServers resource. If the operation fails it returns an *azcore.ResponseError type.

Generated from API version 2020-06-05-preview

  • resourceGroupName - The name of the resource group.
  • vmmServerName - Name of the VMMServer.
  • body - VmmServers patch payload.
  • options - VmmServersClientBeginUpdateOptions contains the optional parameters for the VmmServersClient.BeginUpdate method.
Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/d55b8005f05b040b852c15e74a0f3e36494a15e1/specification/scvmm/resource-manager/Microsoft.ScVmm/preview/2020-06-05-preview/examples/UpdateVMMServer.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/scvmm/armscvmm"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armscvmm.NewClientFactory("<subscription-id>", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	poller, err := clientFactory.NewVmmServersClient().BeginUpdate(ctx, "testrg", "ContosoVMMServer", armscvmm.ResourcePatch{
		Tags: map[string]*string{
			"tag1": to.Ptr("value1"),
			"tag2": to.Ptr("value2"),
		},
	}, 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.VMMServer = armscvmm.VMMServer{
	// 	Name: to.Ptr("ContosoVMMServer"),
	// 	Type: to.Ptr("Microsoft.SCVMM/VMMServers"),
	// 	ExtendedLocation: &armscvmm.ExtendedLocation{
	// 		Name: to.Ptr("/subscriptions/a5015e1c-867f-4533-8541-85cd470d0cfb/resourceGroups/demoRG/providers/Microsoft.Arc/customLocations/contoso"),
	// 		Type: to.Ptr("customLocation"),
	// 	},
	// 	ID: to.Ptr("/subscriptions/fd3c3665-1729-4b7b-9a38-238e83b0f98b/resourceGroups/testrg/providers/Microsoft.SCVMM/VMMServers/ContosoVMMServer"),
	// 	Location: to.Ptr("East US"),
	// 	Properties: &armscvmm.VMMServerProperties{
	// 		ConnectionStatus: to.Ptr("Connected"),
	// 		Fqdn: to.Ptr("VMM.contoso.com"),
	// 		Port: to.Ptr[int32](1234),
	// 		ProvisioningState: to.Ptr("Succeeded"),
	// 		UUID: to.Ptr("fd3c3665-1729-4b7b-9a38-238e83b0f98b"),
	// 		Version: to.Ptr("2.0"),
	// 	},
	// 	Tags: map[string]*string{
	// 		"tag1": to.Ptr("value1"),
	// 		"tag2": to.Ptr("value2"),
	// 	},
	// }
}
Output:

func (*VmmServersClient) Get

func (client *VmmServersClient) Get(ctx context.Context, resourceGroupName string, vmmServerName string, options *VmmServersClientGetOptions) (VmmServersClientGetResponse, error)

Get - Implements VMMServer GET method. If the operation fails it returns an *azcore.ResponseError type.

Generated from API version 2020-06-05-preview

  • resourceGroupName - The name of the resource group.
  • vmmServerName - Name of the VMMServer.
  • options - VmmServersClientGetOptions contains the optional parameters for the VmmServersClient.Get method.
Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/d55b8005f05b040b852c15e74a0f3e36494a15e1/specification/scvmm/resource-manager/Microsoft.ScVmm/preview/2020-06-05-preview/examples/GetVMMServer.json

package main

import (
	"context"
	"log"

	"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
	"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/scvmm/armscvmm"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armscvmm.NewClientFactory("<subscription-id>", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	res, err := clientFactory.NewVmmServersClient().Get(ctx, "testrg", "ContosoVMMServer", 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.VMMServer = armscvmm.VMMServer{
	// 	Name: to.Ptr("ContosoVMMServer"),
	// 	Type: to.Ptr("Microsoft.SCVMM/VMMServers"),
	// 	ExtendedLocation: &armscvmm.ExtendedLocation{
	// 		Name: to.Ptr("/subscriptions/a5015e1c-867f-4533-8541-85cd470d0cfb/resourceGroups/demoRG/providers/Microsoft.Arc/customLocations/contoso"),
	// 		Type: to.Ptr("customLocation"),
	// 	},
	// 	ID: to.Ptr("/subscriptions/fd3c3665-1729-4b7b-9a38-238e83b0f98b/resourceGroups/testrg/providers/Microsoft.SCVMM/VMMServers/ContosoVMMServer"),
	// 	Location: to.Ptr("East US"),
	// 	Properties: &armscvmm.VMMServerProperties{
	// 		ConnectionStatus: to.Ptr("Connected"),
	// 		Fqdn: to.Ptr("VMM.contoso.com"),
	// 		Port: to.Ptr[int32](1234),
	// 		ProvisioningState: to.Ptr("Succeeded"),
	// 		UUID: to.Ptr("fd3c3665-1729-4b7b-9a38-238e83b0f98b"),
	// 		Version: to.Ptr("2.0"),
	// 	},
	// }
}
Output:

func (*VmmServersClient) NewListByResourceGroupPager

func (client *VmmServersClient) NewListByResourceGroupPager(resourceGroupName string, options *VmmServersClientListByResourceGroupOptions) *runtime.Pager[VmmServersClientListByResourceGroupResponse]

NewListByResourceGroupPager - List of VmmServers in a resource group.

Generated from API version 2020-06-05-preview

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

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/d55b8005f05b040b852c15e74a0f3e36494a15e1/specification/scvmm/resource-manager/Microsoft.ScVmm/preview/2020-06-05-preview/examples/ListVMMServersByResourceGroup.json

package main

import (
	"context"
	"log"

	"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
	"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/scvmm/armscvmm"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armscvmm.NewClientFactory("<subscription-id>", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	pager := clientFactory.NewVmmServersClient().NewListByResourceGroupPager("testrg", 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.VMMServerListResult = armscvmm.VMMServerListResult{
		// 	Value: []*armscvmm.VMMServer{
		// 		{
		// 			Name: to.Ptr("ContosoVMMServer"),
		// 			Type: to.Ptr("Microsoft.SCVMM/VMMServers"),
		// 			ExtendedLocation: &armscvmm.ExtendedLocation{
		// 				Name: to.Ptr("/subscriptions/a5015e1c-867f-4533-8541-85cd470d0cfb/resourceGroups/demoRG/providers/Microsoft.Arc/customLocations/contoso"),
		// 				Type: to.Ptr("customLocation"),
		// 			},
		// 			ID: to.Ptr("/subscriptions/fd3c3665-1729-4b7b-9a38-238e83b0f98b/resourceGroups/testrg/providers/Microsoft.SCVMM/VMMServers/ContosoVMMServer"),
		// 			Location: to.Ptr("East US"),
		// 			Properties: &armscvmm.VMMServerProperties{
		// 				ConnectionStatus: to.Ptr("Connected"),
		// 				Fqdn: to.Ptr("VMM.contoso.com"),
		// 				Port: to.Ptr[int32](1234),
		// 				ProvisioningState: to.Ptr("Succeeded"),
		// 				UUID: to.Ptr("fd3c3665-1729-4b7b-9a38-238e83b0f98b"),
		// 				Version: to.Ptr("2.0"),
		// 			},
		// 	}},
		// }
	}
}
Output:

func (*VmmServersClient) NewListBySubscriptionPager

NewListBySubscriptionPager - List of VmmServers in a subscription.

Generated from API version 2020-06-05-preview

  • options - VmmServersClientListBySubscriptionOptions contains the optional parameters for the VmmServersClient.NewListBySubscriptionPager method.
Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/d55b8005f05b040b852c15e74a0f3e36494a15e1/specification/scvmm/resource-manager/Microsoft.ScVmm/preview/2020-06-05-preview/examples/ListVMMServersBySubscription.json

package main

import (
	"context"
	"log"

	"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
	"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/scvmm/armscvmm"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armscvmm.NewClientFactory("<subscription-id>", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	pager := clientFactory.NewVmmServersClient().NewListBySubscriptionPager(nil)
	for pager.More() {
		page, err := pager.NextPage(ctx)
		if err != nil {
			log.Fatalf("failed to advance page: %v", err)
		}
		for _, v := range page.Value {
			// You could use page here. We use blank identifier for just demo purposes.
			_ = v
		}
		// If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes.
		// page.VMMServerListResult = armscvmm.VMMServerListResult{
		// 	Value: []*armscvmm.VMMServer{
		// 		{
		// 			Name: to.Ptr("ContosoVMMServer"),
		// 			Type: to.Ptr("Microsoft.SCVMM/VMMServers"),
		// 			ExtendedLocation: &armscvmm.ExtendedLocation{
		// 				Name: to.Ptr("/subscriptions/a5015e1c-867f-4533-8541-85cd470d0cfb/resourceGroups/demoRG/providers/Microsoft.Arc/customLocations/contoso"),
		// 				Type: to.Ptr("customLocation"),
		// 			},
		// 			ID: to.Ptr("/subscriptions/fd3c3665-1729-4b7b-9a38-238e83b0f98b/resourceGroups/testrg/providers/Microsoft.SCVMM/VMMServers/ContosoVMMServer"),
		// 			Location: to.Ptr("East US"),
		// 			Properties: &armscvmm.VMMServerProperties{
		// 				ConnectionStatus: to.Ptr("Connected"),
		// 				Fqdn: to.Ptr("VMM.contoso.com"),
		// 				Port: to.Ptr[int32](1234),
		// 				ProvisioningState: to.Ptr("Succeeded"),
		// 				UUID: to.Ptr("fd3c3665-1729-4b7b-9a38-238e83b0f98b"),
		// 				Version: to.Ptr("2.0"),
		// 			},
		// 	}},
		// }
	}
}
Output:

type VmmServersClientBeginCreateOrUpdateOptions

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

VmmServersClientBeginCreateOrUpdateOptions contains the optional parameters for the VmmServersClient.BeginCreateOrUpdate method.

type VmmServersClientBeginDeleteOptions

type VmmServersClientBeginDeleteOptions struct {
	// Forces the resource to be deleted from azure. The corresponding CR would be attempted to be deleted too.
	Force *bool

	// Resumes the LRO from the provided token.
	ResumeToken string
}

VmmServersClientBeginDeleteOptions contains the optional parameters for the VmmServersClient.BeginDelete method.

type VmmServersClientBeginUpdateOptions

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

VmmServersClientBeginUpdateOptions contains the optional parameters for the VmmServersClient.BeginUpdate method.

type VmmServersClientCreateOrUpdateResponse

type VmmServersClientCreateOrUpdateResponse struct {
	// The VmmServers resource definition.
	VMMServer
}

VmmServersClientCreateOrUpdateResponse contains the response from method VmmServersClient.BeginCreateOrUpdate.

type VmmServersClientDeleteResponse

type VmmServersClientDeleteResponse struct {
}

VmmServersClientDeleteResponse contains the response from method VmmServersClient.BeginDelete.

type VmmServersClientGetOptions

type VmmServersClientGetOptions struct {
}

VmmServersClientGetOptions contains the optional parameters for the VmmServersClient.Get method.

type VmmServersClientGetResponse

type VmmServersClientGetResponse struct {
	// The VmmServers resource definition.
	VMMServer
}

VmmServersClientGetResponse contains the response from method VmmServersClient.Get.

type VmmServersClientListByResourceGroupOptions

type VmmServersClientListByResourceGroupOptions struct {
}

VmmServersClientListByResourceGroupOptions contains the optional parameters for the VmmServersClient.NewListByResourceGroupPager method.

type VmmServersClientListByResourceGroupResponse

type VmmServersClientListByResourceGroupResponse struct {
	// List of VmmServers.
	VMMServerListResult
}

VmmServersClientListByResourceGroupResponse contains the response from method VmmServersClient.NewListByResourceGroupPager.

type VmmServersClientListBySubscriptionOptions

type VmmServersClientListBySubscriptionOptions struct {
}

VmmServersClientListBySubscriptionOptions contains the optional parameters for the VmmServersClient.NewListBySubscriptionPager method.

type VmmServersClientListBySubscriptionResponse

type VmmServersClientListBySubscriptionResponse struct {
	// List of VmmServers.
	VMMServerListResult
}

VmmServersClientListBySubscriptionResponse contains the response from method VmmServersClient.NewListBySubscriptionPager.

type VmmServersClientUpdateResponse

type VmmServersClientUpdateResponse struct {
	// The VmmServers resource definition.
	VMMServer
}

VmmServersClientUpdateResponse contains the response from method VmmServersClient.BeginUpdate.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL