armloadtestservice

package module
v1.0.1 Latest Latest
Warning

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

Go to latest
Published: Nov 21, 2022 License: MIT Imports: 16 Imported by: 0

README

Azure Load Testing Module for Go

PkgGoDev

The armloadtestservice 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/loadtestservice/armloadtestservice

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.

Clients

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

client, err := armloadtestservice.NewLoadTestsClient(<subscription ID>, cred, nil)

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

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

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

type CheckQuotaAvailabilityResponse struct {
	// Check quota availability response properties.
	Properties *CheckQuotaAvailabilityResponseProperties `json:"properties,omitempty"`

	// READ-ONLY; Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}
	ID *string `json:"id,omitempty" azure:"ro"`

	// READ-ONLY; The name of the resource
	Name *string `json:"name,omitempty" azure:"ro"`

	// READ-ONLY; Azure Resource Manager metadata containing createdBy and modifiedBy information.
	SystemData *SystemData `json:"systemData,omitempty" azure:"ro"`

	// READ-ONLY; The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts"
	Type *string `json:"type,omitempty" azure:"ro"`
}

CheckQuotaAvailabilityResponse - Check quota availability response object.

func (CheckQuotaAvailabilityResponse) MarshalJSON added in v1.0.0

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

MarshalJSON implements the json.Marshaller interface for type CheckQuotaAvailabilityResponse.

func (*CheckQuotaAvailabilityResponse) UnmarshalJSON added in v1.0.0

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

UnmarshalJSON implements the json.Unmarshaller interface for type CheckQuotaAvailabilityResponse.

type CheckQuotaAvailabilityResponseProperties added in v1.0.0

type CheckQuotaAvailabilityResponseProperties struct {
	// Message indicating additional details to add to quota support request.
	AvailabilityStatus *string `json:"availabilityStatus,omitempty"`

	// True/False indicating whether the quota request be granted based on availability.
	IsAvailable *bool `json:"isAvailable,omitempty"`
}

CheckQuotaAvailabilityResponseProperties - Check quota availability response properties.

func (CheckQuotaAvailabilityResponseProperties) MarshalJSON added in v1.0.0

MarshalJSON implements the json.Marshaller interface for type CheckQuotaAvailabilityResponseProperties.

func (*CheckQuotaAvailabilityResponseProperties) UnmarshalJSON added in v1.0.0

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

UnmarshalJSON implements the json.Unmarshaller interface for type CheckQuotaAvailabilityResponseProperties.

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 added in v0.3.0

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

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

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

func (EncryptionProperties) MarshalJSON added in v1.0.0

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

MarshalJSON implements the json.Marshaller interface for type EncryptionProperties.

func (*EncryptionProperties) UnmarshalJSON added in v1.0.0

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

UnmarshalJSON implements the json.Unmarshaller interface for type EncryptionProperties.

type EncryptionPropertiesIdentity added in v0.3.0

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 `json:"resourceId,omitempty"`

	// Managed identity type to use for accessing encryption key Url
	Type *Type `json:"type,omitempty"`
}

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

func (EncryptionPropertiesIdentity) MarshalJSON added in v1.0.0

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

MarshalJSON implements the json.Marshaller interface for type EncryptionPropertiesIdentity.

func (*EncryptionPropertiesIdentity) UnmarshalJSON added in v1.0.0

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

UnmarshalJSON implements the json.Unmarshaller interface for type EncryptionPropertiesIdentity.

type EndpointDependency added in v1.0.0

type EndpointDependency struct {
	// READ-ONLY; Human-readable supplemental information about the dependency and when it is applicable.
	Description *string `json:"description,omitempty" azure:"ro"`

	// READ-ONLY; The domain name of the dependency. Domain names may be fully qualified or may contain a * wildcard.
	DomainName *string `json:"domainName,omitempty" azure:"ro"`

	// READ-ONLY; The list of connection details for this endpoint.
	EndpointDetails []*EndpointDetail `json:"endpointDetails,omitempty" azure:"ro"`
}

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

func (EndpointDependency) MarshalJSON added in v1.0.0

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

