resourcegraph

package
v61.2.0+incompatible Latest Latest
Warning

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

Go to latest
Published: Jan 14, 2022 License: MIT Imports: 8 Imported by: 0

Documentation

Overview

Package resourcegraph implements the Azure ARM Resourcegraph service API version 2021-03-01.

Azure Resource Graph API Reference

Index

Constants

View Source
const (
	// DefaultBaseURI is the default URI used for the service Resourcegraph
	DefaultBaseURI = "https://management.azure.com"
)

Variables

This section is empty.

Functions

func UserAgent

func UserAgent() string

UserAgent returns the UserAgent string to use when sending http.Requests.

func Version

func Version() string

Version returns the semantic version (see http://semver.org) of the client.

Types

type BaseClient

type BaseClient struct {
	autorest.Client
	BaseURI string
}

BaseClient is the base client for Resourcegraph.

func New

func New() BaseClient

New creates an instance of the BaseClient client.

func NewWithBaseURI

func NewWithBaseURI(baseURI string) BaseClient

NewWithBaseURI creates an instance of the BaseClient client using a custom endpoint. Use this when interacting with an Azure cloud that uses a non-standard base URI (sovereign clouds, Azure stack).

func (BaseClient) Resources

func (client BaseClient) Resources(ctx context.Context, query QueryRequest) (result QueryResponse, err error)

Resources queries the resources managed by Azure Resource Manager for scopes specified in the request. Parameters: query - request specifying query and its options.

func (BaseClient) ResourcesPreparer

func (client BaseClient) ResourcesPreparer(ctx context.Context, query QueryRequest) (*http.Request, error)

ResourcesPreparer prepares the Resources request.

func (BaseClient) ResourcesResponder

func (client BaseClient) ResourcesResponder(resp *http.Response) (result QueryResponse, err error)

ResourcesResponder handles the response to the Resources request. The method always closes the http.Response Body.

func (BaseClient) ResourcesSender

func (client BaseClient) ResourcesSender(req *http.Request) (*http.Response, error)

ResourcesSender sends the Resources request. The method will close the http.Response Body if it receives an error.

type BasicFacet

type BasicFacet interface {
	AsFacetResult() (*FacetResult, bool)
	AsFacetError() (*FacetError, bool)
	AsFacet() (*Facet, bool)
}

BasicFacet a facet containing additional statistics on the response of a query. Can be either FacetResult or FacetError.

type Column

type Column struct {
	// Name - Column name.
	Name *string `json:"name,omitempty"`
	// Type - Column data type. Possible values include: 'String', 'Integer', 'Number', 'Boolean', 'Object'
	Type ColumnDataType `json:"type,omitempty"`
}

Column query result column descriptor.

type ColumnDataType

type ColumnDataType string

ColumnDataType enumerates the values for column data type.

const (
	// Boolean ...
	Boolean ColumnDataType = "boolean"
	// Integer ...
	Integer ColumnDataType = "integer"
	// Number ...
	Number ColumnDataType = "number"
	// Object ...
	Object ColumnDataType = "object"
	// String ...
	String ColumnDataType = "string"
)

func PossibleColumnDataTypeValues

func PossibleColumnDataTypeValues() []ColumnDataType

PossibleColumnDataTypeValues returns an array of possible values for the ColumnDataType const type.

type Error

type Error struct {
	// Code - Error code identifying the specific error.
	Code *string `json:"code,omitempty"`
	// Message - A human readable error message.
	Message *string `json:"message,omitempty"`
	// Details - Error details
	Details *[]ErrorDetails `json:"details,omitempty"`
}

Error error details.

type ErrorDetails

type ErrorDetails struct {
	// AdditionalProperties - Unmatched properties from the message are deserialized this collection
	AdditionalProperties map[string]interface{} `json:""`
	// Code - Error code identifying the specific error.
	Code *string `json:"code,omitempty"`
	// Message - A human readable error message.
	Message *string `json:"message,omitempty"`
}

ErrorDetails ...

func (ErrorDetails) MarshalJSON

func (ed ErrorDetails) MarshalJSON() ([]byte, error)

MarshalJSON is the custom marshaler for ErrorDetails.

func (*ErrorDetails) UnmarshalJSON

func (ed *ErrorDetails) UnmarshalJSON(body []byte) error

UnmarshalJSON is the custom unmarshaler for ErrorDetails struct.

type ErrorResponse

type ErrorResponse struct {
	// Error - Error information.
	Error *Error `json:"error,omitempty"`
}

ErrorResponse an error response from the API.

type Facet

type Facet struct {
	// Expression - Facet expression, same as in the corresponding facet request.
	Expression *string `json:"expression,omitempty"`
	// ResultType - Possible values include: 'ResultTypeFacet', 'ResultTypeFacetResult', 'ResultTypeFacetError'
	ResultType ResultType `json:"resultType,omitempty"`
}

Facet a facet containing additional statistics on the response of a query. Can be either FacetResult or FacetError.

func (Facet) AsBasicFacet

func (f Facet) AsBasicFacet() (BasicFacet, bool)

AsBasicFacet is the BasicFacet implementation for Facet.

func (Facet) AsFacet

func (f Facet) AsFacet() (*Facet, bool)

AsFacet is the BasicFacet implementation for Facet.

func (Facet) AsFacetError

func (f Facet) AsFacetError() (*FacetError, bool)

AsFacetError is the BasicFacet implementation for Facet.

func (Facet) AsFacetResult

func (f Facet) AsFacetResult() (*FacetResult, bool)

AsFacetResult is the BasicFacet implementation for Facet.

func (Facet) MarshalJSON

func (f Facet) MarshalJSON() ([]byte, error)

MarshalJSON is the custom marshaler for Facet.

type FacetError

type FacetError struct {
	// Errors - An array containing detected facet errors with details.
	Errors *[]ErrorDetails `json:"errors,omitempty"`
	// Expression - Facet expression, same as in the corresponding facet request.
	Expression *string `json:"expression,omitempty"`
	// ResultType - Possible values include: 'ResultTypeFacet', 'ResultTypeFacetResult', 'ResultTypeFacetError'
	ResultType ResultType `json:"resultType,omitempty"`
}

FacetError a facet whose execution resulted in an error.

func (FacetError) AsBasicFacet

func (fe FacetError) AsBasicFacet() (BasicFacet, bool)

AsBasicFacet is the BasicFacet implementation for FacetError.

func (FacetError) AsFacet

func (fe FacetError) AsFacet() (*Facet, bool)

AsFacet is the BasicFacet implementation for FacetError.

func (FacetError) AsFacetError

func (fe FacetError) AsFacetError() (*FacetError, bool)

AsFacetError is the BasicFacet implementation for FacetError.

func (FacetError) AsFacetResult

func (fe FacetError) AsFacetResult() (*FacetResult, bool)

AsFacetResult is the BasicFacet implementation for FacetError.

func (FacetError) MarshalJSON

func (fe FacetError) MarshalJSON() ([]byte, error)

MarshalJSON is the custom marshaler for FacetError.

type FacetRequest

type FacetRequest struct {
	// Expression - The column or list of columns to summarize by
	Expression *string `json:"expression,omitempty"`
	// Options - The options for facet evaluation
	Options *FacetRequestOptions `json:"options,omitempty"`
}

FacetRequest a request to compute additional statistics (facets) over the query results.

type FacetRequestOptions

type FacetRequestOptions struct {
	// SortBy - The column name or query expression to sort on. Defaults to count if not present.
	SortBy *string `json:"sortBy,omitempty"`
	// SortOrder - The sorting order by the selected column (count by default). Possible values include: 'Asc', 'Desc'
	SortOrder FacetSortOrder `json:"sortOrder,omitempty"`
	// Filter - Specifies the filter condition for the 'where' clause which will be run on main query's result, just before the actual faceting.
	Filter *string `json:"filter,omitempty"`
	// Top - The maximum number of facet rows that should be returned.
	Top *int32 `json:"$top,omitempty"`
}

FacetRequestOptions the options for facet evaluation

type FacetResult

type FacetResult struct {
	// TotalRecords - Number of total records in the facet results.
	TotalRecords *int64 `json:"totalRecords,omitempty"`
	// Count - Number of records returned in the facet response.
	Count *int32 `json:"count,omitempty"`
	// Data - A JObject array or Table containing the desired facets. Only present if the facet is valid.
	Data interface{} `json:"data,omitempty"`
	// Expression - Facet expression, same as in the corresponding facet request.
	Expression *string `json:"expression,omitempty"`
	// ResultType - Possible values include: 'ResultTypeFacet', 'ResultTypeFacetResult', 'ResultTypeFacetError'
	ResultType ResultType `json:"resultType,omitempty"`
}

FacetResult successfully executed facet containing additional statistics on the response of a query.

func (FacetResult) AsBasicFacet

func (fr FacetResult) AsBasicFacet() (BasicFacet, bool)

AsBasicFacet is the BasicFacet implementation for FacetResult.

func (FacetResult) AsFacet

func (fr FacetResult) AsFacet() (*Facet, bool)

AsFacet is the BasicFacet implementation for FacetResult.

func (FacetResult) AsFacetError

func (fr FacetResult) AsFacetError() (*FacetError, bool)

AsFacetError is the BasicFacet implementation for FacetResult.

func (FacetResult) AsFacetResult

func (fr FacetResult) AsFacetResult() (*FacetResult, bool)

AsFacetResult is the BasicFacet implementation for FacetResult.

func (FacetResult) MarshalJSON

func (fr FacetResult) MarshalJSON() ([]byte, error)

MarshalJSON is the custom marshaler for FacetResult.

type FacetSortOrder

type FacetSortOrder string

FacetSortOrder enumerates the values for facet sort order.

const (
	// Asc ...
	Asc FacetSortOrder = "asc"
	// Desc ...
	Desc FacetSortOrder = "desc"
)

func PossibleFacetSortOrderValues

func PossibleFacetSortOrderValues() []FacetSortOrder

PossibleFacetSortOrderValues returns an array of possible values for the FacetSortOrder const type.

type Operation

type Operation struct {
	// Name - Operation name: {provider}/{resource}/{operation}
	Name *string `json:"name,omitempty"`
	// Display - Display metadata associated with the operation.
	Display *OperationDisplay `json:"display,omitempty"`
	// Origin - The origin of operations.
	Origin *string `json:"origin,omitempty"`
}

Operation resource Graph REST API operation definition.

type OperationDisplay

type OperationDisplay struct {
	// Provider - Service provider: Microsoft Resource Graph.
	Provider *string `json:"provider,omitempty"`
	// Resource - Resource on which the operation is performed etc.
	Resource *string `json:"resource,omitempty"`
	// Operation - Type of operation: get, read, delete, etc.
	Operation *string `json:"operation,omitempty"`
	// Description - Description for the operation.
	Description *string `json:"description,omitempty"`
}

OperationDisplay display metadata associated with the operation.

type OperationListResult

type OperationListResult struct {
	autorest.Response `json:"-"`
	// Value - List of Resource Graph operations supported by the Resource Graph resource provider.
	Value *[]Operation `json:"value,omitempty"`
}

OperationListResult result of the request to list Resource Graph operations. It contains a list of operations and a URL link to get the next set of results.

type OperationsClient

type OperationsClient struct {
	BaseClient
}

OperationsClient is the azure Resource Graph API Reference

func NewOperationsClient

func NewOperationsClient() OperationsClient

NewOperationsClient creates an instance of the OperationsClient client.

func NewOperationsClientWithBaseURI

func NewOperationsClientWithBaseURI(baseURI string) OperationsClient

NewOperationsClientWithBaseURI creates an instance of the OperationsClient client using a custom endpoint. Use this when interacting with an Azure cloud that uses a non-standard base URI (sovereign clouds, Azure stack).

func (OperationsClient) List

func (client OperationsClient) List(ctx context.Context) (result OperationListResult, err error)

List lists all of the available REST API operations.

func (OperationsClient) ListPreparer

func (client OperationsClient) ListPreparer(ctx context.Context) (*http.Request, error)

ListPreparer prepares the List request.

func (OperationsClient) ListResponder

func (client OperationsClient) ListResponder(resp *http.Response) (result OperationListResult, err error)

ListResponder handles the response to the List request. The method always closes the http.Response Body.

func (OperationsClient) ListSender

func (client OperationsClient) ListSender(req *http.Request) (*http.Response, error)

ListSender sends the List request. The method will close the http.Response Body if it receives an error.

type QueryRequest

type QueryRequest struct {
	// Subscriptions - Azure subscriptions against which to execute the query.
	Subscriptions *[]string `json:"subscriptions,omitempty"`
	// ManagementGroups - Azure management groups against which to execute the query. Example: [ 'mg1', 'mg2' ]
	ManagementGroups *[]string `json:"managementGroups,omitempty"`
	// Query - The resources query.
	Query *string `json:"query,omitempty"`
	// Options - The query evaluation options
	Options *QueryRequestOptions `json:"options,omitempty"`
	// Facets - An array of facet requests to be computed against the query result.
	Facets *[]FacetRequest `json:"facets,omitempty"`
}

QueryRequest describes a query to be executed.

type QueryRequestOptions

type QueryRequestOptions struct {
	// SkipToken - Continuation token for pagination, capturing the next page size and offset, as well as the context of the query.
	SkipToken *string `json:"$skipToken,omitempty"`
	// Top - The maximum number of rows that the query should return. Overrides the page size when “`$skipToken“` property is present.
	Top *int32 `json:"$top,omitempty"`
	// Skip - The number of rows to skip from the beginning of the results. Overrides the next page offset when “`$skipToken“` property is present.
	Skip *int32 `json:"$skip,omitempty"`
	// ResultFormat - Defines in which format query result returned. Possible values include: 'ResultFormatTable', 'ResultFormatObjectArray'
	ResultFormat ResultFormat `json:"resultFormat,omitempty"`
	// AllowPartialScopes - Only applicable for tenant and management group level queries to decide whether to allow partial scopes for result in case the number of subscriptions exceed allowed limits.
	AllowPartialScopes *bool `json:"allowPartialScopes,omitempty"`
}

QueryRequestOptions the options for query evaluation

type QueryResponse

type QueryResponse struct {
	autorest.Response `json:"-"`
	// TotalRecords - Number of total records matching the query.
	TotalRecords *int64 `json:"totalRecords,omitempty"`
	// Count - Number of records returned in the current response. In the case of paging, this is the number of records in the current page.
	Count *int64 `json:"count,omitempty"`
	// ResultTruncated - Indicates whether the query results are truncated. Possible values include: 'True', 'False'
	ResultTruncated ResultTruncated `json:"resultTruncated,omitempty"`
	// SkipToken - When present, the value can be passed to a subsequent query call (together with the same query and scopes used in the current request) to retrieve the next page of data.
	SkipToken *string `json:"$skipToken,omitempty"`
	// Data - Query output in JObject array or Table format.
	Data interface{} `json:"data,omitempty"`
	// Facets - Query facets.
	Facets *[]BasicFacet `json:"facets,omitempty"`
}

QueryResponse query result.

func (*QueryResponse) UnmarshalJSON

func (qr *QueryResponse) UnmarshalJSON(body []byte) error

UnmarshalJSON is the custom unmarshaler for QueryResponse struct.

type ResultFormat

type ResultFormat string

ResultFormat enumerates the values for result format.

const (
	// ResultFormatObjectArray ...
	ResultFormatObjectArray ResultFormat = "objectArray"
	// ResultFormatTable ...
	ResultFormatTable ResultFormat = "table"
)

func PossibleResultFormatValues

func PossibleResultFormatValues() []ResultFormat

PossibleResultFormatValues returns an array of possible values for the ResultFormat const type.

type ResultTruncated

type ResultTruncated string

ResultTruncated enumerates the values for result truncated.

const (
	// False ...
	False ResultTruncated = "false"
	// True ...
	True ResultTruncated = "true"
)

func PossibleResultTruncatedValues

func PossibleResultTruncatedValues() []ResultTruncated

PossibleResultTruncatedValues returns an array of possible values for the ResultTruncated const type.

type ResultType

type ResultType string

ResultType enumerates the values for result type.

const (
	// ResultTypeFacet ...
	ResultTypeFacet ResultType = "Facet"
	// ResultTypeFacetError ...
	ResultTypeFacetError ResultType = "FacetError"
	// ResultTypeFacetResult ...
	ResultTypeFacetResult ResultType = "FacetResult"
)

func PossibleResultTypeValues

func PossibleResultTypeValues() []ResultType

PossibleResultTypeValues returns an array of possible values for the ResultType const type.

type Table

type Table struct {
	// Columns - Query result column descriptors.
	Columns *[]Column `json:"columns,omitempty"`
	// Rows - Query result rows.
	Rows *[][]interface{} `json:"rows,omitempty"`
}

Table query output in tabular format.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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