README ¶
github.com/hashicorp/go-azure-sdk/resource-manager/chaosstudio/2022-07-01-preview/targets
Documentation
The targets
SDK allows for interaction with the Azure Resource Manager Service chaosstudio
(API Version 2022-07-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-sdk/resource-manager/chaosstudio/2022-07-01-preview/targets"
Client Initialization
client := targets.NewTargetsClientWithBaseURI("https://management.azure.com")
client.Client.Authorizer = authorizer
Example Usage: TargetsClient.CreateOrUpdate
ctx := context.TODO()
id := targets.NewTargetID("12345678-1234-9876-4563-123456789012", "example-resource-group", "providerValue", "parentResourceTypeValue", "parentResourceValue", "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.NewTargetID("12345678-1234-9876-4563-123456789012", "example-resource-group", "providerValue", "parentResourceTypeValue", "parentResourceValue", "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.NewTargetID("12345678-1234-9876-4563-123456789012", "example-resource-group", "providerValue", "parentResourceTypeValue", "parentResourceValue", "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.NewProviderID("12345678-1234-9876-4563-123456789012", "example-resource-group", "providerValue", "parentResourceTypeValue", "parentResourceValue")
// 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 ValidateProviderID(input interface{}, key string) (warnings []string, errors []error)
- func ValidateTargetID(input interface{}, key string) (warnings []string, errors []error)
- type CreateOrUpdateOperationResponse
- type DeleteOperationResponse
- type GetOperationResponse
- type ListCompleteResult
- type ListOperationOptions
- type ListOperationResponse
- type ProviderId
- type Target
- type TargetId
- type TargetOperationPredicate
- type TargetsClient
- func (c TargetsClient) CreateOrUpdate(ctx context.Context, id TargetId, input Target) (result CreateOrUpdateOperationResponse, err error)
- func (c TargetsClient) Delete(ctx context.Context, id TargetId) (result DeleteOperationResponse, err error)
- func (c TargetsClient) Get(ctx context.Context, id TargetId) (result GetOperationResponse, err error)
- func (c TargetsClient) List(ctx context.Context, id ProviderId, options ListOperationOptions) (resp ListOperationResponse, err error)
- func (c TargetsClient) ListComplete(ctx context.Context, id ProviderId, options ListOperationOptions) (ListCompleteResult, error)
- func (c TargetsClient) ListCompleteMatchingPredicate(ctx context.Context, id ProviderId, options ListOperationOptions, ...) (resp ListCompleteResult, err error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ValidateProviderID ¶
ValidateProviderID checks that 'input' can be parsed as a Provider ID
func ValidateTargetID ¶
ValidateTargetID checks that 'input' can be parsed as a 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
type ListOperationResponse ¶
type ListOperationResponse struct { HttpResponse *http.Response Model *[]Target // 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 ProviderId ¶
type ProviderId struct { SubscriptionId string ResourceGroupName string ProviderName string ParentResourceType string ParentResourceName string }
ProviderId is a struct representing the Resource ID for a Provider
func NewProviderID ¶
func NewProviderID(subscriptionId string, resourceGroupName string, providerName string, parentResourceType string, parentResourceName string) ProviderId
NewProviderID returns a new ProviderId struct
func ParseProviderID ¶
func ParseProviderID(input string) (*ProviderId, error)
ParseProviderID parses 'input' into a ProviderId
func ParseProviderIDInsensitively ¶
func ParseProviderIDInsensitively(input string) (*ProviderId, error)
ParseProviderIDInsensitively parses 'input' case-insensitively into a ProviderId note: this method should only be used for API response data and not user input
func (ProviderId) Segments ¶
func (id ProviderId) Segments() []resourceids.Segment
Segments returns a slice of Resource ID Segments which comprise this Provider ID
func (ProviderId) String ¶
func (id ProviderId) String() string
String returns a human-readable description of this Provider 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 TargetId ¶
type TargetId struct { SubscriptionId string ResourceGroupName string ProviderName string ParentResourceType string ParentResourceName string TargetName string }
TargetId is a struct representing the Resource ID for a Target
func NewTargetID ¶
func NewTargetID(subscriptionId string, resourceGroupName string, providerName string, parentResourceType string, parentResourceName string, targetName string) TargetId
NewTargetID returns a new TargetId struct
func ParseTargetID ¶
ParseTargetID parses 'input' into a TargetId
func ParseTargetIDInsensitively ¶
ParseTargetIDInsensitively parses 'input' case-insensitively into a TargetId note: this method should only be used for API response data and not user input
func (TargetId) Segments ¶
func (id TargetId) Segments() []resourceids.Segment
Segments returns a slice of Resource ID Segments which comprise this Target ID
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 ¶
func NewTargetsClientWithBaseURI ¶
func NewTargetsClientWithBaseURI(endpoint string) TargetsClient
func (TargetsClient) CreateOrUpdate ¶
func (c TargetsClient) CreateOrUpdate(ctx context.Context, id TargetId, input Target) (result CreateOrUpdateOperationResponse, err error)
CreateOrUpdate ...
func (TargetsClient) Delete ¶
func (c TargetsClient) Delete(ctx context.Context, id TargetId) (result DeleteOperationResponse, err error)
Delete ...
func (TargetsClient) Get ¶
func (c TargetsClient) Get(ctx context.Context, id TargetId) (result GetOperationResponse, err error)
Get ...
func (TargetsClient) List ¶
func (c TargetsClient) List(ctx context.Context, id ProviderId, options ListOperationOptions) (resp ListOperationResponse, err error)
List ...
func (TargetsClient) ListComplete ¶
func (c TargetsClient) ListComplete(ctx context.Context, id ProviderId, options ListOperationOptions) (ListCompleteResult, error)
ListComplete retrieves all of the results into a single object
func (TargetsClient) ListCompleteMatchingPredicate ¶
func (c TargetsClient) ListCompleteMatchingPredicate(ctx context.Context, id ProviderId, options ListOperationOptions, predicate TargetOperationPredicate) (resp ListCompleteResult, err error)
ListCompleteMatchingPredicate retrieves all of the results and then applied the predicate