job

package
v0.20230216.1112535 Latest Latest
Warning

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

Go to latest
Published: Feb 16, 2023 License: MPL-2.0 Imports: 10 Imported by: 1

README

github.com/hashicorp/go-azure-sdk/resource-manager/automation/2015-10-31/job Documentation

The job SDK allows for interaction with the Azure Resource Manager Service automation (API Version 2015-10-31).

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/automation/2015-10-31/job"

Client Initialization

client := job.NewJobClientWithBaseURI("https://management.azure.com")
client.Client.Authorizer = authorizer

Example Usage: JobClient.Create

ctx := context.TODO()
id := job.NewJobID("12345678-1234-9876-4563-123456789012", "example-resource-group", "automationAccountValue", "jobIdValue")

payload := job.JobCreateParameters{
	// ...
}


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

Example Usage: JobClient.Get

ctx := context.TODO()
id := job.NewJobID("12345678-1234-9876-4563-123456789012", "example-resource-group", "automationAccountValue", "jobIdValue")

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: JobClient.GetOutput

ctx := context.TODO()
id := job.NewJobID("12345678-1234-9876-4563-123456789012", "example-resource-group", "automationAccountValue", "jobIdValue")

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

Example Usage: JobClient.GetRunbookContent

ctx := context.TODO()
id := job.NewJobID("12345678-1234-9876-4563-123456789012", "example-resource-group", "automationAccountValue", "jobIdValue")

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

Example Usage: JobClient.ListByAutomationAccount

ctx := context.TODO()
id := job.NewAutomationAccountID("12345678-1234-9876-4563-123456789012", "example-resource-group", "automationAccountValue")

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

Example Usage: JobClient.Resume

ctx := context.TODO()
id := job.NewJobID("12345678-1234-9876-4563-123456789012", "example-resource-group", "automationAccountValue", "jobIdValue")

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

Example Usage: JobClient.Stop

ctx := context.TODO()
id := job.NewJobID("12345678-1234-9876-4563-123456789012", "example-resource-group", "automationAccountValue", "jobIdValue")

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

Example Usage: JobClient.Suspend

ctx := context.TODO()
id := job.NewJobID("12345678-1234-9876-4563-123456789012", "example-resource-group", "automationAccountValue", "jobIdValue")

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

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func PossibleValuesForJobProvisioningState

func PossibleValuesForJobProvisioningState() []string

func PossibleValuesForJobStatus

func PossibleValuesForJobStatus() []string

func ValidateAutomationAccountID

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

ValidateAutomationAccountID checks that 'input' can be parsed as a Automation Account 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 AutomationAccountId

type AutomationAccountId struct {
	SubscriptionId        string
	ResourceGroupName     string
	AutomationAccountName string
}

AutomationAccountId is a struct representing the Resource ID for a Automation Account

func NewAutomationAccountID

func NewAutomationAccountID(subscriptionId string, resourceGroupName string, automationAccountName string) AutomationAccountId

NewAutomationAccountID returns a new AutomationAccountId struct

func ParseAutomationAccountID

func ParseAutomationAccountID(input string) (*AutomationAccountId, error)

ParseAutomationAccountID parses 'input' into a AutomationAccountId

func ParseAutomationAccountIDInsensitively

func ParseAutomationAccountIDInsensitively(input string) (*AutomationAccountId, error)

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

func (AutomationAccountId) ID

func (id AutomationAccountId) ID() string

ID returns the formatted Automation Account ID

func (AutomationAccountId) Segments

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

Segments returns a slice of Resource ID Segments which comprise this Automation Account ID

func (AutomationAccountId) String

func (id AutomationAccountId) String() string

String returns a human-readable description of this Automation Account ID

type CreateOperationResponse

type CreateOperationResponse struct {
	HttpResponse *http.Response
	Model        *Job
}

type GetOperationResponse

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

type GetOutputOperationResponse

