Method: urlMaps.get

Returns the specified UrlMap resource. Gets a list of available URL maps by making a list() request.

HTTP request

GET https://www.googleapis.com/compute/beta/projects/{project}/global/urlMaps/{resourceId}

The URL uses gRPC Transcoding syntax.

Path parameters

Parameters
project

string

Project ID for this request.

resourceId

string

Name of the UrlMap resource to return.

Request body

The request body must be empty.

Response body

If successful, the response body contains data with the following structure:

A UrlMap resource. This resource defines the mapping from URL to the BackendService resource, based on the "longest-match" of the URL's host and path.

JSON representation
{
  "id": string,
  "creationTimestamp": string,
  "name": string,
  "description": string,
  "selfLink": string,
  "hostRules": [
    {
      "description": string,
      "hosts": [
        string
      ],
      "pathMatcher": string
    }
  ],
  "pathMatchers": [
    {
      "name": string,
      "description": string,
      "defaultService": string,
      "pathRules": [
        {
          "service": string,
          "paths": [
            string
          ]
        }
      ]
    }
  ],
  "tests": [
    {
      "description": string,
      "host": string,
      "path": string,
      "service": string
    }
  ],
  "defaultService": string,
  "fingerprint": string,
  "kind": string
}
Fields
id

string (fixed64 format)

[Output Only] The unique identifier for the resource. This identifier is defined by the server.

creationTimestamp

string

[Output Only] Creation timestamp in RFC3339 text format.

name

string

Name of the resource. Provided by the client when the resource is created. The name must be 1-63 characters long, and comply with RFC1035. Specifically, the name must be 1-63 characters long and match the regular expression [a-z]([-a-z0-9]*[a-z0-9])? which means the first character must be a lowercase letter, and all following characters must be a dash, lowercase letter, or digit, except the last character, which cannot be a dash.

description

string

An optional description of this resource. Provide this property when you create the resource.

hostRules[]

object

The list of HostRules to use against the URL.

hostRules[].description

string

An optional description of this resource. Provide this property when you create the resource.

hostRules[].hosts[]

string

The list of host patterns to match. They must be valid hostnames, except * will match any string of ([a-z0-9-.]*). In that case, * must be the first character and must be followed in the pattern by either - or ..

hostRules[].pathMatcher

string

The name of the PathMatcher to use to match the path portion of the URL if the hostRule matches the URL's host portion.

pathMatchers[]

object

The list of named PathMatchers to use against the URL.

pathMatchers[].name

string

The name to which this PathMatcher is referred by the HostRule.

pathMatchers[].description

string

An optional description of this resource. Provide this property when you create the resource.

pathMatchers[].defaultService

string

The full or partial URL to the BackendService resource. This will be used if none of the pathRules or routeRules defined by this PathMatcher are matched. For example, the following are all valid URLs to a BackendService resource:

If defaultRouteAction is additionally specified, advanced routing actions like URL Rewrites, etc. take effect prior to sending the request to the backend. However, if defaultService is specified, defaultRouteAction cannot contain any weightedBackendServices. Conversely, if defaultRouteAction specifies any weightedBackendServices, defaultService must not be specified.

Only one of defaultService, defaultUrlRedirect or defaultRouteAction.weightedBackendService must be set.

Authorization requires one or more of the following Google IAM permissions on the specified resource defaultService:

  • compute.backendBuckets.use
  • compute.backendServices.use

pathMatchers[].pathRules[]

object

The list of path rules. Use this list instead of routeRules when routing based on simple path matching is all that's required. The order by which path rules are specified does not matter. Matches are always done on the longest-path-first basis.

For example: a pathRule with a path /a/b/c/* will match before /a/b/* irrespective of the order in which those paths appear in this list.

Only one of pathRules or routeRules must be set.

pathMatchers[].pathRules[].service

string

The full or partial URL of the backend service resource to which traffic is directed if this rule is matched. If routeAction is additionally specified, advanced routing actions like URL Rewrites, etc. take effect prior to sending the request to the backend. However, if service is specified, routeAction cannot contain any weightedBackendService s. Conversely, if routeAction specifies any weightedBackendServices, service must not be specified.

Only one of urlRedirect, service or routeAction.weightedBackendService must be set.

pathMatchers[].pathRules[].paths[]

string

The list of path patterns to match. Each must start with / and the only place a * is allowed is at the end following a /. The string fed to the path matcher does not include any text after the first ? or #, and those chars are not allowed here.

tests[]

object

The list of expected URL mapping tests. Request to update this UrlMap will succeed only if all of the test cases pass. You can specify a maximum of 100 tests per UrlMap.

tests[].description

string

Description of this test case.

tests[].host

string

Host portion of the URL.

tests[].path

string

Path portion of the URL.

tests[].service

string

Expected BackendService resource the given URL should be mapped to.

defaultService

string

The full or partial URL of the defaultService resource to which traffic is directed if none of the hostRules match. If defaultRouteAction is additionally specified, advanced routing actions like URL Rewrites, etc. take effect prior to sending the request to the backend. However, if defaultService is specified, defaultRouteAction cannot contain any weightedBackendServices. Conversely, if routeAction specifies any weightedBackendServices, service must not be specified.

Only one of defaultService, defaultUrlRedirect or defaultRouteAction.weightedBackendService must be set.

fingerprint

string (bytes format)

Fingerprint of this resource. A hash of the contents stored in this object. This field is used in optimistic locking. This field will be ignored when inserting a UrlMap. An up-to-date fingerprint must be provided in order to update the UrlMap, otherwise the request will fail with error 412 conditionNotMet.

To see the latest fingerprint, make a get() request to retrieve a UrlMap.

A base64-encoded string.

kind

string

[Output Only] Type of the resource. Always compute#urlMaps for url maps.

Authorization Scopes

Requires one of the following OAuth scopes:

  • https://www.googleapis.com/auth/compute
  • https://www.googleapis.com/auth/cloud-platform

For more information, see the Authentication Overview.

IAM Permissions

In addition to any permissions specified on the fields above, authorization requires one or more of the following Google IAM permissions:

  • compute.urlMaps.get

To find predefined roles that contain those permissions, see Compute Engine IAM Roles.

¿Te sirvió esta página? Envíanos tu opinión:

Enviar comentarios sobre…