agents

package
v0.20240320.1143605 Latest Latest
Warning

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

Go to latest
Published: Mar 20, 2024 License: MPL-2.0 Imports: 14 Imported by: 1

README

github.com/hashicorp/go-azure-sdk/resource-manager/storagemover/2023-10-01/agents Documentation

The agents SDK allows for interaction with the Azure Resource Manager Service storagemover (API Version 2023-10-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/storagemover/2023-10-01/agents"

Client Initialization

client := agents.NewAgentsClientWithBaseURI("https://management.azure.com")
client.Client.Authorizer = authorizer

Example Usage: AgentsClient.CreateOrUpdate

ctx := context.TODO()
id := agents.NewAgentID("12345678-1234-9876-4563-123456789012", "example-resource-group", "storageMoverValue", "agentValue")

payload := agents.Agent{
	// ...
}


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

Example Usage: AgentsClient.Delete

ctx := context.TODO()
id := agents.NewAgentID("12345678-1234-9876-4563-123456789012", "example-resource-group", "storageMoverValue", "agentValue")

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

Example Usage: AgentsClient.Get

ctx := context.TODO()
id := agents.NewAgentID("12345678-1234-9876-4563-123456789012", "example-resource-group", "storageMoverValue", "agentValue")

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

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

// 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: AgentsClient.Update

ctx := context.TODO()
id := agents.NewAgentID("12345678-1234-9876-4563-123456789012", "example-resource-group", "storageMoverValue", "agentValue")

payload := agents.AgentUpdateParameters{
	// ...
}


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 PossibleValuesForAgentStatus

func PossibleValuesForAgentStatus() []string

func PossibleValuesForProvisioningState

func PossibleValuesForProvisioningState() []string

func ValidateAgentID

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

ValidateAgentID checks that 'input' can be parsed as a Agent ID

func ValidateStorageMoverID

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

ValidateStorageMoverID checks that 'input' can be parsed as a Storage Mover ID

Types

type Agent

type Agent struct {
	Id         *string                `json:"id,omitempty"`
	Name       *string                `json:"name,omitempty"`
	Properties AgentProperties        `json:"properties"`
	SystemData *systemdata.SystemData `json:"systemData,omitempty"`
	Type       *string                `json:"type,omitempty"`
}

type AgentId

type AgentId struct {
	SubscriptionId    string
	ResourceGroupName string
	StorageMoverName  string
	AgentName         string
}

AgentId is a struct representing the Resource ID for a Agent

func NewAgentID

func NewAgentID(subscriptionId string, resourceGroupName string, storageMoverName string, agentName string) AgentId

NewAgentID returns a new AgentId struct

func ParseAgentID

func ParseAgentID(input string) (*AgentId, error)

ParseAgentID parses 'input' into a AgentId

func ParseAgentIDInsensitively

func ParseAgentIDInsensitively(input string) (*AgentId, error)

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

func (*AgentId) FromParseResult

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

func (AgentId) ID

func (id AgentId) ID() string

ID returns the formatted Agent ID

func (AgentId) Segments

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

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

func (AgentId) String

func (id AgentId) String() string

String returns a human-readable description of this Agent ID

type AgentOperationPredicate

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

func (AgentOperationPredicate) Matches

func (p AgentOperationPredicate) Matches(input Agent) bool

type AgentProperties

type AgentProperties struct {
	AgentStatus       *AgentStatus                 `json:"agentStatus,omitempty"`
	AgentVersion      *string                      `json:"agentVersion,omitempty"`
	ArcResourceId     string                       `json:"arcResourceId"`
	ArcVMUuid         string                       `json:"arcVmUuid"`
	Description       *string                      `json:"description,omitempty"`
	ErrorDetails      *AgentPropertiesErrorDetails `json:"errorDetails,omitempty"`
	LastStatusUpdate  *string                      `json:"lastStatusUpdate,omitempty"`
	LocalIPAddress    *string                      `json:"localIPAddress,omitempty"`
	MemoryInMB        *int64                       `json:"memoryInMB,omitempty"`
	NumberOfCores     *int64                       `json:"numberOfCores,omitempty"`
	ProvisioningState *ProvisioningState           `json:"provisioningState,omitempty"`
	UptimeInSeconds   *int64                       `json:"uptimeInSeconds,omitempty"`
}

func (*AgentProperties) GetLastStatusUpdateAsTime

func (o *AgentProperties) GetLastStatusUpdateAsTime() (*time.Time, error)

func (*AgentProperties) SetLastStatusUpdateAsTime

func (o *AgentProperties) SetLastStatusUpdateAsTime(input time.Time)

type AgentPropertiesErrorDetails

type AgentPropertiesErrorDetails struct {
	Code    *string `json:"code,omitempty"`
	Message *string `json:"message,omitempty"`
}

type AgentStatus

type AgentStatus string
const (
	AgentStatusExecuting         AgentStatus = "Executing"
	AgentStatusOffline           AgentStatus = "Offline"
	AgentStatusOnline            AgentStatus = "Online"
	AgentStatusRegistering       AgentStatus = "Registering"
	AgentStatusRequiresAttention AgentStatus = "RequiresAttention"
	AgentStatusUnregistering     AgentStatus = "Unregistering"
)

func (*AgentStatus) UnmarshalJSON

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

type AgentUpdateParameters

type AgentUpdateParameters struct {
	Properties *AgentUpdateProperties `json:"properties,omitempty"`
}

type AgentUpdateProperties

type AgentUpdateProperties struct {
	Description *string `json:"description,omitempty"`
}

type AgentsClient

type AgentsClient struct {
	Client *resourcemanager.Client
}

func NewAgentsClientWithBaseURI

func NewAgentsClientWithBaseURI(sdkApi sdkEnv.Api) (*AgentsClient, error)

func (AgentsClient) CreateOrUpdate

func (c AgentsClient) CreateOrUpdate(ctx context.Context, id AgentId, input Agent) (result CreateOrUpdateOperationResponse, err error)

CreateOrUpdate ...

func (AgentsClient) Delete

func (c AgentsClient) Delete(ctx context.Context, id AgentId) (result DeleteOperationResponse, err error)

Delete ...

func (AgentsClient) DeleteThenPoll

func (c AgentsClient) DeleteThenPoll(ctx context.Context, id AgentId) error

DeleteThenPoll performs Delete then polls until it's completed

func (AgentsClient) Get

func (c AgentsClient) Get(ctx context.Context, id AgentId) (result GetOperationResponse, err error)

Get ...

func (AgentsClient) List

func (c AgentsClient) List(ctx context.Context, id StorageMoverId) (result ListOperationResponse, err error)

List ...

func (AgentsClient) ListComplete

ListComplete retrieves all the results into a single object

func (AgentsClient) ListCompleteMatchingPredicate

func (c AgentsClient) ListCompleteMatchingPredicate(ctx context.Context, id StorageMoverId, predicate AgentOperationPredicate) (result ListCompleteResult, err error)

ListCompleteMatchingPredicate retrieves all the results and then applies the predicate

func (AgentsClient) Update

Update ...

type CreateOrUpdateOperationResponse

type CreateOrUpdateOperationResponse struct {
	HttpResponse *http.Response
	OData        *odata.OData
	Model        *Agent
}

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        *Agent
}

