Documentation ¶
Overview ¶
Package globalsearchv2 : Operations and models for the GlobalSearchV2 service
Index ¶
- Constants
- func UnmarshalResultItem(m map[string]json.RawMessage, result interface{}) (err error)
- func UnmarshalScanResult(m map[string]json.RawMessage, result interface{}) (err error)
- func UnmarshalSupportedTypesList(m map[string]json.RawMessage, result interface{}) (err error)
- type GetSupportedTypesOptions
- type GlobalSearchV2
- func (globalSearch *GlobalSearchV2) GetSupportedTypes(getSupportedTypesOptions *GetSupportedTypesOptions) (result *SupportedTypesList, response *core.DetailedResponse, err error)
- func (*GlobalSearchV2) NewGetSupportedTypesOptions() *GetSupportedTypesOptions
- func (*GlobalSearchV2) NewSearchOptions() *SearchOptions
- func (globalSearch *GlobalSearchV2) Search(searchOptions *SearchOptions) (result *ScanResult, response *core.DetailedResponse, err error)
- func (globalSearch *GlobalSearchV2) SetServiceURL(url string) error
- type GlobalSearchV2Options
- type ResultItem
- type ScanResult
- type SearchOptions
- func (options *SearchOptions) SetAccountID(accountID string) *SearchOptions
- func (options *SearchOptions) SetFields(fields []string) *SearchOptions
- func (options *SearchOptions) SetHeaders(param map[string]string) *SearchOptions
- func (options *SearchOptions) SetLimit(limit int64) *SearchOptions
- func (options *SearchOptions) SetQuery(query string) *SearchOptions
- func (options *SearchOptions) SetSearchCursor(searchCursor string) *SearchOptions
- func (options *SearchOptions) SetSort(sort []string) *SearchOptions
- func (options *SearchOptions) SetTimeout(timeout int64) *SearchOptions
- func (options *SearchOptions) SetTransactionID(transactionID string) *SearchOptions
- type SupportedTypesList
Constants ¶
const DefaultServiceName = "global_search"
DefaultServiceName is the default key used to find external configuration information.
const DefaultServiceURL = "https://api.global-search-tagging.cloud.ibm.com"
DefaultServiceURL is the default URL to make service requests to.
Variables ¶
This section is empty.
Functions ¶
func UnmarshalResultItem ¶
func UnmarshalResultItem(m map[string]json.RawMessage, result interface{}) (err error)
UnmarshalResultItem unmarshals an instance of ResultItem from the specified map of raw messages.
func UnmarshalScanResult ¶
func UnmarshalScanResult(m map[string]json.RawMessage, result interface{}) (err error)
UnmarshalScanResult unmarshals an instance of ScanResult from the specified map of raw messages.
func UnmarshalSupportedTypesList ¶
func UnmarshalSupportedTypesList(m map[string]json.RawMessage, result interface{}) (err error)
UnmarshalSupportedTypesList unmarshals an instance of SupportedTypesList from the specified map of raw messages.
Types ¶
type GetSupportedTypesOptions ¶
type GetSupportedTypesOptions struct { // Allows users to set headers on API requests Headers map[string]string }
GetSupportedTypesOptions : The GetSupportedTypes options.
func (*GetSupportedTypesOptions) SetHeaders ¶
func (options *GetSupportedTypesOptions) SetHeaders(param map[string]string) *GetSupportedTypesOptions
SetHeaders : Allow user to set Headers
type GlobalSearchV2 ¶
type GlobalSearchV2 struct {
Service *core.BaseService
}
GlobalSearchV2 : Search for resources with the global and shared resource properties repository integrated in the IBM Cloud Platform. The search repository stores and searches cloud resources attributes, which categorize or classify resources. A resource is a physical or logical component that can be provisioned or reserved for an application or service instance and is owned by resource providers, such as Cloud Foundry, IBM containers, or Resource Controller, in the IBM Cloud platform. Resources are uniquely identified by a CRN (Cloud Resource Naming identifier) or by an IMS ID. The properties of a resource include tags and system properties. Both properties are defined in an IBM Cloud billing account, and span across many regions.
Version: 2.0.1
func NewGlobalSearchV2 ¶
func NewGlobalSearchV2(options *GlobalSearchV2Options) (service *GlobalSearchV2, err error)
NewGlobalSearchV2 : constructs an instance of GlobalSearchV2 with passed in options.
func NewGlobalSearchV2UsingExternalConfig ¶
func NewGlobalSearchV2UsingExternalConfig(options *GlobalSearchV2Options) (globalSearch *GlobalSearchV2, err error)
NewGlobalSearchV2UsingExternalConfig : constructs an instance of GlobalSearchV2 with passed in options and external configuration.
func (*GlobalSearchV2) GetSupportedTypes ¶
func (globalSearch *GlobalSearchV2) GetSupportedTypes(getSupportedTypesOptions *GetSupportedTypesOptions) (result *SupportedTypesList, response *core.DetailedResponse, err error)
GetSupportedTypes : Get all supported resource types Retrieves a list of all the resource types supported by GhoST.
func (*GlobalSearchV2) NewGetSupportedTypesOptions ¶
func (*GlobalSearchV2) NewGetSupportedTypesOptions() *GetSupportedTypesOptions
NewGetSupportedTypesOptions : Instantiate GetSupportedTypesOptions
func (*GlobalSearchV2) NewSearchOptions ¶
func (*GlobalSearchV2) NewSearchOptions() *SearchOptions
NewSearchOptions : Instantiate SearchOptions
func (*GlobalSearchV2) Search ¶
func (globalSearch *GlobalSearchV2) Search(searchOptions *SearchOptions) (result *ScanResult, response *core.DetailedResponse, err error)
Search : Find instances of resources 'Find cloud foundry resources, resource controlled enabled resources, or storage and network resources running on classic infrastructure in a specific account ID. You can apply query strings if necessary. To filter results, you can insert a string using the Lucene syntax and the query string is parsed into a series of terms and operators. A term can be a single word or a phrase, in which case the search is performed for all the words, in the same order. To filter for a specific value regardless of the property that contains it, use an asterisk as the key name. Only resources that belong to the account ID and that are accessible by the client are returned. You must use this operation when you need to fetch more than `10000` resource items. The `/v2/resources/search` prohibits paginating through such a big number. On the first call, the operation returns a live cursor on the data that you must use on all the subsequent calls to get the next batch of results until you get the empty result set. By default, the fields returned for every resources are: "crn", "name", "family", "type", "account_id". You can specify the subset of the fields you want in your request.”.
func (*GlobalSearchV2) SetServiceURL ¶
func (globalSearch *GlobalSearchV2) SetServiceURL(url string) error
SetServiceURL sets the service URL
type GlobalSearchV2Options ¶
type GlobalSearchV2Options struct { ServiceName string URL string Authenticator core.Authenticator }
GlobalSearchV2Options : Service options
type ResultItem ¶
type ResultItem struct { // Resource identifier in CRN format. Crn *string `json:"crn,omitempty"` // contains filtered or unexported fields }
ResultItem : A resource returned in a search result.
func (*ResultItem) GetProperties ¶
func (o *ResultItem) GetProperties() map[string]interface{}
GetProperties allows the user to retrieve the map of arbitrary properties from an instance of ResultItem
func (*ResultItem) GetProperty ¶
func (o *ResultItem) GetProperty(key string) interface{}
GetProperty allows the user to retrieve an arbitrary property from an instance of ResultItem
func (*ResultItem) MarshalJSON ¶
func (o *ResultItem) MarshalJSON() (buffer []byte, err error)
MarshalJSON performs custom serialization for instances of ResultItem
func (*ResultItem) SetProperty ¶
func (o *ResultItem) SetProperty(key string, value interface{})
SetProperty allows the user to set an arbitrary property on an instance of ResultItem
type ScanResult ¶
type ScanResult struct { // The search cursor to use on all calls after the first one. SearchCursor *string `json:"search_cursor" validate:"required"` // Value of the limit parameter specified by the user. Limit *float64 `json:"limit,omitempty"` // The array of results. Each item represents a resource. An empty array signals the end of the result set, there are // no more hits to fetch. Items []ResultItem `json:"items" validate:"required"` }
ScanResult : The search scan response.
type SearchOptions ¶
type SearchOptions struct { // The Lucene-formatted query string. Default to '*' if not set. Query *string `json:"query,omitempty"` // The list of the fields returned by the search. Defaults to all. `crn` is always returned. Fields []string `json:"fields,omitempty"` // An opaque search cursor that is returned on each operation call and that must be set on next call. SearchCursor *string `json:"search_cursor,omitempty"` // An aplhanumeric string that can be used to trace a request across services. If not specified it will be // automatically generated with the prefix "gst-". TransactionID *string `json:"transaction-id,omitempty"` // The account ID to filter resources. AccountID *string `json:"account_id,omitempty"` // The maximum number of hits to return. Defaults to 10. Limit *int64 `json:"limit,omitempty"` // A search timeout, bounding the search request to be executed within the specified time value and bail with the hits // accumulated up to that point when expired. Defaults to the system defined timeout. Timeout *int64 `json:"timeout,omitempty"` // Comma separated properties names used for sorting. Sort []string `json:"sort,omitempty"` // Allows users to set headers on API requests Headers map[string]string }
SearchOptions : The Search options.
func (*SearchOptions) SetAccountID ¶
func (options *SearchOptions) SetAccountID(accountID string) *SearchOptions
SetAccountID : Allow user to set AccountID
func (*SearchOptions) SetFields ¶
func (options *SearchOptions) SetFields(fields []string) *SearchOptions
SetFields : Allow user to set Fields
func (*SearchOptions) SetHeaders ¶
func (options *SearchOptions) SetHeaders(param map[string]string) *SearchOptions
SetHeaders : Allow user to set Headers
func (*SearchOptions) SetLimit ¶
func (options *SearchOptions) SetLimit(limit int64) *SearchOptions
SetLimit : Allow user to set Limit
func (*SearchOptions) SetQuery ¶
func (options *SearchOptions) SetQuery(query string) *SearchOptions
SetQuery : Allow user to set Query
func (*SearchOptions) SetSearchCursor ¶
func (options *SearchOptions) SetSearchCursor(searchCursor string) *SearchOptions
SetSearchCursor : Allow user to set SearchCursor
func (*SearchOptions) SetSort ¶
func (options *SearchOptions) SetSort(sort []string) *SearchOptions
SetSort : Allow user to set Sort
func (*SearchOptions) SetTimeout ¶
func (options *SearchOptions) SetTimeout(timeout int64) *SearchOptions
SetTimeout : Allow user to set Timeout
func (*SearchOptions) SetTransactionID ¶
func (options *SearchOptions) SetTransactionID(transactionID string) *SearchOptions
SetTransactionID : Allow user to set TransactionID
type SupportedTypesList ¶
type SupportedTypesList struct { // A list of resource types supported by GhoST. SupportedTypes []string `json:"supported_types,omitempty"` }
SupportedTypesList : A list of resource types supported by GhoST.