Required. Hostnames define a set of hosts that should match against the
HTTP host header to select a HttpRoute to process the request. Hostname is
the fully qualified domain name of a network host, as defined by RFC 1123
with the exception that:
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 Gateways 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 Mesh (or
Gateways under the same scope), it is not possible to associate two routes
both with *.bar.com or both with bar.com.
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Missing the information I need","missingTheInformationINeed","thumb-down"],["Too complicated / too many steps","tooComplicatedTooManySteps","thumb-down"],["Out of date","outOfDate","thumb-down"],["Samples / code issue","samplesCodeIssue","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2025-08-07 UTC."],[[["\u003cp\u003eThe \u003ccode\u003eHttpRoute\u003c/code\u003e class in the Network Services v1 API defines how HTTP traffic is routed by a Mesh or Gateway resource.\u003c/p\u003e\n"],["\u003cp\u003e\u003ccode\u003eHttpRoute\u003c/code\u003e is part of the \u003ccode\u003eGoogle.Cloud.NetworkServices.V1\u003c/code\u003e namespace and is implemented as a sealed class, inheriting from \u003ccode\u003eobject\u003c/code\u003e and implementing multiple interfaces for message handling and cloning.\u003c/p\u003e\n"],["\u003cp\u003eThe resource is associated with specific gateways or meshes and routes traffic based on defined rules, including hostname matching and sequential rule matching.\u003c/p\u003e\n"],["\u003cp\u003eEach \u003ccode\u003eHttpRoute\u003c/code\u003e resource includes properties like \u003ccode\u003eCreateTime\u003c/code\u003e, \u003ccode\u003eUpdateTime\u003c/code\u003e, \u003ccode\u003eDescription\u003c/code\u003e, \u003ccode\u003eHostnames\u003c/code\u003e, \u003ccode\u003eGateways\u003c/code\u003e, and \u003ccode\u003eMeshes\u003c/code\u003e, allowing for configuration and tracking of the resource.\u003c/p\u003e\n"],["\u003cp\u003e\u003ccode\u003eRules\u003c/code\u003e are a required property that define how traffic is routed and handled.\u003c/p\u003e\n"]]],[],null,["# Network Services v1 API - Class HttpRoute (1.3.0)\n\nVersion latestkeyboard_arrow_down\n\n- [1.3.0 (latest)](/dotnet/docs/reference/Google.Cloud.NetworkServices.V1/latest/Google.Cloud.NetworkServices.V1.HttpRoute)\n- [1.2.0](/dotnet/docs/reference/Google.Cloud.NetworkServices.V1/1.2.0/Google.Cloud.NetworkServices.V1.HttpRoute)\n- [1.1.0](/dotnet/docs/reference/Google.Cloud.NetworkServices.V1/1.1.0/Google.Cloud.NetworkServices.V1.HttpRoute)\n- [1.0.0](/dotnet/docs/reference/Google.Cloud.NetworkServices.V1/1.0.0/Google.Cloud.NetworkServices.V1.HttpRoute) \n\n public sealed class HttpRoute : IMessage\u003cHttpRoute\u003e, IEquatable\u003cHttpRoute\u003e, IDeepCloneable\u003cHttpRoute\u003e, IBufferMessage, IMessage\n\nReference documentation and code samples for the Network Services v1 API class HttpRoute.\n\nHttpRoute is the resource defining how HTTP traffic should be routed by a\nMesh or Gateway resource. \n\nInheritance\n-----------\n\n[object](https://learn.microsoft.com/dotnet/api/system.object) \\\u003e HttpRoute \n\nImplements\n----------\n\n[IMessage](https://cloud.google.com/dotnet/docs/reference/Google.Protobuf/latest/Google.Protobuf.IMessage-1.html)[HttpRoute](/dotnet/docs/reference/Google.Cloud.NetworkServices.V1/latest/Google.Cloud.NetworkServices.V1.HttpRoute), [IEquatable](https://learn.microsoft.com/dotnet/api/system.iequatable-1)[HttpRoute](/dotnet/docs/reference/Google.Cloud.NetworkServices.V1/latest/Google.Cloud.NetworkServices.V1.HttpRoute), [IDeepCloneable](https://cloud.google.com/dotnet/docs/reference/Google.Protobuf/latest/Google.Protobuf.IDeepCloneable-1.html)[HttpRoute](/dotnet/docs/reference/Google.Cloud.NetworkServices.V1/latest/Google.Cloud.NetworkServices.V1.HttpRoute), [IBufferMessage](https://cloud.google.com/dotnet/docs/reference/Google.Protobuf/latest/Google.Protobuf.IBufferMessage.html), [IMessage](https://cloud.google.com/dotnet/docs/reference/Google.Protobuf/latest/Google.Protobuf.IMessage.html) \n\nInherited Members\n-----------------\n\n[object.GetHashCode()](https://learn.microsoft.com/dotnet/api/system.object.gethashcode) \n[object.GetType()](https://learn.microsoft.com/dotnet/api/system.object.gettype) \n[object.ToString()](https://learn.microsoft.com/dotnet/api/system.object.tostring)\n\nNamespace\n---------\n\n[Google.Cloud.NetworkServices.V1](/dotnet/docs/reference/Google.Cloud.NetworkServices.V1/latest/Google.Cloud.NetworkServices.V1)\n\nAssembly\n--------\n\nGoogle.Cloud.NetworkServices.V1.dll\n\nConstructors\n------------\n\n### HttpRoute()\n\n public HttpRoute()\n\n### HttpRoute(HttpRoute)\n\n public HttpRoute(HttpRoute other)\n\nProperties\n----------\n\n### CreateTime\n\n public Timestamp CreateTime { get; set; }\n\nOutput only. The timestamp when the resource was created.\n\n### Description\n\n public string Description { get; set; }\n\nOptional. A free-text description of the resource. Max length 1024\ncharacters.\n\n### Gateways\n\n public RepeatedField\u003cstring\u003e Gateways { get; }\n\nOptional. Gateways defines a list of gateways this HttpRoute is attached\nto, as one of the routing rules to route the requests served by the\ngateway.\n\nEach gateway reference should match the pattern:\n`projects/*/locations/global/gateways/\u003cgateway_name\u003e`\n\n### GatewaysAsGatewayNames\n\n public ResourceNameList\u003cGatewayName\u003e GatewaysAsGatewayNames { get; }\n\n[GatewayName](/dotnet/docs/reference/Google.Cloud.NetworkServices.V1/latest/Google.Cloud.NetworkServices.V1.GatewayName)-typed view over the [Gateways](/dotnet/docs/reference/Google.Cloud.NetworkServices.V1/latest/Google.Cloud.NetworkServices.V1.HttpRoute#Google_Cloud_NetworkServices_V1_HttpRoute_Gateways) resource name property.\n\n### Hostnames\n\n public RepeatedField\u003cstring\u003e Hostnames { get; }\n\nRequired. Hostnames define a set of hosts that should match against the\nHTTP host header to select a HttpRoute to process the request. Hostname is\nthe fully qualified domain name of a network host, as defined by RFC 1123\nwith the exception that:\n\n- IPs are not allowed.\n- A hostname may be prefixed with a wildcard label (`*.`). The wildcard label must appear by itself as the first label.\n\nHostname can be \"precise\" which is a domain name without the terminating\ndot of a network host (e.g. `foo.example.com`) or \"wildcard\", which is a\ndomain name prefixed with a single wildcard label (e.g. `*.example.com`).\n\nNote that as per RFC1035 and RFC1123, a label must consist of lower case\nalphanumeric characters or '-', and must start and end with an alphanumeric\ncharacter. No other punctuation is allowed.\n\nThe routes associated with a Mesh or Gateways must have unique hostnames.\nIf you attempt to attach multiple routes with conflicting hostnames,\nthe configuration will be rejected.\n\nFor example, while it is acceptable for routes for the hostnames\n`*.foo.bar.com` and `*.bar.com` to be associated with the same Mesh (or\nGateways under the same scope), it is not possible to associate two routes\nboth with `*.bar.com` or both with `bar.com`.\n\n### HttpRouteName\n\n public HttpRouteName HttpRouteName { get; set; }\n\n[HttpRouteName](/dotnet/docs/reference/Google.Cloud.NetworkServices.V1/latest/Google.Cloud.NetworkServices.V1.HttpRouteName)-typed view over the [Name](/dotnet/docs/reference/Google.Cloud.NetworkServices.V1/latest/Google.Cloud.NetworkServices.V1.HttpRoute#Google_Cloud_NetworkServices_V1_HttpRoute_Name) resource name property.\n\n### Labels\n\n public MapField\u003cstring, string\u003e Labels { get; }\n\nOptional. Set of label tags associated with the HttpRoute resource.\n\n### Meshes\n\n public RepeatedField\u003cstring\u003e Meshes { get; }\n\nOptional. Meshes defines a list of meshes this HttpRoute is attached to, as\none of the routing rules to route the requests served by the mesh.\n\nEach mesh reference should match the pattern:\n`projects/*/locations/global/meshes/\u003cmesh_name\u003e`\n\nThe attached Mesh should be of a type SIDECAR\n\n### MeshesAsMeshNames\n\n public ResourceNameList\u003cMeshName\u003e MeshesAsMeshNames { get; }\n\n[MeshName](/dotnet/docs/reference/Google.Cloud.NetworkServices.V1/latest/Google.Cloud.NetworkServices.V1.MeshName)-typed view over the [Meshes](/dotnet/docs/reference/Google.Cloud.NetworkServices.V1/latest/Google.Cloud.NetworkServices.V1.HttpRoute#Google_Cloud_NetworkServices_V1_HttpRoute_Meshes) resource name property.\n\n### Name\n\n public string Name { get; set; }\n\nIdentifier. Name of the HttpRoute resource. It matches pattern\n`projects/*/locations/global/httpRoutes/http_route_name\u003e`.\n\n### Rules\n\n public RepeatedField\u003cHttpRoute.Types.RouteRule\u003e Rules { get; }\n\nRequired. Rules that define how traffic is routed and handled.\nRules will be matched sequentially based on the RouteMatch specified for\nthe rule.\n\n### SelfLink\n\n public string SelfLink { get; set; }\n\nOutput only. Server-defined URL of this resource\n\n### UpdateTime\n\n public Timestamp UpdateTime { get; set; }\n\nOutput only. The timestamp when the resource was updated."]]