hosts

package
v0.20240923.1142107 Latest Latest
Warning

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

Go to latest
Published: Sep 23, 2024 License: MPL-2.0 Imports: 16 Imported by: 0

README

github.com/hashicorp/go-azure-sdk/resource-manager/connectedvmware/2023-12-01/hosts Documentation

The hosts SDK allows for interaction with Azure Resource Manager connectedvmware (API Version 2023-12-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-helpers/resourcemanager/commonids"
import "github.com/hashicorp/go-azure-sdk/resource-manager/connectedvmware/2023-12-01/hosts"

Client Initialization

client := hosts.NewHostsClientWithBaseURI("https://management.azure.com")
client.Client.Authorizer = authorizer

Example Usage: HostsClient.Create

ctx := context.TODO()
id := hosts.NewHostID("12345678-1234-9876-4563-123456789012", "example-resource-group", "hostName")

payload := hosts.Host{
	// ...
}


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

Example Usage: HostsClient.Delete

ctx := context.TODO()
id := hosts.NewHostID("12345678-1234-9876-4563-123456789012", "example-resource-group", "hostName")

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

Example Usage: HostsClient.Get

ctx := context.TODO()
id := hosts.NewHostID("12345678-1234-9876-4563-123456789012", "example-resource-group", "hostName")

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: HostsClient.List

ctx := context.TODO()
id := commonids.NewSubscriptionID("12345678-1234-9876-4563-123456789012")

// 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: HostsClient.ListByResourceGroup

ctx := context.TODO()
id := commonids.NewResourceGroupID("12345678-1234-9876-4563-123456789012", "example-resource-group")

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

Example Usage: HostsClient.Update

ctx := context.TODO()
id := hosts.NewHostID("12345678-1234-9876-4563-123456789012", "example-resource-group", "hostName")

payload := hosts.ResourcePatch{
	// ...
}


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

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func PossibleValuesForProvisioningState

func PossibleValuesForProvisioningState() []string

func ValidateHostID

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

ValidateHostID checks that 'input' can be parsed as a Host ID

Types

type CreateOperationResponse

type CreateOperationResponse struct {
	Poller       pollers.Poller
	HttpResponse *http.Response
	OData        *odata.OData
	Model        *Host
}

type DeleteOperationOptions

type DeleteOperationOptions struct {
	Force *bool
}

func DefaultDeleteOperationOptions

func DefaultDeleteOperationOptions() DeleteOperationOptions

func (DeleteOperationOptions) ToHeaders

func (o DeleteOperationOptions) ToHeaders() *client.Headers

func (DeleteOperationOptions) ToOData

func (o DeleteOperationOptions) ToOData() *odata.Query

func (DeleteOperationOptions) ToQuery

type DeleteOperationResponse

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

type ExtendedLocation

type ExtendedLocation struct {
	Name *string `json:"name,omitempty"`
	Type *string `json:"type,omitempty"`
}

type GetOperationResponse

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

type Host

type Host struct {
	ExtendedLocation *ExtendedLocation      `json:"extendedLocation,omitempty"`
	Id               *string                `json:"id,omitempty"`
	Kind             *string                `json:"kind,omitempty"`
	Location         string                 `json:"location"`
	Name             *string                `json:"name,omitempty"`
	Properties       HostProperties         `json:"properties"`
	SystemData       *systemdata.SystemData `json:"systemData,omitempty"`
	Tags             *map[string]string     `json:"tags,omitempty"`
	Type             *string                `json:"type,omitempty"`
}

type HostId

type HostId struct {
	SubscriptionId    string
	ResourceGroupName string
	HostName          string
}

HostId is a struct representing the Resource ID for a Host

func NewHostID

func NewHostID(subscriptionId string, resourceGroupName string, hostName string) HostId

NewHostID returns a new HostId struct

func ParseHostID

func ParseHostID(input string) (*HostId, error)

ParseHostID parses 'input' into a HostId

func ParseHostIDInsensitively

func ParseHostIDInsensitively(input string) (*HostId, error)

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

func (*HostId) FromParseResult

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

func (HostId) ID

func (id HostId) ID() string

ID returns the formatted Host ID

func (HostId) Segments

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

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

func (HostId) String

func (id HostId) String() string

String returns a human-readable description of this Host ID

type HostOperationPredicate

type HostOperationPredicate struct {
	Id       *string
	Kind     *string
	Location *string
	Name     *string
	Type     *string
}

func (HostOperationPredicate) Matches

func (p HostOperationPredicate) Matches(input Host) bool

type HostProperties

type HostProperties struct {
	CpuMhz               *int64             `json:"cpuMhz,omitempty"`
	CustomResourceName   *string            `json:"customResourceName,omitempty"`
	DatastoreIds         *[]string          `json:"datastoreIds,omitempty"`
	InventoryItemId      *string            `json:"inventoryItemId,omitempty"`
	MemorySizeGB         *int64             `json:"memorySizeGB,omitempty"`
	MoName               *string            `json:"moName,omitempty"`
	MoRefId              *string            `json:"moRefId,omitempty"`
	NetworkIds           *[]string          `json:"networkIds,omitempty"`
	OverallCPUUsageMHz   *int64             `json:"overallCpuUsageMHz,omitempty"`
	OverallMemoryUsageGB *int64             `json:"overallMemoryUsageGB,omitempty"`
	ProvisioningState    *ProvisioningState `json:"provisioningState,omitempty"`
	Statuses             *[]ResourceStatus  `json:"statuses,omitempty"`
	Uuid                 *string            `json:"uuid,omitempty"`
	VCenterId            *string            `json:"vCenterId,omitempty"`
}

type HostsClient

type HostsClient struct {
	Client *resourcemanager.Client
}

func NewHostsClientWithBaseURI

func NewHostsClientWithBaseURI(sdkApi sdkEnv.Api) (*HostsClient, error)

func (HostsClient) Create

func (c HostsClient) Create(ctx context.Context, id HostId, input Host) (result CreateOperationResponse, err error)

Create ...

func (HostsClient) CreateThenPoll

func (c HostsClient) CreateThenPoll(ctx context.Context, id HostId, input Host) error

CreateThenPoll performs Create then polls until it's completed

func (HostsClient) Delete

func (c HostsClient) Delete(ctx context.Context, id HostId, options DeleteOperationOptions) (result DeleteOperationResponse, err error)

Delete ...

func (HostsClient) DeleteThenPoll

func (c HostsClient) DeleteThenPoll(ctx context.Context, id HostId, options DeleteOperationOptions) error

DeleteThenPoll performs Delete then polls until it's completed

func (HostsClient) Get

func (c HostsClient) Get(ctx context.Context, id HostId) (result GetOperationResponse, err error)

Get ...

func (HostsClient) List

List ...

func (HostsClient) ListByResourceGroup

func (c HostsClient) ListByResourceGroup(ctx context.Context, id commonids.ResourceGroupId) (result ListByResourceGroupOperationResponse, err error)

ListByResourceGroup ...

func (HostsClient) ListByResourceGroupComplete

ListByResourceGroupComplete retrieves all the results into a single object

func (HostsClient) ListByResourceGroupCompleteMatchingPredicate

func (c HostsClient) ListByResourceGroupCompleteMatchingPredicate(ctx context.Context, id commonids.ResourceGroupId, predicate HostOperationPredicate) (result ListByResourceGroupCompleteResult, err error)

ListByResourceGroupCompleteMatchingPredicate retrieves all the results and then applies the predicate

func (HostsClient) ListComplete

ListComplete retrieves all the results into a single object

func (HostsClient) ListCompleteMatchingPredicate

func (c HostsClient) ListCompleteMatchingPredicate(ctx context.Context, id commonids.SubscriptionId, predicate HostOperationPredicate) (result ListCompleteResult, err error)

ListCompleteMatchingPredicate retrieves all the results and then applies the predicate

func (HostsClient) Update

func (c HostsClient) Update(ctx context.Context, id HostId, input ResourcePatch) (result UpdateOperationResponse, err error)

Update ...

type ListByResourceGroupCompleteResult

type ListByResourceGroupCompleteResult struct {
	LatestHttpResponse *http.Response
	Items              []Host
}

type ListByResourceGroupCustomPager added in v0.20240628.1153531

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

type ListByResourceGroupOperationResponse

type ListByResourceGroupOperationResponse struct {
	HttpResponse *http.Response
	OData        *odata.OData
	Model        *[]Host
}

type ListCompleteResult

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

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        *[]Host
}

