jobdefinitions

package
v0.0.0-...-a81a29a Latest Latest
Warning

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

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

README

github.com/hashicorp/go-azure-sdk/resource-manager/storagemover/2023-03-01/jobdefinitions Documentation

The jobdefinitions SDK allows for interaction with the Azure Resource Manager Service storagemover (API Version 2023-03-01).

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/storagemover/2023-03-01/jobdefinitions"

Client Initialization

client := jobdefinitions.NewJobDefinitionsClientWithBaseURI("https://management.azure.com")
client.Client.Authorizer = authorizer

Example Usage: JobDefinitionsClient.CreateOrUpdate

ctx := context.TODO()
id := jobdefinitions.NewJobDefinitionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "storageMoverValue", "projectValue", "jobDefinitionValue")

payload := jobdefinitions.JobDefinition{
	// ...
}


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

ctx := context.TODO()
id := jobdefinitions.NewJobDefinitionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "storageMoverValue", "projectValue", "jobDefinitionValue")

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

Example Usage: JobDefinitionsClient.Get

ctx := context.TODO()
id := jobdefinitions.NewJobDefinitionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "storageMoverValue", "projectValue", "jobDefinitionValue")

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: JobDefinitionsClient.List

ctx := context.TODO()
id := jobdefinitions.NewProjectID("12345678-1234-9876-4563-123456789012", "example-resource-group", "storageMoverValue", "projectValue")

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

Example Usage: JobDefinitionsClient.StartJob

ctx := context.TODO()
id := jobdefinitions.NewJobDefinitionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "storageMoverValue", "projectValue", "jobDefinitionValue")

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

Example Usage: JobDefinitionsClient.StopJob

ctx := context.TODO()
id := jobdefinitions.NewJobDefinitionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "storageMoverValue", "projectValue", "jobDefinitionValue")

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

Example Usage: JobDefinitionsClient.Update

ctx := context.TODO()
id := jobdefinitions.NewJobDefinitionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "storageMoverValue", "projectValue", "jobDefinitionValue")

payload := jobdefinitions.JobDefinitionUpdateParameters{
	// ...
}


read, err := client.Update(ctx, id, payload)
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 PossibleValuesForCopyMode

func PossibleValuesForCopyMode() []string

func PossibleValuesForJobRunStatus

func PossibleValuesForJobRunStatus() []string

func PossibleValuesForProvisioningState

func PossibleValuesForProvisioningState() []string

func ValidateJobDefinitionID

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

ValidateJobDefinitionID checks that 'input' can be parsed as a Job Definition ID

func ValidateProjectID

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

ValidateProjectID checks that 'input' can be parsed as a Project ID

Types

type CopyMode

type CopyMode string
const (
	CopyModeAdditive CopyMode = "Additive"
	CopyModeMirror   CopyMode = "Mirror"
)

func (*CopyMode) UnmarshalJSON

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

type CreateOrUpdateOperationResponse

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

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        *JobDefinition
}

type JobDefinition

type JobDefinition struct {
	Id         *string                 `json:"id,omitempty"`
	Name       *string                 `json:"name,omitempty"`
	Properties JobDefinitionProperties `json:"properties"`
	SystemData *systemdata.SystemData  `json:"systemData,omitempty"`
	Type       *string                 `json:"type,omitempty"`
}

type JobDefinitionId

type JobDefinitionId struct {
	SubscriptionId    string
	ResourceGroupName string
	StorageMoverName  string
	ProjectName       string
	JobDefinitionName string
}

JobDefinitionId is a struct representing the Resource ID for a Job Definition

func NewJobDefinitionID

func NewJobDefinitionID(subscriptionId string, resourceGroupName string, storageMoverName string, projectName string, jobDefinitionName string) JobDefinitionId

NewJobDefinitionID returns a new JobDefinitionId struct

func ParseJobDefinitionID

func ParseJobDefinitionID(input string) (*JobDefinitionId, error)

ParseJobDefinitionID parses 'input' into a JobDefinitionId

func ParseJobDefinitionIDInsensitively

func ParseJobDefinitionIDInsensitively(input string) (*JobDefinitionId, error)

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

func (JobDefinitionId) ID

func (id JobDefinitionId) ID() string

ID returns the formatted Job Definition ID

func (JobDefinitionId) Segments

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

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

func (JobDefinitionId) String

func (id JobDefinitionId) String() string

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

type JobDefinitionOperationPredicate

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

func (JobDefinitionOperationPredicate) Matches

type JobDefinitionProperties

