placementpolicies

package
v0.20240903.1111904 Latest Latest
Warning

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

Go to latest
Published: Sep 3, 2024 License: MPL-2.0 Imports: 12 Imported by: 1

README

github.com/hashicorp/go-azure-sdk/resource-manager/vmware/2022-05-01/placementpolicies Documentation

The placementpolicies SDK allows for interaction with the Azure Resource Manager Service vmware (API Version 2022-05-01).

This readme covers example usages, but further information on using this SDK can be found in the project root.

Import Path

import "github.com/hashicorp/go-azure-sdk/resource-manager/vmware/2022-05-01/placementpolicies"

Client Initialization

client := placementpolicies.NewPlacementPoliciesClientWithBaseURI("https://management.azure.com")
client.Client.Authorizer = authorizer

Example Usage: PlacementPoliciesClient.CreateOrUpdate

ctx := context.TODO()
id := placementpolicies.NewPlacementPolicyID("12345678-1234-9876-4563-123456789012", "example-resource-group", "privateCloudValue", "clusterValue", "placementPolicyValue")

payload := placementpolicies.PlacementPolicy{
	// ...
}


if err := client.CreateOrUpdateThenPoll(ctx, id, payload); err != nil {
	// handle the error
}

Example Usage: PlacementPoliciesClient.Delete

ctx := context.TODO()
id := placementpolicies.NewPlacementPolicyID("12345678-1234-9876-4563-123456789012", "example-resource-group", "privateCloudValue", "clusterValue", "placementPolicyValue")

if err := client.DeleteThenPoll(ctx, id); err != nil {
	// handle the error
}

Example Usage: PlacementPoliciesClient.Get

ctx := context.TODO()
id := placementpolicies.NewPlacementPolicyID("12345678-1234-9876-4563-123456789012", "example-resource-group", "privateCloudValue", "clusterValue", "placementPolicyValue")

read, err := client.Get(ctx, id)
if err != nil {
	// handle the error
}
if model := read.Model; model != nil {
	// do something with the model/response object
}

Example Usage: PlacementPoliciesClient.List

ctx := context.TODO()
id := placementpolicies.NewClusterID("12345678-1234-9876-4563-123456789012", "example-resource-group", "privateCloudValue", "clusterValue")

// alternatively `client.List(ctx, id)` can be used to do batched pagination
items, err := client.ListComplete(ctx, id)
if err != nil {
	// handle the error
}
for _, item := range items {
	// do something
}

Example Usage: PlacementPoliciesClient.Update

ctx := context.TODO()
id := placementpolicies.NewPlacementPolicyID("12345678-1234-9876-4563-123456789012", "example-resource-group", "privateCloudValue", "clusterValue", "placementPolicyValue")

payload := placementpolicies.PlacementPolicyUpdate{
	// ...
}


if err := client.UpdateThenPoll(ctx, id, payload); err != nil {
	// handle the error
}

Example Usage: PlacementPoliciesClient.VirtualMachinesRestrictMovement

ctx := context.TODO()
id := placementpolicies.NewVirtualMachineID("12345678-1234-9876-4563-123456789012", "example-resource-group", "privateCloudValue", "clusterValue", "virtualMachineIdValue")

payload := placementpolicies.VirtualMachineRestrictMovement{
	// ...
}


if err := client.VirtualMachinesRestrictMovementThenPoll(ctx, id, payload); err != nil {
	// handle the error
}

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func PossibleValuesForAffinityStrength

func PossibleValuesForAffinityStrength() []string

func PossibleValuesForAffinityType

func PossibleValuesForAffinityType() []string

func PossibleValuesForAzureHybridBenefitType

func PossibleValuesForAzureHybridBenefitType() []string

func PossibleValuesForPlacementPolicyProvisioningState

func PossibleValuesForPlacementPolicyProvisioningState() []string

func PossibleValuesForPlacementPolicyState