type ProvisioningState

type ProvisioningState string
const (
	ProvisioningStateAccepted     ProvisioningState = "Accepted"
	ProvisioningStateCanceled     ProvisioningState = "Canceled"
	ProvisioningStateCreated      ProvisioningState = "Created"
	ProvisioningStateDeleting     ProvisioningState = "Deleting"
	ProvisioningStateFailed       ProvisioningState = "Failed"
	ProvisioningStateProvisioning ProvisioningState = "Provisioning"
	ProvisioningStateSucceeded    ProvisioningState = "Succeeded"
	ProvisioningStateUpdating     ProvisioningState = "Updating"
)

func (*ProvisioningState) UnmarshalJSON

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

type ResourcePatch

type ResourcePatch struct {
	Tags *map[string]string `json:"tags,omitempty"`
}

type ResourceStatus

type ResourceStatus struct {
	LastUpdatedAt *string `json:"lastUpdatedAt,omitempty"`
	Message       *string `json:"message,omitempty"`
	Reason        *string `json:"reason,omitempty"`
	Severity      *string `json:"severity,omitempty"`
	Status        *string `json:"status,omitempty"`
	Type          *string `json:"type,omitempty"`
}

func (*ResourceStatus) GetLastUpdatedAtAsTime

func (o *ResourceStatus) GetLastUpdatedAtAsTime() (*time.Time, error)

func (*ResourceStatus) SetLastUpdatedAtAsTime

func (o *ResourceStatus) SetLastUpdatedAtAsTime(input time.Time)

type UpdateOperationResponse

type UpdateOperationResponse struct {
	HttpResponse *http.Response
	OData        *odata.OData
	Model        *Host
}

Jump to

Keyboard shortcuts

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