package
0.20240715.1103416
Repository: https://github.com/hashicorp/go-azure-sdk.git
Documentation: pkg.go.dev

# README

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

The jobexecutions SDK allows for interaction with the Azure Resource Manager Service sql (API Version 2023-02-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/2023-02-01-preview/jobexecutions"

Client Initialization

client := jobexecutions.NewJobExecutionsClientWithBaseURI("https://management.azure.com")
client.Client.Authorizer = authorizer

Example Usage: JobExecutionsClient.Cancel

ctx := context.TODO()
id := jobexecutions.NewExecutionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serverValue", "jobAgentValue", "jobValue", "jobExecutionIdValue")

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

Example Usage: JobExecutionsClient.Create

ctx := context.TODO()
id := jobexecutions.NewJobID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serverValue", "jobAgentValue", "jobValue")

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

Example Usage: JobExecutionsClient.CreateOrUpdate

ctx := context.TODO()
id := jobexecutions.NewExecutionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serverValue", "jobAgentValue", "jobValue", "jobExecutionIdValue")

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

Example Usage: JobExecutionsClient.Get

ctx := context.TODO()
id := jobexecutions.NewExecutionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serverValue", "jobAgentValue", "jobValue", "jobExecutionIdValue")

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: JobExecutionsClient.ListByAgent

ctx := context.TODO()
id := jobexecutions.NewJobAgentID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serverValue", "jobAgentValue")

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

Example Usage: JobExecutionsClient.ListByJob

ctx := context.TODO()
id := jobexecutions.NewJobID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serverValue", "jobAgentValue", "jobValue")

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