README ¶
github.com/hashicorp/go-azure-sdk/resource-manager/chaosstudio/2023-04-15-preview/targets
Documentation
The targets
SDK allows for interaction with the Azure Resource Manager Service chaosstudio
(API Version 2023-04-15-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-sdk/resource-manager/chaosstudio/2023-04-15-preview/targets"
Client Initialization
client := targets.NewTargetsClientWithBaseURI("https://management.azure.com")
client.Client.Authorizer = authorizer
Example Usage: TargetsClient.CreateOrUpdate
ctx := context.TODO()
id := targets.NewScopedTargetID("/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/some-resource-group", "targetValue")
payload := targets.Target{
// ...
}
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: TargetsClient.Delete
ctx := context.TODO()
id := targets.NewScopedTargetID("/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/some-resource-group", "targetValue")
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: TargetsClient.Get
ctx := context.TODO()
id := targets.NewScopedTargetID("/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/some-resource-group", "targetValue")
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: TargetsClient.List
ctx := context.TODO()
id := targets.NewScopeID("/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/some-resource-group")
// alternatively `client.List(ctx, id, targets.DefaultListOperationOptions())` can be used to do batched pagination
items, err := client.ListComplete(ctx, id, targets.DefaultListOperationOptions())
if err != nil {
// handle the error
}
for _, item := range items {
// do something
}
Documentation ¶
Index ¶
- func ValidateScopedTargetID(input interface{}, key string) (warnings []string, errors []error)
- type CreateOrUpdateOperationResponse
- type DeleteOperationResponse
- type GetOperationResponse
- type ListCompleteResult
- type ListOperationOptions
- type ListOperationResponse
- type ScopedTargetId
- type Target
- type TargetOperationPredicate
- type TargetsClient
- func (c TargetsClient) CreateOrUpdate(ctx context.Context, id ScopedTargetId, input Target) (result CreateOrUpdateOperationResponse, err error)
- func (c TargetsClient) Delete(ctx context.Context, id ScopedTargetId) (result DeleteOperationResponse, err error)
- func (c TargetsClient) Get(ctx context.Context, id ScopedTargetId) (result GetOperationResponse, err error)
- func (c TargetsClient) List(ctx context.Context, id commonids.ScopeId, options ListOperationOptions) (result ListOperationResponse, err error)
- func (c TargetsClient) ListComplete(ctx context.Context, id commonids.ScopeId, options ListOperationOptions) (ListCompleteResult, error)
- func (c TargetsClient) ListCompleteMatchingPredicate(ctx context.Context, id commonids.ScopeId, options ListOperationOptions, ...) (result ListCompleteResult, err error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ValidateScopedTargetID ¶
ValidateScopedTargetID checks that 'input' can be parsed as a Scoped Target ID
Types ¶
type DeleteOperationResponse ¶
type GetOperationResponse ¶
type ListCompleteResult ¶
type ListCompleteResult struct {
Items []Target
}
type ListOperationOptions ¶
type ListOperationOptions struct {
ContinuationToken *string
}
func DefaultListOperationOptions ¶
func DefaultListOperationOptions() ListOperationOptions
func (ListOperationOptions) ToHeaders ¶
func (o ListOperationOptions) ToHeaders() *client.Headers
func (ListOperationOptions) ToOData ¶
func (o ListOperationOptions) ToOData() *odata.Query
func (ListOperationOptions) ToQuery ¶
func (o ListOperationOptions) ToQuery() *client.QueryParams
type ListOperationResponse ¶
type ScopedTargetId ¶
ScopedTargetId is a struct representing the Resource ID for a Scoped Target
func NewScopedTargetID ¶
func NewScopedTargetID(scope string, targetName string) ScopedTargetId
NewScopedTargetID returns a new ScopedTargetId struct
func ParseScopedTargetID ¶
func ParseScopedTargetID(input string) (*ScopedTargetId, error)
ParseScopedTargetID parses 'input' into a ScopedTargetId
func ParseScopedTargetIDInsensitively ¶
func ParseScopedTargetIDInsensitively(input string) (*ScopedTargetId, error)
ParseScopedTargetIDInsensitively parses 'input' case-insensitively into a ScopedTargetId note: this method should only be used for API response data and not user input
func (ScopedTargetId) ID ¶
func (id ScopedTargetId) ID() string
ID returns the formatted Scoped Target ID
func (ScopedTargetId) Segments ¶
func (id ScopedTargetId) Segments() []resourceids.Segment
Segments returns a slice of Resource ID Segments which comprise this Scoped Target ID
func (ScopedTargetId) String ¶
func (id ScopedTargetId) String() string
String returns a human-readable description of this Scoped Target ID
type Target ¶
type Target struct { Id *string `json:"id,omitempty"` Location *string `json:"location,omitempty"` Name *string `json:"name,omitempty"` Properties interface{} `json:"properties"` SystemData *systemdata.SystemData `json:"systemData,omitempty"` Type *string `json:"type,omitempty"` }
type TargetOperationPredicate ¶
type TargetOperationPredicate struct { Id *string Location *string Name *string Properties *interface{} Type *string }
func (TargetOperationPredicate) Matches ¶
func (p TargetOperationPredicate) Matches(input Target) bool
type TargetsClient ¶
type TargetsClient struct {
Client *resourcemanager.Client
}
func NewTargetsClientWithBaseURI ¶
func NewTargetsClientWithBaseURI(sdkApi sdkEnv.Api) (*TargetsClient, error)
func (TargetsClient) CreateOrUpdate ¶
func (c TargetsClient) CreateOrUpdate(ctx context.Context, id ScopedTargetId, input Target) (result CreateOrUpdateOperationResponse, err error)
CreateOrUpdate ...
func (TargetsClient) Delete ¶
func (c TargetsClient) Delete(ctx context.Context, id ScopedTargetId) (result DeleteOperationResponse, err error)
Delete ...
func (TargetsClient) Get ¶
func (c TargetsClient) Get(ctx context.Context, id ScopedTargetId) (result GetOperationResponse, err error)
Get ...
func (TargetsClient) List ¶
func (c TargetsClient) List(ctx context.Context, id commonids.ScopeId, options ListOperationOptions) (result ListOperationResponse, err error)
List ...
func (TargetsClient) ListComplete ¶
func (c TargetsClient) ListComplete(ctx context.Context, id commonids.ScopeId, options ListOperationOptions) (ListCompleteResult, error)
ListComplete retrieves all the results into a single object
func (TargetsClient) ListCompleteMatchingPredicate ¶
func (c TargetsClient) ListCompleteMatchingPredicate(ctx context.Context, id commonids.ScopeId, options ListOperationOptions, predicate TargetOperationPredicate) (result ListCompleteResult, err error)
ListCompleteMatchingPredicate retrieves all the results and then applies the predicate