workloadgroups

package
v0.20230804.1074947 Latest Latest
Warning

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

Go to latest
Published: Aug 4, 2023 License: MPL-2.0 Imports: 10 Imported by: 0

README

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

The workloadgroups SDK allows for interaction with the Azure Resource Manager Service sql (API Version 2022-11-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-sdk/resource-manager/sql/2022-11-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 := workloadgroups.NewDatabaseID("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 ValidateDatabaseID

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

ValidateDatabaseID checks that 'input' can be parsed as a Database ID

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
}

type DatabaseId

type DatabaseId struct {
	SubscriptionId    string
	ResourceGroupName string
	ServerName        string
	DatabaseName      string
}

DatabaseId is a struct representing the Resource ID for a Database

func NewDatabaseID

func NewDatabaseID(subscriptionId string, resourceGroupName string, serverName string, databaseName string) DatabaseId

NewDatabaseID returns a new DatabaseId struct

func ParseDatabaseID

func ParseDatabaseID(input string) (*DatabaseId, error)

ParseDatabaseID parses 'input' into a DatabaseId

func ParseDatabaseIDInsensitively

func ParseDatabaseIDInsensitively(input string) (*DatabaseId, error)

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

func (DatabaseId) ID

func (id DatabaseId) ID() string

ID returns the formatted Database ID

func (DatabaseId) Segments

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

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

func (DatabaseId) String

func (id DatabaseId) String() string

String returns a human-readable description of this Database ID

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 {
	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) 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

func (c WorkloadGroupsClient) ListByDatabase(ctx context.Context, id DatabaseId) (result ListByDatabaseOperationResponse, err error)

ListByDatabase ...

func (WorkloadGroupsClient) ListByDatabaseComplete

ListByDatabaseComplete retrieves all the results into a single object

func (WorkloadGroupsClient) ListByDatabaseCompleteMatchingPredicate

func (c WorkloadGroupsClient) ListByDatabaseCompleteMatchingPredicate(ctx context.Context, id DatabaseId, 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