workloadgroups

package
v0.20240223.1130721 Latest Latest
Warning

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

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

README

github.com/hashicorp/go-azure-sdk/resource-manager/sql/2023-05-01-preview/workloadgroups Documentation

The workloadgroups SDK allows for interaction with the Azure Resource Manager Service sql (API Version 2023-05-01-preview).

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/sql/2023-05-01-preview/workloadgroups"

Client Initialization

client := workloadgroups.NewWorkloadGroupsClientWithBaseURI("https://management.azure.com")
client.Client.Authorizer = authorizer

Example Usage: WorkloadGroupsClient.CreateOrUpdate

ctx := context.TODO()
id := workloadgroups.NewWorkloadGroupID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serverValue", "databaseValue", "workloadGroupValue")

payload := workloadgroups.WorkloadGroup{
	// ...
}


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

Example Usage: WorkloadGroupsClient.Delete

ctx := context.TODO()
id := workloadgroups.NewWorkloadGroupID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serverValue", "databaseValue", "workloadGroupValue")

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

Example Usage: WorkloadGroupsClient.Get

ctx := context.TODO()
id := workloadgroups.NewWorkloadGroupID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serverValue", "databaseValue", "workloadGroupValue")

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: WorkloadGroupsClient.ListByDatabase

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

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

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ValidateWorkloadGroupID

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

ValidateWorkloadGroupID checks that 'input' can be parsed as a Workload Group ID

Types

type CreateOrUpdateOperationResponse

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

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

type ListByDatabaseCompleteResult

type ListByDatabaseCompleteResult struct {
	LatestHttpResponse *http.Response
	Items              []WorkloadGroup
}

type ListByDatabaseOperationResponse

type ListByDatabaseOperationResponse struct {
	HttpResponse *http.Response
	OData        *odata.OData
	Model        *[]WorkloadGroup
}

type WorkloadGroup

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

type WorkloadGroupId

type WorkloadGroupId struct {
	SubscriptionId    string
	ResourceGroupName string
	ServerName        string
	DatabaseName      string
	WorkloadGroupName string
}

WorkloadGroupId is a struct representing the Resource ID for a Workload Group

func NewWorkloadGroupID

func NewWorkloadGroupID(subscriptionId string, resourceGroupName string, serverName string, databaseName string, workloadGroupName string) WorkloadGroupId

NewWorkloadGroupID returns a new WorkloadGroupId struct

func ParseWorkloadGroupID

func ParseWorkloadGroupID(input string) (*WorkloadGroupId, error)

ParseWorkloadGroupID parses 'input' into a WorkloadGroupId

func ParseWorkloadGroupIDInsensitively

func ParseWorkloadGroupIDInsensitively(input string) (*WorkloadGroupId, error)

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

func (*WorkloadGroupId) FromParseResult

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

func (WorkloadGroupId) ID

func (id WorkloadGroupId) ID() string

ID returns the formatted Workload Group ID

func (WorkloadGroupId) Segments

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

Segments returns a slice of Resource ID Segments which comprise this Workload Group ID

func (WorkloadGroupId) String

func (id WorkloadGroupId) String() string

String returns a human-readable description of this Workload Group ID

type WorkloadGroupOperationPredicate

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

func (WorkloadGroupOperationPredicate) Matches

type WorkloadGroupProperties

type WorkloadGroupProperties struct {
	Importance                   *string  `json:"importance,omitempty"`
	MaxResourcePercent           int64    `json:"maxResourcePercent"`
	MaxResourcePercentPerRequest *float64 `json:"maxResourcePercentPerRequest,omitempty"`
	MinResourcePercent           int64    `json:"minResourcePercent"`
	MinResourcePercentPerRequest float64  `json:"minResourcePercentPerRequest"`
	QueryExecutionTimeout        *int64   `json:"queryExecutionTimeout,omitempty"`
}

type WorkloadGroupsClient

type WorkloadGroupsClient struct {
	Client *resourcemanager.Client
}

func NewWorkloadGroupsClientWithBaseURI

func NewWorkloadGroupsClientWithBaseURI(sdkApi sdkEnv.Api) (*WorkloadGroupsClient, error)

func (WorkloadGroupsClient) CreateOrUpdate

CreateOrUpdate ...

func (WorkloadGroupsClient) CreateOrUpdateThenPoll

func (c WorkloadGroupsClient) CreateOrUpdateThenPoll(ctx context.Context, id WorkloadGroupId, input WorkloadGroup) error

CreateOrUpdateThenPoll performs CreateOrUpdate then polls until it's completed

func (WorkloadGroupsClient) Delete

Delete ...

func (WorkloadGroupsClient) DeleteThenPoll

func (c WorkloadGroupsClient) DeleteThenPoll(ctx context.Context, id WorkloadGroupId) error

DeleteThenPoll performs Delete then polls until it's completed

func (WorkloadGroupsClient) Get

Get ...

func (WorkloadGroupsClient) ListByDatabase

ListByDatabase ...

func (WorkloadGroupsClient) ListByDatabaseComplete

ListByDatabaseComplete retrieves all the results into a single object

func (WorkloadGroupsClient) ListByDatabaseCompleteMatchingPredicate

func (c WorkloadGroupsClient) ListByDatabaseCompleteMatchingPredicate(ctx context.Context, id commonids.SqlDatabaseId, predicate WorkloadGroupOperationPredicate) (result ListByDatabaseCompleteResult, err error)

ListByDatabaseCompleteMatchingPredicate retrieves all the results and then applies the predicate

Jump to

Keyboard shortcuts

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