MarshalJSON implements the json.Marshaller interface for type EndpointDependency.

func (*EndpointDependency) UnmarshalJSON added in v1.0.0

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

UnmarshalJSON implements the json.Unmarshaller interface for type EndpointDependency.

type EndpointDetail added in v1.0.0

type EndpointDetail struct {
	// READ-ONLY; The port an endpoint is connected to.
	Port *int32 `json:"port,omitempty" azure:"ro"`
}

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

func (EndpointDetail) MarshalJSON added in v1.0.0

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

MarshalJSON implements the json.Marshaller interface for type EndpointDetail.

func (*EndpointDetail) UnmarshalJSON added in v1.0.0

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

UnmarshalJSON implements the json.Unmarshaller interface for type EndpointDetail.

type ErrorAdditionalInfo

type ErrorAdditionalInfo struct {
	// READ-ONLY; The additional info.
	Info interface{} `json:"info,omitempty" azure:"ro"`

	// READ-ONLY; The additional info type.
	Type *string `json:"type,omitempty" azure:"ro"`
}

ErrorAdditionalInfo - The resource management error additional info.

func (ErrorAdditionalInfo) MarshalJSON added in v1.0.0

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

MarshalJSON implements the json.Marshaller interface for type ErrorAdditionalInfo.

func (*ErrorAdditionalInfo) UnmarshalJSON added in v1.0.0

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

UnmarshalJSON implements the json.Unmarshaller interface for type ErrorAdditionalInfo.

type ErrorDetail

type ErrorDetail struct {
	// READ-ONLY; The error additional info.
	AdditionalInfo []*ErrorAdditionalInfo `json:"additionalInfo,omitempty" azure:"ro"`

	// READ-ONLY; The error code.
	Code *string `json:"code,omitempty" azure:"ro"`

	// READ-ONLY; The error details.
	Details []*ErrorDetail `json:"details,omitempty" azure:"ro"`

	// READ-ONLY; The error message.
	Message *string `json:"message,omitempty" azure:"ro"`

	// READ-ONLY; The error target.
	Target *string `json:"target,omitempty" azure:"ro"`
}

ErrorDetail - The error detail.

func (ErrorDetail) MarshalJSON

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

MarshalJSON implements the json.Marshaller interface for type ErrorDetail.

func (*ErrorDetail) UnmarshalJSON added in v1.0.0

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

UnmarshalJSON implements the json.Unmarshaller interface for type ErrorDetail.

type ErrorResponse

type ErrorResponse struct {
	// The error object.
	Error *ErrorDetail `json:"error,omitempty"`
}

ErrorResponse - Common error response for all Azure Resource Manager APIs to return error details for failed operations. (This also follows the OData error response format.).

func (ErrorResponse) MarshalJSON added in v1.0.0

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

MarshalJSON implements the json.Marshaller interface for type ErrorResponse.

func (*ErrorResponse) UnmarshalJSON added in v1.0.0

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

UnmarshalJSON implements the json.Unmarshaller interface for type ErrorResponse.

type LoadTestProperties

type LoadTestProperties struct {
	// Description of the resource.
	Description *string `json:"description,omitempty"`

	// CMK Encryption property.
	Encryption *EncryptionProperties `json:"encryption,omitempty"`

	// READ-ONLY; Resource data plane URI.
	DataPlaneURI *string `json:"dataPlaneURI,omitempty" azure:"ro"`

	// READ-ONLY; Resource provisioning state.
	ProvisioningState *ResourceState `json:"provisioningState,omitempty" azure:"ro"`
}

LoadTestProperties - LoadTest resource properties.

func (LoadTestProperties) MarshalJSON added in v1.0.0

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

MarshalJSON implements the json.Marshaller interface for type LoadTestProperties.

