targets

package
v0.20240320.1105218 Latest Latest
Warning

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

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

README

github.com/hashicorp/go-azure-sdk/resource-manager/chaosstudio/2024-01-01/targets Documentation

The targets SDK allows for interaction with the Azure Resource Manager Service chaosstudio (API Version 2024-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-helpers/resourcemanager/commonids"
import "github.com/hashicorp/go-azure-sdk/resource-manager/chaosstudio/2024-01-01/targets"

Client Initialization

client := targets.NewTargetsClientWithBaseURI("https://management.azure.com")
client.Client.Authorizer = authorizer

Example Usage: TargetsClient.CreateOrUpdate

ctx := context.TODO()
id := commonids.NewChaosStudioTargetID("/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 := commonids.NewChaosStudioTargetID("/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 := commonids.NewChaosStudioTargetID("/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 := commonids.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

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type CreateOrUpdateOperationResponse

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

type DeleteOperationResponse

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

type GetOperationResponse

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

type ListCompleteResult

type ListCompleteResult struct {
	LatestHttpResponse *http.Response
	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

type ListOperationResponse

type ListOperationResponse struct {
	HttpResponse *http.Response
	OData        *odata.OData
	Model        *[]Target
}

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

CreateOrUpdate ...

func (TargetsClient) Delete

Delete ...

func (TargetsClient) Get

Get ...

func (TargetsClient) List

List ...

func (TargetsClient) ListComplete

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

Jump to

Keyboard shortcuts

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