suppressions

package
v0.20230320.1165256 Latest Latest
Warning

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

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

README

github.com/hashicorp/go-azure-sdk/resource-manager/advisor/2022-10-01/suppressions Documentation

The suppressions SDK allows for interaction with the Azure Resource Manager Service advisor (API Version 2022-10-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/advisor/2022-10-01/suppressions"

Client Initialization

client := suppressions.NewSuppressionsClientWithBaseURI("https://management.azure.com")
client.Client.Authorizer = authorizer

Example Usage: SuppressionsClient.Create

ctx := context.TODO()
id := suppressions.NewScopedSuppressionID("/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/some-resource-group", "recommendationIdValue", "suppressionValue")

payload := suppressions.SuppressionContract{
	// ...
}


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

Example Usage: SuppressionsClient.Delete

ctx := context.TODO()
id := suppressions.NewScopedSuppressionID("/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/some-resource-group", "recommendationIdValue", "suppressionValue")

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

ctx := context.TODO()
id := suppressions.NewScopedSuppressionID("/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/some-resource-group", "recommendationIdValue", "suppressionValue")

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

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

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

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ValidateScopedSuppressionID

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

ValidateScopedSuppressionID checks that 'input' can be parsed as a Scoped Suppression ID

Types

type CreateOperationResponse

type CreateOperationResponse struct {
	HttpResponse *http.Response
	Model        *SuppressionContract
}

type DeleteOperationResponse

type DeleteOperationResponse struct {
	HttpResponse *http.Response
}

type GetOperationResponse

type GetOperationResponse struct {
	HttpResponse *http.Response
	Model        *SuppressionContract
}

type ListCompleteResult

type ListCompleteResult struct {
	Items []SuppressionContract
}

type ListOperationOptions

type ListOperationOptions struct {
	Top *int64
}

func DefaultListOperationOptions

func DefaultListOperationOptions() ListOperationOptions

type ListOperationResponse

type ListOperationResponse struct {
	HttpResponse *http.Response
	Model        *[]SuppressionContract
	// contains filtered or unexported fields
}

func (ListOperationResponse) HasMore

func (r ListOperationResponse) HasMore() bool

func (ListOperationResponse) LoadMore

func (r ListOperationResponse) LoadMore(ctx context.Context) (resp ListOperationResponse, err error)

type ScopedSuppressionId

type ScopedSuppressionId struct {
	ResourceUri      string
	RecommendationId string
	SuppressionName  string
}

ScopedSuppressionId is a struct representing the Resource ID for a Scoped Suppression

func NewScopedSuppressionID

func NewScopedSuppressionID(resourceUri string, recommendationId string, suppressionName string) ScopedSuppressionId

NewScopedSuppressionID returns a new ScopedSuppressionId struct

func ParseScopedSuppressionID

func ParseScopedSuppressionID(input string) (*ScopedSuppressionId, error)

ParseScopedSuppressionID parses 'input' into a ScopedSuppressionId

func ParseScopedSuppressionIDInsensitively

func ParseScopedSuppressionIDInsensitively(input string) (*ScopedSuppressionId, error)

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

func (ScopedSuppressionId) ID

func (id ScopedSuppressionId) ID() string

ID returns the formatted Scoped Suppression ID

func (ScopedSuppressionId) Segments

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

Segments returns a slice of Resource ID Segments which comprise this Scoped Suppression ID

func (ScopedSuppressionId) String

func (id ScopedSuppressionId) String() string

String returns a human-readable description of this Scoped Suppression ID

type SuppressionContract

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

type SuppressionContractOperationPredicate

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

func (SuppressionContractOperationPredicate) Matches

type SuppressionProperties

type SuppressionProperties struct {
	ExpirationTimeStamp *string `json:"expirationTimeStamp,omitempty"`
	SuppressionId       *string `json:"suppressionId,omitempty"`
	Ttl                 *string `json:"ttl,omitempty"`
}

func (*SuppressionProperties) GetExpirationTimeStampAsTime

func (o *SuppressionProperties) GetExpirationTimeStampAsTime() (*time.Time, error)

func (*SuppressionProperties) SetExpirationTimeStampAsTime

func (o *SuppressionProperties) SetExpirationTimeStampAsTime(input time.Time)

type SuppressionsClient

type SuppressionsClient struct {
	Client autorest.Client
	// contains filtered or unexported fields
}

func NewSuppressionsClientWithBaseURI

func NewSuppressionsClientWithBaseURI(endpoint string) SuppressionsClient

func (SuppressionsClient) Create

Create ...

func (SuppressionsClient) Delete

Delete ...

func (SuppressionsClient) Get

Get ...

func (SuppressionsClient) List

List ...

func (SuppressionsClient) ListComplete

ListComplete retrieves all of the results into a single object

func (SuppressionsClient) ListCompleteMatchingPredicate

func (c SuppressionsClient) ListCompleteMatchingPredicate(ctx context.Context, id commonids.SubscriptionId, options ListOperationOptions, predicate SuppressionContractOperationPredicate) (resp ListCompleteResult, err error)

ListCompleteMatchingPredicate retrieves all of the results and then applied the predicate

Jump to

Keyboard shortcuts

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