func (*LoadTestProperties) UnmarshalJSON added in v1.0.0

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 `json:"location,omitempty"`

	// The type of identity used for the resource.
	Identity *ManagedServiceIdentity `json:"identity,omitempty"`

	// Load Test resource properties
	Properties *LoadTestProperties `json:"properties,omitempty"`

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

	// READ-ONLY; Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}
	ID *string `json:"id,omitempty" azure:"ro"`

	// READ-ONLY; The name of the resource
	Name *string `json:"name,omitempty" azure:"ro"`

	// READ-ONLY; Azure Resource Manager metadata containing createdBy and modifiedBy information.
	SystemData *SystemData `json:"systemData,omitempty" azure:"ro"`

	// READ-ONLY; The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts"
	Type *string `json:"type,omitempty" azure:"ro"`
}

LoadTestResource - LoadTest details

func (LoadTestResource) MarshalJSON

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

MarshalJSON implements the json.Marshaller interface for type LoadTestResource.

func (*LoadTestResource) UnmarshalJSON added in v1.0.0

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 `json:"nextLink,omitempty"`

	// List of resources in current page.
	Value []*LoadTestResource `json:"value,omitempty"`
}

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

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 `json:"identity,omitempty"`

	// Load Test resource properties
	Properties *LoadTestResourcePatchRequestBodyProperties `json:"properties,omitempty"`

	// Resource tags.
	Tags interface{} `json:"tags,omitempty"`
}

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

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 `json:"description,omitempty"`

	// CMK Encryption property.
	Encryption *EncryptionProperties `json:"encryption,omitempty"`
}

LoadTestResourcePatchRequestBodyProperties - Load Test resource properties

func (LoadTestResourcePatchRequestBodyProperties) MarshalJSON added in v1.0.0

MarshalJSON implements the json.Marshaller interface for type LoadTestResourcePatchRequestBodyProperties.

func (*LoadTestResourcePatchRequestBodyProperties) UnmarshalJSON added in v1.0.0

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 added in v0.3.0

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/tree/main/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/loadtestservice/armloadtestservice"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	client, err := armloadtestservice.NewLoadTestsClient("00000000-0000-0000-0000-000000000000", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	poller, err := client.BeginCreateOrUpdate(ctx, "dummyrg", "myLoadTest", armloadtestservice.LoadTestResource{
		Location: to.Ptr("westus"),
		Tags: map[string]*string{
			"Team": to.Ptr("Dev Exp"),
		},
		Identity: &armloadtestservice.ManagedServiceIdentity{
			Type: to.Ptr(armloadtestservice.ManagedServiceIdentityTypeSystemAssignedUserAssigned),
			UserAssignedIdentities: map[string]*armloadtestservice.UserAssignedIdentity{
				"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/dummyrg/providers/Microsoft.ManagedIdentity/userAssignedIdentities/id1": {},
			},
		},
		Properties: &armloadtestservice.LoadTestProperties{
			Description: to.Ptr("This is new load test resource"),
			Encryption: &armloadtestservice.EncryptionProperties{
				Identity: &armloadtestservice.EncryptionPropertiesIdentity{
					Type:       to.Ptr(armloadtestservice.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)
	}
	// TODO: use response item
	_ = res
}
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/tree/main/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/loadtestservice/armloadtestservice"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	client, err := armloadtestservice.NewLoadTestsClient("00000000-0000-0000-0000-000000000000", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	poller, err := client.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 added in v0.3.0

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/tree/main/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/loadtestservice/armloadtestservice"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	client, err := armloadtestservice.NewLoadTestsClient("00000000-0000-0000-0000-000000000000", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	poller, err := client.BeginUpdate(ctx, "dummyrg", "myLoadTest", armloadtestservice.LoadTestResourcePatchRequestBody{
		Identity: &armloadtestservice.ManagedServiceIdentity{
			Type: to.Ptr(armloadtestservice.ManagedServiceIdentityTypeSystemAssignedUserAssigned),
			UserAssignedIdentities: map[string]*armloadtestservice.UserAssignedIdentity{
				"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/dummyrg/providers/Microsoft.ManagedIdentity/userAssignedIdentities/id1": {},
			},
		},
		Properties: &armloadtestservice.LoadTestResourcePatchRequestBodyProperties{
			Description: to.Ptr("This is new load test resource"),
			Encryption: &armloadtestservice.EncryptionProperties{
				Identity: &armloadtestservice.EncryptionPropertiesIdentity{
					Type: to.Ptr(armloadtestservice.TypeSystemAssigned),
				},
				KeyURL: to.Ptr("https://dummy.vault.azure.net/keys/dummykey1"),
			},
		},
		Tags: map[string]interface{}{
			"Division": "LT",
			"Team":     "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)
	}
	// TODO: use response item
	_ = res
}
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/tree/main/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/loadtestservice/armloadtestservice"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	client, err := armloadtestservice.NewLoadTestsClient("00000000-0000-0000-0000-000000000000", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	res, err := client.Get(ctx, "dummyrg", "myLoadTest", nil)
	if err != nil {
		log.Fatalf("failed to finish the request: %v", err)
	}
	// TODO: use response item
	_ = res
}
Output:

