const ( // DefaultBaseURI is the default URI used for the service Resourcegraph DefaultBaseURI = "https://management.azure.com" )
func UserAgent() string
UserAgent returns the UserAgent string to use when sending http.Requests.
func Version() string
Version returns the semantic version (see http://semver.org) of the client.
BaseClient is the base client for Resourcegraph.
type BaseClient struct { autorest.Client BaseURI string }
func New() BaseClient
New creates an instance of the BaseClient client.
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 (client BaseClient) Resources(ctx context.Context, query QueryRequest) (result QueryResponse, err error)
Resources queries the resources managed by Azure Resource Manager for all subscriptions specified in the request. Parameters: query - request specifying query and its options.
func (client BaseClient) ResourcesPreparer(ctx context.Context, query QueryRequest) (*http.Request, error)
ResourcesPreparer prepares the Resources request.
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 (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.
BasicFacet a facet containing additional statistics on the response of a query. Can be either FacetResult or FacetError.
type BasicFacet interface { AsFacetResult() (*FacetResult, bool) AsFacetError() (*FacetError, bool) AsFacet() (*Facet, bool) }
Column query result column descriptor.
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"` }
ColumnDataType enumerates the values for column data type.
type ColumnDataType string
const ( // Boolean ... Boolean ColumnDataType = "boolean" // Integer ... Integer ColumnDataType = "integer" // Number ... Number ColumnDataType = "number" // Object ... Object ColumnDataType = "object" // String ... String ColumnDataType = "string" )
func PossibleColumnDataTypeValues() []ColumnDataType
PossibleColumnDataTypeValues returns an array of possible values for the ColumnDataType const type.
Error error details.
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"` }
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"` }
func (ed ErrorDetails) MarshalJSON() ([]byte, error)
MarshalJSON is the custom marshaler for ErrorDetails.
func (ed *ErrorDetails) UnmarshalJSON(body []byte) error
UnmarshalJSON is the custom unmarshaler for ErrorDetails struct.
ErrorResponse an error response from the API.
type ErrorResponse struct { // Error - Error information. Error *Error `json:"error,omitempty"` }
Facet a facet containing additional statistics on the response of a query. Can be either FacetResult or FacetError.
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"` }
func (f Facet) AsBasicFacet() (BasicFacet, bool)
AsBasicFacet is the BasicFacet implementation for Facet.
func (f Facet) AsFacet() (*Facet, bool)
AsFacet is the BasicFacet implementation for Facet.
func (f Facet) AsFacetError() (*FacetError, bool)
AsFacetError is the BasicFacet implementation for Facet.
func (f Facet) AsFacetResult() (*FacetResult, bool)
AsFacetResult is the BasicFacet implementation for Facet.
func (f Facet) MarshalJSON() ([]byte, error)
MarshalJSON is the custom marshaler for Facet.
FacetError a facet whose execution resulted in an error.
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"` }
func (fe FacetError) AsBasicFacet() (BasicFacet, bool)
AsBasicFacet is the BasicFacet implementation for FacetError.
func (fe FacetError) AsFacet() (*Facet, bool)
AsFacet is the BasicFacet implementation for FacetError.
func (fe FacetError) AsFacetError() (*FacetError, bool)
AsFacetError is the BasicFacet implementation for FacetError.
func (fe FacetError) AsFacetResult() (*FacetResult, bool)
AsFacetResult is the BasicFacet implementation for FacetError.
func (fe FacetError) MarshalJSON() ([]byte, error)
MarshalJSON is the custom marshaler for FacetError.
FacetRequest a request to compute additional statistics (facets) over the query results.
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"` }
FacetRequestOptions the options for facet evaluation
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"` }
FacetResult successfully executed facet containing additional statistics on the response of a query.
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 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"` }
func (fr FacetResult) AsBasicFacet() (BasicFacet, bool)
AsBasicFacet is the BasicFacet implementation for FacetResult.
func (fr FacetResult) AsFacet() (*Facet, bool)
AsFacet is the BasicFacet implementation for FacetResult.
func (fr FacetResult) AsFacetError() (*FacetError, bool)
AsFacetError is the BasicFacet implementation for FacetResult.
func (fr FacetResult) AsFacetResult() (*FacetResult, bool)
AsFacetResult is the BasicFacet implementation for FacetResult.
func (fr FacetResult) MarshalJSON() ([]byte, error)
MarshalJSON is the custom marshaler for FacetResult.
FacetSortOrder enumerates the values for facet sort order.
type FacetSortOrder string
const ( // Asc ... Asc FacetSortOrder = "asc" // Desc ... Desc FacetSortOrder = "desc" )
func PossibleFacetSortOrderValues() []FacetSortOrder
PossibleFacetSortOrderValues returns an array of possible values for the FacetSortOrder const type.
Operation resource Graph REST API operation definition.
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"` }
OperationDisplay display metadata associated with the operation.
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"` }
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 OperationListResult struct { autorest.Response `json:"-"` // Value - List of Resource Graph operations supported by the Resource Graph resource provider. Value *[]Operation `json:"value,omitempty"` }
OperationsClient is the azure Resource Graph API Reference
type OperationsClient struct { BaseClient }
func NewOperationsClient() OperationsClient
NewOperationsClient creates an instance of the OperationsClient client.
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 (client OperationsClient) List(ctx context.Context) (result OperationListResult, err error)
List lists all of the available REST API operations.
func (client OperationsClient) ListPreparer(ctx context.Context) (*http.Request, error)
ListPreparer prepares the List request.
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 (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.
QueryRequest describes a query to be executed.
type QueryRequest struct { // Subscriptions - Azure subscriptions against which to execute the query. Subscriptions *[]string `json:"subscriptions,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"` }
QueryRequestOptions the options for query evaluation
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"` }
QueryResponse query result.
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 subscriptions used in the current request) to retrieve the next page of data. SkipToken *string `json:"$skipToken,omitempty"` // Data - Query output in tabular format. Data interface{} `json:"data,omitempty"` // Facets - Query facets. Facets *[]BasicFacet `json:"facets,omitempty"` }
func (qr *QueryResponse) UnmarshalJSON(body []byte) error
UnmarshalJSON is the custom unmarshaler for QueryResponse struct.
ResultFormat enumerates the values for result format.
type ResultFormat string
const ( // ResultFormatObjectArray ... ResultFormatObjectArray ResultFormat = "objectArray" // ResultFormatTable ... ResultFormatTable ResultFormat = "table" )
func PossibleResultFormatValues() []ResultFormat
PossibleResultFormatValues returns an array of possible values for the ResultFormat const type.
ResultTruncated enumerates the values for result truncated.
type ResultTruncated string
const ( // False ... False ResultTruncated = "false" // True ... True ResultTruncated = "true" )
func PossibleResultTruncatedValues() []ResultTruncated
PossibleResultTruncatedValues returns an array of possible values for the ResultTruncated const type.
ResultType enumerates the values for result type.
type ResultType string
const ( // ResultTypeFacet ... ResultTypeFacet ResultType = "Facet" // ResultTypeFacetError ... ResultTypeFacetError ResultType = "FacetError" // ResultTypeFacetResult ... ResultTypeFacetResult ResultType = "FacetResult" )
func PossibleResultTypeValues() []ResultType
PossibleResultTypeValues returns an array of possible values for the ResultType const type.
Table query output in tabular format.
type Table struct { // Columns - Query result column descriptors. Columns *[]Column `json:"columns,omitempty"` // Rows - Query result rows. Rows *[][]interface{} `json:"rows,omitempty"` }
Name | Synopsis |
---|---|
.. | |
resourcegraphapi | Deprecated: Please note, this package has been deprecated. |