armrecommender

package module
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Sep 23, 2025 License: MIT Imports: 14 Imported by: 0

README

Azure Compute Recommender Module for Go

The armrecommender module provides operations for working with Azure Compute Recommender.

Source code

Getting started

Prerequisites

  • An Azure subscription
  • Supported version of Go (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 Compute module:

go get github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/compute/armrecommender

Authorization

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

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 Compute 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 - Extensible enum. Indicates the action type. "Internal" refers to actions that are for internal only APIs.

const (
	// ActionTypeInternal - Actions are for internal-only APIs.
	ActionTypeInternal ActionType = "Internal"
)

func PossibleActionTypeValues

func PossibleActionTypeValues() []ActionType

PossibleActionTypeValues returns the possible values for the ActionType const type.

type ClientFactory

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

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

func NewClientFactory

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

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

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

func (*ClientFactory) NewOperationsClient

func (c *ClientFactory) NewOperationsClient() *OperationsClient

NewOperationsClient creates a new instance of OperationsClient.

func (*ClientFactory) NewSpotPlacementScoresClient

func (c *ClientFactory) NewSpotPlacementScoresClient() *SpotPlacementScoresClient

NewSpotPlacementScoresClient creates a new instance of SpotPlacementScoresClient.

type ComputeDiagnosticBase

type ComputeDiagnosticBase struct {
	// Contains additional properties of a diagnostic
	Properties *DiagnosticProperties

	// 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
}

ComputeDiagnosticBase - Contains metadata of a diagnostic type

func (ComputeDiagnosticBase) MarshalJSON

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

MarshalJSON implements the json.Marshaller interface for type ComputeDiagnosticBase.

func (*ComputeDiagnosticBase) UnmarshalJSON

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

UnmarshalJSON implements the json.Unmarshaller interface for type ComputeDiagnosticBase.

type CreatedByType

type CreatedByType string

CreatedByType - The kind of entity that created the resource.

const (
	// CreatedByTypeApplication - The entity was created by an application.
	CreatedByTypeApplication CreatedByType = "Application"
	// CreatedByTypeKey - The entity was created by a key.
	CreatedByTypeKey CreatedByType = "Key"
	// CreatedByTypeManagedIdentity - The entity was created by a managed identity.
	CreatedByTypeManagedIdentity CreatedByType = "ManagedIdentity"
	// CreatedByTypeUser - The entity was created by a user.
	CreatedByTypeUser CreatedByType = "User"
)

func PossibleCreatedByTypeValues

func PossibleCreatedByTypeValues() []CreatedByType

PossibleCreatedByTypeValues returns the possible values for the CreatedByType const type.

type DiagnosticProperties

type DiagnosticProperties struct {
	// Describes what are the supported resource types for a diagnostic.
	SupportedResourceTypes []*string
}

DiagnosticProperties - Contains additional properties of a diagnostic

func (DiagnosticProperties) MarshalJSON

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

MarshalJSON implements the json.Marshaller interface for type DiagnosticProperties.

func (*DiagnosticProperties) UnmarshalJSON

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

UnmarshalJSON implements the json.Unmarshaller interface for type DiagnosticProperties.

type Operation

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

	// READ-ONLY; Extensible 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 Azure
	// Resource Manager/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 - REST API 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 and 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 {
	// REQUIRED; The Operation items on this page
	Value []*Operation

	// The link to the next page of items
	NextLink *string
}

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 - List the operations for the provider

Generated from API version 2025-06-05

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

Generated from example definition: 2025-06-05/Operations_List_MaximumSet_Gen.json

package main

