job

package
v0.20231002.1065327 Latest Latest
Warning

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

Go to latest
Published: Oct 2, 2023 License: MPL-2.0 Imports: 12 Imported by: 1

README

github.com/hashicorp/go-azure-sdk/resource-manager/automation/2022-08-08/job Documentation

The job SDK allows for interaction with the Azure Resource Manager Service automation (API Version 2022-08-08).

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/2022-08-08/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", "jobValue")

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


read, err := client.Create(ctx, id, payload, job.DefaultCreateOperationOptions())
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", "jobValue")

read, err := client.Get(ctx, id, job.DefaultGetOperationOptions())
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", "jobValue")

read, err := client.GetOutput(ctx, id, job.DefaultGetOutputOperationOptions())
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", "jobValue")

read, err := client.GetRunbookContent(ctx, id, job.DefaultGetRunbookContentOperationOptions())
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", "jobValue")

read, err := client.Resume(ctx, id, job.DefaultResumeOperationOptions())
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", "jobValue")

read, err := client.Stop(ctx, id, job.DefaultStopOperationOptions())
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", "jobValue")

read, err := client.Suspend(ctx, id, job.DefaultSuspendOperationOptions())
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 CreateOperationOptions

type CreateOperationOptions struct {
	ClientRequestId *string
}

func DefaultCreateOperationOptions

func DefaultCreateOperationOptions() CreateOperationOptions

func (CreateOperationOptions) ToHeaders added in v0.20230216.1112329

func (o CreateOperationOptions) ToHeaders() *client.Headers

func (CreateOperationOptions) ToOData added in v0.20230216.1112329

func (o CreateOperationOptions) ToOData() *odata.Query

func (CreateOperationOptions) ToQuery added in v0.20230216.1112329

type CreateOperationResponse

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

type GetOperationOptions

type GetOperationOptions struct {
	ClientRequestId *string
}

func DefaultGetOperationOptions

func DefaultGetOperationOptions() GetOperationOptions

func (GetOperationOptions) ToHeaders added in v0.20230216.1112329

func (o GetOperationOptions) ToHeaders() *client.Headers

func (GetOperationOptions) ToOData added in v0.20230216.1112329

func (o GetOperationOptions) ToOData() *odata.Query

func (GetOperationOptions) ToQuery added in v0.20230216.1112329

func (o GetOperationOptions) ToQuery() *client.QueryParams

type GetOperationResponse

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

type GetOutputOperationOptions

type GetOutputOperationOptions struct {
	ClientRequestId *string
}

func DefaultGetOutputOperationOptions

func DefaultGetOutputOperationOptions() GetOutputOperationOptions

func (GetOutputOperationOptions) ToHeaders added in v0.20230216.1112329

func (o GetOutputOperationOptions) ToHeaders() *client.Headers

func (GetOutputOperationOptions) ToOData added in v0.20230216.1112329

func (o GetOutputOperationOptions) ToOData() *odata.Query

func (GetOutputOperationOptions) ToQuery added in v0.20230216.1112329

type GetOutputOperationResponse

type GetOutputOperationResponse struct {
	HttpResponse *http.Response
	OData        *odata.OData
	Model        *string
}

type GetRunbookContentOperationOptions

type GetRunbookContentOperationOptions struct {
	ClientRequestId *string
}

func DefaultGetRunbookContentOperationOptions

func DefaultGetRunbookContentOperationOptions() GetRunbookContentOperationOptions

func (GetRunbookContentOperationOptions) ToHeaders added in v0.20230216.1112329

func (GetRunbookContentOperationOptions) ToOData added in v0.20230216.1112329

func (GetRunbookContentOperationOptions) ToQuery added in v0.20230216.1112329

type GetRunbookContentOperationResponse

type GetRunbookContentOperationResponse struct {
	HttpResponse *http.Response
	OData        *odata.OData
	Model        *string
}

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 JobClient

type JobClient struct {
	Client *resourcemanager.Client
}

func NewJobClientWithBaseURI

func NewJobClientWithBaseURI(sdkApi sdkEnv.Api) (*JobClient, error)

func (JobClient) Create

Create ...

func (JobClient) Get

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

Get ...

func (JobClient) GetOutput

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

GetOutput ...

func (JobClient) GetRunbookContent

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

GetRunbookContent ...

func (JobClient) ListByAutomationAccount

ListByAutomationAccount ...

func (JobClient) ListByAutomationAccountComplete

ListByAutomationAccountComplete retrieves all the results into a single object

func (JobClient) ListByAutomationAccountCompleteMatchingPredicate

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

ListByAutomationAccountCompleteMatchingPredicate retrieves all the results and then applies the predicate

func (JobClient) Resume

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

Resume ...

func (JobClient) Stop

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

Stop ...

func (JobClient) Suspend

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

Suspend ...

