Documentation ¶
Index ¶
- type AuthorizationScopeFilter
- 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 OperationsListOptions
- type OperationsListResponse
- type OperationsListResult
- type QueryRequest
- type QueryRequestOptions
- type QueryResponse
- type ResourceGraphClient
- func (client *ResourceGraphClient) Resources(ctx context.Context, query QueryRequest, ...) (ResourceGraphClientResourcesResponse, error)
- func (client *ResourceGraphClient) ResourcesHistory(ctx context.Context, request ResourcesHistoryRequest, ...) (ResourceGraphClientResourcesHistoryResponse, error)
- type ResourceGraphClientResourcesHistoryOptions
- type ResourceGraphClientResourcesHistoryResponse
- type ResourceGraphClientResourcesHistoryResult
- type ResourceGraphClientResourcesOptions
- type ResourceGraphClientResourcesResponse
- type ResourceGraphClientResourcesResult
- type ResourcesHistoryRequest
- type ResourcesHistoryRequestOptions
- type ResultFormat
- type ResultTruncated
- type Table
Examples ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
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.
func (AuthorizationScopeFilter) ToPtr ¶
func (c AuthorizationScopeFilter) ToPtr() *AuthorizationScopeFilter
ToPtr returns a *AuthorizationScopeFilter pointing to the current value.
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.
func (ColumnDataType) ToPtr ¶
func (c ColumnDataType) ToPtr() *ColumnDataType
ToPtr returns a *ColumnDataType pointing to the current value.
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.
func (Error) MarshalJSON ¶
MarshalJSON implements the json.Marshaller interface for type Error.
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]map[string]interface{} }
ErrorDetails - Error details.
func (ErrorDetails) MarshalJSON ¶
func (e ErrorDetails) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type ErrorDetails.
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. InnerError *Error `json:"error,omitempty"` // contains filtered or unexported fields }
ErrorResponse - An error response from the API. Implements the error and azcore.HTTPResponse interfaces.
func (ErrorResponse) Error ¶
func (e ErrorResponse) Error() string
Error implements the error interface for type ErrorResponse. The contents of the error text are not contractual and subject to change.
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.
func (*Facet) UnmarshalJSON ¶
UnmarshalJSON implements the json.Unmarshaller interface for type Facet.
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 { Facet // REQUIRED; An array containing detected facet errors with details. Errors []*ErrorDetails `json:"errors,omitempty"` }
FacetError - A facet whose execution resulted in an error.
func (FacetError) MarshalJSON ¶
func (f FacetError) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller 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 { Facet // 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 map[string]interface{} `json:"data,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) MarshalJSON ¶
func (f FacetResult) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller 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.
func (FacetSortOrder) ToPtr ¶
func (c FacetSortOrder) ToPtr() *FacetSortOrder
ToPtr returns a *FacetSortOrder pointing to the current value.
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.
func (OperationListResult) MarshalJSON ¶
func (o OperationListResult) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type OperationListResult.
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
NewOperationsClient creates a new instance of OperationsClient with the specified values.
func (*OperationsClient) List ¶
func (client *OperationsClient) List(ctx context.Context, options *OperationsListOptions) (OperationsListResponse, error)
List - Lists all of the available REST API operations. If the operation fails it returns the *ErrorResponse error type.
Example ¶
x-ms-original-file: specification/resourcegraph/resource-manager/Microsoft.ResourceGraph/preview/2021-06-01-preview/examples/OperationsList.json
package main import ( "context" "log" "github.com/Azure/azure-sdk-for-go/sdk/azidentity" "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/resourcegraph/armresourcegraph" ) func main() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() client := armresourcegraph.NewOperationsClient(cred, nil) _, err = client.List(ctx, nil) if err != nil { log.Fatal(err) } }
Output:
type OperationsListOptions ¶
type OperationsListOptions struct { }
OperationsListOptions contains the optional parameters for the Operations.List method.
type OperationsListResponse ¶
type OperationsListResponse struct { OperationsListResult // RawResponse contains the underlying HTTP response. RawResponse *http.Response }
OperationsListResponse contains the response from method Operations.List.
type OperationsListResult ¶
type OperationsListResult struct {
OperationListResult
}
OperationsListResult contains the result from method Operations.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 map[string]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) MarshalJSON ¶
func (q QueryResponse) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type QueryResponse.
func (*QueryResponse) UnmarshalJSON ¶
func (q *QueryResponse) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type QueryResponse.
type ResourceGraphClient ¶
type ResourceGraphClient struct {
// contains filtered or unexported fields
}
ResourceGraphClient contains the methods for the ResourceGraphClient group. Don't use this type directly, use NewResourceGraphClient() instead.
func NewResourceGraphClient ¶
func NewResourceGraphClient(credential azcore.TokenCredential, options *arm.ClientOptions) *ResourceGraphClient
NewResourceGraphClient creates a new instance of ResourceGraphClient with the specified values.
func (*ResourceGraphClient) Resources ¶
func (client *ResourceGraphClient) Resources(ctx context.Context, query QueryRequest, options *ResourceGraphClientResourcesOptions) (ResourceGraphClientResourcesResponse, error)
Resources - Queries the resources managed by Azure Resource Manager for scopes specified in the request. If the operation fails it returns the *ErrorResponse error type.
Example ¶
x-ms-original-file: specification/resourcegraph/resource-manager/Microsoft.ResourceGraph/preview/2021-06-01-preview/examples/ResourcesPropertiesQuery.json
package main import ( "context" "log" "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" "github.com/Azure/azure-sdk-for-go/sdk/azidentity" "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/resourcegraph/armresourcegraph" ) func main() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() client := armresourcegraph.NewResourceGraphClient(cred, nil) _, err = client.Resources(ctx, armresourcegraph.QueryRequest{ Query: to.StringPtr("<query>"), Subscriptions: []*string{ to.StringPtr("cfbbd179-59d2-4052-aa06-9270a38aa9d6")}, }, nil) if err != nil { log.Fatal(err) } }
Output:
func (*ResourceGraphClient) ResourcesHistory ¶
func (client *ResourceGraphClient) ResourcesHistory(ctx context.Context, request ResourcesHistoryRequest, options *ResourceGraphClientResourcesHistoryOptions) (ResourceGraphClientResourcesHistoryResponse, error)
ResourcesHistory - List all snapshots of a resource for a given time interval. If the operation fails it returns the *ErrorResponse error type.
Example ¶
x-ms-original-file: specification/resourcegraph/resource-manager/Microsoft.ResourceGraph/preview/2021-06-01-preview/examples/ResourcesHistoryMgsGet.json
package main import ( "context" "log" "time" "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" "github.com/Azure/azure-sdk-for-go/sdk/azidentity" "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/resourcegraph/armresourcegraph" ) func main() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() client := armresourcegraph.NewResourceGraphClient(cred, nil) _, err = client.ResourcesHistory(ctx, armresourcegraph.ResourcesHistoryRequest{ ManagementGroups: []*string{ to.StringPtr("e927f598-c1d4-4f72-8541-95d83a6a4ac8"), to.StringPtr("ProductionMG")}, Options: &armresourcegraph.ResourcesHistoryRequestOptions{ Interval: &armresourcegraph.DateTimeInterval{ End: to.TimePtr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-11-12T01:25:00.0000000Z"); return t }()), Start: to.TimePtr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-11-12T01:00:00.0000000Z"); return t }()), }, }, Query: to.StringPtr("<query>"), }, nil) if err != nil { log.Fatal(err) } }
Output:
type ResourceGraphClientResourcesHistoryOptions ¶
type ResourceGraphClientResourcesHistoryOptions struct { }
ResourceGraphClientResourcesHistoryOptions contains the optional parameters for the ResourceGraphClient.ResourcesHistory method.
type ResourceGraphClientResourcesHistoryResponse ¶
type ResourceGraphClientResourcesHistoryResponse struct { ResourceGraphClientResourcesHistoryResult // RawResponse contains the underlying HTTP response. RawResponse *http.Response }
ResourceGraphClientResourcesHistoryResponse contains the response from method ResourceGraphClient.ResourcesHistory.
type ResourceGraphClientResourcesHistoryResult ¶
type ResourceGraphClientResourcesHistoryResult struct { // Any object Object map[string]interface{} }
ResourceGraphClientResourcesHistoryResult contains the result from method ResourceGraphClient.ResourcesHistory.
type ResourceGraphClientResourcesOptions ¶
type ResourceGraphClientResourcesOptions struct { }
ResourceGraphClientResourcesOptions contains the optional parameters for the ResourceGraphClient.Resources method.
type ResourceGraphClientResourcesResponse ¶
type ResourceGraphClientResourcesResponse struct { ResourceGraphClientResourcesResult // RawResponse contains the underlying HTTP response. RawResponse *http.Response }
ResourceGraphClientResourcesResponse contains the response from method ResourceGraphClient.Resources.
type ResourceGraphClientResourcesResult ¶
type ResourceGraphClientResourcesResult struct {
QueryResponse
}
ResourceGraphClientResourcesResult contains the result from method ResourceGraphClient.Resources.
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.
func (ResultFormat) ToPtr ¶
func (c ResultFormat) ToPtr() *ResultFormat
ToPtr returns a *ResultFormat pointing to the current value.
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.
func (ResultTruncated) ToPtr ¶
func (c ResultTruncated) ToPtr() *ResultTruncated
ToPtr returns a *ResultTruncated pointing to the current value.
type Table ¶
type Table struct { // REQUIRED; Query result column descriptors. Columns []*Column `json:"columns,omitempty"` // REQUIRED; Query result rows. Rows [][]map[string]interface{} `json:"rows,omitempty"` }
Table - Query output in tabular format.
func (Table) MarshalJSON ¶
MarshalJSON implements the json.Marshaller interface for type Table.