Documentation ¶
Overview ¶
Package cloudresourcesearch provides access to the Google Cloud Resource Search.
See https://groups.google.com/forum/#!forum/resource-search-api-alpha
Usage example:
import "github.com/skelterjohn/gcloud_apis/clients/cloudresourcesearch/v1" ... cloudresourcesearchService, err := cloudresourcesearch.New(oauthHttpClient)
Index ¶
- Constants
- type ResourcesSearchCall
- func (c *ResourcesSearchCall) Context(ctx context.Context) *ResourcesSearchCall
- func (c *ResourcesSearchCall) Do(opts ...googleapi.CallOption) (*SearchResponse, error)
- func (c *ResourcesSearchCall) Fields(s ...googleapi.Field) *ResourcesSearchCall
- func (c *ResourcesSearchCall) IfNoneMatch(entityTag string) *ResourcesSearchCall
- func (c *ResourcesSearchCall) OrderBy(orderBy string) *ResourcesSearchCall
- func (c *ResourcesSearchCall) PageSize(pageSize int64) *ResourcesSearchCall
- func (c *ResourcesSearchCall) PageToken(pageToken string) *ResourcesSearchCall
- func (c *ResourcesSearchCall) Pages(ctx context.Context, f func(*SearchResponse) error) error
- func (c *ResourcesSearchCall) Query(query string) *ResourcesSearchCall
- type ResourcesService
- type SearchResponse
- type SearchResult
- type SearchResultResource
- type Service
Constants ¶
const ( // View and manage your data across Google Cloud Platform services CloudPlatformScope = "https://www.googleapis.com/auth/cloud-platform" // View your data across Google Cloud Platform services CloudPlatformReadOnlyScope = "https://www.googleapis.com/auth/cloud-platform.read-only" )
OAuth2 scopes used by this API.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ResourcesSearchCall ¶
type ResourcesSearchCall struct {
// contains filtered or unexported fields
}
func (*ResourcesSearchCall) Context ¶
func (c *ResourcesSearchCall) Context(ctx context.Context) *ResourcesSearchCall
Context sets the context to be used in this call's Do method. Any pending HTTP request will be aborted if the provided context is canceled.
func (*ResourcesSearchCall) Do ¶
func (c *ResourcesSearchCall) Do(opts ...googleapi.CallOption) (*SearchResponse, error)
Do executes the "cloudresourcesearch.resources.search" call. Exactly one of *SearchResponse or error will be non-nil. Any non-2xx status code is an error. Response headers are in either *SearchResponse.ServerResponse.Header or (if a response was returned at all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check whether the returned error was because http.StatusNotModified was returned.
func (*ResourcesSearchCall) Fields ¶
func (c *ResourcesSearchCall) Fields(s ...googleapi.Field) *ResourcesSearchCall
Fields allows partial responses to be retrieved. See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more information.
func (*ResourcesSearchCall) IfNoneMatch ¶
func (c *ResourcesSearchCall) IfNoneMatch(entityTag string) *ResourcesSearchCall
IfNoneMatch sets the optional parameter which makes the operation fail if the object's ETag matches the given value. This is useful for getting updates only after the object has changed since the last request. Use googleapi.IsNotModified to check whether the response error from Do is the result of In-None-Match.
func (*ResourcesSearchCall) OrderBy ¶
func (c *ResourcesSearchCall) OrderBy(orderBy string) *ResourcesSearchCall
OrderBy sets the optional parameter "orderBy": A comma-separated list of string-valued fields for sorting the results. If this field is omitted, then the order of results is not defined. You can use fields from the resource schemas as well as the built-in fields `resourceName` and `resourceType`. Field values are ordered by their UTF-8 encodings.
Fields are sorted in ascending order by default. To sort a field in descending order, append " desc" to the field name. For example, the `order_by` value "resource_type desc,resource_name" sorts results by resource type in descending order; resources with the same type are returned in ascending order of their names.
func (*ResourcesSearchCall) PageSize ¶
func (c *ResourcesSearchCall) PageSize(pageSize int64) *ResourcesSearchCall
PageSize sets the optional parameter "pageSize": The maximum number of resources to return from this request. The presence of `next_page_token` in the response indicates that more resources are available. The default value of `page_size` is 20 and the maximum value is 1000.
func (*ResourcesSearchCall) PageToken ¶
func (c *ResourcesSearchCall) PageToken(pageToken string) *ResourcesSearchCall
PageToken sets the optional parameter "pageToken": If present, then retrieve the next batch of results from the preceding call to this method. `page_token` must be the value of `next_page_token` from the previous response. The values of other method parameters, including the query and sort order, must be identical to those in the previous call.
func (*ResourcesSearchCall) Pages ¶
func (c *ResourcesSearchCall) Pages(ctx context.Context, f func(*SearchResponse) error) error
Pages invokes f for each page of results. A non-nil error returned from f will halt the iteration. The provided context supersedes any context provided to the Context method.
func (*ResourcesSearchCall) Query ¶
func (c *ResourcesSearchCall) Query(query string) *ResourcesSearchCall
Query sets the optional parameter "query": The query string. If the query is missing or empty, all accessible resources are returned.
Any field in a supported resource type's schema may be specified in the query. Additionally, every resource has a `@type` field whose value is the resource's type URL. See `SearchResult.resource_type` for more information.
Example: The following query searches for accessible Compute Engine VM instances (`@type:Instance`) that have an `env` label value of `prod` and that have a machine type that starts with "n1-stand":
@type:Instance labels.env:prod machineType:n1-stand*
For more information, see [Search Queries](/resource-search/docs/search-queries) and [Resource Types](/resource-search/docs/reference/Resource.Types).
type ResourcesService ¶
type ResourcesService struct {
// contains filtered or unexported fields
}
func NewResourcesService ¶
func NewResourcesService(s *Service) *ResourcesService
func (*ResourcesService) Search ¶
func (r *ResourcesService) Search() *ResourcesSearchCall
Search: Lists accessible Google Cloud Platform resources that match a query. A resource is accessible to the caller if the caller has permission to perform a GET operation on the resource.
type SearchResponse ¶
type SearchResponse struct { // MatchedCount: The approximate total number of resources that match // the query. It will // never be less than the number of resources returned so far, but it // can // change as additional pages of results are returned. MatchedCount int64 `json:"matchedCount,omitempty,string"` // NextPageToken: If there are more results than those appearing in this // response, then // `next_page_token` is included. To get the next set of results, call // this // method again using the value of `next_page_token` as `page_token`. NextPageToken string `json:"nextPageToken,omitempty"` // Results: A list of resources that match the search query. Results []*SearchResult `json:"results,omitempty"` // ServerResponse contains the HTTP response code and headers from the // server. googleapi.ServerResponse `json:"-"` // ForceSendFields is a list of field names (e.g. "MatchedCount") to // unconditionally include in API requests. By default, fields with // empty values are omitted from API requests. However, any non-pointer, // non-interface field appearing in ForceSendFields will be sent to the // server regardless of whether the field is empty or not. This may be // used to include empty fields in Patch requests. ForceSendFields []string `json:"-"` }
SearchResponse: Response message for `resources.search`.
func (*SearchResponse) MarshalJSON ¶
func (s *SearchResponse) MarshalJSON() ([]byte, error)
type SearchResult ¶
type SearchResult struct { // DiscoveryType: The JSON schema name listed in the discovery // document. // Example: `Project`. DiscoveryType string `json:"discoveryType,omitempty"` // DiscoveryUrl: The URL of the discovery document containing the // resource's JSON schema. // Example: // `https://cloudresourcemanager.googleapis.com/$discovery/rest`. DiscoveryUrl string `json:"discoveryUrl,omitempty"` // Resource: The matched resource, expressed as a JSON object. Resource SearchResultResource `json:"resource,omitempty"` // ResourceName: The RPC resource name: a scheme-less URI that includes // the DNS-compatible // API service name. The URI does not include an API version and does // not // support %-encoding. // Example: // `//cloudresourcemanager.googleapis.com/projects/my-project-123`. ResourceName string `json:"resourceName,omitempty"` // ResourceType: A domain-scoped name that describes the protocol buffer // message type. // Example: // `type.googleapis.com/google.cloud.resourcemanager.v1.Project`. ResourceType string `json:"resourceType,omitempty"` // ResourceUrl: The REST URL for accessing the resource. An HTTP GET // operation using this // URL returns an object equivalent to the value in the `resource` // field. // Example: // `https://cloudresourcemanager.googleapis.com/v1/projec // ts/my-project-123`. ResourceUrl string `json:"resourceUrl,omitempty"` // ForceSendFields is a list of field names (e.g. "DiscoveryType") to // unconditionally include in API requests. By default, fields with // empty values are omitted from API requests. However, any non-pointer, // non-interface field appearing in ForceSendFields will be sent to the // server regardless of whether the field is empty or not. This may be // used to include empty fields in Patch requests. ForceSendFields []string `json:"-"` }
SearchResult: A single Google Cloud Platform resource.
func (*SearchResult) MarshalJSON ¶
func (s *SearchResult) MarshalJSON() ([]byte, error)
type SearchResultResource ¶
type SearchResultResource interface{}