Documentation ¶
Overview ¶
Package globalsearchv2 : Operations and models for the GlobalSearchV2 service
Index ¶
- Constants
- func GetServiceURLForRegion(region string) (string, error)
- 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) Clone() *GlobalSearchV2
- func (globalSearch *GlobalSearchV2) DisableRetries()
- func (globalSearch *GlobalSearchV2) EnableRetries(maxRetries int, maxRetryInterval time.Duration)
- func (globalSearch *GlobalSearchV2) GetEnableGzipCompression() bool
- func (globalSearch *GlobalSearchV2) GetServiceURL() string
- func (globalSearch *GlobalSearchV2) GetSupportedTypes(getSupportedTypesOptions *GetSupportedTypesOptions) (result *SupportedTypesList, response *core.DetailedResponse, err error)
- func (globalSearch *GlobalSearchV2) GetSupportedTypesWithContext(ctx context.Context, 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) SearchWithContext(ctx context.Context, searchOptions *SearchOptions) (result *ScanResult, response *core.DetailedResponse, err error)
- func (globalSearch *GlobalSearchV2) SetDefaultHeaders(headers http.Header)
- func (globalSearch *GlobalSearchV2) SetEnableGzipCompression(enableGzip bool)
- func (globalSearch *GlobalSearchV2) SetServiceURL(url string) error
- type GlobalSearchV2Options
- type ResultItem
- func (o *ResultItem) GetProperties() map[string]interface{}
- func (o *ResultItem) GetProperty(key string) interface{}
- func (o *ResultItem) MarshalJSON() (buffer []byte, err error)
- func (o *ResultItem) SetProperties(m map[string]interface{})
- func (o *ResultItem) SetProperty(key string, value interface{})
- type ScanResult
- type SearchOptions
- func (_options *SearchOptions) SetAccountID(accountID string) *SearchOptions
- func (_options *SearchOptions) SetBoundary(boundary string) *SearchOptions
- func (_options *SearchOptions) SetCanTag(canTag string) *SearchOptions
- func (_options *SearchOptions) SetFields(fields []string) *SearchOptions
- func (options *SearchOptions) SetHeaders(param map[string]string) *SearchOptions
- func (_options *SearchOptions) SetImpersonateUser(impersonateUser string) *SearchOptions
- func (_options *SearchOptions) SetIsDeleted(isDeleted string) *SearchOptions
- func (_options *SearchOptions) SetIsPublic(isPublic string) *SearchOptions
- func (_options *SearchOptions) SetIsReclaimed(isReclaimed 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 ( SearchOptionsBoundaryGlobalConst = "global" SearchOptionsBoundaryUsRegulatedConst = "us-regulated" )
Constants associated with the SearchOptions.Boundary property. The boundary where the search performs. This parameter must be set only for the cross-account searches.
const ( SearchOptionsIsDeletedAnyConst = "any" SearchOptionsIsDeletedFalseConst = "false" SearchOptionsIsDeletedTrueConst = "true" )
Constants associated with the SearchOptions.IsDeleted property. Determines if deleted documents should be included in result set or not. Possible values are false (default), true or any. If false, only existing documents are returned; if true, only deleted documents are returned; If any, both existing and deleted documents are returned. (_for administrators only_).
const ( SearchOptionsIsReclaimedAnyConst = "any" SearchOptionsIsReclaimedFalseConst = "false" SearchOptionsIsReclaimedTrueConst = "true" )
Constants associated with the SearchOptions.IsReclaimed property. Determines if reclaimed documents should be included in result set or not. Possible values are false (default), true or any. If false, only not reclaimed documents are returned; if true, only reclaimed documents are returned; If any, both reclaimed and not reclaimed documents are returned.
const ( SearchOptionsIsPublicAnyConst = "any" SearchOptionsIsPublicFalseConst = "false" SearchOptionsIsPublicTrueConst = "true" )
Constants associated with the SearchOptions.IsPublic property. Determines if public resources should be included in result set or not. Possible values are false (default), true or any. If false, do not search public resources; if true, search only public resources; If any, search also public resources.
const ( SearchOptionsCanTagFalseConst = "false" SearchOptionsCanTagTrueConst = "true" )
Constants associated with the SearchOptions.CanTag property. Determines if the result set must return the resources that the user can tag or the resources that the user can view (only a GhoST admin can use this parameter). If false (default), only resources user can view are returned; if true, only resources that user has permissions for tagging are returned (_for administrators only_).
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 GetServiceURLForRegion ¶ added in v0.17.1
GetServiceURLForRegion returns the service URL to be used for the specified region
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 that is 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 created or reserved for an application or service instance. They are owned by resource providers, such as Cloud Foundry, IBM Kubernetes Service, or resource controller in IBM Cloud. Resources are uniquely identified by a Cloud Resource Name (CRN) 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.
API 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) Clone ¶ added in v0.17.1
func (globalSearch *GlobalSearchV2) Clone() *GlobalSearchV2
Clone makes a copy of "globalSearch" suitable for processing requests.
func (*GlobalSearchV2) DisableRetries ¶ added in v0.12.2
func (globalSearch *GlobalSearchV2) DisableRetries()
DisableRetries disables automatic retries for requests invoked for this service instance.
func (*GlobalSearchV2) EnableRetries ¶ added in v0.12.2
func (globalSearch *GlobalSearchV2) EnableRetries(maxRetries int, maxRetryInterval time.Duration)
EnableRetries enables automatic retries for requests invoked for this service instance. If either parameter is specified as 0, then a default value is used instead.
func (*GlobalSearchV2) GetEnableGzipCompression ¶ added in v0.12.2
func (globalSearch *GlobalSearchV2) GetEnableGzipCompression() bool
GetEnableGzipCompression returns the service's EnableGzipCompression field
func (*GlobalSearchV2) GetServiceURL ¶ added in v0.12.2
func (globalSearch *GlobalSearchV2) GetServiceURL() string
GetServiceURL returns the service URL
func (*GlobalSearchV2) GetSupportedTypes ¶
func (globalSearch *GlobalSearchV2) GetSupportedTypes(getSupportedTypesOptions *GetSupportedTypesOptions) (result *SupportedTypesList, response *core.DetailedResponse, err error)
GetSupportedTypes : DEPRECATED. Get all GhoST indexes Retrieves a list of all GhoST indexes. Deprecated: this method is deprecated and may be removed in a future release.
func (*GlobalSearchV2) GetSupportedTypesWithContext ¶ added in v0.12.2
func (globalSearch *GlobalSearchV2) GetSupportedTypesWithContext(ctx context.Context, getSupportedTypesOptions *GetSupportedTypesOptions) (result *SupportedTypesList, response *core.DetailedResponse, err error)
GetSupportedTypesWithContext is an alternate form of the GetSupportedTypes method which supports a Context parameter Deprecated: this method is deprecated and may be removed in a future release.
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 (v3) Find Cloud Foundry resources, IAM-enabled resources, or storage and network resources that run on classic infrastructure in a specific account ID. You can apply query strings if necessary.
To filter results, you can insert a string by 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, type the search term without specifying a field. Only resources that belong to the account ID and that are accessible by the client are returned.
You must use `/v3/resources/search` when you need to fetch more than `10000` resource items. 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 that are returned for every resource are "crn", "name", "family", "type", and "account_id". You can specify the subset of the fields you want in your request.
func (*GlobalSearchV2) SearchWithContext ¶ added in v0.12.2
func (globalSearch *GlobalSearchV2) SearchWithContext(ctx context.Context, searchOptions *SearchOptions) (result *ScanResult, response *core.DetailedResponse, err error)
SearchWithContext is an alternate form of the Search method which supports a Context parameter
func (*GlobalSearchV2) SetDefaultHeaders ¶ added in v0.12.2
func (globalSearch *GlobalSearchV2) SetDefaultHeaders(headers http.Header)
SetDefaultHeaders sets HTTP headers to be sent in every request
func (*GlobalSearchV2) SetEnableGzipCompression ¶ added in v0.12.2
func (globalSearch *GlobalSearchV2) SetEnableGzipCompression(enableGzip bool)
SetEnableGzipCompression sets the service's EnableGzipCompression field
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" validate:"required"` // contains filtered or unexported fields }
ResultItem : A resource returned in a search result, which is identified by its `crn`. It contains other properties that depend on the resource type.
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) SetProperties ¶ added in v0.31.3
func (o *ResultItem) SetProperties(m map[string]interface{})
SetProperties allows the user to set a map of arbitrary properties on an instance 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,omitempty"` // Value of the limit parameter specified by the user. Limit *int64 `json:"limit" validate:"required"` // The array of results. Each item represents a resource. An empty array signals the end of the result set, which means // there are no more results 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. By default, the returned fields are the `account_id`, `name`, `type`, // `family`, and `crn`. For all queries, `crn` is always returned. Fields []string `json:"fields,omitempty"` // An opaque cursor that is returned on each call and that must be set on the subsequent call to get the next batch of // items. If the search returns no items, then the search_cursor is not present in the response. SearchCursor *string `json:"search_cursor,omitempty"` // An alphanumeric string that can be used to trace a request across services. If not specified, it 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 boundary where the search performs. This parameter must be set only for the cross-account searches. Boundary *string `json:"boundary,omitempty"` // The maximum number of hits to return. Defaults to 10. Limit *int64 `json:"limit,omitempty"` // A search timeout in milliseconds, bounding the search request to run 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 that are used for sorting. Sort []string `json:"sort,omitempty"` // Determines if deleted documents should be included in result set or not. Possible values are false (default), true // or any. If false, only existing documents are returned; if true, only deleted documents are returned; If any, both // existing and deleted documents are returned. (_for administrators only_). IsDeleted *string `json:"is_deleted,omitempty"` // Determines if reclaimed documents should be included in result set or not. Possible values are false (default), true // or any. If false, only not reclaimed documents are returned; if true, only reclaimed documents are returned; If any, // both reclaimed and not reclaimed documents are returned. IsReclaimed *string `json:"is_reclaimed,omitempty"` // Determines if public resources should be included in result set or not. Possible values are false (default), true or // any. If false, do not search public resources; if true, search only public resources; If any, search also public // resources. IsPublic *string `json:"is_public,omitempty"` // The user on whose behalf the search must be performed. Only a GhoST admin can impersonate a user, so be sure you set // a GhoST admin IAM token in the Authorization header if you set this parameter. (_for administrators only_). ImpersonateUser *string `json:"impersonate_user,omitempty"` // Determines if the result set must return the resources that the user can tag or the resources that the user can view // (only a GhoST admin can use this parameter). If false (default), only resources user can view are returned; if true, // only resources that user has permissions for tagging are returned (_for administrators only_). CanTag *string `json:"can_tag,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) SetBoundary ¶ added in v0.31.3
func (_options *SearchOptions) SetBoundary(boundary string) *SearchOptions
SetBoundary : Allow user to set Boundary
func (*SearchOptions) SetCanTag ¶ added in v0.31.3
func (_options *SearchOptions) SetCanTag(canTag string) *SearchOptions
SetCanTag : Allow user to set CanTag
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) SetImpersonateUser ¶ added in v0.31.3
func (_options *SearchOptions) SetImpersonateUser(impersonateUser string) *SearchOptions
SetImpersonateUser : Allow user to set ImpersonateUser
func (*SearchOptions) SetIsDeleted ¶ added in v0.31.3
func (_options *SearchOptions) SetIsDeleted(isDeleted string) *SearchOptions
SetIsDeleted : Allow user to set IsDeleted
func (*SearchOptions) SetIsPublic ¶ added in v0.31.3
func (_options *SearchOptions) SetIsPublic(isPublic string) *SearchOptions
SetIsPublic : Allow user to set IsPublic
func (*SearchOptions) SetIsReclaimed ¶ added in v0.31.3
func (_options *SearchOptions) SetIsReclaimed(isReclaimed string) *SearchOptions
SetIsReclaimed : Allow user to set IsReclaimed
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 all GhoST indexes. SupportedTypes []string `json:"supported_types,omitempty"` }
SupportedTypesList : A list of all GhoST indexes.