automations

package
v0.20241111.1164443 Latest Latest
Warning

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

Go to latest
Published: Nov 11, 2024 License: MPL-2.0 Imports: 12 Imported by: 1

README

github.com/hashicorp/go-azure-sdk/resource-manager/security/2019-01-01-preview/automations Documentation

The automations SDK allows for interaction with Azure Resource Manager security (API Version 2019-01-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-helpers/resourcemanager/commonids"
import "github.com/hashicorp/go-azure-sdk/resource-manager/security/2019-01-01-preview/automations"

Client Initialization

client := automations.NewAutomationsClientWithBaseURI("https://management.azure.com")
client.Client.Authorizer = authorizer

Example Usage: AutomationsClient.CreateOrUpdate

ctx := context.TODO()
id := automations.NewAutomationID("12345678-1234-9876-4563-123456789012", "example-resource-group", "automationName")

payload := automations.Automation{
	// ...
}


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

ctx := context.TODO()
id := automations.NewAutomationID("12345678-1234-9876-4563-123456789012", "example-resource-group", "automationName")

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

ctx := context.TODO()
id := automations.NewAutomationID("12345678-1234-9876-4563-123456789012", "example-resource-group", "automationName")

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

ctx := context.TODO()
id := commonids.NewSubscriptionID("12345678-1234-9876-4563-123456789012")

// 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: AutomationsClient.ListByResourceGroup

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

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

Example Usage: AutomationsClient.Validate

ctx := context.TODO()
id := automations.NewAutomationID("12345678-1234-9876-4563-123456789012", "example-resource-group", "automationName")

payload := automations.Automation{
	// ...
}


read, err := client.Validate(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 PossibleValuesForActionType

func PossibleValuesForActionType() []string

func PossibleValuesForEventSource

func PossibleValuesForEventSource() []string

func PossibleValuesForOperator

func PossibleValuesForOperator() []string

func PossibleValuesForPropertyType

func PossibleValuesForPropertyType() []string

func ValidateAutomationID

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

ValidateAutomationID checks that 'input' can be parsed as a Automation ID

Types

type ActionType

type ActionType string
const (
	ActionTypeEventHub  ActionType = "EventHub"
	ActionTypeLogicApp  ActionType = "LogicApp"
	ActionTypeWorkspace ActionType = "Workspace"
)

func (*ActionType) UnmarshalJSON added in v0.20240228.1142829

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

type Automation

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

type AutomationAction

type AutomationAction interface {
	AutomationAction() BaseAutomationActionImpl
}

func UnmarshalAutomationActionImplementation added in v0.20240920.1135249

func UnmarshalAutomationActionImplementation(input []byte) (AutomationAction, error)

type AutomationActionEventHub

type AutomationActionEventHub struct {
	ConnectionString   *string `json:"connectionString,omitempty"`
	EventHubResourceId *string `json:"eventHubResourceId,omitempty"`
	SasPolicyName      *string `json:"sasPolicyName,omitempty"`

	ActionType ActionType `json:"actionType"`
}

func (AutomationActionEventHub) AutomationAction added in v0.20240920.1135249

func (AutomationActionEventHub) MarshalJSON

func (s AutomationActionEventHub) MarshalJSON() ([]byte, error)

type AutomationActionLogicApp

type AutomationActionLogicApp struct {
	LogicAppResourceId *string `json:"logicAppResourceId,omitempty"`
	Uri                *string `json:"uri,omitempty"`

	ActionType ActionType `json:"actionType"`
}

func (AutomationActionLogicApp) AutomationAction added in v0.20240920.1135249

func (AutomationActionLogicApp) MarshalJSON

func (s AutomationActionLogicApp) MarshalJSON() ([]byte, error)

type AutomationActionWorkspace

type AutomationActionWorkspace struct {
	WorkspaceResourceId *string `json:"workspaceResourceId,omitempty"`

	ActionType ActionType `json:"actionType"`
}

func (AutomationActionWorkspace) AutomationAction added in v0.20240920.1135249

func (AutomationActionWorkspace) MarshalJSON

func (s AutomationActionWorkspace) MarshalJSON() ([]byte, error)

type AutomationId

type AutomationId struct {
	SubscriptionId    string
	ResourceGroupName string
	AutomationName    string
}

AutomationId is a struct representing the Resource ID for a Automation

func NewAutomationID

func NewAutomationID(subscriptionId string, resourceGroupName string, automationName string) AutomationId

NewAutomationID returns a new AutomationId struct

func ParseAutomationID

func ParseAutomationID(input string) (*AutomationId, error)

ParseAutomationID parses 'input' into a AutomationId

func ParseAutomationIDInsensitively

func ParseAutomationIDInsensitively(input string) (*AutomationId, error)

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

func (*AutomationId) FromParseResult

func (id *AutomationId) FromParseResult(input resourceids.ParseResult) error

func (AutomationId) ID

func (id AutomationId) ID() string

ID returns the formatted Automation ID

func (AutomationId) Segments

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

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

func (AutomationId) String

func (id AutomationId) String() string

String returns a human-readable description of this Automation ID

type AutomationOperationPredicate

type AutomationOperationPredicate struct {
	Etag     *string
	Id       *string
	Kind     *string
	Location *string
	Name     *string
	Type     *string
}

func (AutomationOperationPredicate) Matches

func (p AutomationOperationPredicate) Matches(input Automation) bool

type AutomationProperties

type AutomationProperties struct {
	Actions     *[]AutomationAction `json:"actions,omitempty"`
	Description *string             `json:"description,omitempty"`
	IsEnabled   *bool               `json:"isEnabled,omitempty"`
	Scopes      *[]AutomationScope  `json:"scopes,omitempty"`
	Sources     *[]AutomationSource `json:"sources,omitempty"`
}

func (*AutomationProperties) UnmarshalJSON

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

type AutomationRuleSet

type AutomationRuleSet struct {
	Rules *[]AutomationTriggeringRule `json:"rules,omitempty"`
}

type AutomationScope

type AutomationScope struct {
	Description *string `json:"description,omitempty"`
	ScopePath   *string `json:"scopePath,omitempty"`
}

type AutomationSource

type AutomationSource struct {
	EventSource *EventSource         `json:"eventSource,omitempty"`
	RuleSets    *[]AutomationRuleSet `json:"ruleSets,omitempty"`
}

type AutomationTriggeringRule

type AutomationTriggeringRule struct {
	ExpectedValue *string       `json:"expectedValue,omitempty"`
	Operator      *Operator     `json:"operator,omitempty"`
	PropertyJPath *string       `json:"propertyJPath,omitempty"`
	PropertyType  *PropertyType `json:"propertyType,omitempty"`
}

type AutomationValidationStatus

type AutomationValidationStatus struct {
	IsValid *bool   `json:"isValid,omitempty"`
	Message *string `json:"message,omitempty"`
}

type AutomationsClient

type AutomationsClient struct {
	Client *resourcemanager.Client
}

func NewAutomationsClientWithBaseURI

func NewAutomationsClientWithBaseURI(sdkApi sdkEnv.Api) (*AutomationsClient, error)

func (AutomationsClient) CreateOrUpdate

func (c AutomationsClient) CreateOrUpdate(ctx context.Context, id AutomationId, input Automation) (result CreateOrUpdateOperationResponse, err error)

CreateOrUpdate ...

func (AutomationsClient) Delete

Delete ...

func (AutomationsClient) Get

Get ...

func (AutomationsClient) List

List ...

func (AutomationsClient) ListByResourceGroup

ListByResourceGroup ...

func (AutomationsClient) ListByResourceGroupComplete

ListByResourceGroupComplete retrieves all the results into a single object

func (AutomationsClient) ListByResourceGroupCompleteMatchingPredicate

func (c AutomationsClient) ListByResourceGroupCompleteMatchingPredicate(ctx context.Context, id commonids.ResourceGroupId, predicate AutomationOperationPredicate) (result ListByResourceGroupCompleteResult, err error)

ListByResourceGroupCompleteMatchingPredicate retrieves all the results and then applies the predicate

func (AutomationsClient) ListComplete

ListComplete retrieves all the results into a single object

func (AutomationsClient) ListCompleteMatchingPredicate

func (c AutomationsClient) ListCompleteMatchingPredicate(ctx context.Context, id commonids.SubscriptionId, predicate AutomationOperationPredicate) (result ListCompleteResult, err error)

ListCompleteMatchingPredicate retrieves all the results and then applies the predicate

func (AutomationsClient) Validate

func (c AutomationsClient) Validate(ctx context.Context, id AutomationId, input Automation) (result ValidateOperationResponse, err error)

Validate ...

type BaseAutomationActionImpl added in v0.20240920.1135249

type BaseAutomationActionImpl struct {
	ActionType ActionType `json:"actionType"`
}

func (BaseAutomationActionImpl) AutomationAction added in v0.20240920.1135249

type CreateOrUpdateOperationResponse

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

type DeleteOperationResponse

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

type EventSource

type EventSource string
const (
	EventSourceAlerts                                 EventSource = "Alerts"
	EventSourceAssessments                            EventSource = "Assessments"
	EventSourceAssessmentsSnapshot                    EventSource = "AssessmentsSnapshot"
	EventSourceRegulatoryComplianceAssessment         EventSource = "RegulatoryComplianceAssessment"
	EventSourceRegulatoryComplianceAssessmentSnapshot EventSource = "RegulatoryComplianceAssessmentSnapshot"
	EventSourceSecureScoreControls                    EventSource = "SecureScoreControls"
	EventSourceSecureScoreControlsSnapshot            EventSource = "SecureScoreControlsSnapshot"
	EventSourceSecureScores                           EventSource = "SecureScores"
	EventSourceSecureScoresSnapshot                   EventSource = "SecureScoresSnapshot"
	EventSourceSubAssessments                         EventSource = "SubAssessments"
	EventSourceSubAssessmentsSnapshot                 EventSource = "SubAssessmentsSnapshot"
)

func (*EventSource) UnmarshalJSON added in v0.20240228.1142829

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

type GetOperationResponse

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

type ListByResourceGroupCompleteResult

type ListByResourceGroupCompleteResult struct {
	LatestHttpResponse *http.Response
	Items              []Automation
}

type ListByResourceGroupCustomPager added in v0.20240628.1153531

type ListByResourceGroupCustomPager struct {
	NextLink *odata.Link `json:"nextLink"`
}
func (p *ListByResourceGroupCustomPager) NextPageLink() *odata.Link

type ListByResourceGroupOperationResponse

type ListByResourceGroupOperationResponse struct {
	HttpResponse *http.Response
	OData        *odata.OData
	Model        *[]Automation
}

type ListCompleteResult

type ListCompleteResult struct {
	LatestHttpResponse *http.Response
	Items              []Automation
}

type ListCustomPager added in v0.20240628.1153531

type ListCustomPager struct {
	NextLink *odata.Link `json:"nextLink"`
}
func (p *ListCustomPager) NextPageLink() *odata.Link

type ListOperationResponse

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

type Operator

type Operator string
const (
	OperatorContains             Operator = "Contains"
	OperatorEndsWith             Operator = "EndsWith"
	OperatorEquals               Operator = "Equals"
	OperatorGreaterThan          Operator = "GreaterThan"
	OperatorGreaterThanOrEqualTo Operator = "GreaterThanOrEqualTo"
	OperatorLesserThan           Operator = "LesserThan"
	OperatorLesserThanOrEqualTo  Operator = "LesserThanOrEqualTo"
	OperatorNotEquals            Operator = "NotEquals"
	OperatorStartsWith           Operator = "StartsWith"
)

func (*Operator) UnmarshalJSON added in v0.20240228.1142829

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

type PropertyType

type PropertyType string
const (
	PropertyTypeBoolean PropertyType = "Boolean"
	PropertyTypeInteger PropertyType = "Integer"
	PropertyTypeNumber  PropertyType = "Number"
	PropertyTypeString  PropertyType = "String"
)

func (*PropertyType) UnmarshalJSON added in v0.20240228.1142829

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

type RawAutomationActionImpl

type RawAutomationActionImpl struct {
	Type   string
	Values map[string]interface{}
	// contains filtered or unexported fields
}

RawAutomationActionImpl is returned when the Discriminated Value doesn't match any of the defined types NOTE: this should only be used when a type isn't defined for this type of Object (as a workaround) and is used only for Deserialization (e.g. this cannot be used as a Request Payload).

func (RawAutomationActionImpl) AutomationAction added in v0.20240920.1135249

type ValidateOperationResponse

type ValidateOperationResponse struct {
	HttpResponse *http.Response
	OData        *odata.OData
	Model        *AutomationValidationStatus
}

Jump to

Keyboard shortcuts

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