# Method: services.search

- [HTTP request](https://docs.cloud.google.com/service-infrastructure/docs/service-consumer-management/reference/rest/v1/services/search#body.HTTP_TEMPLATE)
- [Path parameters](https://docs.cloud.google.com/service-infrastructure/docs/service-consumer-management/reference/rest/v1/services/search#body.PATH_PARAMETERS)
- [Query parameters](https://docs.cloud.google.com/service-infrastructure/docs/service-consumer-management/reference/rest/v1/services/search#body.QUERY_PARAMETERS)
- [Request body](https://docs.cloud.google.com/service-infrastructure/docs/service-consumer-management/reference/rest/v1/services/search#body.request_body)
- [Response body](https://docs.cloud.google.com/service-infrastructure/docs/service-consumer-management/reference/rest/v1/services/search#body.response_body)
  - [JSON representation](https://docs.cloud.google.com/service-infrastructure/docs/service-consumer-management/reference/rest/v1/services/search#body.SearchTenancyUnitsResponse.SCHEMA_REPRESENTATION)
- [Authorization Scopes](https://docs.cloud.google.com/service-infrastructure/docs/service-consumer-management/reference/rest/v1/services/search#body.aspect)
- [Try it!](https://docs.cloud.google.com/service-infrastructure/docs/service-consumer-management/reference/rest/v1/services/search#try-it)

Search tenancy units for a managed service.

### HTTP request

`GET https://serviceconsumermanagement.googleapis.com/v1/{parent=services/*}:search`

The URL uses [gRPC Transcoding](https://github.com/googleapis/googleapis/blob/master/google/api/http.proto) syntax.

### Path parameters

| Parameters ||
|---|---|
| `parent` | `string` Service for which search is performed. services/{service} {service} the name of a service, for example 'service.googleapis.com'. Authorization requires the following [Google IAM](https://cloud.google.com/iam) permission on the specified resource `parent`: - `serviceconsumermanagement.tenancyu.list` |

### Query parameters

| Parameters ||
|---|---|
| `query` | `string` Set a query `{expression}` for querying tenancy units. Your `{expression}` must be in the format: `field_name=literal_string`. The `field_name` is the name of the field you want to compare. Supported fields are `tenant_resources.tag` and `tenant_resources.resource`. For example, to search tenancy units that contain at least one tenant resource with a given tag 'xyz', use the query `tenant_resources.tag=xyz`. To search tenancy units that contain at least one tenant resource with a given resource name 'projects/123456', use the query `tenant_resources.resource=projects/123456`. Multiple expressions can be joined with `AND`s. Tenancy units must match all expressions to be included in the result set. For example, `tenant_resources.tag=xyz AND tenant_resources.resource=projects/123456` Optional. |
| `pageSize` | `integer` The maximum number of results returned by this request. Currently, the default maximum is set to 1000. If `pageSize` isn't provided or the size provided is a number larger than 1000, it's automatically set to 1000. Optional. |
| `pageToken` | `string` The continuation token, which is used to page through large result sets. To get the next page of results, set this parameter to the value of `nextPageToken` from the previous response. Optional. |

### Request body

The request body must be empty.

### Response body

If successful, the response body contains data with the following structure:
Response for the search query.

| JSON representation ||
|---|---|
| ``` { "tenancyUnits": [ { object (`https://docs.cloud.google.com/service-infrastructure/docs/service-consumer-management/reference/rest/v1/services.tenancyUnits#TenancyUnit`) } ], "nextPageToken": string } ``` |

| Fields ||
|---|---|
| `tenancyUnits[]` | ``object (`https://docs.cloud.google.com/service-infrastructure/docs/service-consumer-management/reference/rest/v1/services.tenancyUnits#TenancyUnit`)`` Tenancy Units matching the request. |
| `nextPageToken` | `string` Pagination token for large results. |

### Authorization Scopes

Requires the following OAuth scope:

- `https://www.googleapis.com/auth/cloud-platform`

For more information, see the [Authentication Overview](https://cloud.google.com/docs/authentication/).

## Try it!