func PossibleValuesForPlacementPolicyState() []string

func PossibleValuesForPlacementPolicyType

func PossibleValuesForPlacementPolicyType() []string

func PossibleValuesForVirtualMachineRestrictMovementState

func PossibleValuesForVirtualMachineRestrictMovementState() []string

func ValidateClusterID

func ValidateClusterID(input interface{}, key string) (warnings []string, errors []error)

ValidateClusterID checks that 'input' can be parsed as a Cluster ID

func ValidatePlacementPolicyID

func ValidatePlacementPolicyID(input interface{}, key string) (warnings []string, errors []error)

ValidatePlacementPolicyID checks that 'input' can be parsed as a Placement Policy ID

func ValidateVirtualMachineID

func ValidateVirtualMachineID(input interface{}, key string) (warnings []string, errors []error)

ValidateVirtualMachineID checks that 'input' can be parsed as a Virtual Machine ID

Types

type AffinityStrength

type AffinityStrength string
const (
	AffinityStrengthMust   AffinityStrength = "Must"
	AffinityStrengthShould AffinityStrength = "Should"
)

func (*AffinityStrength) UnmarshalJSON

func (s *AffinityStrength) UnmarshalJSON(bytes []byte) error

type AffinityType

type AffinityType string
const (
	AffinityTypeAffinity     AffinityType = "Affinity"
	AffinityTypeAntiAffinity AffinityType = "AntiAffinity"
)

func (*AffinityType) UnmarshalJSON

func (s *AffinityType) UnmarshalJSON(bytes []byte) error

type AzureHybridBenefitType

type AzureHybridBenefitType string
const (
	AzureHybridBenefitTypeNone    AzureHybridBenefitType = "None"
	AzureHybridBenefitTypeSqlHost AzureHybridBenefitType = "SqlHost"
)

func (*AzureHybridBenefitType) UnmarshalJSON

func (s *AzureHybridBenefitType) UnmarshalJSON(bytes []byte) error

type ClusterId

type ClusterId struct {
	SubscriptionId    string
	ResourceGroupName string
	PrivateCloudName  string
	ClusterName       string
}

ClusterId is a struct representing the Resource ID for a Cluster

func NewClusterID

func NewClusterID(subscriptionId string, resourceGroupName string, privateCloudName string, clusterName string) ClusterId

NewClusterID returns a new ClusterId struct

func ParseClusterID

func ParseClusterID(input string) (*ClusterId, error)

ParseClusterID parses 'input' into a ClusterId

func ParseClusterIDInsensitively

func ParseClusterIDInsensitively(input string) (*ClusterId, error)

ParseClusterIDInsensitively parses 'input' case-insensitively into a ClusterId note: this method should only be used for API response data and not user input

func (*ClusterId) FromParseResult

func (id *ClusterId) FromParseResult(input resourceids.ParseResult) error

func (ClusterId) ID

func (id ClusterId) ID() string

ID returns the formatted Cluster ID

func (ClusterId) Segments

func (id ClusterId) Segments() []resourceids.Segment

Segments returns a slice of Resource ID Segments which comprise this Cluster ID

func (ClusterId) String

func (id ClusterId) String() string

String returns a human-readable description of this Cluster ID

type CreateOrUpdateOperationResponse

type CreateOrUpdateOperationResponse struct {
	Poller       pollers.Poller
	HttpResponse *http.Response
	OData        *odata.OData
	Model        *PlacementPolicy
}

type DeleteOperationResponse

type DeleteOperationResponse struct {
	Poller       pollers.Poller
	HttpResponse *http.Response
	OData        *odata.OData
}

type GetOperationResponse

type GetOperationResponse struct {
	HttpResponse *http.Response
	OData        *odata.OData
	Model        *PlacementPolicy
}

type ListCompleteResult

type ListCompleteResult struct {
	LatestHttpResponse *http.Response
	Items              []PlacementPolicy
}

