globalsearchv2

package
v0.19.2 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jul 29, 2021 License: Apache-2.0 Imports: 9 Imported by: 7

Documentation

Overview

Package globalsearchv2 : Operations and models for the GlobalSearchV2 service

Index

Constants

View Source
const DefaultServiceName = "global_search"

DefaultServiceName is the default key used to find external configuration information.

View Source
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

func GetServiceURLForRegion(region string) (string, error)

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 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 and is 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.

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 indices Retrieves a list of all GhoST indices.

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

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 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, 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. 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 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,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 *int64 `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

	// The list of the fields returned by the search. Defaults to all. `crn` is always returned.
	Fields []string

	// An opaque search cursor that is returned on each operation call and that must be set on next call.
	SearchCursor *string

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

	// The account ID to filter resources.
	AccountID *string

	// The maximum number of hits to return. Defaults to 10.
	Limit *int64

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

	// Comma separated properties names used for sorting.
	Sort []string

	// 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 all GhoST indices.
	SupportedTypes []string `json:"supported_types,omitempty"`
}

SupportedTypesList : A list of all GhoST indices.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL