Reference documentation and code samples for the Google Cloud Network Services V1 Client class Destination.
The destination to which traffic will be routed.
Generated from protobuf messagegoogle.cloud.networkservices.v1.GrpcRoute.Destination
Namespace
Google \ Cloud \ NetworkServices \ V1 \ GrpcRoute
Methods
__construct
Constructor.
Parameters
Name
Description
data
array
Optional. Data for populating the Message object.
↳ service_name
string
Required. The URL of a destination service to which to route traffic. Must refer to either a BackendService or ServiceDirectoryService.
↳ weight
int
Optional. Specifies the proportion of requests forwarded to the backend referenced by the serviceName field. This is computed as: - weight/Sum(weights in this destination list). For non-zero values, there may be some epsilon from the exact proportion defined here depending on the precision an implementation supports. If only one serviceName is specified and it has a weight greater than 0, 100% of the traffic is forwarded to that backend. If weights are specified for any one service name, they need to be specified for all of them. If weights are unspecified for all services, then, traffic is distributed in equal proportions to all of them.
getServiceName
Required. The URL of a destination service to which to route traffic.
Must refer to either a BackendService or ServiceDirectoryService.
Returns
Type
Description
string
hasServiceName
setServiceName
Required. The URL of a destination service to which to route traffic.
Must refer to either a BackendService or ServiceDirectoryService.
Parameter
Name
Description
var
string
Returns
Type
Description
$this
getWeight
Optional. Specifies the proportion of requests forwarded to the backend
referenced by the serviceName field. This is computed as:
weight/Sum(weights in this destination list).
For non-zero values, there may be some epsilon from the exact proportion
defined here depending on the precision an implementation supports.
If only one serviceName is specified and it has a weight greater than 0,
100% of the traffic is forwarded to that backend.
If weights are specified for any one service name, they need to be
specified for all of them.
If weights are unspecified for all services, then, traffic is distributed
in equal proportions to all of them.
Returns
Type
Description
int
hasWeight
clearWeight
setWeight
Optional. Specifies the proportion of requests forwarded to the backend
referenced by the serviceName field. This is computed as:
weight/Sum(weights in this destination list).
For non-zero values, there may be some epsilon from the exact proportion
defined here depending on the precision an implementation supports.
If only one serviceName is specified and it has a weight greater than 0,
100% of the traffic is forwarded to that backend.
If weights are specified for any one service name, they need to be
specified for all of them.
If weights are unspecified for all services, then, traffic is distributed
in equal proportions to all of them.
[[["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 Network Services V1 Client - Class Destination (0.6.1)\n\nVersion latestkeyboard_arrow_down\n\n- [0.6.1 (latest)](/php/docs/reference/cloud-networkservices/latest/V1.GrpcRoute.Destination)\n- [0.6.0](/php/docs/reference/cloud-networkservices/0.6.0/V1.GrpcRoute.Destination)\n- [0.5.0](/php/docs/reference/cloud-networkservices/0.5.0/V1.GrpcRoute.Destination)\n- [0.4.0](/php/docs/reference/cloud-networkservices/0.4.0/V1.GrpcRoute.Destination)\n- [0.3.0](/php/docs/reference/cloud-networkservices/0.3.0/V1.GrpcRoute.Destination)\n- [0.2.3](/php/docs/reference/cloud-networkservices/0.2.3/V1.GrpcRoute.Destination)\n- [0.1.1](/php/docs/reference/cloud-networkservices/0.1.1/V1.GrpcRoute.Destination) \nReference documentation and code samples for the Google Cloud Network Services V1 Client class Destination.\n\nThe destination to which traffic will be routed.\n\nGenerated from protobuf message `google.cloud.networkservices.v1.GrpcRoute.Destination`\n\nNamespace\n---------\n\nGoogle \\\\ Cloud \\\\ NetworkServices \\\\ V1 \\\\ GrpcRoute\n\nMethods\n-------\n\n### __construct\n\nConstructor.\n\n### getServiceName\n\nRequired. The URL of a destination service to which to route traffic.\n\nMust refer to either a BackendService or ServiceDirectoryService.\n\n### hasServiceName\n\n### setServiceName\n\nRequired. The URL of a destination service to which to route traffic.\n\nMust refer to either a BackendService or ServiceDirectoryService.\n\n### getWeight\n\nOptional. Specifies the proportion of requests forwarded to the backend\nreferenced by the serviceName field. This is computed as:\n\n- weight/Sum(weights in this destination list).\n\nFor non-zero values, there may be some epsilon from the exact proportion\ndefined here depending on the precision an implementation supports.\nIf only one serviceName is specified and it has a weight greater than 0,\n100% of the traffic is forwarded to that backend.\nIf weights are specified for any one service name, they need to be\nspecified for all of them.\nIf weights are unspecified for all services, then, traffic is distributed\nin equal proportions to all of them.\n\n### hasWeight\n\n### clearWeight\n\n### setWeight\n\nOptional. Specifies the proportion of requests forwarded to the backend\nreferenced by the serviceName field. This is computed as:\n\n- weight/Sum(weights in this destination list).\n\nFor non-zero values, there may be some epsilon from the exact proportion\ndefined here depending on the precision an implementation supports.\nIf only one serviceName is specified and it has a weight greater than 0,\n100% of the traffic is forwarded to that backend.\nIf weights are specified for any one service name, they need to be\nspecified for all of them.\nIf weights are unspecified for all services, then, traffic is distributed\nin equal proportions to all of them.\n\n### getDestinationType"]]