type GetOutputOperationResponse struct {
	HttpResponse *http.Response
	Model        *[]byte
}

type GetRunbookContentOperationResponse

type GetRunbookContentOperationResponse struct {
	HttpResponse *http.Response
	Model        *[]byte
}

type Job

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

type JobClient

type JobClient struct {
	Client autorest.Client
	// contains filtered or unexported fields
}

func NewJobClientWithBaseURI

func NewJobClientWithBaseURI(endpoint string) JobClient

func (JobClient) Create

func (c JobClient) Create(ctx context.Context, id JobId, input JobCreateParameters) (result CreateOperationResponse, err error)

Create ...

func (JobClient) Get

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

Get ...

func (JobClient) GetOutput

func (c JobClient) GetOutput(ctx context.Context, id JobId) (result GetOutputOperationResponse, err error)

GetOutput ...

func (JobClient) GetRunbookContent

func (c JobClient) GetRunbookContent(ctx context.Context, id JobId) (result GetRunbookContentOperationResponse, err error)

GetRunbookContent ...

func (JobClient) ListByAutomationAccount

ListByAutomationAccount ...

func (JobClient) ListByAutomationAccountComplete

ListByAutomationAccountComplete retrieves all of the results into a single object

func (JobClient) ListByAutomationAccountCompleteMatchingPredicate

func (c JobClient) ListByAutomationAccountCompleteMatchingPredicate(ctx context.Context, id AutomationAccountId, options ListByAutomationAccountOperationOptions, predicate JobOperationPredicate) (resp ListByAutomationAccountCompleteResult, err error)

ListByAutomationAccountCompleteMatchingPredicate retrieves all of the results and then applied the predicate

func (JobClient) Resume

func (c JobClient) Resume(ctx context.Context, id JobId) (result ResumeOperationResponse, err error)

Resume ...

func (JobClient) Stop

func (c JobClient) Stop(ctx context.Context, id JobId) (result StopOperationResponse, err error)

Stop ...

func (JobClient) Suspend

func (c JobClient) Suspend(ctx context.Context, id JobId) (result SuspendOperationResponse, err error)

Suspend ...

type JobCreateParameters

type JobCreateParameters struct {
	Properties JobCreateProperties `json:"properties"`
}

type JobCreateProperties

type JobCreateProperties struct {
	Parameters *map[string]string         `json:"parameters,omitempty"`
	RunOn      *string                    `json:"runOn,omitempty"`
	Runbook    RunbookAssociationProperty `json:"runbook"`
}

type JobId

type JobId struct {
	SubscriptionId        string
	ResourceGroupName     string
	AutomationAccountName string
	JobId                 string
}

JobId is a struct representing the Resource ID for a Job

func NewJobID

func NewJobID(subscriptionId string, resourceGroupName string, automationAccountName string, jobId 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
}

func (JobOperationPredicate) Matches

func (p JobOperationPredicate) Matches(input Job) bool

type JobProperties

type JobProperties struct {
	CreationTime           *string                      `json:"creationTime,omitempty"`
	EndTime                *string                      `json:"endTime,omitempty"`
	Exception              *string                      `json:"exception,omitempty"`
	JobId                  *string                      `json:"jobId,omitempty"`
	JobScheduleId          *string                      `json:"jobScheduleId,omitempty"`
	LastModifiedTime       *string                      `json:"lastModifiedTime,omitempty"`
	LastStatusModifiedTime *string                      `json:"lastStatusModifiedTime,omitempty"`
	Parameters             *map[string]string           `json:"parameters,omitempty"`
	ProvisioningState      *JobProvisioningState        `json:"provisioningState,omitempty"`
	RunOn                  *string                      `json:"runOn,omitempty"`
	Runbook                *RunbookAssociationProperty  `json:"runbook,omitempty"`
	Schedule               *ScheduleAssociationProperty `json:"schedule,omitempty"`
	StartTime              *string                      `json:"startTime,omitempty"`
	StartedBy              *string                      `json:"startedBy,omitempty"`
	Status                 *JobStatus                   `json:"status,omitempty"`
	StatusDetails          *string                      `json:"statusDetails,omitempty"`
}