import (
	"context"
	"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
	"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/compute/armrecommender"
	"log"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armrecommender.NewClientFactory("<subscriptionID>", 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 = armrecommender.OperationsClientListResponse{
		// 	OperationListResult: armrecommender.OperationListResult{
		// 		Value: []*armrecommender.Operation{
		// 			{
		// 				Origin: to.Ptr(armrecommender.Origin("aaaaa")),
		// 				Name: to.Ptr("aaaaaaaaaaaa"),
		// 				Display: &armrecommender.OperationDisplay{
		// 					Operation: to.Ptr("aaaaaaaaaaaaaaaaaaaaaa"),
		// 					Resource: to.Ptr("aaaaaaaaaaaaaaaaaaaaaaaaaaaaa"),
		// 					Description: to.Ptr("aaaaaaaaaaaaaaaaaaaaaa"),
		// 					Provider: to.Ptr("aaaaaaaaaaaaaaaaaa"),
		// 				},
		// 			},
		// 		},
		// 	},
		// }
	}
}
Example (OperationsListMinimumSetGen)

Generated from example definition: 2025-06-05/Operations_List_MinimumSet_Gen.json

package main

import (
	"context"
	"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
	"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/compute/armrecommender"
	"log"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armrecommender.NewClientFactory("<subscriptionID>", 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 = armrecommender.OperationsClientListResponse{
		// 	OperationListResult: armrecommender.OperationListResult{
		// 	},
		// }
	}
}

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 - Indicates the operation is initiated by a system.
	OriginSystem Origin = "system"
	// OriginUser - Indicates the operation is initiated by a user.
	OriginUser Origin = "user"
	// OriginUserSystem - Indicates the operation is initiated by a user or system.
	OriginUserSystem Origin = "user,system"
)

func PossibleOriginValues

func PossibleOriginValues() []Origin

PossibleOriginValues returns the possible values for the Origin const type.

type PlacementScore

type PlacementScore struct {
	// The availability zone.
	AvailabilityZone *string

	// Whether the desired quota is available.
	IsQuotaAvailable *bool

	// The region.
	Region *string

	// The resource's CRP virtual machine SKU size.
	SKU *string

	// A placement score indicating the likelihood of successfully allocating the specified Spot VM(s), as well as the expected
	// lifetimes of the Spot VM(s) after allocation.
	Score *string
}

PlacementScore - The spot placement score for sku/region/zone combination.

func (PlacementScore) MarshalJSON

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

MarshalJSON implements the json.Marshaller interface for type PlacementScore.

func (*PlacementScore) UnmarshalJSON

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

UnmarshalJSON implements the json.Unmarshaller interface for type PlacementScore.

type ResourceSize

type ResourceSize struct {
	// The resource's CRP virtual machine SKU size.
	SKU *string
}

ResourceSize - SpotPlacementRecommender API response.

func (ResourceSize) MarshalJSON

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

MarshalJSON implements the json.Marshaller interface for type ResourceSize.

func (*ResourceSize) UnmarshalJSON

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

UnmarshalJSON implements the json.Unmarshaller interface for type ResourceSize.

type SpotPlacementScoresClient

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

SpotPlacementScoresClient contains the methods for the SpotPlacementScores group. Don't use this type directly, use NewSpotPlacementScoresClient() instead.

func NewSpotPlacementScoresClient

func NewSpotPlacementScoresClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*SpotPlacementScoresClient, error)

NewSpotPlacementScoresClient creates a new instance of SpotPlacementScoresClient with the specified values.

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

func (*SpotPlacementScoresClient) Get

Get - Gets Spot Placement Scores metadata. If the operation fails it returns an *azcore.ResponseError type.

Generated from API version 2025-06-05

  • location - The name of the Azure region.
  • options - SpotPlacementScoresClientGetOptions contains the optional parameters for the SpotPlacementScoresClient.Get method.
Example

Generated from example definition: 2025-06-05/GetSpotPlacementScores.json

package main