func (*LoadTestsClient) NewListByResourceGroupPager added in v0.4.0

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.ListByResourceGroup method.

Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/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/loadtestservice/armloadtestservice"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	client, err := armloadtestservice.NewLoadTestsClient("00000000-0000-0000-0000-000000000000", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	pager := client.NewListByResourceGroupPager("dummyrg", nil)
	for pager.More() {
		nextResult, err := pager.NextPage(ctx)
		if err != nil {
			log.Fatalf("failed to advance page: %v", err)
		}
		for _, v := range nextResult.Value {
			// TODO: use page item
			_ = v
		}
	}
}
Output:

func (*LoadTestsClient) NewListBySubscriptionPager added in v0.4.0

NewListBySubscriptionPager - Lists loadtests resources in a subscription. Generated from API version 2022-12-01 options - LoadTestsClientListBySubscriptionOptions contains the optional parameters for the LoadTestsClient.ListBySubscription method.

Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/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/loadtestservice/armloadtestservice"
)

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

func (*LoadTestsClient) NewListOutboundNetworkDependenciesEndpointsPager added in v1.0.0

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.ListOutboundNetworkDependenciesEndpoints method.

Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/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/loadtestservice/armloadtestservice"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	client, err := armloadtestservice.NewLoadTestsClient("subid", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	pager := client.NewListOutboundNetworkDependenciesEndpointsPager("default-azureloadtest-japaneast", "sampleloadtest", nil)
	for pager.More() {
		nextResult, err := pager.NextPage(ctx)
		if err != nil {
			log.Fatalf("failed to advance page: %v", err)
		}
		for _, v := range nextResult.Value {
			// TODO: use page item
			_ = v
		}
	}
}
Output:

type LoadTestsClientBeginCreateOrUpdateOptions added in v0.3.0

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

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

type LoadTestsClientBeginDeleteOptions added in v0.2.0

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

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

type LoadTestsClientBeginUpdateOptions added in v0.3.0

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

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

type LoadTestsClientCreateOrUpdateResponse added in v0.2.0

type LoadTestsClientCreateOrUpdateResponse struct {
	LoadTestResource
}

LoadTestsClientCreateOrUpdateResponse contains the response from method LoadTestsClient.CreateOrUpdate.

type LoadTestsClientDeleteResponse added in v0.2.0

type LoadTestsClientDeleteResponse struct {
}

LoadTestsClientDeleteResponse contains the response from method LoadTestsClient.Delete.

type LoadTestsClientGetOptions added in v0.2.0

type LoadTestsClientGetOptions struct {
}

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

type LoadTestsClientGetResponse added in v0.2.0

type LoadTestsClientGetResponse struct {
	LoadTestResource
}

LoadTestsClientGetResponse contains the response from method LoadTestsClient.Get.

type LoadTestsClientListByResourceGroupOptions added in v0.2.0

type LoadTestsClientListByResourceGroupOptions struct {
}

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

type LoadTestsClientListByResourceGroupResponse added in v0.2.0

type LoadTestsClientListByResourceGroupResponse struct {
	LoadTestResourcePageList
}

LoadTestsClientListByResourceGroupResponse contains the response from method LoadTestsClient.ListByResourceGroup.

type LoadTestsClientListBySubscriptionOptions added in v0.2.0

type LoadTestsClientListBySubscriptionOptions struct {
}

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

