Documentation ¶
Index ¶
- func ResourcesAll2[T any](client *Client, ctx context.Context, query QueryRequest) ([]T, error)
- func ResourcesAll3(client *Client, ctx context.Context, query QueryRequest, out any) error
- type AuthorizationScopeFilter
- type Client
- type ClientResourcesHistoryOptions
- type ClientResourcesHistoryResponse
- type ClientResourcesOptions
- type ClientResourcesResponse
- type Column
- type ColumnDataType
- type DateTimeInterval
- type Error
- type ErrorDetails
- type ErrorResponse
- type Facet
- type FacetClassification
- type FacetError
- type FacetRequest
- type FacetRequestOptions
- type FacetResult
- type FacetSortOrder
- type Operation
- type OperationDisplay
- type OperationListResult
- type OperationsClient
- type OperationsClientListOptions
- type OperationsClientListResponse
- type QueryRequest
- type QueryRequestOptions
- type QueryResponse
- type QueryResultPager2
- type QueryResultPager3
- type ResourcesHistoryRequest
- type ResourcesHistoryRequestOptions
- type ResultFormat
- type ResultTruncated
- type Table
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ResourcesAll2 ¶
ResourcesAll2 is a convenience method which executes a query and returns all data unmarshalled into the specified type.
func ResourcesAll3 ¶
ResourcesAll3 is a convenience method which executes a query and returns all data unmarshalled into the specified type.
Types ¶
type AuthorizationScopeFilter ¶
type AuthorizationScopeFilter string
AuthorizationScopeFilter - Defines what level of authorization resources should be returned based on the which subscriptions and management groups are passed as scopes.
const ( AuthorizationScopeFilterAtScopeAndBelow AuthorizationScopeFilter = "AtScopeAndBelow" AuthorizationScopeFilterAtScopeAndAbove AuthorizationScopeFilter = "AtScopeAndAbove" AuthorizationScopeFilterAtScopeExact AuthorizationScopeFilter = "AtScopeExact" AuthorizationScopeFilterAtScopeAboveAndBelow AuthorizationScopeFilter = "AtScopeAboveAndBelow" )
func PossibleAuthorizationScopeFilterValues ¶
func PossibleAuthorizationScopeFilterValues() []AuthorizationScopeFilter
PossibleAuthorizationScopeFilterValues returns the possible values for the AuthorizationScopeFilter const type.
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
Client contains the methods for the ResourceGraphClient group. Don't use this type directly, use NewClient() instead.
func NewClient ¶
func NewClient(credential azcore.TokenCredential, options *arm.ClientOptions) (*Client, error)
NewClient creates a new instance of Client with the specified values. credential - used to authorize requests. Usually a credential from azidentity. options - pass nil to accept the default values.
func (*Client) Resources ¶
func (client *Client) Resources(ctx context.Context, query QueryRequest, options *ClientResourcesOptions) (ClientResourcesResponse, error)
Resources - Queries the resources managed by Azure Resource Manager for scopes specified in the request. If the operation fails it returns an *azcore.ResponseError type. Generated from API version 2021-06-01-preview query - Request specifying query and its options. options - ClientResourcesOptions contains the optional parameters for the Client.Resources method.
func (*Client) ResourcesHistory ¶
func (client *Client) ResourcesHistory(ctx context.Context, request ResourcesHistoryRequest, options *ClientResourcesHistoryOptions) (ClientResourcesHistoryResponse, error)
ResourcesHistory - List all snapshots of a resource for a given time interval. If the operation fails it returns an *azcore.ResponseError type. Generated from API version 2021-06-01-preview request - Request specifying the query and its options. options - ClientResourcesHistoryOptions contains the optional parameters for the Client.ResourcesHistory method.
type ClientResourcesHistoryOptions ¶
type ClientResourcesHistoryOptions struct { }
ClientResourcesHistoryOptions contains the optional parameters for the Client.ResourcesHistory method.
type ClientResourcesHistoryResponse ¶
type ClientResourcesHistoryResponse struct {
// Anything
Interface interface{}
}
ClientResourcesHistoryResponse contains the response from method Client.ResourcesHistory.
type ClientResourcesOptions ¶
type ClientResourcesOptions struct { }
ClientResourcesOptions contains the optional parameters for the Client.Resources method.
type ClientResourcesResponse ¶
type ClientResourcesResponse struct {
QueryResponse
}
ClientResourcesResponse contains the response from method Client.Resources.
type Column ¶
type Column struct { // REQUIRED; Column name. Name *string `json:"name,omitempty"` // REQUIRED; Column data type. Type *ColumnDataType `json:"type,omitempty"` }
Column - Query result column descriptor.
type ColumnDataType ¶
type ColumnDataType string
ColumnDataType - Data type of a column in a table.
const ( ColumnDataTypeString ColumnDataType = "string" ColumnDataTypeInteger ColumnDataType = "integer" ColumnDataTypeNumber ColumnDataType = "number" ColumnDataTypeBoolean ColumnDataType = "boolean" ColumnDataTypeObject ColumnDataType = "object" ColumnDataTypeDatetime ColumnDataType = "datetime" )
func PossibleColumnDataTypeValues ¶
func PossibleColumnDataTypeValues() []ColumnDataType
PossibleColumnDataTypeValues returns the possible values for the ColumnDataType const type.
type DateTimeInterval ¶
type DateTimeInterval struct { // REQUIRED; A datetime indicating the exclusive/open end of the time interval, i.e. [start,end). Specifying an end that occurs // chronologically before start will result in an error. End *time.Time `json:"end,omitempty"` // REQUIRED; A datetime indicating the inclusive/closed start of the time interval, i.e. [start, end). Specifying a start // that occurs chronologically after end will result in an error. Start *time.Time `json:"start,omitempty"` }
DateTimeInterval - An interval in time specifying the date and time for the inclusive start and exclusive end, i.e. [start, end).
func (DateTimeInterval) MarshalJSON ¶
func (d DateTimeInterval) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type DateTimeInterval.
func (*DateTimeInterval) UnmarshalJSON ¶
func (d *DateTimeInterval) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type DateTimeInterval.
type Error ¶
type Error struct { // REQUIRED; Error code identifying the specific error. Code *string `json:"code,omitempty"` // REQUIRED; A human readable error message. Message *string `json:"message,omitempty"` // Error details Details []*ErrorDetails `json:"details,omitempty"` }
Error details.
type ErrorDetails ¶
type ErrorDetails struct { // REQUIRED; Error code identifying the specific error. Code *string `json:"code,omitempty"` // REQUIRED; A human readable error message. Message *string `json:"message,omitempty"` // OPTIONAL; Contains additional key/value pairs not defined in the schema. AdditionalProperties map[string]interface{} }
ErrorDetails - Error details.
func (*ErrorDetails) UnmarshalJSON ¶
func (e *ErrorDetails) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type ErrorDetails.
type ErrorResponse ¶
type ErrorResponse struct { // REQUIRED; Error information. Error *Error `json:"error,omitempty"` }
ErrorResponse - An error response from the API.
type Facet ¶
type Facet struct { // REQUIRED; Facet expression, same as in the corresponding facet request. Expression *string `json:"expression,omitempty"` // REQUIRED; Result type ResultType *string `json:"resultType,omitempty"` }
Facet - A facet containing additional statistics on the response of a query. Can be either FacetResult or FacetError.
type FacetClassification ¶
type FacetClassification interface { // GetFacet returns the Facet content of the underlying type. GetFacet() *Facet }
FacetClassification provides polymorphic access to related types. Call the interface's GetFacet() method to access the common type. Use a type switch to determine the concrete type. The possible types are: - *Facet, *FacetError, *FacetResult
type FacetError ¶
type FacetError struct { // REQUIRED; An array containing detected facet errors with details. Errors []*ErrorDetails `json:"errors,omitempty"` // REQUIRED; Facet expression, same as in the corresponding facet request. Expression *string `json:"expression,omitempty"` // REQUIRED; Result type ResultType *string `json:"resultType,omitempty"` }
FacetError - A facet whose execution resulted in an error.
func (*FacetError) GetFacet ¶
func (f *FacetError) GetFacet() *Facet
GetFacet implements the FacetClassification interface for type FacetError.
func (*FacetError) UnmarshalJSON ¶
func (f *FacetError) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type FacetError.
type FacetRequest ¶
type FacetRequest struct { // REQUIRED; The column or list of columns to summarize by Expression *string `json:"expression,omitempty"` // 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 { // 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"` // The column name or query expression to sort on. Defaults to count if not present. SortBy *string `json:"sortBy,omitempty"` // The sorting order by the selected column (count by default). SortOrder *FacetSortOrder `json:"sortOrder,omitempty"` // 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 { // REQUIRED; Number of records returned in the facet response. Count *int32 `json:"count,omitempty"` // REQUIRED; A JObject array or Table containing the desired facets. Only present if the facet is valid. Data interface{} `json:"data,omitempty"` // REQUIRED; Facet expression, same as in the corresponding facet request. Expression *string `json:"expression,omitempty"` // REQUIRED; Result type ResultType *string `json:"resultType,omitempty"` // REQUIRED; Number of total records in the facet results. TotalRecords *int64 `json:"totalRecords,omitempty"` }
FacetResult - Successfully executed facet containing additional statistics on the response of a query.
func (*FacetResult) GetFacet ¶
func (f *FacetResult) GetFacet() *Facet
GetFacet implements the FacetClassification interface for type FacetResult.
func (*FacetResult) UnmarshalJSON ¶
func (f *FacetResult) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type FacetResult.
type FacetSortOrder ¶
type FacetSortOrder string
FacetSortOrder - The sorting order by the selected column (count by default).
const ( FacetSortOrderAsc FacetSortOrder = "asc" FacetSortOrderDesc FacetSortOrder = "desc" )
func PossibleFacetSortOrderValues ¶
func PossibleFacetSortOrderValues() []FacetSortOrder
PossibleFacetSortOrderValues returns the possible values for the FacetSortOrder const type.
type Operation ¶
type Operation struct { // Display metadata associated with the operation. Display *OperationDisplay `json:"display,omitempty"` // Operation name: {provider}/{resource}/{operation} Name *string `json:"name,omitempty"` // The origin of operations. Origin *string `json:"origin,omitempty"` }
Operation - Resource Graph REST API operation definition.
type OperationDisplay ¶
type OperationDisplay struct { // Description for the operation. Description *string `json:"description,omitempty"` // Type of operation: get, read, delete, etc. Operation *string `json:"operation,omitempty"` // Service provider: Microsoft Resource Graph. Provider *string `json:"provider,omitempty"` // Resource on which the operation is performed etc. Resource *string `json:"resource,omitempty"` }
OperationDisplay - Display metadata associated with the operation.
type OperationListResult ¶
type OperationListResult struct { // 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 {
// contains filtered or unexported fields
}
OperationsClient contains the methods for the Operations group. Don't use this type directly, use NewOperationsClient() instead.
func NewOperationsClient ¶
func NewOperationsClient(credential azcore.TokenCredential, options *arm.ClientOptions) (*OperationsClient, error)
NewOperationsClient creates a new instance of OperationsClient with the specified values. credential - used to authorize requests. Usually a credential from azidentity. options - pass nil to accept the default values.
func (*OperationsClient) NewListPager ¶
func (client *OperationsClient) NewListPager(options *OperationsClientListOptions) *runtime.Pager[OperationsClientListResponse]
NewListPager - Lists all of the available REST API operations. If the operation fails it returns an *azcore.ResponseError type. Generated from API version 2021-06-01-preview options - OperationsClientListOptions contains the optional parameters for the OperationsClient.List method.
type OperationsClientListOptions ¶
type OperationsClientListOptions struct { }
OperationsClientListOptions contains the optional parameters for the OperationsClient.List method.
type OperationsClientListResponse ¶
type OperationsClientListResponse struct {
OperationListResult
}
OperationsClientListResponse contains the response from method OperationsClient.List.
type QueryRequest ¶
type QueryRequest struct { // REQUIRED; The resources query. Query *string `json:"query,omitempty"` // An array of facet requests to be computed against the query result. Facets []*FacetRequest `json:"facets,omitempty"` // Azure management groups against which to execute the query. Example: [ 'mg1', 'mg2' ] ManagementGroups []*string `json:"managementGroups,omitempty"` // The query evaluation options Options *QueryRequestOptions `json:"options,omitempty"` // Azure subscriptions against which to execute the query. Subscriptions []*string `json:"subscriptions,omitempty"` }
QueryRequest - Describes a query to be executed.
func (QueryRequest) MarshalJSON ¶
func (q QueryRequest) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type QueryRequest.
type QueryRequestOptions ¶
type QueryRequestOptions struct { // 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"` // Defines what level of authorization resources should be returned based on the which subscriptions and management groups // are passed as scopes. AuthorizationScopeFilter *AuthorizationScopeFilter `json:"authorizationScopeFilter,omitempty"` // Defines in which format query result returned. ResultFormat *ResultFormat `json:"resultFormat,omitempty"` // 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"` // Continuation token for pagination, capturing the next page size and offset, as well as the context of the query. SkipToken *string `json:"$skipToken,omitempty"` // The maximum number of rows that the query should return. Overrides the page size when $skipToken property is present. Top *int32 `json:"$top,omitempty"` }
QueryRequestOptions - The options for query evaluation
type QueryResponse ¶
type QueryResponse struct { // REQUIRED; 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"` // REQUIRED; Query output in JObject array or Table format. Data interface{} `json:"data,omitempty"` // REQUIRED; Indicates whether the query results are truncated. ResultTruncated *ResultTruncated `json:"resultTruncated,omitempty"` // REQUIRED; Number of total records matching the query. TotalRecords *int64 `json:"totalRecords,omitempty"` // Query facets. Facets []FacetClassification `json:"facets,omitempty"` // 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"` }
QueryResponse - Query result.
func (*QueryResponse) UnmarshalJSON ¶
func (q *QueryResponse) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type QueryResponse.
type QueryResultPager2 ¶
type QueryResultPager2[T any] struct { // contains filtered or unexported fields }
QueryResultPager2 iterates over the query result pages.
func Resources2 ¶
func Resources2[T any](client *Client, ctx context.Context, query QueryRequest) *QueryResultPager2[T]
Resources2 executes a query and returns data unmarshalled into the specified type.
func (*QueryResultPager2[T]) Get ¶
func (q *QueryResultPager2[T]) Get() ([]T, error)
Get returns the data for the current page and advances to the next page.
func (*QueryResultPager2[T]) HasNext ¶
func (q *QueryResultPager2[T]) HasNext() bool
HasNext tells if there is next page.
type QueryResultPager3 ¶
type QueryResultPager3 struct {
// contains filtered or unexported fields
}
QueryResultPager3 iterates over the query result pages.
func Resources3 ¶
func Resources3(client *Client, ctx context.Context, query QueryRequest) *QueryResultPager3
Resources3 executes a query and returns data unmarshalled into the specified type.
func (*QueryResultPager3) Get ¶
func (q *QueryResultPager3) Get(out any) error
Get returns the data for the current page and advances to the next page.
func (*QueryResultPager3) HasNext ¶
func (q *QueryResultPager3) HasNext() bool
HasNext tells if there is next page.
type ResourcesHistoryRequest ¶
type ResourcesHistoryRequest struct { // Azure management groups against which to execute the query. Example: [ 'mg1', 'mg2' ] ManagementGroups []*string `json:"managementGroups,omitempty"` // The history request evaluation options Options *ResourcesHistoryRequestOptions `json:"options,omitempty"` // The resources query. Query *string `json:"query,omitempty"` // Azure subscriptions against which to execute the query. Subscriptions []*string `json:"subscriptions,omitempty"` }
ResourcesHistoryRequest - Describes a history request to be executed.
func (ResourcesHistoryRequest) MarshalJSON ¶
func (r ResourcesHistoryRequest) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type ResourcesHistoryRequest.
type ResourcesHistoryRequestOptions ¶
type ResourcesHistoryRequestOptions struct { // The time interval used to fetch history. Interval *DateTimeInterval `json:"interval,omitempty"` // Defines in which format query result returned. ResultFormat *ResultFormat `json:"resultFormat,omitempty"` // 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"` // Continuation token for pagination, capturing the next page size and offset, as well as the context of the query. SkipToken *string `json:"$skipToken,omitempty"` // The maximum number of rows that the query should return. Overrides the page size when $skipToken property is present. Top *int32 `json:"$top,omitempty"` }
ResourcesHistoryRequestOptions - The options for history request evaluation
type ResultFormat ¶
type ResultFormat string
ResultFormat - Defines in which format query result returned.
const ( ResultFormatTable ResultFormat = "table" ResultFormatObjectArray ResultFormat = "objectArray" )
func PossibleResultFormatValues ¶
func PossibleResultFormatValues() []ResultFormat
PossibleResultFormatValues returns the possible values for the ResultFormat const type.
type ResultTruncated ¶
type ResultTruncated string
ResultTruncated - Indicates whether the query results are truncated.
const ( ResultTruncatedTrue ResultTruncated = "true" ResultTruncatedFalse ResultTruncated = "false" )
func PossibleResultTruncatedValues ¶
func PossibleResultTruncatedValues() []ResultTruncated
PossibleResultTruncatedValues returns the possible values for the ResultTruncated const type.