jobs

package
v0.20230728.1102029 Latest Latest
Warning

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

Go to latest
Published: Jul 28, 2023 License: MPL-2.0 Imports: 12 Imported by: 0

README

github.com/hashicorp/go-azure-sdk/resource-manager/sql/2017-03-01-preview/jobs Documentation

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

Client Initialization

client := jobs.NewJobsClientWithBaseURI("https://management.azure.com")
client.Client.Authorizer = authorizer

Example Usage: JobsClient.CreateOrUpdate

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

payload := jobs.Job{
	// ...
}


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: JobsClient.Delete

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

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

Example Usage: JobsClient.Get

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

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

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

// alternatively `client.ListByAgent(ctx, id)` can be used to do batched pagination
items, err := client.ListByAgentComplete(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 PossibleValuesForJobScheduleType

func PossibleValuesForJobScheduleType() []string

func ValidateJobAgentID

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

ValidateJobAgentID checks that 'input' can be parsed as a Job Agent ID

func ValidateJobID

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

ValidateJobID checks that 'input' can be parsed as a Job ID

Types

type CreateOrUpdateOperationResponse

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

type DeleteOperationResponse

type DeleteOperationResponse struct {
	HttpResponse *http.Response
	OData        *odata.OData
}

type GetOperationResponse

type GetOperationResponse struct {
	HttpResponse *http.Response
	OData        *odata.OData
	Model        *Job
}

type Job

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

type JobAgentId

type JobAgentId struct {
	SubscriptionId    string
	ResourceGroupName string
	ServerName        string
	JobAgentName      string
}

JobAgentId is a struct representing the Resource ID for a Job Agent

func NewJobAgentID

func NewJobAgentID(subscriptionId string, resourceGroupName string, serverName string, jobAgentName string) JobAgentId

NewJobAgentID returns a new JobAgentId struct

func ParseJobAgentID

func ParseJobAgentID(input string) (*JobAgentId, error)

ParseJobAgentID parses 'input' into a JobAgentId

func ParseJobAgentIDInsensitively

func ParseJobAgentIDInsensitively(input string) (*JobAgentId, error)

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

func (JobAgentId) ID

func (id JobAgentId) ID() string

ID returns the formatted Job Agent ID

func (JobAgentId) Segments

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

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

func (JobAgentId) String

func (id JobAgentId) String() string

String returns a human-readable description of this Job Agent ID

type JobId

type JobId struct {
	SubscriptionId    string
	ResourceGroupName string
	ServerName        string
	JobAgentName      string
	JobName           string
}

JobId is a struct representing the Resource ID for a Job

func NewJobID

func NewJobID(subscriptionId string, resourceGroupName string, serverName string, jobAgentName string, jobName string) JobId

NewJobID returns a new JobId struct

func ParseJobID

func ParseJobID(input string) (*JobId, error)

ParseJobID parses 'input' into a JobId

func ParseJobIDInsensitively

func ParseJobIDInsensitively(input string) (*JobId, error)

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

func (JobId) ID

func (id JobId) ID() string

ID returns the formatted Job ID

func (JobId) Segments

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

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

func (JobId) String

func (id JobId) String() string

String returns a human-readable description of this Job ID

type JobOperationPredicate

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

func (JobOperationPredicate) Matches

func (p JobOperationPredicate) Matches(input Job) bool

type JobProperties

type JobProperties struct {
	Description *string      `json:"description,omitempty"`
	Schedule    *JobSchedule `json:"schedule,omitempty"`
	Version     *int64       `json:"version,omitempty"`
}

type JobSchedule

type JobSchedule struct {
	Enabled   *bool            `json:"enabled,omitempty"`
	EndTime   *string          `json:"endTime,omitempty"`
	Interval  *string          `json:"interval,omitempty"`
	StartTime *string          `json:"startTime,omitempty"`
	Type      *JobScheduleType `json:"type,omitempty"`
}

func (*JobSchedule) GetEndTimeAsTime

func (o *JobSchedule) GetEndTimeAsTime() (*time.Time, error)

func (*JobSchedule) GetStartTimeAsTime

func (o *JobSchedule) GetStartTimeAsTime() (*time.Time, error)

func (*JobSchedule) SetEndTimeAsTime

func (o *JobSchedule) SetEndTimeAsTime(input time.Time)

func (*JobSchedule) SetStartTimeAsTime

func (o *JobSchedule) SetStartTimeAsTime(input time.Time)

type JobScheduleType

type JobScheduleType string
const (
	JobScheduleTypeOnce      JobScheduleType = "Once"
	JobScheduleTypeRecurring JobScheduleType = "Recurring"
)

func (*JobScheduleType) UnmarshalJSON

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

type JobsClient

type JobsClient struct {
	Client *resourcemanager.Client
}

func NewJobsClientWithBaseURI

func NewJobsClientWithBaseURI(api environments.Api) (*JobsClient, error)

func (JobsClient) CreateOrUpdate

func (c JobsClient) CreateOrUpdate(ctx context.Context, id JobId, input Job) (result CreateOrUpdateOperationResponse, err error)

CreateOrUpdate ...

func (JobsClient) Delete

func (c JobsClient) Delete(ctx context.Context, id JobId) (result DeleteOperationResponse, err error)

Delete ...

func (JobsClient) Get

func (c JobsClient) Get(ctx context.Context, id JobId) (result GetOperationResponse, err error)

Get ...

func (JobsClient) ListByAgent

func (c JobsClient) ListByAgent(ctx context.Context, id JobAgentId) (result ListByAgentOperationResponse, err error)

ListByAgent ...

func (JobsClient) ListByAgentComplete

func (c JobsClient) ListByAgentComplete(ctx context.Context, id JobAgentId) (ListByAgentCompleteResult, error)

ListByAgentComplete retrieves all the results into a single object

func (JobsClient) ListByAgentCompleteMatchingPredicate

func (c JobsClient) ListByAgentCompleteMatchingPredicate(ctx context.Context, id JobAgentId, predicate JobOperationPredicate) (result ListByAgentCompleteResult, err error)

ListByAgentCompleteMatchingPredicate retrieves all the results and then applies the predicate

type ListByAgentCompleteResult

type ListByAgentCompleteResult struct {
	Items []Job
}

type ListByAgentOperationResponse

type ListByAgentOperationResponse struct {
	HttpResponse *http.Response
	OData        *odata.OData
	Model        *[]Job
}

Jump to

Keyboard shortcuts

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