type LoadTestsClientListBySubscriptionResponse added in v0.2.0

type LoadTestsClientListBySubscriptionResponse struct {
	LoadTestResourcePageList
}

LoadTestsClientListBySubscriptionResponse contains the response from method LoadTestsClient.ListBySubscription.

type LoadTestsClientListOutboundNetworkDependenciesEndpointsOptions added in v1.0.0

type LoadTestsClientListOutboundNetworkDependenciesEndpointsOptions struct {
}

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

type LoadTestsClientListOutboundNetworkDependenciesEndpointsResponse added in v1.0.0

type LoadTestsClientListOutboundNetworkDependenciesEndpointsResponse struct {
	OutboundEnvironmentEndpointCollection
}

LoadTestsClientListOutboundNetworkDependenciesEndpointsResponse contains the response from method LoadTestsClient.ListOutboundNetworkDependenciesEndpoints.

type LoadTestsClientUpdateResponse added in v0.2.0

type LoadTestsClientUpdateResponse struct {
	LoadTestResource
}

LoadTestsClientUpdateResponse contains the response from method LoadTestsClient.Update.

type ManagedServiceIdentity added in v0.3.0

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

	// 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 `json:"userAssignedIdentities,omitempty"`

	// READ-ONLY; The service principal ID of the system assigned identity. This property will only be provided for a system assigned
	// identity.
	PrincipalID *string `json:"principalId,omitempty" azure:"ro"`

	// READ-ONLY; The tenant ID of the system assigned identity. This property will only be provided for a system assigned identity.
	TenantID *string `json:"tenantId,omitempty" azure:"ro"`
}

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

func (ManagedServiceIdentity) MarshalJSON added in v0.3.0

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

MarshalJSON implements the json.Marshaller interface for type ManagedServiceIdentity.

func (*ManagedServiceIdentity) UnmarshalJSON added in v1.0.0

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

UnmarshalJSON implements the json.Unmarshaller interface for type ManagedServiceIdentity.

type ManagedServiceIdentityType added in v0.3.0

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 added in v0.3.0

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 `json:"display,omitempty"`

	// READ-ONLY; Enum. Indicates the action type. "Internal" refers to actions that are for internal only APIs.
	ActionType *ActionType `json:"actionType,omitempty" azure:"ro"`

	// 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 `json:"isDataAction,omitempty" azure:"ro"`

	// 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 `json:"name,omitempty" azure:"ro"`

	// 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 `json:"origin,omitempty" azure:"ro"`
}

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

func (Operation) MarshalJSON added in v1.0.0

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

MarshalJSON implements the json.Marshaller interface for type Operation.

func (*Operation) UnmarshalJSON added in v1.0.0

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 `json:"description,omitempty" azure:"ro"`

	// 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 `json:"operation,omitempty" azure:"ro"`

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

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

OperationDisplay - Localized display information for this particular operation.

func (OperationDisplay) MarshalJSON added in v1.0.0

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

MarshalJSON implements the json.Marshaller interface for type OperationDisplay.

func (*OperationDisplay) UnmarshalJSON added in v1.0.0

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 `json:"nextLink,omitempty" azure:"ro"`

	// READ-ONLY; List of operations supported by the resource provider
	Value []*Operation `json:"value,omitempty" azure:"ro"`
}

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

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 added in v0.4.0

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.List method.

Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/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/loadtestservice/armloadtestservice"
)

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

type OperationsClientListOptions added in v0.2.0

type OperationsClientListOptions struct {
}

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

type OperationsClientListResponse added in v0.2.0

type OperationsClientListResponse struct {
	OperationListResult
}

OperationsClientListResponse contains the response from method OperationsClient.List.

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

type OutboundEnvironmentEndpoint struct {
	// READ-ONLY; The type of service that Azure Load Testing connects to.
	Category *string `json:"category,omitempty" azure:"ro"`

	// READ-ONLY; The endpoints for this service to which the Batch service makes outbound calls.
	Endpoints []*EndpointDependency `json:"endpoints,omitempty" azure:"ro"`
}

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

func (OutboundEnvironmentEndpoint) MarshalJSON added in v1.0.0

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