func (*JobProperties) GetCreationTimeAsTime

func (o *JobProperties) GetCreationTimeAsTime() (*time.Time, error)

func (*JobProperties) GetEndTimeAsTime

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

func (*JobProperties) GetLastModifiedTimeAsTime

func (o *JobProperties) GetLastModifiedTimeAsTime() (*time.Time, error)

func (*JobProperties) GetLastStatusModifiedTimeAsTime

func (o *JobProperties) GetLastStatusModifiedTimeAsTime() (*time.Time, error)

func (*JobProperties) GetStartTimeAsTime

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

func (*JobProperties) SetCreationTimeAsTime

func (o *JobProperties) SetCreationTimeAsTime(input time.Time)

func (*JobProperties) SetEndTimeAsTime

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

func (*JobProperties) SetLastModifiedTimeAsTime

func (o *JobProperties) SetLastModifiedTimeAsTime(input time.Time)

func (*JobProperties) SetLastStatusModifiedTimeAsTime

func (o *JobProperties) SetLastStatusModifiedTimeAsTime(input time.Time)

func (*JobProperties) SetStartTimeAsTime

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

type JobProvisioningState

type JobProvisioningState string
const (
	JobProvisioningStateFailed     JobProvisioningState = "Failed"
	JobProvisioningStateProcessing JobProvisioningState = "Processing"
	JobProvisioningStateSucceeded  JobProvisioningState = "Succeeded"
	JobProvisioningStateSuspended  JobProvisioningState = "Suspended"
)

type JobStatus

type JobStatus string
const (
	JobStatusActivating   JobStatus = "Activating"
	JobStatusBlocked      JobStatus = "Blocked"
	JobStatusCompleted    JobStatus = "Completed"
	JobStatusDisconnected JobStatus = "Disconnected"
	JobStatusFailed       JobStatus = "Failed"
	JobStatusNew          JobStatus = "New"
	JobStatusRemoving     JobStatus = "Removing"
	JobStatusResuming     JobStatus = "Resuming"
	JobStatusRunning      JobStatus = "Running"
	JobStatusStopped      JobStatus = "Stopped"
	JobStatusStopping     JobStatus = "Stopping"
	JobStatusSuspended    JobStatus = "Suspended"
	JobStatusSuspending   JobStatus = "Suspending"
)

type ListByAutomationAccountCompleteResult

type ListByAutomationAccountCompleteResult struct {
	Items []Job
}

type ListByAutomationAccountOperationOptions

type ListByAutomationAccountOperationOptions struct {
	Filter *string
}

func DefaultListByAutomationAccountOperationOptions

func DefaultListByAutomationAccountOperationOptions() ListByAutomationAccountOperationOptions

type ListByAutomationAccountOperationResponse

type ListByAutomationAccountOperationResponse struct {
	HttpResponse *http.Response
	Model        *[]Job
	// contains filtered or unexported fields
}

func (ListByAutomationAccountOperationResponse) HasMore

func (ListByAutomationAccountOperationResponse) LoadMore

type ResumeOperationResponse

type ResumeOperationResponse struct {
	HttpResponse *http.Response
}

type RunbookAssociationProperty

type RunbookAssociationProperty struct {
	Name *string `json:"name,omitempty"`
}

type ScheduleAssociationProperty

type ScheduleAssociationProperty struct {
	Name *string `json:"name,omitempty"`
}

type StopOperationResponse

type StopOperationResponse struct {
	HttpResponse *http.Response
}

type SuspendOperationResponse

type SuspendOperationResponse struct {
	HttpResponse *http.Response
}

Jump to

Keyboard shortcuts

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