runbook

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: 13 Imported by: 0

README

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

The runbook 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/runbook"

Client Initialization

client := runbook.NewRunbookClientWithBaseURI("https://management.azure.com")
client.Client.Authorizer = authorizer

Example Usage: RunbookClient.CreateOrUpdate

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

payload := runbook.RunbookCreateOrUpdateParameters{
	// ...
}


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

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

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: RunbookClient.Get

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

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: RunbookClient.GetContent

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

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

Example Usage: RunbookClient.ListByAutomationAccount

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

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

Example Usage: RunbookClient.Publish

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

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

Example Usage: RunbookClient.Update

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

payload := runbook.RunbookUpdateParameters{
	// ...
}


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 PossibleValuesForRunbookProvisioningState

func PossibleValuesForRunbookProvisioningState() []string

func PossibleValuesForRunbookState

func PossibleValuesForRunbookState() []string

func PossibleValuesForRunbookTypeEnum

func PossibleValuesForRunbookTypeEnum() []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 ValidateRunbookID

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

ValidateRunbookID checks that 'input' can be parsed as a Runbook 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 ContentHash

type ContentHash struct {
	Algorithm string `json:"algorithm"`
	Value     string `json:"value"`
}
type ContentLink struct {
	ContentHash *ContentHash `json:"contentHash,omitempty"`
	Uri         *string      `json:"uri,omitempty"`
	Version     *string      `json:"version,omitempty"`
}

type CreateOrUpdateOperationResponse

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

type DeleteOperationResponse

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

type GetContentOperationResponse

type GetContentOperationResponse struct {
	HttpResponse *http.Response
	OData        *odata.OData
	Model        *[]byte
}

type GetOperationResponse

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

type ListByAutomationAccountCompleteResult

type ListByAutomationAccountCompleteResult struct {
	Items []Runbook
}

type ListByAutomationAccountOperationResponse

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

type PublishOperationResponse

type PublishOperationResponse struct {
	Poller       pollers.Poller
	HttpResponse *http.Response
	OData        *odata.OData
}

type Runbook

type Runbook struct {
	Etag       *string            `json:"etag,omitempty"`
	Id         *string            `json:"id,omitempty"`
	Location   *string            `json:"location,omitempty"`
	Name       *string            `json:"name,omitempty"`
	Properties *RunbookProperties `json:"properties,omitempty"`
	Tags       *map[string]string `json:"tags,omitempty"`
	Type       *string            `json:"type,omitempty"`
}

type RunbookClient

type RunbookClient struct {
	Client *resourcemanager.Client
}

func NewRunbookClientWithBaseURI

func NewRunbookClientWithBaseURI(api environments.Api) (*RunbookClient, error)

func (RunbookClient) CreateOrUpdate

CreateOrUpdate ...

func (RunbookClient) Delete

func (c RunbookClient) Delete(ctx context.Context, id RunbookId) (result DeleteOperationResponse, err error)

Delete ...

func (RunbookClient) Get

func (c RunbookClient) Get(ctx context.Context, id RunbookId) (result GetOperationResponse, err error)

Get ...

func (RunbookClient) GetContent

func (c RunbookClient) GetContent(ctx context.Context, id RunbookId) (result GetContentOperationResponse, err error)

GetContent ...

func (RunbookClient) ListByAutomationAccount

func (c RunbookClient) ListByAutomationAccount(ctx context.Context, id AutomationAccountId) (result ListByAutomationAccountOperationResponse, err error)

ListByAutomationAccount ...

func (RunbookClient) ListByAutomationAccountComplete

func (c RunbookClient) ListByAutomationAccountComplete(ctx context.Context, id AutomationAccountId) (ListByAutomationAccountCompleteResult, error)

ListByAutomationAccountComplete retrieves all the results into a single object

func (RunbookClient) ListByAutomationAccountCompleteMatchingPredicate

func (c RunbookClient) ListByAutomationAccountCompleteMatchingPredicate(ctx context.Context, id AutomationAccountId, predicate RunbookOperationPredicate) (result ListByAutomationAccountCompleteResult, err error)

ListByAutomationAccountCompleteMatchingPredicate retrieves all the results and then applies the predicate

func (RunbookClient) Publish

func (c RunbookClient) Publish(ctx context.Context, id RunbookId) (result PublishOperationResponse, err error)

Publish ...

func (RunbookClient) PublishThenPoll

func (c RunbookClient) PublishThenPoll(ctx context.Context, id RunbookId) error

PublishThenPoll performs Publish then polls until it's completed

func (RunbookClient) Update

Update ...

type RunbookCreateOrUpdateParameters

type RunbookCreateOrUpdateParameters struct {
	Location   *string                         `json:"location,omitempty"`
	Name       *string                         `json:"name,omitempty"`
	Properties RunbookCreateOrUpdateProperties `json:"properties"`
	Tags       *map[string]string              `json:"tags,omitempty"`
}

type RunbookCreateOrUpdateProperties

type RunbookCreateOrUpdateProperties struct {
	Description        *string         `json:"description,omitempty"`
	Draft              *RunbookDraft   `json:"draft,omitempty"`
	LogActivityTrace   *int64          `json:"logActivityTrace,omitempty"`
	LogProgress        *bool           `json:"logProgress,omitempty"`
	LogVerbose         *bool           `json:"logVerbose,omitempty"`
	PublishContentLink *ContentLink    `json:"publishContentLink,omitempty"`
	RunbookType        RunbookTypeEnum `json:"runbookType"`
}

type RunbookDraft