MarshalJSON implements the json.Marshaller interface for type OutboundEnvironmentEndpoint.

func (*OutboundEnvironmentEndpoint) UnmarshalJSON added in v1.0.0

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

UnmarshalJSON implements the json.Unmarshaller interface for type OutboundEnvironmentEndpoint.

type OutboundEnvironmentEndpointCollection added in v1.0.0

type OutboundEnvironmentEndpointCollection struct {
	// The continuation token.
	NextLink *string `json:"nextLink,omitempty"`

	// READ-ONLY; The collection of outbound network dependency endpoints returned by the listing operation.
	Value []*OutboundEnvironmentEndpoint `json:"value,omitempty" azure:"ro"`
}

OutboundEnvironmentEndpointCollection - Values returned by the List operation.

func (OutboundEnvironmentEndpointCollection) MarshalJSON added in v1.0.0

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

MarshalJSON implements the json.Marshaller interface for type OutboundEnvironmentEndpointCollection.

func (*OutboundEnvironmentEndpointCollection) UnmarshalJSON added in v1.0.0

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

UnmarshalJSON implements the json.Unmarshaller interface for type OutboundEnvironmentEndpointCollection.

type QuotaBucketRequest added in v1.0.0

type QuotaBucketRequest struct {
	// New quota request request properties.
	Properties *QuotaBucketRequestProperties `json:"properties,omitempty"`

	// READ-ONLY; Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}
	ID *string `json:"id,omitempty" azure:"ro"`

	// READ-ONLY; The name of the resource
	Name *string `json:"name,omitempty" azure:"ro"`

	// READ-ONLY; Azure Resource Manager metadata containing createdBy and modifiedBy information.
	SystemData *SystemData `json:"systemData,omitempty" azure:"ro"`

	// READ-ONLY; The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts"
	Type *string `json:"type,omitempty" azure:"ro"`
}

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

func (QuotaBucketRequest) MarshalJSON added in v1.0.0

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

MarshalJSON implements the json.Marshaller interface for type QuotaBucketRequest.

func (*QuotaBucketRequest) UnmarshalJSON added in v1.0.0

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

UnmarshalJSON implements the json.Unmarshaller interface for type QuotaBucketRequest.

type QuotaBucketRequestProperties added in v1.0.0

type QuotaBucketRequestProperties struct {
	// Current quota limit of the quota bucket.
	CurrentQuota *int32 `json:"currentQuota,omitempty"`

	// Current quota usage of the quota bucket.
	CurrentUsage *int32 `json:"currentUsage,omitempty"`

	// Dimensions for new quota request.
	Dimensions *QuotaBucketRequestPropertiesDimensions `json:"dimensions,omitempty"`

	// New quota limit of the quota bucket.
	NewQuota *int32 `json:"newQuota,omitempty"`
}

QuotaBucketRequestProperties - New quota request request properties.

func (QuotaBucketRequestProperties) MarshalJSON added in v1.0.0

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

MarshalJSON implements the json.Marshaller interface for type QuotaBucketRequestProperties.

func (*QuotaBucketRequestProperties) UnmarshalJSON added in v1.0.0

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

UnmarshalJSON implements the json.Unmarshaller interface for type QuotaBucketRequestProperties.

type QuotaBucketRequestPropertiesDimensions added in v1.0.0

type QuotaBucketRequestPropertiesDimensions struct {
	// Location dimension for new quota request of the quota bucket.
	Location *string `json:"location,omitempty"`

	// Subscription Id dimension for new quota request of the quota bucket.
	SubscriptionID *string `json:"subscriptionId,omitempty"`
}

QuotaBucketRequestPropertiesDimensions - Dimensions for new quota request.

func (QuotaBucketRequestPropertiesDimensions) MarshalJSON added in v1.0.0

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

MarshalJSON implements the json.Marshaller interface for type QuotaBucketRequestPropertiesDimensions.

func (*QuotaBucketRequestPropertiesDimensions) UnmarshalJSON added in v1.0.0

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

UnmarshalJSON implements the json.Unmarshaller interface for type QuotaBucketRequestPropertiesDimensions.

