clusters

package
v0.20240522.1080424 Latest Latest
Warning

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

Go to latest
Published: May 22, 2024 License: MPL-2.0 Imports: 15 Imported by: 1

README

github.com/hashicorp/go-azure-sdk/resource-manager/streamanalytics/2020-03-01/clusters Documentation

The clusters SDK allows for interaction with the Azure Resource Manager Service streamanalytics (API Version 2020-03-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/streamanalytics/2020-03-01/clusters"

Client Initialization

client := clusters.NewClustersClientWithBaseURI("https://management.azure.com")
client.Client.Authorizer = authorizer

Example Usage: ClustersClient.CreateOrUpdate

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

payload := clusters.Cluster{
	// ...
}


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

Example Usage: ClustersClient.Delete

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

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

Example Usage: ClustersClient.Get

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

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: ClustersClient.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: ClustersClient.ListBySubscription

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

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

Example Usage: ClustersClient.ListStreamingJobs

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

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

Example Usage: ClustersClient.Update

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

payload := clusters.Cluster{
	// ...
}


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

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func PossibleValuesForClusterProvisioningState

func PossibleValuesForClusterProvisioningState() []string

func PossibleValuesForClusterSkuName

func PossibleValuesForClusterSkuName() []string

func PossibleValuesForJobState

func PossibleValuesForJobState() []string

func ValidateClusterID

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

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

Types

type Cluster

type Cluster struct {
	Etag       *string            `json:"etag,omitempty"`
	Id         *string            `json:"id,omitempty"`
	Location   *string            `json:"location,omitempty"`
	Name       *string            `json:"name,omitempty"`
	Properties *ClusterProperties `json:"properties,omitempty"`
	Sku        *ClusterSku        `json:"sku,omitempty"`
	Tags       *map[string]string `json:"tags,omitempty"`
	Type       *string            `json:"type,omitempty"`
}

type ClusterId

type ClusterId struct {
	SubscriptionId    string
	ResourceGroupName string
	ClusterName       string
}

ClusterId is a struct representing the Resource ID for a Cluster

func NewClusterID

func NewClusterID(subscriptionId string, resourceGroupName 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 ClusterJob

type ClusterJob struct {
	Id             *string   `json:"id,omitempty"`
	JobState       *JobState `json:"jobState,omitempty"`
	StreamingUnits *int64    `json:"streamingUnits,omitempty"`
}

type ClusterJobOperationPredicate

type ClusterJobOperationPredicate struct {
	Id             *string
	StreamingUnits *int64
}

func (ClusterJobOperationPredicate) Matches

func (p ClusterJobOperationPredicate) Matches(input ClusterJob) bool

type ClusterOperationPredicate

type ClusterOperationPredicate struct {
	Etag     *string
	Id       *string
	Location *string
	Name     *string
	Type     *string
}

func (ClusterOperationPredicate) Matches

func (p ClusterOperationPredicate) Matches(input Cluster) bool

type ClusterProperties

type ClusterProperties struct {
	CapacityAllocated *int64                    `json:"capacityAllocated,omitempty"`
	CapacityAssigned  *int64                    `json:"capacityAssigned,omitempty"`
	ClusterId         *string                   `json:"clusterId,omitempty"`
	CreatedDate       *string                   `json:"createdDate,omitempty"`
	ProvisioningState *ClusterProvisioningState `json:"provisioningState,omitempty"`
}

func (*ClusterProperties) GetCreatedDateAsTime

func (o *ClusterProperties) GetCreatedDateAsTime() (*time.Time, error)

func (*ClusterProperties) SetCreatedDateAsTime

func (o *ClusterProperties) SetCreatedDateAsTime(input time.Time)

type ClusterProvisioningState

type ClusterProvisioningState string
const (
	ClusterProvisioningStateCanceled   ClusterProvisioningState = "Canceled"
	ClusterProvisioningStateFailed     ClusterProvisioningState = "Failed"
	ClusterProvisioningStateInProgress ClusterProvisioningState = "InProgress"
	ClusterProvisioningStateSucceeded  ClusterProvisioningState = "Succeeded"
)

func (*ClusterProvisioningState) UnmarshalJSON added in v0.20240208.1095436

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

type ClusterSku

type ClusterSku struct {
	Capacity *int64          `json:"capacity,omitempty"`
	Name     *ClusterSkuName `json:"name,omitempty"`
}

type ClusterSkuName

type ClusterSkuName string
const (
	ClusterSkuNameDefault ClusterSkuName = "Default"
)

func (*ClusterSkuName) UnmarshalJSON added in v0.20240208.1095436

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

type ClustersClient

type ClustersClient struct {
	Client *resourcemanager.Client
}

func NewClustersClientWithBaseURI

func NewClustersClientWithBaseURI(sdkApi sdkEnv.Api) (*ClustersClient, error)

func (ClustersClient) CreateOrUpdate

CreateOrUpdate ...

func (ClustersClient) CreateOrUpdateThenPoll

func (c ClustersClient) CreateOrUpdateThenPoll(ctx context.Context, id ClusterId, input Cluster, options CreateOrUpdateOperationOptions) error

CreateOrUpdateThenPoll performs CreateOrUpdate then polls until it's completed

func (ClustersClient) Delete

func (c ClustersClient) Delete(ctx context.Context, id ClusterId) (result DeleteOperationResponse, err error)

Delete ...

func (ClustersClient) DeleteThenPoll

func (c ClustersClient) DeleteThenPoll(ctx context.Context, id ClusterId) error

DeleteThenPoll performs Delete then polls until it's completed

func (ClustersClient) Get

func (c ClustersClient) Get(ctx context.Context, id ClusterId) (result GetOperationResponse, err error)

Get ...

func (ClustersClient) ListByResourceGroup

ListByResourceGroup ...

func (ClustersClient) ListByResourceGroupComplete

ListByResourceGroupComplete retrieves all the results into a single object

func (ClustersClient) ListByResourceGroupCompleteMatchingPredicate

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

ListByResourceGroupCompleteMatchingPredicate retrieves all the results and then applies the predicate

func (ClustersClient) ListBySubscription

ListBySubscription ...

func (ClustersClient) ListBySubscriptionComplete

ListBySubscriptionComplete retrieves all the results into a single object

func (ClustersClient) ListBySubscriptionCompleteMatchingPredicate

func (c ClustersClient) ListBySubscriptionCompleteMatchingPredicate(ctx context.Context, id commonids.SubscriptionId, predicate ClusterOperationPredicate) (result ListBySubscriptionCompleteResult, err error)

ListBySubscriptionCompleteMatchingPredicate retrieves all the results and then applies the predicate

func (ClustersClient) ListStreamingJobs

func (c ClustersClient) ListStreamingJobs(ctx context.Context, id ClusterId) (result ListStreamingJobsOperationResponse, err error)

ListStreamingJobs ...

func (ClustersClient) ListStreamingJobsComplete

func (c ClustersClient) ListStreamingJobsComplete(ctx context.Context, id ClusterId) (ListStreamingJobsCompleteResult, error)

ListStreamingJobsComplete retrieves all the results into a single object

func (ClustersClient) ListStreamingJobsCompleteMatchingPredicate

func (c ClustersClient) ListStreamingJobsCompleteMatchingPredicate(ctx context.Context, id ClusterId, predicate ClusterJobOperationPredicate) (result ListStreamingJobsCompleteResult, err error)

ListStreamingJobsCompleteMatchingPredicate retrieves all the results and then applies the predicate

func (ClustersClient) Update

func (c ClustersClient) Update(ctx context.Context, id ClusterId, input Cluster, options UpdateOperationOptions) (result UpdateOperationResponse, err error)

Update ...

func (ClustersClient) UpdateThenPoll

func (c ClustersClient) UpdateThenPoll(ctx context.Context, id ClusterId, input Cluster, options UpdateOperationOptions) error

UpdateThenPoll performs Update then polls until it's completed

type CreateOrUpdateOperationOptions

type CreateOrUpdateOperationOptions struct {
	IfMatch     *string
	IfNoneMatch *string
}

func DefaultCreateOrUpdateOperationOptions

func DefaultCreateOrUpdateOperationOptions() CreateOrUpdateOperationOptions

func (CreateOrUpdateOperationOptions) ToHeaders added in v0.20240208.1095436

func (CreateOrUpdateOperationOptions) ToOData added in v0.20240208.1095436

func (CreateOrUpdateOperationOptions) ToQuery added in v0.20240208.1095436

type CreateOrUpdateOperationResponse

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

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

type JobState

type JobState string
const (
	JobStateCreated    JobState = "Created"
	JobStateDegraded   JobState = "Degraded"
	JobStateDeleting   JobState = "Deleting"
	JobStateFailed     JobState = "Failed"
	JobStateRestarting JobState = "Restarting"
	JobStateRunning    JobState = "Running"
	JobStateScaling    JobState = "Scaling"
	JobStateStarting   JobState = "Starting"
	JobStateStopped    JobState = "Stopped"
	JobStateStopping   JobState = "Stopping"
)

func (*JobState) UnmarshalJSON added in v0.20240208.1095436

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

type ListByResourceGroupCompleteResult

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

type ListByResourceGroupOperationResponse

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

type ListBySubscriptionCompleteResult

type ListBySubscriptionCompleteResult struct {
	LatestHttpResponse *http.Response
	Items              []Cluster
}

type ListBySubscriptionOperationResponse

type ListBySubscriptionOperationResponse struct {
	HttpResponse *http.Response
	OData        *odata.OData
	Model        *[]Cluster
}

type ListStreamingJobsCompleteResult

type ListStreamingJobsCompleteResult struct {
	LatestHttpResponse *http.Response
	Items              []ClusterJob
}

type ListStreamingJobsOperationResponse

type ListStreamingJobsOperationResponse struct {
	HttpResponse *http.Response
	OData        *odata.OData
	Model        *[]ClusterJob
}

type UpdateOperationOptions

type UpdateOperationOptions struct {
	IfMatch *string
}

func DefaultUpdateOperationOptions

func DefaultUpdateOperationOptions() UpdateOperationOptions

func (UpdateOperationOptions) ToHeaders added in v0.20240208.1095436

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

func (UpdateOperationOptions) ToOData added in v0.20240208.1095436

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

func (UpdateOperationOptions) ToQuery added in v0.20240208.1095436

type UpdateOperationResponse

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

Jump to

Keyboard shortcuts

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