diagnosticsettings

package
v0.20241209.1115630 Latest Latest
Warning

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

Go to latest
Published: Dec 9, 2024 License: MPL-2.0 Imports: 12 Imported by: 2

README

github.com/hashicorp/go-azure-sdk/resource-manager/insights/2021-05-01-preview/diagnosticsettings Documentation

The diagnosticsettings SDK allows for interaction with Azure Resource Manager insights (API Version 2021-05-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/insights/2021-05-01-preview/diagnosticsettings"

Client Initialization

client := diagnosticsettings.NewDiagnosticSettingsClientWithBaseURI("https://management.azure.com")
client.Client.Authorizer = authorizer

Example Usage: DiagnosticSettingsClient.CreateOrUpdate

ctx := context.TODO()
id := diagnosticsettings.NewScopedDiagnosticSettingID("/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/some-resource-group", "diagnosticSettingName")

payload := diagnosticsettings.DiagnosticSettingsResource{
	// ...
}


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

ctx := context.TODO()
id := diagnosticsettings.NewScopedDiagnosticSettingID("/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/some-resource-group", "diagnosticSettingName")

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

ctx := context.TODO()
id := diagnosticsettings.NewScopedDiagnosticSettingID("/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/some-resource-group", "diagnosticSettingName")

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

ctx := context.TODO()
id := commonids.NewScopeID("/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/some-resource-group")

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

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

ValidateScopedDiagnosticSettingID checks that 'input' can be parsed as a Scoped Diagnostic Setting ID

Types

type CreateOrUpdateOperationResponse

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

type DeleteOperationResponse

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

type DiagnosticSettings

type DiagnosticSettings struct {
	EventHubAuthorizationRuleId *string           `json:"eventHubAuthorizationRuleId,omitempty"`
	EventHubName                *string           `json:"eventHubName,omitempty"`
	LogAnalyticsDestinationType *string           `json:"logAnalyticsDestinationType,omitempty"`
	Logs                        *[]LogSettings    `json:"logs,omitempty"`
	MarketplacePartnerId        *string           `json:"marketplacePartnerId,omitempty"`
	Metrics                     *[]MetricSettings `json:"metrics,omitempty"`
	ServiceBusRuleId            *string           `json:"serviceBusRuleId,omitempty"`
	StorageAccountId            *string           `json:"storageAccountId,omitempty"`
	WorkspaceId                 *string           `json:"workspaceId,omitempty"`
}

type DiagnosticSettingsClient

type DiagnosticSettingsClient struct {
	Client *resourcemanager.Client
}

func NewDiagnosticSettingsClientWithBaseURI

func NewDiagnosticSettingsClientWithBaseURI(sdkApi sdkEnv.Api) (*DiagnosticSettingsClient, error)

func (DiagnosticSettingsClient) CreateOrUpdate

CreateOrUpdate ...

func (DiagnosticSettingsClient) Delete

Delete ...

func (DiagnosticSettingsClient) Get

Get ...

func (DiagnosticSettingsClient) List

List ...

type DiagnosticSettingsResource

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

type DiagnosticSettingsResourceCollection

type DiagnosticSettingsResourceCollection struct {
	Value *[]DiagnosticSettingsResource `json:"value,omitempty"`
}

type GetOperationResponse

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

type ListOperationResponse

type ListOperationResponse struct {
	HttpResponse *http.Response
	OData        *odata.OData
	Model        *DiagnosticSettingsResourceCollection
}

type LogSettings

type LogSettings struct {
	Category        *string          `json:"category,omitempty"`
	CategoryGroup   *string          `json:"categoryGroup,omitempty"`
	Enabled         bool             `json:"enabled"`
	RetentionPolicy *RetentionPolicy `json:"retentionPolicy,omitempty"`
}

type MetricSettings

type MetricSettings struct {
	Category        *string          `json:"category,omitempty"`
	Enabled         bool             `json:"enabled"`
	RetentionPolicy *RetentionPolicy `json:"retentionPolicy,omitempty"`
	TimeGrain       *string          `json:"timeGrain,omitempty"`
}

type RetentionPolicy

type RetentionPolicy struct {
	Days    int64 `json:"days"`
	Enabled bool  `json:"enabled"`
}

type ScopedDiagnosticSettingId

type ScopedDiagnosticSettingId struct {
	ResourceUri           string
	DiagnosticSettingName string
}

ScopedDiagnosticSettingId is a struct representing the Resource ID for a Scoped Diagnostic Setting

func NewScopedDiagnosticSettingID

func NewScopedDiagnosticSettingID(resourceUri string, diagnosticSettingName string) ScopedDiagnosticSettingId

NewScopedDiagnosticSettingID returns a new ScopedDiagnosticSettingId struct

func ParseScopedDiagnosticSettingID

func ParseScopedDiagnosticSettingID(input string) (*ScopedDiagnosticSettingId, error)

ParseScopedDiagnosticSettingID parses 'input' into a ScopedDiagnosticSettingId

func ParseScopedDiagnosticSettingIDInsensitively

func ParseScopedDiagnosticSettingIDInsensitively(input string) (*ScopedDiagnosticSettingId, error)

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

func (*ScopedDiagnosticSettingId) FromParseResult

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

func (ScopedDiagnosticSettingId) ID

ID returns the formatted Scoped Diagnostic Setting ID

func (ScopedDiagnosticSettingId) Segments

Segments returns a slice of Resource ID Segments which comprise this Scoped Diagnostic Setting ID

func (ScopedDiagnosticSettingId) String

func (id ScopedDiagnosticSettingId) String() string

String returns a human-readable description of this Scoped Diagnostic Setting ID

Jump to

Keyboard shortcuts

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