type QuotaResource added in v1.0.0

type QuotaResource struct {
	// Quota bucket resource properties.
	Properties *QuotaResourceProperties `json:"properties,omitempty"`

	// READ-ONLY; Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}
	ID *string `json:"id,omitempty" azure:"ro"`

	// READ-ONLY; The name of the resource
	Name *string `json:"name,omitempty" azure:"ro"`

	// READ-ONLY; Azure Resource Manager metadata containing createdBy and modifiedBy information.
	SystemData *SystemData `json:"systemData,omitempty" azure:"ro"`

	// READ-ONLY; The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts"
	Type *string `json:"type,omitempty" azure:"ro"`
}

QuotaResource - Quota bucket details object.

func (QuotaResource) MarshalJSON added in v1.0.0

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

MarshalJSON implements the json.Marshaller interface for type QuotaResource.

func (*QuotaResource) UnmarshalJSON added in v1.0.0

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

UnmarshalJSON implements the json.Unmarshaller interface for type QuotaResource.

type QuotaResourceList added in v1.0.0

type QuotaResourceList struct {
	// READ-ONLY; URL to get the next set of quota bucket objects results (if there are any).
	NextLink *string `json:"nextLink,omitempty" azure:"ro"`

	// READ-ONLY; List of quota bucket objects provided by the loadtestservice.
	Value []*QuotaResource `json:"value,omitempty" azure:"ro"`
}

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

func (QuotaResourceList) MarshalJSON added in v1.0.0

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

MarshalJSON implements the json.Marshaller interface for type QuotaResourceList.

func (*QuotaResourceList) UnmarshalJSON added in v1.0.0

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

UnmarshalJSON implements the json.Unmarshaller interface for type QuotaResourceList.

type QuotaResourceProperties added in v1.0.0

type QuotaResourceProperties struct {
	// Current quota limit of the quota bucket.
	Limit *int32 `json:"limit,omitempty"`

	// Current quota usage of the quota bucket.
	Usage *int32 `json:"usage,omitempty"`

	// READ-ONLY; Resource provisioning state.
	ProvisioningState *ResourceState `json:"provisioningState,omitempty" azure:"ro"`
}

QuotaResourceProperties - Quota bucket resource properties.

func (QuotaResourceProperties) MarshalJSON added in v1.0.0

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

MarshalJSON implements the json.Marshaller interface for type QuotaResourceProperties.

func (*QuotaResourceProperties) UnmarshalJSON added in v1.0.0

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

UnmarshalJSON implements the json.Unmarshaller interface for type QuotaResourceProperties.

type QuotasClient added in v1.0.0

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

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

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/tree/main/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/loadtestservice/armloadtestservice"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	client, err := armloadtestservice.NewQuotasClient("00000000-0000-0000-0000-000000000000", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	res, err := client.CheckAvailability(ctx, "westus", "testQuotaBucket", armloadtestservice.QuotaBucketRequest{
		Properties: &armloadtestservice.QuotaBucketRequestProperties{
			CurrentQuota: to.Ptr[int32](40),
			CurrentUsage: to.Ptr[int32](20),
			Dimensions: &armloadtestservice.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)
	}
	// TODO: use response item
	_ = res
}
Output:

func (*QuotasClient) Get added in v1.0.0

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/tree/main/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/loadtestservice/armloadtestservice"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	client, err := armloadtestservice.NewQuotasClient("00000000-0000-0000-0000-000000000000", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	res, err := client.Get(ctx, "westus", "testQuotaBucket", nil)
	if err != nil {
		log.Fatalf("failed to finish the request: %v", err)
	}
	// TODO: use response item
	_ = res
}
Output:

func (*QuotasClient) NewListPager added in v1.0.0

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.List method.

Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/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/loadtestservice/armloadtestservice"
)

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

type QuotasClientCheckAvailabilityOptions added in v1.0.0

type QuotasClientCheckAvailabilityOptions struct {
}

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

type QuotasClientCheckAvailabilityResponse added in v1.0.0