type ListCustomPager added in v0.20240628.1153531

type ListCustomPager struct {
	NextLink *odata.Link `json:"nextLink"`
}
func (p *ListCustomPager) NextPageLink() *odata.Link

type ListOperationResponse

type ListOperationResponse struct {
	HttpResponse *http.Response
	OData        *odata.OData
	Model        *[]PlacementPolicy
}

type PlacementPoliciesClient

type PlacementPoliciesClient struct {
	Client *resourcemanager.Client
}

func NewPlacementPoliciesClientWithBaseURI

func NewPlacementPoliciesClientWithBaseURI(sdkApi sdkEnv.Api) (*PlacementPoliciesClient, error)

func (PlacementPoliciesClient) CreateOrUpdate

CreateOrUpdate ...

func (PlacementPoliciesClient) CreateOrUpdateThenPoll

func (c PlacementPoliciesClient) CreateOrUpdateThenPoll(ctx context.Context, id PlacementPolicyId, input PlacementPolicy) error

CreateOrUpdateThenPoll performs CreateOrUpdate then polls until it's completed

func (PlacementPoliciesClient) Delete

Delete ...

func (PlacementPoliciesClient) DeleteThenPoll

DeleteThenPoll performs Delete then polls until it's completed

func (PlacementPoliciesClient) Get

Get ...

func (PlacementPoliciesClient) List

List ...

func (PlacementPoliciesClient) ListComplete

ListComplete retrieves all the results into a single object

func (PlacementPoliciesClient) ListCompleteMatchingPredicate

func (c PlacementPoliciesClient) ListCompleteMatchingPredicate(ctx context.Context, id ClusterId, predicate PlacementPolicyOperationPredicate) (result ListCompleteResult, err error)

ListCompleteMatchingPredicate retrieves all the results and then applies the predicate

func (PlacementPoliciesClient) Update

Update ...

func (PlacementPoliciesClient) UpdateThenPoll

UpdateThenPoll performs Update then polls until it's completed

func (PlacementPoliciesClient) VirtualMachinesRestrictMovement

VirtualMachinesRestrictMovement ...

func (PlacementPoliciesClient) VirtualMachinesRestrictMovementThenPoll

func (c PlacementPoliciesClient) VirtualMachinesRestrictMovementThenPoll(ctx context.Context, id VirtualMachineId, input VirtualMachineRestrictMovement) error

VirtualMachinesRestrictMovementThenPoll performs VirtualMachinesRestrictMovement then polls until it's completed

type PlacementPolicy

type PlacementPolicy struct {
	Id         *string                   `json:"id,omitempty"`
	Name       *string                   `json:"name,omitempty"`
	Properties PlacementPolicyProperties `json:"properties"`
	Type       *string                   `json:"type,omitempty"`
}

func (*PlacementPolicy) UnmarshalJSON

func (s *PlacementPolicy) UnmarshalJSON(bytes []byte) error

type PlacementPolicyId

type PlacementPolicyId struct {
	SubscriptionId      string
	ResourceGroupName   string
	PrivateCloudName    string
	ClusterName         string
	PlacementPolicyName string
}

PlacementPolicyId is a struct representing the Resource ID for a Placement Policy

func NewPlacementPolicyID

func NewPlacementPolicyID(subscriptionId string, resourceGroupName string, privateCloudName string, clusterName string, placementPolicyName string) PlacementPolicyId

NewPlacementPolicyID returns a new PlacementPolicyId struct

func ParsePlacementPolicyID

func ParsePlacementPolicyID(input string) (*PlacementPolicyId, error)

ParsePlacementPolicyID parses 'input' into a PlacementPolicyId

func ParsePlacementPolicyIDInsensitively

func ParsePlacementPolicyIDInsensitively(input string) (*PlacementPolicyId, error)

ParsePlacementPolicyIDInsensitively parses 'input' case-insensitively into a PlacementPolicyId note: this method should only be used for API response data and not user input

