# Network Services V1 API - Class Google::Cloud::NetworkServices::V1::GrpcRoute (v2.10.1)

2.10.1 (latest) 2.10.0 2.9.0 2.8.0 2.7.0 2.6.1 2.5.0 2.4.0 2.3.0 2.2.0 2.1.0 2.0.1 1.2.0 1.1.0 1.0.1 0.2.0 0.1.0 Reference documentation and code samples for the Network Services V1 API class Google::Cloud::NetworkServices::V1::GrpcRoute.

GrpcRoute is the resource defining how gRPC traffic routed by a Mesh
or Gateway resource is routed.

## Inherits

- Object

## Extended By

- Google::Protobuf::MessageExts::ClassMethods

## Includes

- Google::Protobuf::MessageExts

## Methods

### #create_time

    def create_time() -> ::Google::Protobuf::Timestamp

**Returns**

- ([::Google::Protobuf::Timestamp](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-network_services-v1/latest/Google-Protobuf-Timestamp)) --- Output only. The timestamp when the resource was created.

### #description

    def description() -> ::String

**Returns**

- (::String) --- Optional. A free-text description of the resource. Max length 1024 characters.

### #description=

    def description=(value) -> ::String

**Parameter**

- **value** (::String) --- Optional. A free-text description of the resource. Max length 1024 characters.
**Returns**

- (::String) --- Optional. A free-text description of the resource. Max length 1024 characters.

### #gateways

    def gateways() -> ::Array<::String>

**Returns**

- (::Array\<::String\>) --- Optional. Gateways defines a list of gateways this GrpcRoute is attached to, as one of the routing rules to route the requests served by the gateway.

  Each gateway reference should match the pattern:
  `projects/*/locations/*/gateways/<gateway_name>`

### #gateways=

    def gateways=(value) -> ::Array<::String>

**Parameter**

- **value** (::Array\<::String\>) --- Optional. Gateways defines a list of gateways this GrpcRoute is attached to, as one of the routing rules to route the requests served by the gateway.


  Each gateway reference should match the pattern:
  `projects/*/locations/*/gateways/<gateway_name>`
**Returns**

- (::Array\<::String\>) --- Optional. Gateways defines a list of gateways this GrpcRoute is attached to, as one of the routing rules to route the requests served by the gateway.

  Each gateway reference should match the pattern:
  `projects/*/locations/*/gateways/<gateway_name>`

### #hostnames

    def hostnames() -> ::Array<::String>

**Returns**

- (::Array\<::String\>) --- Required. Service hostnames with an optional port for which this route describes traffic.

  Format:


  Hostname is the fully qualified domain name of a network host. This matches
  the RFC 1123 definition of a hostname with 2 notable exceptions:
  - IPs are not allowed.
  - A hostname may be prefixed with a wildcard label (`*.`). The wildcard label must appear by itself as the first label.

  Hostname can be "precise" which is a domain name without the terminating
  dot of a network host (e.g. `foo.example.com`) or "wildcard", which is a
  domain name prefixed with a single wildcard label (e.g. `*.example.com`).

  Note that as per RFC1035 and RFC1123, a label must consist of lower case
  alphanumeric characters or '-', and must start and end with an alphanumeric
  character. No other punctuation is allowed.

  The routes associated with a Mesh or Gateway must have unique hostnames. If
  you attempt to attach multiple routes with conflicting hostnames, the
  configuration will be rejected.

  For example, while it is acceptable for routes for the hostnames
  `*.foo.bar.com` and `*.bar.com` to be associated with the same route, it is
  not possible to associate two routes both with `*.bar.com` or both with
  `bar.com`.

  If a port is specified, then gRPC clients must use the channel URI with the
  port to match this rule (i.e. "xds:///service:123"), otherwise they must
  supply the URI without a port (i.e. "xds:///service").

### #hostnames=

    def hostnames=(value) -> ::Array<::String>

**Parameter**

- **value** (::Array\<::String\>) --- Required. Service hostnames with an optional port for which this route describes traffic.


  Format:


  Hostname is the fully qualified domain name of a network host. This matches
  the RFC 1123 definition of a hostname with 2 notable exceptions:
  - IPs are not allowed.
  - A hostname may be prefixed with a wildcard label (`*.`). The wildcard label must appear by itself as the first label.

  Hostname can be "precise" which is a domain name without the terminating
  dot of a network host (e.g. `foo.example.com`) or "wildcard", which is a
  domain name prefixed with a single wildcard label (e.g. `*.example.com`).

  Note that as per RFC1035 and RFC1123, a label must consist of lower case
  alphanumeric characters or '-', and must start and end with an alphanumeric
  character. No other punctuation is allowed.

  The routes associated with a Mesh or Gateway must have unique hostnames. If
  you attempt to attach multiple routes with conflicting hostnames, the
  configuration will be rejected.

  For example, while it is acceptable for routes for the hostnames
  `*.foo.bar.com` and `*.bar.com` to be associated with the same route, it is
  not possible to associate two routes both with `*.bar.com` or both with
  `bar.com`.

  If a port is specified, then gRPC clients must use the channel URI with the
  port to match this rule (i.e. "xds:///service:123"), otherwise they must
  supply the URI without a port (i.e. "xds:///service").
**Returns**

