Looks up a service by its name, returns the service and its endpoints.
Generated from protobuf message google.cloud.servicedirectory.v1.ResolveServiceRequest
Namespace
Google \ Cloud \ ServiceDirectory \ V1
Methods
__construct
Constructor.
Parameters
Name
Description
data
array
Optional. Data for populating the Message object.
↳ name
string
Required. The name of the service to resolve.
↳ max_endpoints
int
Optional. The maximum number of endpoints to return. Defaults to 25. Maximum is 100. If a value less than one is specified, the Default is used. If a value greater than the Maximum is specified, the Maximum is used.
↳ endpoint_filter
string
Optional. The filter applied to the endpoints of the resolved service. General filter string syntax: <field> <operator> <value> (<logical connector>) * * <field> can be name, address, port, or annotations.<key> for map field * * <operator> can be <, >, <=, >=, !=, =, :. Of which : means HAS, and is roughly the same as = * * <value> must be the same data type as field * * <logical connector> can be AND, OR, NOT Examples of valid filters: * * annotations.owner returns endpoints that have a annotation with the key owner, this is the same as annotations:owner * * annotations.protocol=gRPC returns endpoints that have key/value protocol=gRPC * * address=192.108.1.105 returns endpoints that have this address * * port>8080 returns endpoints that have port number larger than 8080 * name>projects/my-project/locations/us-east1/namespaces/my-namespace/services/my-service/endpoints/endpoint-c returns endpoints that have name that is alphabetically later than the string, so "endpoint-e" is returned but "endpoint-a" is not * name=projects/my-project/locations/us-central1/namespaces/my-namespace/services/my-service/endpoints/ep-1 returns the endpoint that has an endpoint_id equal to ep-1 * * annotations.owner!=sd AND annotations.foo=bar returns endpoints that have owner in annotation key but value is not sd AND have key/value foo=bar * * doesnotexist.foo=bar returns an empty list. Note that endpoint doesn't have a field called "doesnotexist". Since the filter does not match any endpoint, it returns no results For more information about filtering, see API Filtering.
getName
Required. The name of the service to resolve.
Returns
Type
Description
string
setName
Required. The name of the service to resolve.
Parameter
Name
Description
var
string
Returns
Type
Description
$this
getMaxEndpoints
Optional. The maximum number of endpoints to return. Defaults to 25.
Maximum is 100. If a value less than one is specified, the Default is used.
If a value greater than the Maximum is specified, the Maximum is used.
Returns
Type
Description
int
setMaxEndpoints
Optional. The maximum number of endpoints to return. Defaults to 25.
Maximum is 100. If a value less than one is specified, the Default is used.
If a value greater than the Maximum is specified, the Maximum is used.
Parameter
Name
Description
var
int
Returns
Type
Description
$this
getEndpointFilter
Optional. The filter applied to the endpoints of the resolved service.
General filter string syntax:
<field> <operator> <value> (<logical connector>)
<field> can be name, address, port, or annotations.<key> for
map field
<operator> can be <, >, <=, >=, !=, =, :. Of which :
means HAS, and is roughly the same as =
<value> must be the same data type as field
<logical connector> can be AND, OR, NOT
Examples of valid filters:
annotations.owner returns endpoints that have a annotation with the
key owner, this is the same as annotations:owner
annotations.protocol=gRPC returns endpoints that have key/value
protocol=gRPC
address=192.108.1.105 returns endpoints that have this address
port>8080 returns endpoints that have port number larger than 8080
*
name>projects/my-project/locations/us-east1/namespaces/my-namespace/services/my-service/endpoints/endpoint-c
returns endpoints that have name that is alphabetically later than the
string, so "endpoint-e" is returned but "endpoint-a" is not
*
name=projects/my-project/locations/us-central1/namespaces/my-namespace/services/my-service/endpoints/ep-1
returns the endpoint that has an endpoint_id equal to ep-1
annotations.owner!=sd AND annotations.foo=bar returns endpoints that
have owner in annotation key but value is not sd AND have
key/value foo=bar
doesnotexist.foo=bar returns an empty list. Note that endpoint
doesn't have a field called "doesnotexist". Since the filter does not
match any endpoint, it returns no results
For more information about filtering, see
API Filtering.
Returns
Type
Description
string
setEndpointFilter
Optional. The filter applied to the endpoints of the resolved service.
General filter string syntax:
<field> <operator> <value> (<logical connector>)
<field> can be name, address, port, or annotations.<key> for
map field
<operator> can be <, >, <=, >=, !=, =, :. Of which :
means HAS, and is roughly the same as =
<value> must be the same data type as field
<logical connector> can be AND, OR, NOT
Examples of valid filters:
annotations.owner returns endpoints that have a annotation with the
key owner, this is the same as annotations:owner
annotations.protocol=gRPC returns endpoints that have key/value
protocol=gRPC
address=192.108.1.105 returns endpoints that have this address
port>8080 returns endpoints that have port number larger than 8080
*
name>projects/my-project/locations/us-east1/namespaces/my-namespace/services/my-service/endpoints/endpoint-c
returns endpoints that have name that is alphabetically later than the
string, so "endpoint-e" is returned but "endpoint-a" is not
*
name=projects/my-project/locations/us-central1/namespaces/my-namespace/services/my-service/endpoints/ep-1
returns the endpoint that has an endpoint_id equal to ep-1
annotations.owner!=sd AND annotations.foo=bar returns endpoints that
have owner in annotation key but value is not sd AND have
key/value foo=bar
doesnotexist.foo=bar returns an empty list. Note that endpoint
doesn't have a field called "doesnotexist". Since the filter does not
match any endpoint, it returns no results
For more information about filtering, see
API Filtering.
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Hard to understand","hardToUnderstand","thumb-down"],["Incorrect information or sample code","incorrectInformationOrSampleCode","thumb-down"],["Missing the information/samples I need","missingTheInformationSamplesINeed","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2025-09-04 UTC."],[],[],null,["# Google Cloud Service Directory V1 Client - Class ResolveServiceRequest (2.0.6)\n\nVersion latestkeyboard_arrow_down\n\n- [2.0.6 (latest)](/php/docs/reference/cloud-service-directory/latest/V1.ResolveServiceRequest)\n- [2.0.5](/php/docs/reference/cloud-service-directory/2.0.5/V1.ResolveServiceRequest)\n- [1.3.6](/php/docs/reference/cloud-service-directory/1.3.6/V1.ResolveServiceRequest)\n- [1.2.1](/php/docs/reference/cloud-service-directory/1.2.1/V1.ResolveServiceRequest)\n- [1.1.2](/php/docs/reference/cloud-service-directory/1.1.2/V1.ResolveServiceRequest)\n- [1.0.5](/php/docs/reference/cloud-service-directory/1.0.5/V1.ResolveServiceRequest) \nReference documentation and code samples for the Google Cloud Service Directory V1 Client class ResolveServiceRequest.\n\nThe request message for\n[LookupService.ResolveService](/php/docs/reference/cloud-service-directory/latest/V1.Client.LookupServiceClient#_Google_Cloud_ServiceDirectory_V1_Client_LookupServiceClient__resolveService__).\n\nLooks up a service by its name, returns the service and its endpoints.\n\nGenerated from protobuf message `google.cloud.servicedirectory.v1.ResolveServiceRequest`\n\nNamespace\n---------\n\nGoogle \\\\ Cloud \\\\ ServiceDirectory \\\\ V1\n\nMethods\n-------\n\n### __construct\n\nConstructor.\n\n### getName\n\nRequired. The name of the service to resolve.\n\n### setName\n\nRequired. The name of the service to resolve.\n\n### getMaxEndpoints\n\nOptional. The maximum number of endpoints to return. Defaults to 25.\n\nMaximum is 100. If a value less than one is specified, the Default is used.\nIf a value greater than the Maximum is specified, the Maximum is used.\n\n### setMaxEndpoints\n\nOptional. The maximum number of endpoints to return. Defaults to 25.\n\nMaximum is 100. If a value less than one is specified, the Default is used.\nIf a value greater than the Maximum is specified, the Maximum is used.\n\n### getEndpointFilter\n\nOptional. The filter applied to the endpoints of the resolved service.\n\nGeneral `filter` string syntax:\n`\u003cfield\u003e \u003coperator\u003e \u003cvalue\u003e (\u003clogical connector\u003e)`\n\n- `\u003cfield\u003e` can be `name`, `address`, `port`, or `annotations.\u003ckey\u003e` for map field\n- `\u003coperator\u003e` can be `\u003c`, `\u003e`, `\u003c=`, `\u003e=`, `!=`, `=`, `:`. Of which `:` means `HAS`, and is roughly the same as `=`\n- `\u003cvalue\u003e` must be the same data type as field\n- `\u003clogical connector\u003e` can be `AND`, `OR`, `NOT` Examples of valid filters:\n- `annotations.owner` returns endpoints that have a annotation with the key `owner`, this is the same as `annotations:owner`\n- `annotations.protocol=gRPC` returns endpoints that have key/value `protocol=gRPC`\n- `address=192.108.1.105` returns endpoints that have this address\n- `port\u003e8080` returns endpoints that have port number larger than 8080 \\* `name\u003eprojects/my-project/locations/us-east1/namespaces/my-namespace/services/my-service/endpoints/endpoint-c` returns endpoints that have name that is alphabetically later than the string, so \"endpoint-e\" is returned but \"endpoint-a\" is not \\* `name=projects/my-project/locations/us-central1/namespaces/my-namespace/services/my-service/endpoints/ep-1` returns the endpoint that has an endpoint_id equal to `ep-1`\n- `annotations.owner!=sd AND annotations.foo=bar` returns endpoints that have `owner` in annotation key but value is not `sd` AND have key/value `foo=bar`\n- `doesnotexist.foo=bar` returns an empty list. Note that endpoint doesn't have a field called \"doesnotexist\". Since the filter does not match any endpoint, it returns no results For more information about filtering, see [API Filtering](https://aip.dev/160).\n\n### setEndpointFilter\n\nOptional. The filter applied to the endpoints of the resolved service.\n\nGeneral `filter` string syntax:\n`\u003cfield\u003e \u003coperator\u003e \u003cvalue\u003e (\u003clogical connector\u003e)`\n\n- `\u003cfield\u003e` can be `name`, `address`, `port`, or `annotations.\u003ckey\u003e` for map field\n- `\u003coperator\u003e` can be `\u003c`, `\u003e`, `\u003c=`, `\u003e=`, `!=`, `=`, `:`. Of which `:` means `HAS`, and is roughly the same as `=`\n- `\u003cvalue\u003e` must be the same data type as field\n- `\u003clogical connector\u003e` can be `AND`, `OR`, `NOT` Examples of valid filters:\n- `annotations.owner` returns endpoints that have a annotation with the key `owner`, this is the same as `annotations:owner`\n- `annotations.protocol=gRPC` returns endpoints that have key/value `protocol=gRPC`\n- `address=192.108.1.105` returns endpoints that have this address\n- `port\u003e8080` returns endpoints that have port number larger than 8080 \\* `name\u003eprojects/my-project/locations/us-east1/namespaces/my-namespace/services/my-service/endpoints/endpoint-c` returns endpoints that have name that is alphabetically later than the string, so \"endpoint-e\" is returned but \"endpoint-a\" is not \\* `name=projects/my-project/locations/us-central1/namespaces/my-namespace/services/my-service/endpoints/ep-1` returns the endpoint that has an endpoint_id equal to `ep-1`\n- `annotations.owner!=sd AND annotations.foo=bar` returns endpoints that have `owner` in annotation key but value is not `sd` AND have key/value `foo=bar`\n- `doesnotexist.foo=bar` returns an empty list. Note that endpoint doesn't have a field called \"doesnotexist\". Since the filter does not match any endpoint, it returns no results For more information about filtering, see [API Filtering](https://aip.dev/160)."]]