func (*PlacementPolicyId) FromParseResult

func (id *PlacementPolicyId) FromParseResult(input resourceids.ParseResult) error

func (PlacementPolicyId) ID

func (id PlacementPolicyId) ID() string

ID returns the formatted Placement Policy ID

func (PlacementPolicyId) Segments

func (id PlacementPolicyId) Segments() []resourceids.Segment

Segments returns a slice of Resource ID Segments which comprise this Placement Policy ID

func (PlacementPolicyId) String

func (id PlacementPolicyId) String() string

String returns a human-readable description of this Placement Policy ID

type PlacementPolicyOperationPredicate

type PlacementPolicyOperationPredicate struct {
	Id   *string
	Name *string
	Type *string
}

func (PlacementPolicyOperationPredicate) Matches

type PlacementPolicyProperties

type PlacementPolicyProperties interface {
}

type PlacementPolicyProvisioningState

type PlacementPolicyProvisioningState string
const (
	PlacementPolicyProvisioningStateBuilding  PlacementPolicyProvisioningState = "Building"
	PlacementPolicyProvisioningStateCanceled  PlacementPolicyProvisioningState = "Canceled"
	PlacementPolicyProvisioningStateDeleting  PlacementPolicyProvisioningState = "Deleting"
	PlacementPolicyProvisioningStateFailed    PlacementPolicyProvisioningState = "Failed"
	PlacementPolicyProvisioningStateSucceeded PlacementPolicyProvisioningState = "Succeeded"
	PlacementPolicyProvisioningStateUpdating  PlacementPolicyProvisioningState = "Updating"
)

func (*PlacementPolicyProvisioningState) UnmarshalJSON

func (s *PlacementPolicyProvisioningState) UnmarshalJSON(bytes []byte) error

type PlacementPolicyState

type PlacementPolicyState string
const (
	PlacementPolicyStateDisabled PlacementPolicyState = "Disabled"
	PlacementPolicyStateEnabled  PlacementPolicyState = "Enabled"
)

func (*PlacementPolicyState) UnmarshalJSON

func (s *PlacementPolicyState) UnmarshalJSON(bytes []byte) error

type PlacementPolicyType

type PlacementPolicyType string
const (
	PlacementPolicyTypeVMHost PlacementPolicyType = "VmHost"
	PlacementPolicyTypeVMVM   PlacementPolicyType = "VmVm"
)

func (*PlacementPolicyType) UnmarshalJSON

func (s *PlacementPolicyType) UnmarshalJSON(bytes []byte) error

type PlacementPolicyUpdate

type PlacementPolicyUpdate struct {
	Properties *PlacementPolicyUpdateProperties `json:"properties,omitempty"`
}

type PlacementPolicyUpdateProperties

type PlacementPolicyUpdateProperties struct {
	AffinityStrength       *AffinityStrength       `json:"affinityStrength,omitempty"`
	AzureHybridBenefitType *AzureHybridBenefitType `json:"azureHybridBenefitType,omitempty"`
	HostMembers            *[]string               `json:"hostMembers,omitempty"`
	State                  *PlacementPolicyState   `json:"state,omitempty"`
	VMMembers              *[]string               `json:"vmMembers,omitempty"`
}

type RawPlacementPolicyPropertiesImpl

type RawPlacementPolicyPropertiesImpl struct {
	Type   string
	Values map[string]interface{}
}

RawPlacementPolicyPropertiesImpl is returned when the Discriminated Value doesn't match any of the defined types NOTE: this should only be used when a type isn't defined for this type of Object (as a workaround) and is used only for Deserialization (e.g. this cannot be used as a Request Payload).

type UpdateOperationResponse

type UpdateOperationResponse struct {
	Poller       pollers.Poller
	HttpResponse *http.Response
	OData        *odata.OData
	Model        *PlacementPolicy
}

type VMHostPlacementPolicyProperties