type JobCollectionItem

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

type JobCollectionItemOperationPredicate

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

func (JobCollectionItemOperationPredicate) Matches

type JobCollectionItemProperties

type JobCollectionItemProperties struct {
	CreationTime      *string                     `json:"creationTime,omitempty"`
	EndTime           *string                     `json:"endTime,omitempty"`
	JobId             *string                     `json:"jobId,omitempty"`
	LastModifiedTime  *string                     `json:"lastModifiedTime,omitempty"`
	ProvisioningState *string                     `json:"provisioningState,omitempty"`
	RunOn             *string                     `json:"runOn,omitempty"`
	Runbook           *RunbookAssociationProperty `json:"runbook,omitempty"`
	StartTime         *string                     `json:"startTime,omitempty"`
	Status            *JobStatus                  `json:"status,omitempty"`
}

func (*JobCollectionItemProperties) GetCreationTimeAsTime

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

func (*JobCollectionItemProperties) GetEndTimeAsTime

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

func (*JobCollectionItemProperties) GetLastModifiedTimeAsTime

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

func (*JobCollectionItemProperties) GetStartTimeAsTime

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

func (*JobCollectionItemProperties) SetCreationTimeAsTime

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

func (*JobCollectionItemProperties) SetEndTimeAsTime

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

func (*JobCollectionItemProperties) SetLastModifiedTimeAsTime

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

func (*JobCollectionItemProperties) SetStartTimeAsTime

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

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,omitempty"`
}

type JobId

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

JobId is a struct representing the Resource ID for a Job

func NewJobID

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

type JobProperties struct {
	CreationTime           *string                     `json:"creationTime,omitempty"`
	EndTime                *string                     `json:"endTime,omitempty"`
	Exception              *string                     `json:"exception,omitempty"`
	JobId                  *string                     `json:"jobId,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"`
	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"
)

func (*JobProvisioningState) UnmarshalJSON added in v0.20230406.1124617

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

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

func (*JobStatus) UnmarshalJSON added in v0.20230406.1124617

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

type ListByAutomationAccountCompleteResult

type ListByAutomationAccountCompleteResult struct {
	Items []JobCollectionItem
}

type ListByAutomationAccountOperationOptions

type ListByAutomationAccountOperationOptions struct {
	ClientRequestId *string
	Filter          *string
}

func DefaultListByAutomationAccountOperationOptions

func DefaultListByAutomationAccountOperationOptions() ListByAutomationAccountOperationOptions

func (ListByAutomationAccountOperationOptions) ToHeaders added in v0.20230216.1112329

func (ListByAutomationAccountOperationOptions) ToOData added in v0.20230216.1112329

func (ListByAutomationAccountOperationOptions) ToQuery added in v0.20230216.1112329

type ListByAutomationAccountOperationResponse

type ListByAutomationAccountOperationResponse struct {
	HttpResponse *http.Response
	OData        *odata.OData
	Model        *[]JobCollectionItem
}

type ResumeOperationOptions

type ResumeOperationOptions struct {
	ClientRequestId *string
}

func DefaultResumeOperationOptions

func DefaultResumeOperationOptions() ResumeOperationOptions

func (ResumeOperationOptions) ToHeaders added in v0.20230216.1112329

func (o ResumeOperationOptions) ToHeaders() *client.Headers

func (ResumeOperationOptions) ToOData added in v0.20230216.1112329

func (o ResumeOperationOptions) ToOData() *odata.Query

func (ResumeOperationOptions) ToQuery added in v0.20230216.1112329

type ResumeOperationResponse

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

type RunbookAssociationProperty

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

type StopOperationOptions

type StopOperationOptions struct {
	ClientRequestId *string
}

func DefaultStopOperationOptions

func DefaultStopOperationOptions() StopOperationOptions

func (StopOperationOptions) ToHeaders added in v0.20230216.1112329

func (o StopOperationOptions) ToHeaders() *client.Headers

func (StopOperationOptions) ToOData added in v0.20230216.1112329

func (o StopOperationOptions) ToOData() *odata.Query

func (StopOperationOptions) ToQuery added in v0.20230216.1112329

type StopOperationResponse

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

type SuspendOperationOptions

type SuspendOperationOptions struct {
	ClientRequestId *string
}

func DefaultSuspendOperationOptions

func DefaultSuspendOperationOptions() SuspendOperationOptions

func (SuspendOperationOptions) ToHeaders added in v0.20230216.1112329

func (o SuspendOperationOptions) ToHeaders() *client.Headers

func (SuspendOperationOptions) ToOData added in v0.20230216.1112329

func (o SuspendOperationOptions) ToOData() *odata.Query

func (SuspendOperationOptions) ToQuery added in v0.20230216.1112329

type SuspendOperationResponse

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

Jump to

Keyboard shortcuts

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