README ¶
github.com/hashicorp/go-azure-sdk/resource-manager/advisor/2023-01-01/suppressions
Documentation
The suppressions
SDK allows for interaction with the Azure Resource Manager Service advisor
(API Version 2023-01-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/2023-01-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 ¶
- func ValidateScopedSuppressionID(input interface{}, key string) (warnings []string, errors []error)
- type CreateOperationResponse
- type DeleteOperationResponse
- type GetOperationResponse
- type ListCompleteResult
- type ListOperationOptions
- type ListOperationResponse
- type ScopedSuppressionId
- type SuppressionContract
- type SuppressionContractOperationPredicate
- type SuppressionProperties
- type SuppressionsClient
- func (c SuppressionsClient) Create(ctx context.Context, id ScopedSuppressionId, input SuppressionContract) (result CreateOperationResponse, err error)
- func (c SuppressionsClient) Delete(ctx context.Context, id ScopedSuppressionId) (result DeleteOperationResponse, err error)
- func (c SuppressionsClient) Get(ctx context.Context, id ScopedSuppressionId) (result GetOperationResponse, err error)
- func (c SuppressionsClient) List(ctx context.Context, id commonids.SubscriptionId, options ListOperationOptions) (resp ListOperationResponse, err error)
- func (c SuppressionsClient) ListComplete(ctx context.Context, id commonids.SubscriptionId, options ListOperationOptions) (ListCompleteResult, error)
- func (c SuppressionsClient) ListCompleteMatchingPredicate(ctx context.Context, id commonids.SubscriptionId, options ListOperationOptions, ...) (resp ListCompleteResult, err error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ValidateScopedSuppressionID ¶
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 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 ¶
func (SuppressionContractOperationPredicate) Matches ¶
func (p SuppressionContractOperationPredicate) Matches(input SuppressionContract) bool
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 ¶
func NewSuppressionsClientWithBaseURI ¶
func NewSuppressionsClientWithBaseURI(endpoint string) SuppressionsClient
func (SuppressionsClient) Create ¶
func (c SuppressionsClient) Create(ctx context.Context, id ScopedSuppressionId, input SuppressionContract) (result CreateOperationResponse, err error)
Create ...
func (SuppressionsClient) Delete ¶
func (c SuppressionsClient) Delete(ctx context.Context, id ScopedSuppressionId) (result DeleteOperationResponse, err error)
Delete ...
func (SuppressionsClient) Get ¶
func (c SuppressionsClient) Get(ctx context.Context, id ScopedSuppressionId) (result GetOperationResponse, err error)
Get ...
func (SuppressionsClient) List ¶
func (c SuppressionsClient) List(ctx context.Context, id commonids.SubscriptionId, options ListOperationOptions) (resp ListOperationResponse, err error)
List ...
func (SuppressionsClient) ListComplete ¶
func (c SuppressionsClient) ListComplete(ctx context.Context, id commonids.SubscriptionId, options ListOperationOptions) (ListCompleteResult, error)
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