type VMHostPlacementPolicyProperties struct {
	AffinityStrength       *AffinityStrength       `json:"affinityStrength,omitempty"`
	AffinityType           AffinityType            `json:"affinityType"`
	AzureHybridBenefitType *AzureHybridBenefitType `json:"azureHybridBenefitType,omitempty"`
	HostMembers            []string                `json:"hostMembers"`
	VMMembers              []string                `json:"vmMembers"`

	// Fields inherited from PlacementPolicyProperties
	DisplayName       *string                           `json:"displayName,omitempty"`
	ProvisioningState *PlacementPolicyProvisioningState `json:"provisioningState,omitempty"`
	State             *PlacementPolicyState             `json:"state,omitempty"`
}

func (VMHostPlacementPolicyProperties) MarshalJSON

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

type VMVMPlacementPolicyProperties

type VMVMPlacementPolicyProperties struct {
	AffinityType AffinityType `json:"affinityType"`
	VMMembers    []string     `json:"vmMembers"`

	// Fields inherited from PlacementPolicyProperties
	DisplayName       *string                           `json:"displayName,omitempty"`
	ProvisioningState *PlacementPolicyProvisioningState `json:"provisioningState,omitempty"`
	State             *PlacementPolicyState             `json:"state,omitempty"`
}

func (VMVMPlacementPolicyProperties) MarshalJSON

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

type VirtualMachineId

type VirtualMachineId struct {
	SubscriptionId    string
	ResourceGroupName string
	PrivateCloudName  string
	ClusterName       string
	VirtualMachineId  string
}

VirtualMachineId is a struct representing the Resource ID for a Virtual Machine

func NewVirtualMachineID

func NewVirtualMachineID(subscriptionId string, resourceGroupName string, privateCloudName string, clusterName string, virtualMachineId string) VirtualMachineId

NewVirtualMachineID returns a new VirtualMachineId struct

func ParseVirtualMachineID

func ParseVirtualMachineID(input string) (*VirtualMachineId, error)

ParseVirtualMachineID parses 'input' into a VirtualMachineId

func ParseVirtualMachineIDInsensitively

func ParseVirtualMachineIDInsensitively(input string) (*VirtualMachineId, error)

ParseVirtualMachineIDInsensitively parses 'input' case-insensitively into a VirtualMachineId note: this method should only be used for API response data and not user input

func (*VirtualMachineId) FromParseResult

func (id *VirtualMachineId) FromParseResult(input resourceids.ParseResult) error

func (VirtualMachineId) ID

func (id VirtualMachineId) ID() string

ID returns the formatted Virtual Machine ID

func (VirtualMachineId) Segments

func (id VirtualMachineId) Segments() []resourceids.Segment

Segments returns a slice of Resource ID Segments which comprise this Virtual Machine ID

func (VirtualMachineId) String

func (id VirtualMachineId) String() string

String returns a human-readable description of this Virtual Machine ID

type VirtualMachineRestrictMovement

type VirtualMachineRestrictMovement struct {
	RestrictMovement *VirtualMachineRestrictMovementState `json:"restrictMovement,omitempty"`
}

type VirtualMachineRestrictMovementState

type VirtualMachineRestrictMovementState string
const (
	VirtualMachineRestrictMovementStateDisabled VirtualMachineRestrictMovementState = "Disabled"
	VirtualMachineRestrictMovementStateEnabled  VirtualMachineRestrictMovementState = "Enabled"
)

func (*VirtualMachineRestrictMovementState) UnmarshalJSON

func (s *VirtualMachineRestrictMovementState) UnmarshalJSON(bytes []byte) error

type VirtualMachinesRestrictMovementOperationResponse

type VirtualMachinesRestrictMovementOperationResponse struct {
	Poller       pollers.Poller
	HttpResponse *http.Response
	OData        *odata.OData
}

Jump to

Keyboard shortcuts

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