graphquery

package
v0.20241212.1154051 Latest Latest
Warning

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

Go to latest
Published: Dec 12, 2024 License: MPL-2.0 Imports: 15 Imported by: 1

README

github.com/hashicorp/go-azure-sdk/resource-manager/resourcegraph/2024-04-01/graphquery Documentation

The graphquery SDK allows for interaction with Azure Resource Manager resourcegraph (API Version 2024-04-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/resourcegraph/2024-04-01/graphquery"

Client Initialization

client := graphquery.NewGraphQueryClientWithBaseURI("https://management.azure.com")
client.Client.Authorizer = authorizer

Example Usage: GraphQueryClient.CreateOrUpdate

ctx := context.TODO()
id := graphquery.NewQueryID("12345678-1234-9876-4563-123456789012", "example-resource-group", "queryName")

payload := graphquery.GraphQueryResource{
	// ...
}


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: GraphQueryClient.Delete

ctx := context.TODO()
id := graphquery.NewQueryID("12345678-1234-9876-4563-123456789012", "example-resource-group", "queryName")

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

ctx := context.TODO()
id := graphquery.NewQueryID("12345678-1234-9876-4563-123456789012", "example-resource-group", "queryName")

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

ctx := context.TODO()
id := commonids.NewResourceGroupID("12345678-1234-9876-4563-123456789012", "example-resource-group")

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

Example Usage: GraphQueryClient.ListBySubscription

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

// alternatively `client.ListBySubscription(ctx, id)` can be used to do batched pagination
items, err := client.ListBySubscriptionComplete(ctx, id)
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 PossibleValuesForResultKind

func PossibleValuesForResultKind() []string

func ValidateQueryID

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

ValidateQueryID checks that 'input' can be parsed as a Query ID

Types

type CreateOrUpdateOperationResponse

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

type DeleteOperationResponse

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

type GetOperationResponse

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

type GraphQueryClient

type GraphQueryClient struct {
	Client *resourcemanager.Client
}

func NewGraphQueryClientWithBaseURI

func NewGraphQueryClientWithBaseURI(sdkApi sdkEnv.Api) (*GraphQueryClient, error)

func (GraphQueryClient) CreateOrUpdate

func (c GraphQueryClient) CreateOrUpdate(ctx context.Context, id QueryId, input GraphQueryResource) (result CreateOrUpdateOperationResponse, err error)

CreateOrUpdate ...

func (GraphQueryClient) Delete

func (c GraphQueryClient) Delete(ctx context.Context, id QueryId) (result DeleteOperationResponse, err error)

Delete ...

func (GraphQueryClient) Get

func (c GraphQueryClient) Get(ctx context.Context, id QueryId) (result GetOperationResponse, err error)

Get ...

func (GraphQueryClient) List

List ...

func (GraphQueryClient) ListBySubscription

ListBySubscription ...

func (GraphQueryClient) ListBySubscriptionComplete

ListBySubscriptionComplete retrieves all the results into a single object

func (GraphQueryClient) ListBySubscriptionCompleteMatchingPredicate

func (c GraphQueryClient) ListBySubscriptionCompleteMatchingPredicate(ctx context.Context, id commonids.SubscriptionId, predicate GraphQueryResourceOperationPredicate) (result ListBySubscriptionCompleteResult, err error)

ListBySubscriptionCompleteMatchingPredicate retrieves all the results and then applies the predicate

func (GraphQueryClient) ListComplete

ListComplete retrieves all the results into a single object

func (GraphQueryClient) ListCompleteMatchingPredicate

func (c GraphQueryClient) ListCompleteMatchingPredicate(ctx context.Context, id commonids.ResourceGroupId, predicate GraphQueryResourceOperationPredicate) (result ListCompleteResult, err error)

ListCompleteMatchingPredicate retrieves all the results and then applies the predicate

type GraphQueryProperties

type GraphQueryProperties struct {
	Description  *string     `json:"description,omitempty"`
	Query        string      `json:"query"`
	ResultKind   *ResultKind `json:"resultKind,omitempty"`
	TimeModified *string     `json:"timeModified,omitempty"`
}

func (*GraphQueryProperties) GetTimeModifiedAsTime

func (o *GraphQueryProperties) GetTimeModifiedAsTime() (*time.Time, error)

func (*GraphQueryProperties) SetTimeModifiedAsTime

func (o *GraphQueryProperties) SetTimeModifiedAsTime(input time.Time)

type GraphQueryResource

type GraphQueryResource struct {
	Etag       *string                `json:"etag,omitempty"`
	Id         *string                `json:"id,omitempty"`
	Location   *string                `json:"location,omitempty"`
	Name       *string                `json:"name,omitempty"`
	Properties *GraphQueryProperties  `json:"properties,omitempty"`
	SystemData *systemdata.SystemData `json:"systemData,omitempty"`
	Tags       *map[string]string     `json:"tags,omitempty"`
	Type       *string                `json:"type,omitempty"`
}

type GraphQueryResourceOperationPredicate

type GraphQueryResourceOperationPredicate struct {
	Etag     *string
	Id       *string
	Location *string
	Name     *string
	Type     *string
}

func (GraphQueryResourceOperationPredicate) Matches

type ListBySubscriptionCompleteResult

type ListBySubscriptionCompleteResult struct {
	LatestHttpResponse *http.Response
	Items              []GraphQueryResource
}

type ListBySubscriptionCustomPager

type ListBySubscriptionCustomPager struct {
	NextLink *odata.Link `json:"nextLink"`
}
func (p *ListBySubscriptionCustomPager) NextPageLink() *odata.Link

type ListBySubscriptionOperationResponse

type ListBySubscriptionOperationResponse struct {
	HttpResponse *http.Response
	OData        *odata.OData
	Model        *[]GraphQueryResource
}

type ListCompleteResult

type ListCompleteResult struct {
	LatestHttpResponse *http.Response
	Items              []GraphQueryResource
}

type ListCustomPager

type ListCustomPager struct {
	NextLink *odata.Link `json:"nextLink"`
}
func (p *ListCustomPager) NextPageLink() *odata.Link

type ListOperationResponse

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

type QueryId

type QueryId struct {
	SubscriptionId    string
	ResourceGroupName string
	QueryName         string
}

QueryId is a struct representing the Resource ID for a Query

func NewQueryID

func NewQueryID(subscriptionId string, resourceGroupName string, queryName string) QueryId

NewQueryID returns a new QueryId struct

func ParseQueryID

func ParseQueryID(input string) (*QueryId, error)

ParseQueryID parses 'input' into a QueryId

func ParseQueryIDInsensitively

func ParseQueryIDInsensitively(input string) (*QueryId, error)

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

func (*QueryId) FromParseResult

func (id *QueryId) FromParseResult(input resourceids.ParseResult) error

func (QueryId) ID

func (id QueryId) ID() string

ID returns the formatted Query ID

func (QueryId) Segments

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

Segments returns a slice of Resource ID Segments which comprise this Query ID

func (QueryId) String

func (id QueryId) String() string

String returns a human-readable description of this Query ID

type ResultKind

type ResultKind string
const (
	ResultKindBasic ResultKind = "basic"
)

func (*ResultKind) UnmarshalJSON

func (s *ResultKind) UnmarshalJSON(bytes []byte) error

Jump to

Keyboard shortcuts

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