type QuotasClientCheckAvailabilityResponse struct {
	CheckQuotaAvailabilityResponse
}

QuotasClientCheckAvailabilityResponse contains the response from method QuotasClient.CheckAvailability.

type QuotasClientGetOptions added in v1.0.0

type QuotasClientGetOptions struct {
}

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

type QuotasClientGetResponse added in v1.0.0

type QuotasClientGetResponse struct {
	QuotaResource
}

QuotasClientGetResponse contains the response from method QuotasClient.Get.

type QuotasClientListOptions added in v1.0.0

type QuotasClientListOptions struct {
}

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

type QuotasClientListResponse added in v1.0.0

type QuotasClientListResponse struct {
	QuotaResourceList
}

QuotasClientListResponse contains the response from method QuotasClient.List.

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 `json:"id,omitempty" azure:"ro"`

	// READ-ONLY; The name of the resource
	Name *string `json:"name,omitempty" azure:"ro"`

	// READ-ONLY; Azure Resource Manager metadata containing createdBy and modifiedBy information.
	SystemData *SystemData `json:"systemData,omitempty" azure:"ro"`

	// READ-ONLY; The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts"
	Type *string `json:"type,omitempty" azure:"ro"`
}

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

func (Resource) MarshalJSON

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

MarshalJSON implements the json.Marshaller interface for type Resource.

func (*Resource) UnmarshalJSON added in v1.0.0

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

UnmarshalJSON implements the json.Unmarshaller interface for type Resource.

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 `json:"createdAt,omitempty"`

	// The identity that created the resource.
	CreatedBy *string `json:"createdBy,omitempty"`

	// The type of identity that created the resource.
	CreatedByType *CreatedByType `json:"createdByType,omitempty"`

	// The timestamp of resource last modification (UTC)
	LastModifiedAt *time.Time `json:"lastModifiedAt,omitempty"`

	// The identity that last modified the resource.
	LastModifiedBy *string `json:"lastModifiedBy,omitempty"`

	// The type of identity that last modified the resource.
	LastModifiedByType *CreatedByType `json:"lastModifiedByType,omitempty"`
}

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 TrackedResource

type TrackedResource struct {
	// REQUIRED; The geo-location where the resource lives
	Location *string `json:"location,omitempty"`

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

	// READ-ONLY; Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}
	ID *string `json:"id,omitempty" azure:"ro"`

	// READ-ONLY; The name of the resource
	Name *string `json:"name,omitempty" azure:"ro"`

	// READ-ONLY; Azure Resource Manager metadata containing createdBy and modifiedBy information.
	SystemData *SystemData `json:"systemData,omitempty" azure:"ro"`

	// READ-ONLY; The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts"
	Type *string `json:"type,omitempty" azure:"ro"`
}

TrackedResource - The resource model definition for an Azure Resource Manager tracked top level resource which has 'tags' and a 'location'

func (TrackedResource) MarshalJSON

func (t TrackedResource) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.Marshaller interface for type TrackedResource.

func (*TrackedResource) UnmarshalJSON added in v1.0.0

func (t *TrackedResource) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the json.Unmarshaller interface for type TrackedResource.

type Type added in v0.3.0

type Type string

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

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

func PossibleTypeValues added in v0.3.0

func PossibleTypeValues() []Type

PossibleTypeValues returns the possible values for the Type const type.

type UserAssignedIdentity added in v0.3.0

type UserAssignedIdentity struct {
	// READ-ONLY; The client ID of the assigned identity.
	ClientID *string `json:"clientId,omitempty" azure:"ro"`

	// READ-ONLY; The principal ID of the assigned identity.
	PrincipalID *string `json:"principalId,omitempty" azure:"ro"`
}

UserAssignedIdentity - User assigned identity properties

func (UserAssignedIdentity) MarshalJSON added in v1.0.0

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

MarshalJSON implements the json.Marshaller interface for type UserAssignedIdentity.

func (*UserAssignedIdentity) UnmarshalJSON added in v1.0.0

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

UnmarshalJSON implements the json.Unmarshaller interface for type UserAssignedIdentity.

Jump to

Keyboard shortcuts

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