armloadtesting

package module
v1.2.0 Latest Latest
Warning

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

Go to latest
Published: Nov 24, 2023 License: MIT Imports: 14 Imported by: 1

README

Azure Load Testing Module for Go

PkgGoDev

The armloadtesting module provides operations for working with Azure Load Testing.

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 Load Testing module:

go get github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/loadtesting/armloadtesting

Authorization

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

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 Load Testing 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 ActionType

type ActionType string

ActionType - Enum. Indicates the action type. "Internal" refers to actions that are for internal only APIs.

const (
	ActionTypeInternal ActionType = "Internal"
)

func PossibleActionTypeValues

func PossibleActionTypeValues() []ActionType

PossibleActionTypeValues returns the possible values for the ActionType const type.

type CheckQuotaAvailabilityResponse

type CheckQuotaAvailabilityResponse struct {
	// Check quota availability response properties.
	Properties *CheckQuotaAvailabilityResponseProperties

	// 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; Azure Resource Manager metadata containing createdBy and modifiedBy information.
	SystemData *SystemData

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

CheckQuotaAvailabilityResponse - Check quota availability response object.

func (CheckQuotaAvailabilityResponse) MarshalJSON

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

MarshalJSON implements the json.Marshaller interface for type CheckQuotaAvailabilityResponse.

func (*CheckQuotaAvailabilityResponse) UnmarshalJSON

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

UnmarshalJSON implements the json.Unmarshaller interface for type CheckQuotaAvailabilityResponse.

type CheckQuotaAvailabilityResponseProperties

type CheckQuotaAvailabilityResponseProperties struct {
	// Message indicating additional details to add to quota support request.
	AvailabilityStatus *string

	// True/False indicating whether the quota request be granted based on availability.
	IsAvailable *bool
}

CheckQuotaAvailabilityResponseProperties - Check quota availability response properties.

func (CheckQuotaAvailabilityResponseProperties) MarshalJSON

MarshalJSON implements the json.Marshaller interface for type CheckQuotaAvailabilityResponseProperties.

func (*CheckQuotaAvailabilityResponseProperties) UnmarshalJSON

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

UnmarshalJSON implements the json.Unmarshaller interface for type CheckQuotaAvailabilityResponseProperties.

type ClientFactory added in v1.1.0

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

ClientFactory is a client factory used to create any client in this module. Don't use this type directly, use NewClientFactory instead.

func NewClientFactory added in v1.1.0

func NewClientFactory(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*ClientFactory, error)

NewClientFactory creates a new instance of ClientFactory with the specified values. The parameter values will be propagated to any client created from this factory.

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

func (*ClientFactory) NewLoadTestsClient added in v1.1.0

func (c *ClientFactory) NewLoadTestsClient() *LoadTestsClient

NewLoadTestsClient creates a new instance of LoadTestsClient.

func (*ClientFactory) NewOperationsClient added in v1.1.0

func (c *ClientFactory) NewOperationsClient() *OperationsClient

NewOperationsClient creates a new instance of OperationsClient.

func (*ClientFactory) NewQuotasClient added in v1.1.0

func (c *ClientFactory) NewQuotasClient() *QuotasClient

NewQuotasClient creates a new instance of QuotasClient.

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 EncryptionProperties

type EncryptionProperties struct {
	// All identity configuration for Customer-managed key settings defining which identity should be used to auth to Key Vault.
	Identity *EncryptionPropertiesIdentity

	// key encryption key Url, versioned. Ex: https://contosovault.vault.azure.net/keys/contosokek/562a4bb76b524a1493a6afe8e536ee78
	// or https://contosovault.vault.azure.net/keys/contosokek.
	KeyURL *string
}

EncryptionProperties - Key and identity details for Customer Managed Key encryption of load test resource

func (EncryptionProperties) MarshalJSON

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

MarshalJSON implements the json.Marshaller interface for type EncryptionProperties.

func (*EncryptionProperties) UnmarshalJSON

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

UnmarshalJSON implements the json.Unmarshaller interface for type EncryptionProperties.

type EncryptionPropertiesIdentity

type EncryptionPropertiesIdentity struct {
	// user assigned identity to use for accessing key encryption key Url. Ex: /subscriptions/fa5fc227-a624-475e-b696-cdd604c735bc/resourceGroups/
	// /providers/Microsoft.ManagedIdentity/userAssignedIdentities/myId
	ResourceID *string

	// Managed identity type to use for accessing encryption key Url
	Type *Type
}

EncryptionPropertiesIdentity - All identity configuration for Customer-managed key settings defining which identity should be used to auth to Key Vault.

func (EncryptionPropertiesIdentity) MarshalJSON

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

MarshalJSON implements the json.Marshaller interface for type EncryptionPropertiesIdentity.

func (*EncryptionPropertiesIdentity) UnmarshalJSON

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

UnmarshalJSON implements the json.Unmarshaller interface for type EncryptionPropertiesIdentity.

type EndpointDependency

type EndpointDependency struct {
	// READ-ONLY; Human-readable supplemental information about the dependency and when it is applicable.
	Description *string

	// READ-ONLY; The domain name of the dependency. Domain names may be fully qualified or may contain a * wildcard.
	DomainName *string

	// READ-ONLY; The list of connection details for this endpoint.
	EndpointDetails []*EndpointDetail
}

EndpointDependency - A domain name and connection details used to access a dependency.

func (EndpointDependency) MarshalJSON

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

MarshalJSON implements the json.Marshaller interface for type EndpointDependency.

func (*EndpointDependency) UnmarshalJSON

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

UnmarshalJSON implements the json.Unmarshaller interface for type EndpointDependency.

type EndpointDetail

type EndpointDetail struct {
	// READ-ONLY; The port an endpoint is connected to.
	Port *int32
}

EndpointDetail - Details about the connection between the Batch service and the endpoint.

func (EndpointDetail) MarshalJSON

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

MarshalJSON implements the json.Marshaller interface for type EndpointDetail.

func (*EndpointDetail) UnmarshalJSON

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

UnmarshalJSON implements the json.Unmarshaller interface for type EndpointDetail.

type LoadTestProperties

type LoadTestProperties struct {
	// Description of the resource.
	Description *string

	// CMK Encryption property.
	Encryption *EncryptionProperties

	// READ-ONLY; Resource data plane URI.
	DataPlaneURI *string

	// READ-ONLY; Resource provisioning state.
	ProvisioningState *ResourceState
}

LoadTestProperties - LoadTest resource properties.

func (LoadTestProperties) MarshalJSON

func (l LoadTestProperties) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.Marshaller interface for type LoadTestProperties.

func (*LoadTestProperties) UnmarshalJSON

func (l *LoadTestProperties) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the json.Unmarshaller interface for type LoadTestProperties.

type LoadTestResource

type LoadTestResource struct {
	// REQUIRED; The geo-location where the resource lives
	Location *string

	// The type of identity used for the resource.
	Identity *ManagedServiceIdentity

	// Load Test resource properties
	Properties *LoadTestProperties

	// Resource tags.
	Tags map[string]*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; Azure Resource Manager metadata containing createdBy and modifiedBy information.
	SystemData *SystemData

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

LoadTestResource - LoadTest details

func (LoadTestResource) MarshalJSON

func (l LoadTestResource) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.Marshaller interface for type LoadTestResource.

func (*LoadTestResource) UnmarshalJSON

func (l *LoadTestResource) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the json.Unmarshaller interface for type LoadTestResource.

type LoadTestResourcePageList

type LoadTestResourcePageList struct {
	// Link to next page of resources.
	NextLink *string

	// List of resources in current page.
	Value []*LoadTestResource
}

LoadTestResourcePageList - List of resources page result.

func (LoadTestResourcePageList) MarshalJSON

func (l LoadTestResourcePageList) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.Marshaller interface for type LoadTestResourcePageList.

func (*LoadTestResourcePageList) UnmarshalJSON

func (l *LoadTestResourcePageList) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the json.Unmarshaller interface for type LoadTestResourcePageList.

type LoadTestResourcePatchRequestBody

type LoadTestResourcePatchRequestBody struct {
	// The type of identity used for the resource.
	Identity *ManagedServiceIdentity

	// Load Test resource properties
	Properties *LoadTestResourcePatchRequestBodyProperties

	// Resource tags.
	Tags map[string]*string
}

LoadTestResourcePatchRequestBody - LoadTest resource patch request body.

func (LoadTestResourcePatchRequestBody) MarshalJSON

func (l LoadTestResourcePatchRequestBody) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.Marshaller interface for type LoadTestResourcePatchRequestBody.

func (*LoadTestResourcePatchRequestBody) UnmarshalJSON

func (l *LoadTestResourcePatchRequestBody) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the json.Unmarshaller interface for type LoadTestResourcePatchRequestBody.

type LoadTestResourcePatchRequestBodyProperties

type LoadTestResourcePatchRequestBodyProperties struct {
	// Description of the resource.
	Description *string

	// CMK Encryption property.
	Encryption *EncryptionProperties
}

LoadTestResourcePatchRequestBodyProperties - Load Test resource properties

func (LoadTestResourcePatchRequestBodyProperties) MarshalJSON

MarshalJSON implements the json.Marshaller interface for type LoadTestResourcePatchRequestBodyProperties.

func (*LoadTestResourcePatchRequestBodyProperties) UnmarshalJSON

func (l *LoadTestResourcePatchRequestBodyProperties) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the json.Unmarshaller interface for type LoadTestResourcePatchRequestBodyProperties.

type LoadTestsClient

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

LoadTestsClient contains the methods for the LoadTests group. Don't use this type directly, use NewLoadTestsClient() instead.

func NewLoadTestsClient

func NewLoadTestsClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*LoadTestsClient, error)

NewLoadTestsClient creates a new instance of LoadTestsClient with the specified values.

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

func (*LoadTestsClient) BeginCreateOrUpdate

func (client *LoadTestsClient) BeginCreateOrUpdate(ctx context.Context, resourceGroupName string, loadTestName string, loadTestResource LoadTestResource, options *LoadTestsClientBeginCreateOrUpdateOptions) (*runtime.Poller[LoadTestsClientCreateOrUpdateResponse], error)

BeginCreateOrUpdate - Create or update LoadTest resource. If the operation fails it returns an *azcore.ResponseError type.

Generated from API version 2022-12-01

  • resourceGroupName - The name of the resource group. The name is case insensitive.
  • loadTestName - Load Test name.
  • loadTestResource - LoadTest resource data
  • options - LoadTestsClientBeginCreateOrUpdateOptions contains the optional parameters for the LoadTestsClient.BeginCreateOrUpdate method.
Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/630ec444f8dd7c09b9cdd5fa99951f8a0d1ad41f/specification/loadtestservice/resource-manager/Microsoft.LoadTestService/stable/2022-12-01/examples/LoadTests_CreateOrUpdate.json

package main

import (
	"context"
	"log"

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

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armloadtesting.NewClientFactory("<subscription-id>", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	poller, err := clientFactory.NewLoadTestsClient().BeginCreateOrUpdate(ctx, "dummyrg", "myLoadTest", armloadtesting.LoadTestResource{
		Location: to.Ptr("westus"),
		Tags: map[string]*string{
			"Team": to.Ptr("Dev Exp"),
		},
		Identity: &armloadtesting.ManagedServiceIdentity{
			Type: to.Ptr(armloadtesting.ManagedServiceIdentityTypeSystemAssignedUserAssigned),
			UserAssignedIdentities: map[string]*armloadtesting.UserAssignedIdentity{
				"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/dummyrg/providers/Microsoft.ManagedIdentity/userAssignedIdentities/id1": {},
			},
		},
		Properties: &armloadtesting.LoadTestProperties{
			Description: to.Ptr("This is new load test resource"),
			Encryption: &armloadtesting.EncryptionProperties{
				Identity: &armloadtesting.EncryptionPropertiesIdentity{
					Type:       to.Ptr(armloadtesting.TypeUserAssigned),
					ResourceID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/dummyrg/providers/Microsoft.ManagedIdentity/userAssignedIdentities/id1"),
				},
				KeyURL: to.Ptr("https://dummy.vault.azure.net/keys/dummykey1"),
			},
		},
	}, 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.LoadTestResource = armloadtesting.LoadTestResource{
	// 	Name: to.Ptr("myLoadTest"),
	// 	Type: to.Ptr("Microsoft.LoadTestService/loadTests"),
	// 	ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/dummyrg/providers/Microsoft.LoadTestService/loadTests/myLoadTest"),
	// 	SystemData: &armloadtesting.SystemData{
	// 		CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-09-28T12:32:33.000Z"); return t}()),
	// 		CreatedBy: to.Ptr("userId1001"),
	// 		CreatedByType: to.Ptr(armloadtesting.CreatedByTypeUser),
	// 		LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-09-28T12:32:33.000Z"); return t}()),
	// 		LastModifiedBy: to.Ptr("userId1001"),
	// 		LastModifiedByType: to.Ptr(armloadtesting.CreatedByTypeUser),
	// 	},
	// 	Location: to.Ptr("westus"),
	// 	Tags: map[string]*string{
	// 		"Team": to.Ptr("Dev Exp"),
	// 	},
	// 	Identity: &armloadtesting.ManagedServiceIdentity{
	// 		Type: to.Ptr(armloadtesting.ManagedServiceIdentityTypeSystemAssignedUserAssigned),
	// 		PrincipalID: to.Ptr("12345678-1234-1234-1234-123456789012"),
	// 		TenantID: to.Ptr("12345678-1234-1234-4321-123456789012"),
	// 		UserAssignedIdentities: map[string]*armloadtesting.UserAssignedIdentity{
	// 			"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/dummyrg/providers/Microsoft.ManagedIdentity/userAssignedIdentities/id1": &armloadtesting.UserAssignedIdentity{
	// 				ClientID: to.Ptr("12345678-4321-1234-1234-123456789012"),
	// 				PrincipalID: to.Ptr("12345678-1234-4321-1234-123456789012"),
	// 			},
	// 		},
	// 	},
	// 	Properties: &armloadtesting.LoadTestProperties{
	// 		Description: to.Ptr("This is new load test resource"),
	// 		DataPlaneURI: to.Ptr("https://myLoadTest.00000000-0000-0000-0000-000000000000.cnt-dp.domain.com"),
	// 		Encryption: &armloadtesting.EncryptionProperties{
	// 			Identity: &armloadtesting.EncryptionPropertiesIdentity{
	// 				Type: to.Ptr(armloadtesting.TypeUserAssigned),
	// 				ResourceID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/dummyrg/providers/Microsoft.ManagedIdentity/userAssignedIdentities/id1"),
	// 			},
	// 			KeyURL: to.Ptr("https://dummy.vault.azure.net/keys/dummykey1"),
	// 		},
	// 		ProvisioningState: to.Ptr(armloadtesting.ResourceStateSucceeded),
	// 	},
	// }
}
Output:

func (*LoadTestsClient) BeginDelete

func (client *LoadTestsClient) BeginDelete(ctx context.Context, resourceGroupName string, loadTestName string, options *LoadTestsClientBeginDeleteOptions) (*runtime.Poller[LoadTestsClientDeleteResponse], error)

BeginDelete - Delete a LoadTest resource. If the operation fails it returns an *azcore.ResponseError type.

Generated from API version 2022-12-01

  • resourceGroupName - The name of the resource group. The name is case insensitive.
  • loadTestName - Load Test name.
  • options - LoadTestsClientBeginDeleteOptions contains the optional parameters for the LoadTestsClient.BeginDelete method.
Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/630ec444f8dd7c09b9cdd5fa99951f8a0d1ad41f/specification/loadtestservice/resource-manager/Microsoft.LoadTestService/stable/2022-12-01/examples/LoadTests_Delete.json

package main

import (
	"context"
	"log"

	"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
	"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/loadtesting/armloadtesting"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armloadtesting.NewClientFactory("<subscription-id>", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	poller, err := clientFactory.NewLoadTestsClient().BeginDelete(ctx, "dummyrg", "myLoadTest", 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 (*LoadTestsClient) BeginUpdate

func (client *LoadTestsClient) BeginUpdate(ctx context.Context, resourceGroupName string, loadTestName string, loadTestResourcePatchRequestBody LoadTestResourcePatchRequestBody, options *LoadTestsClientBeginUpdateOptions) (*runtime.Poller[LoadTestsClientUpdateResponse], error)

BeginUpdate - Update a loadtest resource. If the operation fails it returns an *azcore.ResponseError type.

Generated from API version 2022-12-01

  • resourceGroupName - The name of the resource group. The name is case insensitive.
  • loadTestName - Load Test name.
  • loadTestResourcePatchRequestBody - LoadTest resource update data
  • options - LoadTestsClientBeginUpdateOptions contains the optional parameters for the LoadTestsClient.BeginUpdate method.
Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/630ec444f8dd7c09b9cdd5fa99951f8a0d1ad41f/specification/loadtestservice/resource-manager/Microsoft.LoadTestService/stable/2022-12-01/examples/LoadTests_Update.json

package main

import (
	"context"
	"log"

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

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armloadtesting.NewClientFactory("<subscription-id>", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	poller, err := clientFactory.NewLoadTestsClient().BeginUpdate(ctx, "dummyrg", "myLoadTest", armloadtesting.LoadTestResourcePatchRequestBody{
		Identity: &armloadtesting.ManagedServiceIdentity{
			Type: to.Ptr(armloadtesting.ManagedServiceIdentityTypeSystemAssignedUserAssigned),
			UserAssignedIdentities: map[string]*armloadtesting.UserAssignedIdentity{
				"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/dummyrg/providers/Microsoft.ManagedIdentity/userAssignedIdentities/id1": {},
			},
		},
		Properties: &armloadtesting.LoadTestResourcePatchRequestBodyProperties{
			Description: to.Ptr("This is new load test resource"),
			Encryption: &armloadtesting.EncryptionProperties{
				Identity: &armloadtesting.EncryptionPropertiesIdentity{
					Type: to.Ptr(armloadtesting.TypeSystemAssigned),
				},
				KeyURL: to.Ptr("https://dummy.vault.azure.net/keys/dummykey1"),
			},
		},
		Tags: map[string]*string{
			"Division": to.Ptr("LT"),
			"Team":     to.Ptr("Dev Exp"),
		},
	}, 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.LoadTestResource = armloadtesting.LoadTestResource{
	// 	Name: to.Ptr("myLoadTest"),
	// 	Type: to.Ptr("Microsoft.LoadTestService/loadTests"),
	// 	ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/dummyrg/providers/Microsoft.LoadTestService/loadTests/myLoadTest"),
	// 	SystemData: &armloadtesting.SystemData{
	// 		CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-09-28T12:32:33.000Z"); return t}()),
	// 		CreatedBy: to.Ptr("userId1001"),
	// 		CreatedByType: to.Ptr(armloadtesting.CreatedByTypeUser),
	// 		LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-09-28T12:32:33.000Z"); return t}()),
	// 		LastModifiedBy: to.Ptr("userId1001"),
	// 		LastModifiedByType: to.Ptr(armloadtesting.CreatedByTypeUser),
	// 	},
	// 	Location: to.Ptr("westus"),
	// 	Tags: map[string]*string{
	// 		"Division": to.Ptr("LT"),
	// 		"Team": to.Ptr("Dev Exp"),
	// 	},
	// 	Identity: &armloadtesting.ManagedServiceIdentity{
	// 		Type: to.Ptr(armloadtesting.ManagedServiceIdentityTypeSystemAssignedUserAssigned),
	// 		PrincipalID: to.Ptr("12345678-1234-1234-1234-123456789012"),
	// 		TenantID: to.Ptr("12345678-1234-1234-4321-123456789012"),
	// 		UserAssignedIdentities: map[string]*armloadtesting.UserAssignedIdentity{
	// 			"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/dummyrg/providers/Microsoft.ManagedIdentity/userAssignedIdentities/id1": &armloadtesting.UserAssignedIdentity{
	// 				ClientID: to.Ptr("12345678-4321-1234-1234-123456789012"),
	// 				PrincipalID: to.Ptr("12345678-1234-4321-1234-123456789012"),
	// 			},
	// 		},
	// 	},
	// 	Properties: &armloadtesting.LoadTestProperties{
	// 		Description: to.Ptr("This is new load test resource"),
	// 		DataPlaneURI: to.Ptr("https://myLoadTest.00000000-0000-0000-0000-000000000000.cnt-dp.domain.com"),
	// 		Encryption: &armloadtesting.EncryptionProperties{
	// 			Identity: &armloadtesting.EncryptionPropertiesIdentity{
	// 				Type: to.Ptr(armloadtesting.TypeSystemAssigned),
	// 			},
	// 			KeyURL: to.Ptr("https://dummy.vault.azure.net/keys/dummykey1"),
	// 		},
	// 		ProvisioningState: to.Ptr(armloadtesting.ResourceStateSucceeded),
	// 	},
	// }
}
Output:

func (*LoadTestsClient) Get

func (client *LoadTestsClient) Get(ctx context.Context, resourceGroupName string, loadTestName string, options *LoadTestsClientGetOptions) (LoadTestsClientGetResponse, error)

Get - Get a LoadTest resource. If the operation fails it returns an *azcore.ResponseError type.

Generated from API version 2022-12-01

  • resourceGroupName - The name of the resource group. The name is case insensitive.
  • loadTestName - Load Test name.
  • options - LoadTestsClientGetOptions contains the optional parameters for the LoadTestsClient.Get method.
Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/630ec444f8dd7c09b9cdd5fa99951f8a0d1ad41f/specification/loadtestservice/resource-manager/Microsoft.LoadTestService/stable/2022-12-01/examples/LoadTests_Get.json

package main

import (
	"context"
	"log"

	"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
	"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/loadtesting/armloadtesting"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armloadtesting.NewClientFactory("<subscription-id>", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	res, err := clientFactory.NewLoadTestsClient().Get(ctx, "dummyrg", "myLoadTest", 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.LoadTestResource = armloadtesting.LoadTestResource{
	// 	Name: to.Ptr("myLoadTest"),
	// 	Type: to.Ptr("Microsoft.LoadTestService/loadTests"),
	// 	ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/dummyrg/providers/Microsoft.LoadTestService/loadTests/myLoadTest"),
	// 	SystemData: &armloadtesting.SystemData{
	// 		CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-09-28T12:32:33.000Z"); return t}()),
	// 		CreatedBy: to.Ptr("userId1001"),
	// 		CreatedByType: to.Ptr(armloadtesting.CreatedByTypeUser),
	// 		LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-09-28T12:32:33.000Z"); return t}()),
	// 		LastModifiedBy: to.Ptr("userId1001"),
	// 		LastModifiedByType: to.Ptr(armloadtesting.CreatedByTypeUser),
	// 	},
	// 	Location: to.Ptr("westus"),
	// 	Tags: map[string]*string{
	// 		"Team": to.Ptr("Dev Exp"),
	// 	},
	// 	Properties: &armloadtesting.LoadTestProperties{
	// 		Description: to.Ptr("This is new load test resource"),
	// 		DataPlaneURI: to.Ptr("https://myLoadTest.00000000-0000-0000-0000-000000000000.cnt-dp.domain.com"),
	// 		ProvisioningState: to.Ptr(armloadtesting.ResourceStateSucceeded),
	// 	},
	// }
}
Output:

func (*LoadTestsClient) NewListByResourceGroupPager

func (client *LoadTestsClient) NewListByResourceGroupPager(resourceGroupName string, options *LoadTestsClientListByResourceGroupOptions) *runtime.Pager[LoadTestsClientListByResourceGroupResponse]

NewListByResourceGroupPager - Lists loadtest resources in a resource group.

Generated from API version 2022-12-01

  • resourceGroupName - The name of the resource group. The name is case insensitive.
  • options - LoadTestsClientListByResourceGroupOptions contains the optional parameters for the LoadTestsClient.NewListByResourceGroupPager method.
Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/630ec444f8dd7c09b9cdd5fa99951f8a0d1ad41f/specification/loadtestservice/resource-manager/Microsoft.LoadTestService/stable/2022-12-01/examples/LoadTests_ListByResourceGroup.json

package main

import (
	"context"
	"log"

	"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
	"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/loadtesting/armloadtesting"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armloadtesting.NewClientFactory("<subscription-id>", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	pager := clientFactory.NewLoadTestsClient().NewListByResourceGroupPager("dummyrg", 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.LoadTestResourcePageList = armloadtesting.LoadTestResourcePageList{
		// 	Value: []*armloadtesting.LoadTestResource{
		// 		{
		// 			Name: to.Ptr("myLoadTest"),
		// 			Type: to.Ptr("Microsoft.LoadTestService/loadTests"),
		// 			ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/dummyrg/providers/Microsoft.LoadTestService/loadTests/myLoadTest"),
		// 			SystemData: &armloadtesting.SystemData{
		// 				CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-09-28T12:32:33.000Z"); return t}()),
		// 				CreatedBy: to.Ptr("userId1001"),
		// 				CreatedByType: to.Ptr(armloadtesting.CreatedByTypeUser),
		// 				LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-09-28T12:32:33.000Z"); return t}()),
		// 				LastModifiedBy: to.Ptr("userId1001"),
		// 				LastModifiedByType: to.Ptr(armloadtesting.CreatedByTypeUser),
		// 			},
		// 			Location: to.Ptr("westus"),
		// 			Tags: map[string]*string{
		// 				"Team": to.Ptr("Dev Exp"),
		// 			},
		// 			Properties: &armloadtesting.LoadTestProperties{
		// 				Description: to.Ptr("This is new load test resource"),
		// 				DataPlaneURI: to.Ptr("https://myLoadTest.00000000-0000-0000-0000-000000000000.cnt-dp.domain.com"),
		// 				ProvisioningState: to.Ptr(armloadtesting.ResourceStateSucceeded),
		// 			},
		// 	}},
		// }
	}
}
Output:

func (*LoadTestsClient) NewListBySubscriptionPager

NewListBySubscriptionPager - Lists loadtests resources in a subscription.

Generated from API version 2022-12-01

  • options - LoadTestsClientListBySubscriptionOptions contains the optional parameters for the LoadTestsClient.NewListBySubscriptionPager method.
Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/630ec444f8dd7c09b9cdd5fa99951f8a0d1ad41f/specification/loadtestservice/resource-manager/Microsoft.LoadTestService/stable/2022-12-01/examples/LoadTests_ListBySubscription.json

package main

import (
	"context"
	"log"

	"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
	"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/loadtesting/armloadtesting"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armloadtesting.NewClientFactory("<subscription-id>", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	pager := clientFactory.NewLoadTestsClient().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.LoadTestResourcePageList = armloadtesting.LoadTestResourcePageList{
		// 	Value: []*armloadtesting.LoadTestResource{
		// 		{
		// 			Name: to.Ptr("myLoadTest"),
		// 			Type: to.Ptr("Microsoft.LoadTestService/loadTests"),
		// 			ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/dummyrg/providers/Microsoft.LoadTestService/loadTests/myLoadTest"),
		// 			SystemData: &armloadtesting.SystemData{
		// 				CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-09-28T12:32:33.000Z"); return t}()),
		// 				CreatedBy: to.Ptr("userId1001"),
		// 				CreatedByType: to.Ptr(armloadtesting.CreatedByTypeUser),
		// 				LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-09-28T12:32:33.000Z"); return t}()),
		// 				LastModifiedBy: to.Ptr("userId1001"),
		// 				LastModifiedByType: to.Ptr(armloadtesting.CreatedByTypeUser),
		// 			},
		// 			Location: to.Ptr("westus"),
		// 			Tags: map[string]*string{
		// 				"Team": to.Ptr("Dev Exp"),
		// 			},
		// 			Properties: &armloadtesting.LoadTestProperties{
		// 				Description: to.Ptr("This is new load test resource"),
		// 				DataPlaneURI: to.Ptr("https://myLoadTest.00000000-0000-0000-0000-000000000000.cnt-dp.domain.com"),
		// 				ProvisioningState: to.Ptr(armloadtesting.ResourceStateSucceeded),
		// 			},
		// 	}},
		// }
	}
}
Output:

func (*LoadTestsClient) NewListOutboundNetworkDependenciesEndpointsPager

func (client *LoadTestsClient) NewListOutboundNetworkDependenciesEndpointsPager(resourceGroupName string, loadTestName string, options *LoadTestsClientListOutboundNetworkDependenciesEndpointsOptions) *runtime.Pager[LoadTestsClientListOutboundNetworkDependenciesEndpointsResponse]

NewListOutboundNetworkDependenciesEndpointsPager - Lists the endpoints that agents may call as part of load testing.

Generated from API version 2022-12-01

  • resourceGroupName - The name of the resource group. The name is case insensitive.
  • loadTestName - Load Test name.
  • options - LoadTestsClientListOutboundNetworkDependenciesEndpointsOptions contains the optional parameters for the LoadTestsClient.NewListOutboundNetworkDependenciesEndpointsPager method.
Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/630ec444f8dd7c09b9cdd5fa99951f8a0d1ad41f/specification/loadtestservice/resource-manager/Microsoft.LoadTestService/stable/2022-12-01/examples/LoadTests_ListOutboundNetworkDependenciesEndpoints.json

package main

import (
	"context"
	"log"

	"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
	"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/loadtesting/armloadtesting"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armloadtesting.NewClientFactory("<subscription-id>", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	pager := clientFactory.NewLoadTestsClient().NewListOutboundNetworkDependenciesEndpointsPager("default-azureloadtest-japaneast", "sampleloadtest", 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.OutboundEnvironmentEndpointCollection = armloadtesting.OutboundEnvironmentEndpointCollection{
		// 	Value: []*armloadtesting.OutboundEnvironmentEndpoint{
		// 		{
		// 			Category: to.Ptr("Azure Batch"),
		// 			Endpoints: []*armloadtesting.EndpointDependency{
		// 				{
		// 					Description: to.Ptr("Applicable to job manager tasks, tasks that use job scoped authentication, or any task that makes calls to Batch."),
		// 					DomainName: to.Ptr("sampleacct.japaneast.batch.azure.com"),
		// 					EndpointDetails: []*armloadtesting.EndpointDetail{
		// 						{
		// 							Port: to.Ptr[int32](443),
		// 					}},
		// 				},
		// 				{
		// 					Description: to.Ptr("Applicable to all Azure Batch pools."),
		// 					DomainName: to.Ptr("japaneast.service.batch.azure.com"),
		// 					EndpointDetails: []*armloadtesting.EndpointDetail{
		// 						{
		// 							Port: to.Ptr[int32](443),
		// 					}},
		// 			}},
		// 		},
		// 		{
		// 			Category: to.Ptr("Azure Storage"),
		// 			Endpoints: []*armloadtesting.EndpointDependency{
		// 				{
		// 					Description: to.Ptr("AutoStorage endpoint for this Batch account. Applicable to all Azure Batch pools under this account."),
		// 					DomainName: to.Ptr("autostorageaccountname.blob.core.windows.net"),
		// 					EndpointDetails: []*armloadtesting.EndpointDetail{
		// 						{
		// 							Port: to.Ptr[int32](443),
		// 					}},
		// 				},
		// 				{
		// 					Description: to.Ptr("Applicable to all Azure Batch pools."),
		// 					DomainName: to.Ptr("*.blob.core.windows.net"),
		// 					EndpointDetails: []*armloadtesting.EndpointDetail{
		// 						{
		// 							Port: to.Ptr[int32](443),
		// 					}},
		// 				},
		// 				{
		// 					Description: to.Ptr("Applicable to all Azure Batch pools."),
		// 					DomainName: to.Ptr("*.table.core.windows.net"),
		// 					EndpointDetails: []*armloadtesting.EndpointDetail{
		// 						{
		// 							Port: to.Ptr[int32](443),
		// 					}},
		// 				},
		// 				{
		// 					Description: to.Ptr("Applicable to all Azure Batch pools."),
		// 					DomainName: to.Ptr("*.queue.core.windows.net"),
		// 					EndpointDetails: []*armloadtesting.EndpointDetail{
		// 						{
		// 							Port: to.Ptr[int32](443),
		// 					}},
		// 			}},
		// 		},
		// 		{
		// 			Category: to.Ptr("Microsoft Package Repository"),
		// 			Endpoints: []*armloadtesting.EndpointDependency{
		// 				{
		// 					Description: to.Ptr("Only applicable to pools containing a Mount Configuration. Learn about Mount Configurations in Batch at https://docs.microsoft.com/azure/batch/virtual-file-mount."),
		// 					DomainName: to.Ptr("packages.microsoft.com"),
		// 					EndpointDetails: []*armloadtesting.EndpointDetail{
		// 						{
		// 							Port: to.Ptr[int32](443),
		// 					}},
		// 			}},
		// 		},
		// 		{
		// 			Category: to.Ptr("Azure Key Vault"),
		// 			Endpoints: []*armloadtesting.EndpointDependency{
		// 				{
		// 					Description: to.Ptr("Only applicable to pools containing a Disk Encryption Configuration and whose VM size does not support encryption at host. Learn more about disk encryption in Azure Batch at https://docs.microsoft.com/azure/batch/disk-encryption. Learn more about encryption at host and supported VM sizes at https://docs.microsoft.com/azure/virtual-machines/disks-enable-host-based-encryption-portal."),
		// 					DomainName: to.Ptr("*.vault.azure.net"),
		// 					EndpointDetails: []*armloadtesting.EndpointDetail{
		// 						{
		// 							Port: to.Ptr[int32](443),
		// 					}},
		// 			}},
		// 	}},
		// }
	}
}
Output:

type LoadTestsClientBeginCreateOrUpdateOptions

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

LoadTestsClientBeginCreateOrUpdateOptions contains the optional parameters for the LoadTestsClient.BeginCreateOrUpdate method.

type LoadTestsClientBeginDeleteOptions

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

LoadTestsClientBeginDeleteOptions contains the optional parameters for the LoadTestsClient.BeginDelete method.

type LoadTestsClientBeginUpdateOptions

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

LoadTestsClientBeginUpdateOptions contains the optional parameters for the LoadTestsClient.BeginUpdate method.

type LoadTestsClientCreateOrUpdateResponse

type LoadTestsClientCreateOrUpdateResponse struct {
	// LoadTest details
	LoadTestResource
}

LoadTestsClientCreateOrUpdateResponse contains the response from method LoadTestsClient.BeginCreateOrUpdate.

type LoadTestsClientDeleteResponse

type LoadTestsClientDeleteResponse struct {
}

LoadTestsClientDeleteResponse contains the response from method LoadTestsClient.BeginDelete.

type LoadTestsClientGetOptions

type LoadTestsClientGetOptions struct {
}

LoadTestsClientGetOptions contains the optional parameters for the LoadTestsClient.Get method.

type LoadTestsClientGetResponse

type LoadTestsClientGetResponse struct {
	// LoadTest details
	LoadTestResource
}

LoadTestsClientGetResponse contains the response from method LoadTestsClient.Get.

type LoadTestsClientListByResourceGroupOptions

type LoadTestsClientListByResourceGroupOptions struct {
}

LoadTestsClientListByResourceGroupOptions contains the optional parameters for the LoadTestsClient.NewListByResourceGroupPager method.

type LoadTestsClientListByResourceGroupResponse

type LoadTestsClientListByResourceGroupResponse struct {
	// List of resources page result.
	LoadTestResourcePageList
}

LoadTestsClientListByResourceGroupResponse contains the response from method LoadTestsClient.NewListByResourceGroupPager.

type LoadTestsClientListBySubscriptionOptions

type LoadTestsClientListBySubscriptionOptions struct {
}

LoadTestsClientListBySubscriptionOptions contains the optional parameters for the LoadTestsClient.NewListBySubscriptionPager method.

type LoadTestsClientListBySubscriptionResponse

type LoadTestsClientListBySubscriptionResponse struct {
	// List of resources page result.
	LoadTestResourcePageList
}

LoadTestsClientListBySubscriptionResponse contains the response from method LoadTestsClient.NewListBySubscriptionPager.

type LoadTestsClientListOutboundNetworkDependenciesEndpointsOptions

type LoadTestsClientListOutboundNetworkDependenciesEndpointsOptions struct {
}

LoadTestsClientListOutboundNetworkDependenciesEndpointsOptions contains the optional parameters for the LoadTestsClient.NewListOutboundNetworkDependenciesEndpointsPager method.

type LoadTestsClientListOutboundNetworkDependenciesEndpointsResponse

type LoadTestsClientListOutboundNetworkDependenciesEndpointsResponse struct {
	// Values returned by the List operation.
	OutboundEnvironmentEndpointCollection
}

LoadTestsClientListOutboundNetworkDependenciesEndpointsResponse contains the response from method LoadTestsClient.NewListOutboundNetworkDependenciesEndpointsPager.

type LoadTestsClientUpdateResponse

type LoadTestsClientUpdateResponse struct {
	// LoadTest details
	LoadTestResource
}

LoadTestsClientUpdateResponse contains the response from method LoadTestsClient.BeginUpdate.

type ManagedServiceIdentity

type ManagedServiceIdentity struct {
	// REQUIRED; Type of managed service identity (where both SystemAssigned and UserAssigned types are allowed).
	Type *ManagedServiceIdentityType

	// The set of user assigned identities associated with the resource. The userAssignedIdentities dictionary keys will be ARM
	// resource ids in the form:
	// '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{identityName}.
	// The dictionary values can be empty objects ({}) in
	// requests.
	UserAssignedIdentities map[string]*UserAssignedIdentity

	// READ-ONLY; The service principal ID of the system assigned identity. This property will only be provided for a system assigned
	// identity.
	PrincipalID *string

	// READ-ONLY; The tenant ID of the system assigned identity. This property will only be provided for a system assigned identity.
	TenantID *string
}

ManagedServiceIdentity - Managed service identity (system assigned and/or user assigned identities)

func (ManagedServiceIdentity) MarshalJSON

func (m ManagedServiceIdentity) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.Marshaller interface for type ManagedServiceIdentity.

func (*ManagedServiceIdentity) UnmarshalJSON

func (m *ManagedServiceIdentity) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the json.Unmarshaller interface for type ManagedServiceIdentity.

type ManagedServiceIdentityType

type ManagedServiceIdentityType string

ManagedServiceIdentityType - Type of managed service identity (where both SystemAssigned and UserAssigned types are allowed).

const (
	ManagedServiceIdentityTypeNone                       ManagedServiceIdentityType = "None"
	ManagedServiceIdentityTypeSystemAssigned             ManagedServiceIdentityType = "SystemAssigned"
	ManagedServiceIdentityTypeSystemAssignedUserAssigned ManagedServiceIdentityType = "SystemAssigned,UserAssigned"
	ManagedServiceIdentityTypeUserAssigned               ManagedServiceIdentityType = "UserAssigned"
)

func PossibleManagedServiceIdentityTypeValues

func PossibleManagedServiceIdentityTypeValues() []ManagedServiceIdentityType

PossibleManagedServiceIdentityTypeValues returns the possible values for the ManagedServiceIdentityType const type.

type Operation

type Operation struct {
	// Localized display information for this particular operation.
	Display *OperationDisplay

	// READ-ONLY; Enum. Indicates the action type. "Internal" refers to actions that are for internal only APIs.
	ActionType *ActionType

	// READ-ONLY; Whether the operation applies to data-plane. This is "true" for data-plane operations and "false" for ARM/control-plane
	// operations.
	IsDataAction *bool

	// READ-ONLY; The name of the operation, as per Resource-Based Access Control (RBAC). Examples: "Microsoft.Compute/virtualMachines/write",
	// "Microsoft.Compute/virtualMachines/capture/action"
	Name *string

	// READ-ONLY; The intended executor of the operation; as in Resource Based Access Control (RBAC) and audit logs UX. Default
	// value is "user,system"
	Origin *Origin
}

Operation - Details of a REST API operation, returned from the Resource Provider Operations API

func (Operation) MarshalJSON

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

MarshalJSON implements the json.Marshaller interface for type Operation.

func (*Operation) UnmarshalJSON

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

UnmarshalJSON implements the json.Unmarshaller interface for type Operation.

type OperationDisplay

type OperationDisplay struct {
	// READ-ONLY; The short, localized friendly description of the operation; suitable for tool tips and detailed views.
	Description *string

	// READ-ONLY; The concise, localized friendly name for the operation; suitable for dropdowns. E.g. "Create or Update Virtual
	// Machine", "Restart Virtual Machine".
	Operation *string

	// READ-ONLY; The localized friendly form of the resource provider name, e.g. "Microsoft Monitoring Insights" or "Microsoft
	// Compute".
	Provider *string

	// READ-ONLY; The localized friendly name of the resource type related to this operation. E.g. "Virtual Machines" or "Job
	// Schedule Collections".
	Resource *string
}

OperationDisplay - Localized display information for this particular operation.

func (OperationDisplay) MarshalJSON

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

MarshalJSON implements the json.Marshaller interface for type OperationDisplay.

func (*OperationDisplay) UnmarshalJSON

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

UnmarshalJSON implements the json.Unmarshaller interface for type OperationDisplay.

type OperationListResult

type OperationListResult struct {
	// READ-ONLY; URL to get the next set of operation list results (if there are any).
	NextLink *string

	// READ-ONLY; List of operations supported by the resource provider
	Value []*Operation
}

OperationListResult - A list of REST API operations supported by an Azure Resource Provider. It contains an URL link to get the next set of results.

func (OperationListResult) MarshalJSON

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

MarshalJSON implements the json.Marshaller interface for type OperationListResult.

func (*OperationListResult) UnmarshalJSON

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

UnmarshalJSON implements the json.Unmarshaller interface for type OperationListResult.

type 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 - Lists all the available API operations for Load Test Resource.

Generated from API version 2022-12-01

  • 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/630ec444f8dd7c09b9cdd5fa99951f8a0d1ad41f/specification/loadtestservice/resource-manager/Microsoft.LoadTestService/stable/2022-12-01/examples/Operations_List.json

package main

import (
	"context"
	"log"

	"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
	"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/loadtesting/armloadtesting"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armloadtesting.NewClientFactory("<subscription-id>", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	pager := clientFactory.NewOperationsClient().NewListPager(nil)
	for pager.More() {
		page, err := pager.NextPage(ctx)
		if err != nil {
			log.Fatalf("failed to advance page: %v", err)
		}
		for _, v := range page.Value {
			// You could use page here. We use blank identifier for just demo purposes.
			_ = v
		}
		// If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes.
		// page.OperationListResult = armloadtesting.OperationListResult{
		// 	Value: []*armloadtesting.Operation{
		// 		{
		// 			Name: to.Ptr("Microsoft.LoadTestService/loadTests/Write"),
		// 			Display: &armloadtesting.OperationDisplay{
		// 				Description: to.Ptr("Set LoadTests"),
		// 				Operation: to.Ptr("Creates or updates the LoadTests"),
		// 				Provider: to.Ptr("Microsoft.LoadTestService"),
		// 				Resource: to.Ptr("loadTests"),
		// 			},
		// 			IsDataAction: to.Ptr(false),
		// 		},
		// 		{
		// 			Name: to.Ptr("Microsoft.LoadTestService/loadTests/Delete"),
		// 			Display: &armloadtesting.OperationDisplay{
		// 				Description: to.Ptr("Delete LoadTests"),
		// 				Operation: to.Ptr("Deletes the LoadTests"),
		// 				Provider: to.Ptr("Microsoft.LoadTestService"),
		// 				Resource: to.Ptr("loadTests"),
		// 			},
		// 			IsDataAction: to.Ptr(false),
		// 		},
		// 		{
		// 			Name: to.Ptr("Microsoft.LoadTestService/loadTests/Read"),
		// 			Display: &armloadtesting.OperationDisplay{
		// 				Description: to.Ptr("Read LoadTests"),
		// 				Operation: to.Ptr("Reads the LoadTests"),
		// 				Provider: to.Ptr("Microsoft.LoadTestService"),
		// 				Resource: to.Ptr("loadTests"),
		// 			},
		// 			IsDataAction: to.Ptr(false),
		// 	}},
		// }
	}
}
Output:

type OperationsClientListOptions

type OperationsClientListOptions struct {
}

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

type OperationsClientListResponse

type OperationsClientListResponse struct {
	// A list of REST API operations supported by an Azure Resource Provider. It contains an URL link to get the next set of results.
	OperationListResult
}

OperationsClientListResponse contains the response from method OperationsClient.NewListPager.

type Origin

type Origin string

Origin - The intended executor of the operation; as in Resource Based Access Control (RBAC) and audit logs UX. Default value is "user,system"

const (
	OriginSystem     Origin = "system"
	OriginUser       Origin = "user"
	OriginUserSystem Origin = "user,system"
)

func PossibleOriginValues

func PossibleOriginValues() []Origin

PossibleOriginValues returns the possible values for the Origin const type.

type OutboundEnvironmentEndpoint

type OutboundEnvironmentEndpoint struct {
	// READ-ONLY; The type of service that Azure Load Testing connects to.
	Category *string

	// READ-ONLY; The endpoints for this service to which the Batch service makes outbound calls.
	Endpoints []*EndpointDependency
}

OutboundEnvironmentEndpoint - A collection of related endpoints from the same service for which the Batch service requires outbound access.

func (OutboundEnvironmentEndpoint) MarshalJSON

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

MarshalJSON implements the json.Marshaller interface for type OutboundEnvironmentEndpoint.

func (*OutboundEnvironmentEndpoint) UnmarshalJSON

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

UnmarshalJSON implements the json.Unmarshaller interface for type OutboundEnvironmentEndpoint.

type OutboundEnvironmentEndpointCollection

type OutboundEnvironmentEndpointCollection struct {
	// The continuation token.
	NextLink *string

	// READ-ONLY; The collection of outbound network dependency endpoints returned by the listing operation.
	Value []*OutboundEnvironmentEndpoint
}

OutboundEnvironmentEndpointCollection - Values returned by the List operation.

func (OutboundEnvironmentEndpointCollection) MarshalJSON

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

MarshalJSON implements the json.Marshaller interface for type OutboundEnvironmentEndpointCollection.

func (*OutboundEnvironmentEndpointCollection) UnmarshalJSON

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

UnmarshalJSON implements the json.Unmarshaller interface for type OutboundEnvironmentEndpointCollection.

type QuotaBucketRequest

type QuotaBucketRequest struct {
	// New quota request request properties.
	Properties *QuotaBucketRequestProperties

	// 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; Azure Resource Manager metadata containing createdBy and modifiedBy information.
	SystemData *SystemData

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

QuotaBucketRequest - Request object of new quota for a quota bucket.

func (QuotaBucketRequest) MarshalJSON

func (q QuotaBucketRequest) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.Marshaller interface for type QuotaBucketRequest.

func (*QuotaBucketRequest) UnmarshalJSON

func (q *QuotaBucketRequest) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the json.Unmarshaller interface for type QuotaBucketRequest.

type QuotaBucketRequestProperties

type QuotaBucketRequestProperties struct {
	// Current quota limit of the quota bucket.
	CurrentQuota *int32

	// Current quota usage of the quota bucket.
	CurrentUsage *int32

	// Dimensions for new quota request.
	Dimensions *QuotaBucketRequestPropertiesDimensions

	// New quota limit of the quota bucket.
	NewQuota *int32
}

QuotaBucketRequestProperties - New quota request request properties.

func (QuotaBucketRequestProperties) MarshalJSON

func (q QuotaBucketRequestProperties) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.Marshaller interface for type QuotaBucketRequestProperties.

func (*QuotaBucketRequestProperties) UnmarshalJSON

func (q *QuotaBucketRequestProperties) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the json.Unmarshaller interface for type QuotaBucketRequestProperties.

type QuotaBucketRequestPropertiesDimensions

type QuotaBucketRequestPropertiesDimensions struct {
	// Location dimension for new quota request of the quota bucket.
	Location *string

	// Subscription Id dimension for new quota request of the quota bucket.
	SubscriptionID *string
}

QuotaBucketRequestPropertiesDimensions - Dimensions for new quota request.

func (QuotaBucketRequestPropertiesDimensions) MarshalJSON

func (q QuotaBucketRequestPropertiesDimensions) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.Marshaller interface for type QuotaBucketRequestPropertiesDimensions.

func (*QuotaBucketRequestPropertiesDimensions) UnmarshalJSON

func (q *QuotaBucketRequestPropertiesDimensions) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the json.Unmarshaller interface for type QuotaBucketRequestPropertiesDimensions.

type QuotaResource

type QuotaResource struct {
	// Quota bucket resource properties.
	Properties *QuotaResourceProperties

	// 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; Azure Resource Manager metadata containing createdBy and modifiedBy information.
	SystemData *SystemData

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

QuotaResource - Quota bucket details object.

func (QuotaResource) MarshalJSON

func (q QuotaResource) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.Marshaller interface for type QuotaResource.

func (*QuotaResource) UnmarshalJSON

func (q *QuotaResource) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the json.Unmarshaller interface for type QuotaResource.

type QuotaResourceList

type QuotaResourceList struct {
	// READ-ONLY; URL to get the next set of quota bucket objects results (if there are any).
	NextLink *string

	// READ-ONLY; List of quota bucket objects provided by the loadtestservice.
	Value []*QuotaResource
}

QuotaResourceList - List of quota bucket objects. It contains a URL link to get the next set of results.

func (QuotaResourceList) MarshalJSON

func (q QuotaResourceList) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.Marshaller interface for type QuotaResourceList.

func (*QuotaResourceList) UnmarshalJSON

func (q *QuotaResourceList) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the json.Unmarshaller interface for type QuotaResourceList.

type QuotaResourceProperties

type QuotaResourceProperties struct {
	// Current quota limit of the quota bucket.
	Limit *int32

	// Current quota usage of the quota bucket.
	Usage *int32

	// READ-ONLY; Resource provisioning state.
	ProvisioningState *ResourceState
}

QuotaResourceProperties - Quota bucket resource properties.

func (QuotaResourceProperties) MarshalJSON

func (q QuotaResourceProperties) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.Marshaller interface for type QuotaResourceProperties.

func (*QuotaResourceProperties) UnmarshalJSON

func (q *QuotaResourceProperties) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the json.Unmarshaller interface for type QuotaResourceProperties.

type QuotasClient

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

QuotasClient contains the methods for the Quotas group. Don't use this type directly, use NewQuotasClient() instead.

func NewQuotasClient

func NewQuotasClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*QuotasClient, error)

NewQuotasClient creates a new instance of QuotasClient with the specified values.

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

func (*QuotasClient) CheckAvailability

func (client *QuotasClient) CheckAvailability(ctx context.Context, location string, quotaBucketName string, quotaBucketRequest QuotaBucketRequest, options *QuotasClientCheckAvailabilityOptions) (QuotasClientCheckAvailabilityResponse, error)

CheckAvailability - Check Quota Availability on quota bucket per region per subscription. If the operation fails it returns an *azcore.ResponseError type.

Generated from API version 2022-12-01

  • location - The name of Azure region.
  • quotaBucketName - Quota Bucket name.
  • quotaBucketRequest - Quota Bucket Request data
  • options - QuotasClientCheckAvailabilityOptions contains the optional parameters for the QuotasClient.CheckAvailability method.
Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/630ec444f8dd7c09b9cdd5fa99951f8a0d1ad41f/specification/loadtestservice/resource-manager/Microsoft.LoadTestService/stable/2022-12-01/examples/Quotas_CheckAvailability.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/loadtesting/armloadtesting"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armloadtesting.NewClientFactory("<subscription-id>", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	res, err := clientFactory.NewQuotasClient().CheckAvailability(ctx, "westus", "testQuotaBucket", armloadtesting.QuotaBucketRequest{
		Properties: &armloadtesting.QuotaBucketRequestProperties{
			CurrentQuota: to.Ptr[int32](40),
			CurrentUsage: to.Ptr[int32](20),
			Dimensions: &armloadtesting.QuotaBucketRequestPropertiesDimensions{
				Location:       to.Ptr("westus"),
				SubscriptionID: to.Ptr("testsubscriptionId"),
			},
			NewQuota: to.Ptr[int32](50),
		},
	}, 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.CheckQuotaAvailabilityResponse = armloadtesting.CheckQuotaAvailabilityResponse{
	// 	Name: to.Ptr("testQuotaBucket"),
	// 	Type: to.Ptr("Microsoft.LoadTestService/locations/quotas"),
	// 	ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.LoadTestService/locations/westus/quotas/testQuotaBucket"),
	// 	Properties: &armloadtesting.CheckQuotaAvailabilityResponseProperties{
	// 		AvailabilityStatus: to.Ptr("The requested quota is currently unavailable. Please request for different quota, or upgrade subscription offer type and try again later."),
	// 		IsAvailable: to.Ptr(false),
	// 	},
	// }
}
Output:

func (*QuotasClient) Get

func (client *QuotasClient) Get(ctx context.Context, location string, quotaBucketName string, options *QuotasClientGetOptions) (QuotasClientGetResponse, error)

Get - Get the available quota for a quota bucket per region per subscription. If the operation fails it returns an *azcore.ResponseError type.

Generated from API version 2022-12-01

  • location - The name of Azure region.
  • quotaBucketName - Quota Bucket name.
  • options - QuotasClientGetOptions contains the optional parameters for the QuotasClient.Get method.
Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/630ec444f8dd7c09b9cdd5fa99951f8a0d1ad41f/specification/loadtestservice/resource-manager/Microsoft.LoadTestService/stable/2022-12-01/examples/Quotas_Get.json

package main

import (
	"context"
	"log"

	"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
	"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/loadtesting/armloadtesting"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armloadtesting.NewClientFactory("<subscription-id>", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	res, err := clientFactory.NewQuotasClient().Get(ctx, "westus", "testQuotaBucket", 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.QuotaResource = armloadtesting.QuotaResource{
	// 	Name: to.Ptr("testQuotaBucket"),
	// 	Type: to.Ptr("Microsoft.LoadTestService/locations/quotas"),
	// 	ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.LoadTestService/locations/westus/quotas/testQuotaBucket"),
	// 	Properties: &armloadtesting.QuotaResourceProperties{
	// 		Limit: to.Ptr[int32](50),
	// 		Usage: to.Ptr[int32](20),
	// 	},
	// }
}
Output:

func (*QuotasClient) NewListPager

func (client *QuotasClient) NewListPager(location string, options *QuotasClientListOptions) *runtime.Pager[QuotasClientListResponse]

NewListPager - Lists all the available quota per region per subscription.

Generated from API version 2022-12-01

  • location - The name of Azure region.
  • options - QuotasClientListOptions contains the optional parameters for the QuotasClient.NewListPager method.
Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/630ec444f8dd7c09b9cdd5fa99951f8a0d1ad41f/specification/loadtestservice/resource-manager/Microsoft.LoadTestService/stable/2022-12-01/examples/Quotas_List.json

package main

import (
	"context"
	"log"

	"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
	"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/loadtesting/armloadtesting"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armloadtesting.NewClientFactory("<subscription-id>", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	pager := clientFactory.NewQuotasClient().NewListPager("westus", 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.QuotaResourceList = armloadtesting.QuotaResourceList{
		// 	Value: []*armloadtesting.QuotaResource{
		// 		{
		// 			Name: to.Ptr("testQuotaBucket"),
		// 			Type: to.Ptr("Microsoft.LoadTestService/locations/quotas"),
		// 			ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.LoadTestService/locations/westus/quotas/testQuotaBucket"),
		// 			Properties: &armloadtesting.QuotaResourceProperties{
		// 				Limit: to.Ptr[int32](50),
		// 				Usage: to.Ptr[int32](20),
		// 			},
		// 	}},
		// }
	}
}
Output:

type QuotasClientCheckAvailabilityOptions

type QuotasClientCheckAvailabilityOptions struct {
}

QuotasClientCheckAvailabilityOptions contains the optional parameters for the QuotasClient.CheckAvailability method.

type QuotasClientCheckAvailabilityResponse

type QuotasClientCheckAvailabilityResponse struct {
	// Check quota availability response object.
	CheckQuotaAvailabilityResponse
}

QuotasClientCheckAvailabilityResponse contains the response from method QuotasClient.CheckAvailability.

type QuotasClientGetOptions

type QuotasClientGetOptions struct {
}

QuotasClientGetOptions contains the optional parameters for the QuotasClient.Get method.

type QuotasClientGetResponse

type QuotasClientGetResponse struct {
	// Quota bucket details object.
	QuotaResource
}

QuotasClientGetResponse contains the response from method QuotasClient.Get.

type QuotasClientListOptions

type QuotasClientListOptions struct {
}

QuotasClientListOptions contains the optional parameters for the QuotasClient.NewListPager method.

type QuotasClientListResponse

type QuotasClientListResponse struct {
	// List of quota bucket objects. It contains a URL link to get the next set of results.
	QuotaResourceList
}

QuotasClientListResponse contains the response from method QuotasClient.NewListPager.

type ResourceState

type ResourceState string

ResourceState - Resources provisioning states.

const (
	ResourceStateCanceled  ResourceState = "Canceled"
	ResourceStateDeleted   ResourceState = "Deleted"
	ResourceStateFailed    ResourceState = "Failed"
	ResourceStateSucceeded ResourceState = "Succeeded"
)

func PossibleResourceStateValues

func PossibleResourceStateValues() []ResourceState

PossibleResourceStateValues returns the possible values for the ResourceState const type.

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 Type

type Type string

Type - Managed identity type to use for accessing encryption key Url

const (
	TypeSystemAssigned Type = "SystemAssigned"
	TypeUserAssigned   Type = "UserAssigned"
)

func PossibleTypeValues

func PossibleTypeValues() []Type

PossibleTypeValues returns the possible values for the Type const type.

type UserAssignedIdentity

type UserAssignedIdentity struct {
	// READ-ONLY; The client ID of the assigned identity.
	ClientID *string

	// READ-ONLY; The principal ID of the assigned identity.
	PrincipalID *string
}

UserAssignedIdentity - User assigned identity properties

func (UserAssignedIdentity) MarshalJSON

func (u UserAssignedIdentity) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.Marshaller interface for type UserAssignedIdentity.

func (*UserAssignedIdentity) UnmarshalJSON

func (u *UserAssignedIdentity) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the json.Unmarshaller interface for type UserAssignedIdentity.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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