type JobDefinitionProperties struct {
	AgentName              *string            `json:"agentName,omitempty"`
	AgentResourceId        *string            `json:"agentResourceId,omitempty"`
	CopyMode               CopyMode           `json:"copyMode"`
	Description            *string            `json:"description,omitempty"`
	LatestJobRunName       *string            `json:"latestJobRunName,omitempty"`
	LatestJobRunResourceId *string            `json:"latestJobRunResourceId,omitempty"`
	LatestJobRunStatus     *JobRunStatus      `json:"latestJobRunStatus,omitempty"`
	ProvisioningState      *ProvisioningState `json:"provisioningState,omitempty"`
	SourceName             string             `json:"sourceName"`
	SourceResourceId       *string            `json:"sourceResourceId,omitempty"`
	SourceSubpath          *string            `json:"sourceSubpath,omitempty"`
	TargetName             string             `json:"targetName"`
	TargetResourceId       *string            `json:"targetResourceId,omitempty"`
	TargetSubpath          *string            `json:"targetSubpath,omitempty"`
}

type JobDefinitionUpdateParameters

type JobDefinitionUpdateParameters struct {
	Properties *JobDefinitionUpdateProperties `json:"properties,omitempty"`
}

type JobDefinitionUpdateProperties

type JobDefinitionUpdateProperties struct {
	AgentName   *string   `json:"agentName,omitempty"`
	CopyMode    *CopyMode `json:"copyMode,omitempty"`
	Description *string   `json:"description,omitempty"`
}

type JobDefinitionsClient

type JobDefinitionsClient struct {
	Client *resourcemanager.Client
}

func NewJobDefinitionsClientWithBaseURI

func NewJobDefinitionsClientWithBaseURI(api environments.Api) (*JobDefinitionsClient, error)

func (JobDefinitionsClient) CreateOrUpdate

CreateOrUpdate ...

func (JobDefinitionsClient) Delete

Delete ...

func (JobDefinitionsClient) DeleteThenPoll

func (c JobDefinitionsClient) DeleteThenPoll(ctx context.Context, id JobDefinitionId) error

DeleteThenPoll performs Delete then polls until it's completed

func (JobDefinitionsClient) Get

Get ...

func (JobDefinitionsClient) List

List ...

func (JobDefinitionsClient) ListComplete

ListComplete retrieves all the results into a single object

func (JobDefinitionsClient) ListCompleteMatchingPredicate

func (c JobDefinitionsClient) ListCompleteMatchingPredicate(ctx context.Context, id ProjectId, predicate JobDefinitionOperationPredicate) (result ListCompleteResult, err error)

ListCompleteMatchingPredicate retrieves all the results and then applies the predicate

func (JobDefinitionsClient) StartJob

StartJob ...

func (JobDefinitionsClient) StopJob

StopJob ...

func (JobDefinitionsClient) Update

Update ...

type JobRunResourceId

type JobRunResourceId struct {
	JobRunResourceId *string `json:"jobRunResourceId,omitempty"`
}

type JobRunStatus

type JobRunStatus string
const (
	JobRunStatusCancelRequested JobRunStatus = "CancelRequested"
	JobRunStatusCanceled        JobRunStatus = "Canceled"
	JobRunStatusCanceling       JobRunStatus = "Canceling"
	JobRunStatusFailed          JobRunStatus = "Failed"
	JobRunStatusQueued          JobRunStatus = "Queued"
	JobRunStatusRunning         JobRunStatus = "Running"
	JobRunStatusStarted         JobRunStatus = "Started"
	JobRunStatusSucceeded       JobRunStatus = "Succeeded"
)

func (*JobRunStatus) UnmarshalJSON

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

type ListCompleteResult

type ListCompleteResult struct {
	Items []JobDefinition
}

type ListOperationResponse

type ListOperationResponse struct {
	HttpResponse *http.Response
	OData        *odata.OData
	Model        *[]JobDefinition
}

type ProjectId

type ProjectId struct {
	SubscriptionId    string
	ResourceGroupName string
	StorageMoverName  string
	ProjectName       string
}

ProjectId is a struct representing the Resource ID for a Project

func NewProjectID

func NewProjectID(subscriptionId string, resourceGroupName string, storageMoverName string, projectName string) ProjectId

NewProjectID returns a new ProjectId struct

func ParseProjectID

func ParseProjectID(input string) (*ProjectId, error)

ParseProjectID parses 'input' into a ProjectId

func ParseProjectIDInsensitively

func ParseProjectIDInsensitively(input string) (*ProjectId, error)

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

func (ProjectId) ID

func (id ProjectId) ID() string

ID returns the formatted Project ID

func (ProjectId) Segments

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

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

func (ProjectId) String

func (id ProjectId) String() string

String returns a human-readable description of this Project ID

type ProvisioningState

type ProvisioningState string
const (
	ProvisioningStateSucceeded ProvisioningState = "Succeeded"
)

func (*ProvisioningState) UnmarshalJSON

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

type StartJobOperationResponse

type StartJobOperationResponse struct {
	HttpResponse *http.Response
	OData        *odata.OData
	Model        *JobRunResourceId
}

type StopJobOperationResponse

type StopJobOperationResponse struct {
	HttpResponse *http.Response
	OData        *odata.OData
	Model        *JobRunResourceId
}

type UpdateOperationResponse

type UpdateOperationResponse struct {
	HttpResponse *http.Response
	OData        *odata.OData
	Model        *JobDefinition
}

Jump to

Keyboard shortcuts

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