import (
	"context"
	"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
	"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/compute/armrecommender"
	"log"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armrecommender.NewClientFactory("00000000-0000-0000-0000-000000000000", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	res, err := clientFactory.NewSpotPlacementScoresClient().Get(ctx, "eastus", 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 = armrecommender.SpotPlacementScoresClientGetResponse{
	// 	ComputeDiagnosticBase: &armrecommender.ComputeDiagnosticBase{
	// 		Name: to.Ptr("spotPlacementScores"),
	// 		Type: to.Ptr("Microsoft.Compute/placementScores"),
	// 		ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/placementScores/spot?api-version=2025-06-05"),
	// 		Properties: &armrecommender.DiagnosticProperties{
	// 			SupportedResourceTypes: []*string{
	// 				to.Ptr("Microsoft.Compute/virtualMachines"),
	// 			},
	// 		},
	// 	},
	// }
}

func (*SpotPlacementScoresClient) Post

Post - Generates placement scores for Spot VM skus. If the operation fails it returns an *azcore.ResponseError type.

Generated from API version 2025-06-05

  • location - The name of the Azure region.
  • spotPlacementScoresInput - SpotPlacementScores object supplied in the body of the Post spot placement scores operation.
  • options - SpotPlacementScoresClientPostOptions contains the optional parameters for the SpotPlacementScoresClient.Post method.
Example

Generated from example definition: 2025-06-05/GenerateSpotPlacementScores.json

package main

import (
	"context"
	"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/compute/armrecommender"
	"log"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armrecommender.NewClientFactory("00000000-0000-0000-0000-000000000000", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	res, err := clientFactory.NewSpotPlacementScoresClient().Post(ctx, "eastus", armrecommender.SpotPlacementScoresInput{
		AvailabilityZones: to.Ptr(true),
		DesiredCount:      to.Ptr[int32](1),
		DesiredLocations: []*string{
			to.Ptr("eastus"),
			to.Ptr("eastus2"),
		},
		DesiredSizes: []*armrecommender.ResourceSize{
			{
				SKU: to.Ptr("Standard_D2_v2"),
			},
		},
	}, 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 = armrecommender.SpotPlacementScoresClientPostResponse{
	// 	SpotPlacementScoresResponse: &armrecommender.SpotPlacementScoresResponse{
	// 		AvailabilityZones: to.Ptr(true),
	// 		DesiredCount: to.Ptr[int32](1),
	// 		DesiredLocations: []*string{
	// 			to.Ptr("eastus"),
	// 			to.Ptr("eastus2"),
	// 		},
	// 		DesiredSizes: []*armrecommender.ResourceSize{
	// 			{
	// 				SKU: to.Ptr("Standard_D2_v2"),
	// 			},
	// 		},
	// 		PlacementScores: []*armrecommender.PlacementScore{
	// 			{
	// 				AvailabilityZone: to.Ptr("1"),
	// 				IsQuotaAvailable: to.Ptr(true),
	// 				Region: to.Ptr("eastus"),
	// 				Score: to.Ptr("High"),
	// 				SKU: to.Ptr("Standard_D2_v2"),
	// 			},
	// 			{
	// 				AvailabilityZone: to.Ptr("2"),
	// 				IsQuotaAvailable: to.Ptr(true),
	// 				Region: to.Ptr("eastus"),
	// 				Score: to.Ptr("High"),
	// 				SKU: to.Ptr("Standard_D2_v2"),
	// 			},
	// 			{
	// 				AvailabilityZone: to.Ptr("3"),
	// 				IsQuotaAvailable: to.Ptr(true),
	// 				Region: to.Ptr("eastus"),
	// 				Score: to.Ptr("High"),
	// 				SKU: to.Ptr("Standard_D2_v2"),
	// 			},
	// 			{
	// 				AvailabilityZone: to.Ptr("1"),
	// 				IsQuotaAvailable: to.Ptr(true),
	// 				Region: to.Ptr("eastus2"),
	// 				Score: to.Ptr("DataNotFoundOrStale"),
	// 				SKU: to.Ptr("Standard_D2_v2"),
	// 			},
	// 			{
	// 				AvailabilityZone: to.Ptr("2"),
	// 				IsQuotaAvailable: to.Ptr(true),
	// 				Region: to.Ptr("eastus2"),
	// 				Score: to.Ptr("High"),
	// 				SKU: to.Ptr("Standard_D2_v2"),
	// 			},
	// 			{
	// 				AvailabilityZone: to.Ptr("3"),
	// 				IsQuotaAvailable: to.Ptr(true),
	// 				Region: to.Ptr("eastus2"),
	// 				Score: to.Ptr("High"),
	// 				SKU: to.Ptr("Standard_D2_v2"),
	// 			},
	// 		},
	// 	},
	// }
}

type SpotPlacementScoresClientGetOptions

type SpotPlacementScoresClientGetOptions struct {
}

SpotPlacementScoresClientGetOptions contains the optional parameters for the SpotPlacementScoresClient.Get method.

type SpotPlacementScoresClientGetResponse

type SpotPlacementScoresClientGetResponse struct {
	// Contains metadata of a diagnostic type
	ComputeDiagnosticBase
}

SpotPlacementScoresClientGetResponse contains the response from method SpotPlacementScoresClient.Get.

type SpotPlacementScoresClientPostOptions

type SpotPlacementScoresClientPostOptions struct {
}

SpotPlacementScoresClientPostOptions contains the optional parameters for the SpotPlacementScoresClient.Post method.

type SpotPlacementScoresClientPostResponse

type SpotPlacementScoresClientPostResponse struct {
	// SpotPlacementScores API response.
	SpotPlacementScoresResponse
}

SpotPlacementScoresClientPostResponse contains the response from method SpotPlacementScoresClient.Post.

type SpotPlacementScoresInput

type SpotPlacementScoresInput struct {
	// Defines if the scope is zonal or regional.
	AvailabilityZones *bool

	// Desired instance count per region/zone based on the scope.
	DesiredCount *int32

	// The desired regions
	DesiredLocations []*string

	// The desired virtual machine SKU sizes.
	DesiredSizes []*ResourceSize
}

SpotPlacementScoresInput - SpotPlacementScores API Input.

func (SpotPlacementScoresInput) MarshalJSON

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

MarshalJSON implements the json.Marshaller interface for type SpotPlacementScoresInput.

func (*SpotPlacementScoresInput) UnmarshalJSON

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

UnmarshalJSON implements the json.Unmarshaller interface for type SpotPlacementScoresInput.

type SpotPlacementScoresResponse

type SpotPlacementScoresResponse struct {
	// Defines if the scope is zonal or regional.
	AvailabilityZones *bool

	// Desired instance count per region/zone based on the scope.
	DesiredCount *int32

	// The desired regions
	DesiredLocations []*string

	// The desired virtual machine SKU sizes.
	DesiredSizes []*ResourceSize

	// A placement score indicating the likelihood of successfully allocating the specified Spot VM(s), as well as the expected
	// lifetimes of the Spot VM(s) after allocation.
	PlacementScores []*PlacementScore
}

SpotPlacementScoresResponse - SpotPlacementScores API response.

func (SpotPlacementScoresResponse) MarshalJSON

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

MarshalJSON implements the json.Marshaller interface for type SpotPlacementScoresResponse.

func (*SpotPlacementScoresResponse) UnmarshalJSON

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

UnmarshalJSON implements the json.Unmarshaller interface for type SpotPlacementScoresResponse.

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.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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