...

Package resourcegraph

import "github.com/Azure/azure-sdk-for-go/services/resourcegraph/mgmt/2019-04-01/resourcegraph"
Overview
Index
Subdirectories

Overview ▾

Deprecated: Please note, this package has been deprecated. A replacement package is available github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/resourcegraph/armresourcegraph(https://pkg.go.dev/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/resourcegraph/armresourcegraph). We strongly encourage you to upgrade to continue receiving updates. See [Migration Guide](https://aka.ms/azsdk/golang/t2/migration) for guidance on upgrading. Refer to our [deprecation policy](https://azure.github.io/azure-sdk/policies_support.html) for more details.

Package resourcegraph implements the Azure ARM Resourcegraph service API version 2019-04-01.

Azure Resource Graph API Reference

Index ▾

Constants
func UserAgent() string
func Version() string
type BaseClient
    func New() BaseClient
    func NewWithBaseURI(baseURI string) BaseClient
    func (client BaseClient) Resources(ctx context.Context, query QueryRequest) (result QueryResponse, err error)
    func (client BaseClient) ResourcesPreparer(ctx context.Context, query QueryRequest) (*http.Request, error)
    func (client BaseClient) ResourcesResponder(resp *http.Response) (result QueryResponse, err error)
    func (client BaseClient) ResourcesSender(req *http.Request) (*http.Response, error)
type BasicFacet
type Column
type ColumnDataType
    func PossibleColumnDataTypeValues() []ColumnDataType
type Error
type ErrorDetails
    func (ed ErrorDetails) MarshalJSON() ([]byte, error)
    func (ed *ErrorDetails) UnmarshalJSON(body []byte) error
type ErrorResponse
type Facet
    func (f Facet) AsBasicFacet() (BasicFacet, bool)
    func (f Facet) AsFacet() (*Facet, bool)
    func (f Facet) AsFacetError() (*FacetError, bool)
    func (f Facet) AsFacetResult() (*FacetResult, bool)
    func (f Facet) MarshalJSON() ([]byte, error)
type FacetError
    func (fe FacetError) AsBasicFacet() (BasicFacet, bool)
    func (fe FacetError) AsFacet() (*Facet, bool)
    func (fe FacetError) AsFacetError() (*FacetError, bool)
    func (fe FacetError) AsFacetResult() (*FacetResult, bool)
    func (fe FacetError) MarshalJSON() ([]byte, error)
type FacetRequest
type FacetRequestOptions
type FacetResult
    func (fr FacetResult) AsBasicFacet() (BasicFacet, bool)
    func (fr FacetResult) AsFacet() (*Facet, bool)
    func (fr FacetResult) AsFacetError() (*FacetError, bool)
    func (fr FacetResult) AsFacetResult() (*FacetResult, bool)
    func (fr FacetResult) MarshalJSON() ([]byte, error)
type FacetSortOrder
    func PossibleFacetSortOrderValues() []FacetSortOrder
type Operation
type OperationDisplay
type OperationListResult
type OperationsClient
    func NewOperationsClient() OperationsClient
    func NewOperationsClientWithBaseURI(baseURI string) OperationsClient
    func (client OperationsClient) List(ctx context.Context) (result OperationListResult, err error)
    func (client OperationsClient) ListPreparer(ctx context.Context) (*http.Request, error)
    func (client OperationsClient) ListResponder(resp *http.Response) (result OperationListResult, err error)
    func (client OperationsClient) ListSender(req *http.Request) (*http.Response, error)
type QueryRequest
type QueryRequestOptions
type QueryResponse
    func (qr *QueryResponse) UnmarshalJSON(body []byte) error
type ResultFormat
    func PossibleResultFormatValues() []ResultFormat
type ResultTruncated
    func PossibleResultTruncatedValues() []ResultTruncated
type ResultType
    func PossibleResultTypeValues() []ResultType
type Table

Package files

client.go enums.go models.go operations.go version.go

Constants

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

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.

type BaseClient

BaseClient is the base client for Resourcegraph.

type BaseClient struct {
    autorest.Client
    BaseURI string
}

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 all subscriptions 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

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)
}

type Column

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"`
}

type ColumnDataType

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

func PossibleColumnDataTypeValues() []ColumnDataType

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

type Error

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"`
}

type ErrorDetails

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 (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

ErrorResponse an error response from the API.

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

type Facet

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 (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

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 (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

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"`
}

type FacetRequestOptions

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"`
}

type FacetResult

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 (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

FacetSortOrder enumerates the values for facet sort order.

type FacetSortOrder string
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

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"`
}

type OperationDisplay

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"`
}

type OperationListResult

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"`
}

type OperationsClient

OperationsClient is the azure Resource Graph API Reference

type OperationsClient struct {
    BaseClient
}

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

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"`
}

type QueryRequestOptions

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"`
}

type QueryResponse

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 (*QueryResponse) UnmarshalJSON

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

UnmarshalJSON is the custom unmarshaler for QueryResponse struct.

type ResultFormat

ResultFormat enumerates the values for result format.

type ResultFormat string
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

ResultTruncated enumerates the values for result truncated.

type ResultTruncated string
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

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

func PossibleResultTypeValues() []ResultType

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

type Table

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"`
}

Subdirectories

Name Synopsis
..
resourcegraphapi Deprecated: Please note, this package has been deprecated.