type ListCompleteResult

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

type ListOperationResponse

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

type ProvisioningState

type ProvisioningState string
const (
	ProvisioningStateSucceeded ProvisioningState = "Succeeded"
)

func (*ProvisioningState) UnmarshalJSON

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

type StorageMoverId

type StorageMoverId struct {
	SubscriptionId    string
	ResourceGroupName string
	StorageMoverName  string
}

StorageMoverId is a struct representing the Resource ID for a Storage Mover

func NewStorageMoverID

func NewStorageMoverID(subscriptionId string, resourceGroupName string, storageMoverName string) StorageMoverId

NewStorageMoverID returns a new StorageMoverId struct

func ParseStorageMoverID

func ParseStorageMoverID(input string) (*StorageMoverId, error)

ParseStorageMoverID parses 'input' into a StorageMoverId

func ParseStorageMoverIDInsensitively

func ParseStorageMoverIDInsensitively(input string) (*StorageMoverId, error)

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

func (*StorageMoverId) FromParseResult

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

func (StorageMoverId) ID

func (id StorageMoverId) ID() string

ID returns the formatted Storage Mover ID

func (StorageMoverId) Segments

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

Segments returns a slice of Resource ID Segments which comprise this Storage Mover ID

func (StorageMoverId) String

func (id StorageMoverId) String() string

String returns a human-readable description of this Storage Mover ID

type UpdateOperationResponse

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

Jump to

Keyboard shortcuts

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