type RunbookDraft struct {
	CreationTime     *string                      `json:"creationTime,omitempty"`
	DraftContentLink *ContentLink                 `json:"draftContentLink,omitempty"`
	InEdit           *bool                        `json:"inEdit,omitempty"`
	LastModifiedTime *string                      `json:"lastModifiedTime,omitempty"`
	OutputTypes      *[]string                    `json:"outputTypes,omitempty"`
	Parameters       *map[string]RunbookParameter `json:"parameters,omitempty"`
}

func (*RunbookDraft) GetCreationTimeAsTime

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

func (*RunbookDraft) GetLastModifiedTimeAsTime

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

func (*RunbookDraft) SetCreationTimeAsTime

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

func (*RunbookDraft) SetLastModifiedTimeAsTime

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

type RunbookId

type RunbookId struct {
	SubscriptionId        string
	ResourceGroupName     string
	AutomationAccountName string
	RunbookName           string
}

RunbookId is a struct representing the Resource ID for a Runbook

func NewRunbookID

func NewRunbookID(subscriptionId string, resourceGroupName string, automationAccountName string, runbookName string) RunbookId

NewRunbookID returns a new RunbookId struct

func ParseRunbookID

func ParseRunbookID(input string) (*RunbookId, error)

ParseRunbookID parses 'input' into a RunbookId

func ParseRunbookIDInsensitively

func ParseRunbookIDInsensitively(input string) (*RunbookId, error)

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

func (RunbookId) ID

func (id RunbookId) ID() string

ID returns the formatted Runbook ID

func (RunbookId) Segments

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

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

func (RunbookId) String

func (id RunbookId) String() string

String returns a human-readable description of this Runbook ID

type RunbookOperationPredicate

type RunbookOperationPredicate struct {
	Etag     *string
	Id       *string
	Location *string
	Name     *string
	Type     *string
}

func (RunbookOperationPredicate) Matches

func (p RunbookOperationPredicate) Matches(input Runbook) bool

type RunbookParameter

type RunbookParameter struct {
	DefaultValue *string `json:"defaultValue,omitempty"`
	IsMandatory  *bool   `json:"isMandatory,omitempty"`
	Position     *int64  `json:"position,omitempty"`
	Type         *string `json:"type,omitempty"`
}

type RunbookProperties

type RunbookProperties struct {
	CreationTime       *string                      `json:"creationTime,omitempty"`
	Description        *string                      `json:"description,omitempty"`
	Draft              *RunbookDraft                `json:"draft,omitempty"`
	JobCount           *int64                       `json:"jobCount,omitempty"`
	LastModifiedBy     *string                      `json:"lastModifiedBy,omitempty"`
	LastModifiedTime   *string                      `json:"lastModifiedTime,omitempty"`
	LogActivityTrace   *int64                       `json:"logActivityTrace,omitempty"`
	LogProgress        *bool                        `json:"logProgress,omitempty"`
	LogVerbose         *bool                        `json:"logVerbose,omitempty"`
	OutputTypes        *[]string                    `json:"outputTypes,omitempty"`
	Parameters         *map[string]RunbookParameter `json:"parameters,omitempty"`
	ProvisioningState  *RunbookProvisioningState    `json:"provisioningState,omitempty"`
	PublishContentLink *ContentLink                 `json:"publishContentLink,omitempty"`
	RunbookType        *RunbookTypeEnum             `json:"runbookType,omitempty"`
	State              *RunbookState                `json:"state,omitempty"`
}

func (*RunbookProperties) GetCreationTimeAsTime

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

func (*RunbookProperties) GetLastModifiedTimeAsTime

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

func (*RunbookProperties) SetCreationTimeAsTime

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

func (*RunbookProperties) SetLastModifiedTimeAsTime

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

type RunbookProvisioningState

type RunbookProvisioningState string
const (
	RunbookProvisioningStateSucceeded RunbookProvisioningState = "Succeeded"
)

func (*RunbookProvisioningState) UnmarshalJSON

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

type RunbookState

type RunbookState string
const (
	RunbookStateEdit      RunbookState = "Edit"
	RunbookStateNew       RunbookState = "New"
	RunbookStatePublished RunbookState = "Published"
)

func (*RunbookState) UnmarshalJSON

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

type RunbookTypeEnum

type RunbookTypeEnum string
const (
	RunbookTypeEnumGraph                   RunbookTypeEnum = "Graph"
	RunbookTypeEnumGraphPowerShell         RunbookTypeEnum = "GraphPowerShell"
	RunbookTypeEnumGraphPowerShellWorkflow RunbookTypeEnum = "GraphPowerShellWorkflow"
	RunbookTypeEnumPowerShell              RunbookTypeEnum = "PowerShell"
	RunbookTypeEnumPowerShellWorkflow      RunbookTypeEnum = "PowerShellWorkflow"
	RunbookTypeEnumPythonThree             RunbookTypeEnum = "Python3"
	RunbookTypeEnumPythonTwo               RunbookTypeEnum = "Python2"
	RunbookTypeEnumScript                  RunbookTypeEnum = "Script"
)

func (*RunbookTypeEnum) UnmarshalJSON

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

type RunbookUpdateParameters

type RunbookUpdateParameters struct {
	Location   *string                  `json:"location,omitempty"`
	Name       *string                  `json:"name,omitempty"`
	Properties *RunbookUpdateProperties `json:"properties,omitempty"`
	Tags       *map[string]string       `json:"tags,omitempty"`
}

type RunbookUpdateProperties

type RunbookUpdateProperties struct {
	Description      *string `json:"description,omitempty"`
	LogActivityTrace *int64  `json:"logActivityTrace,omitempty"`
	LogProgress      *bool   `json:"logProgress,omitempty"`
	LogVerbose       *bool   `json:"logVerbose,omitempty"`
}

type UpdateOperationResponse

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

Jump to

Keyboard shortcuts

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