- (::Array\<::String\>) --- Required. Service hostnames with an optional port for which this route describes traffic.

  Format:


  Hostname is the fully qualified domain name of a network host. This matches
  the RFC 1123 definition of a hostname with 2 notable exceptions:
  - IPs are not allowed.
  - A hostname may be prefixed with a wildcard label (`*.`). The wildcard label must appear by itself as the first label.

  Hostname can be "precise" which is a domain name without the terminating
  dot of a network host (e.g. `foo.example.com`) or "wildcard", which is a
  domain name prefixed with a single wildcard label (e.g. `*.example.com`).

  Note that as per RFC1035 and RFC1123, a label must consist of lower case
  alphanumeric characters or '-', and must start and end with an alphanumeric
  character. No other punctuation is allowed.

  The routes associated with a Mesh or Gateway must have unique hostnames. If
  you attempt to attach multiple routes with conflicting hostnames, the
  configuration will be rejected.

  For example, while it is acceptable for routes for the hostnames
  `*.foo.bar.com` and `*.bar.com` to be associated with the same route, it is
  not possible to associate two routes both with `*.bar.com` or both with
  `bar.com`.

  If a port is specified, then gRPC clients must use the channel URI with the
  port to match this rule (i.e. "xds:///service:123"), otherwise they must
  supply the URI without a port (i.e. "xds:///service").

### #labels

    def labels() -> ::Google::Protobuf::Map{::String => ::String}

**Returns**

- (::Google::Protobuf::Map{::String =\> ::String}) --- Optional. Set of label tags associated with the GrpcRoute resource.

### #labels=

    def labels=(value) -> ::Google::Protobuf::Map{::String => ::String}

**Parameter**

- **value** (::Google::Protobuf::Map{::String =\> ::String}) --- Optional. Set of label tags associated with the GrpcRoute resource.
**Returns**

- (::Google::Protobuf::Map{::String =\> ::String}) --- Optional. Set of label tags associated with the GrpcRoute resource.

### #meshes

    def meshes() -> ::Array<::String>

**Returns**

- (::Array\<::String\>) --- Optional. Meshes defines a list of meshes this GrpcRoute is attached to, as one of the routing rules to route the requests served by the mesh.

  Each mesh reference should match the pattern:
  `projects/*/locations/*/meshes/<mesh_name>`

### #meshes=

    def meshes=(value) -> ::Array<::String>

**Parameter**

- **value** (::Array\<::String\>) --- Optional. Meshes defines a list of meshes this GrpcRoute is attached to, as one of the routing rules to route the requests served by the mesh.


  Each mesh reference should match the pattern:
  `projects/*/locations/*/meshes/<mesh_name>`
**Returns**

- (::Array\<::String\>) --- Optional. Meshes defines a list of meshes this GrpcRoute is attached to, as one of the routing rules to route the requests served by the mesh.

  Each mesh reference should match the pattern:
  `projects/*/locations/*/meshes/<mesh_name>`

### #name

    def name() -> ::String

**Returns**

- (::String) --- Identifier. Name of the GrpcRoute resource. It matches pattern `projects/*/locations/*/grpcRoutes/<grpc_route_name>`

### #name=

    def name=(value) -> ::String

**Parameter**

- **value** (::String) --- Identifier. Name of the GrpcRoute resource. It matches pattern `projects/*/locations/*/grpcRoutes/<grpc_route_name>`
**Returns**

- (::String) --- Identifier. Name of the GrpcRoute resource. It matches pattern `projects/*/locations/*/grpcRoutes/<grpc_route_name>`

### #rules

    def rules() -> ::Array<::Google::Cloud::NetworkServices::V1::GrpcRoute::RouteRule>

**Returns**

- (::Array\<[::Google::Cloud::NetworkServices::V1::GrpcRoute::RouteRule](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-network_services-v1/latest/Google-Cloud-NetworkServices-V1-GrpcRoute-RouteRule)\>) --- Required. A list of detailed rules defining how to route traffic.


  Within a single GrpcRoute, the GrpcRoute.RouteAction associated with the
  first matching GrpcRoute.RouteRule will be executed. At least one rule
  must be supplied.

### #rules=

    def rules=(value) -> ::Array<::Google::Cloud::NetworkServices::V1::GrpcRoute::RouteRule>

**Parameter**

- **value** (::Array\<[::Google::Cloud::NetworkServices::V1::GrpcRoute::RouteRule](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-network_services-v1/latest/Google-Cloud-NetworkServices-V1-GrpcRoute-RouteRule)\>) --- Required. A list of detailed rules defining how to route traffic.


  Within a single GrpcRoute, the GrpcRoute.RouteAction associated with the
  first matching GrpcRoute.RouteRule will be executed. At least one rule
  must be supplied.
**Returns**

- (::Array\<[::Google::Cloud::NetworkServices::V1::GrpcRoute::RouteRule](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-network_services-v1/latest/Google-Cloud-NetworkServices-V1-GrpcRoute-RouteRule)\>) --- Required. A list of detailed rules defining how to route traffic.


  Within a single GrpcRoute, the GrpcRoute.RouteAction associated with the
  first matching GrpcRoute.RouteRule will be executed. At least one rule
  must be supplied.

### #self_link

    def self_link() -> ::String

**Returns**

- (::String) --- Output only. Server-defined URL of this resource

### #update_time

    def update_time() -> ::Google::Protobuf::Timestamp

**Returns**

- ([::Google::Protobuf::Timestamp](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-network_services-v1/latest/Google-Protobuf-Timestamp)) --- Output only. The timestamp when the resource was updated.