Resource: Version
A Version
is a configuration and a collection of static files which determine how a site is displayed.
JSON representation |
---|
{ "name": string, "status": enum ( |
Fields | |
---|---|
name |
The fully-qualified resource name for the version, in the format:
This name is provided in the response body when you call |
status |
The deploy status of the version. For a successful deploy, call Note that if you leave the version in the You can also change the status of a version to |
config |
The configuration for the behavior of the site. This configuration exists in the |
labels |
The labels used for extra metadata and/or filtering. An object containing a list of |
createTime |
Output only. The time at which the version was created. A timestamp in RFC3339 UTC "Zulu" format, with nanosecond resolution and up to nine fractional digits. Examples: |
createUser |
Output only. Identifies the user who created the version. |
finalizeTime |
Output only. The time at which the version was A timestamp in RFC3339 UTC "Zulu" format, with nanosecond resolution and up to nine fractional digits. Examples: |
finalizeUser |
Output only. Identifies the user who |
deleteTime |
Output only. The time at which the version was A timestamp in RFC3339 UTC "Zulu" format, with nanosecond resolution and up to nine fractional digits. Examples: |
deleteUser |
Output only. Identifies the user who |
fileCount |
Output only. The total number of files associated with the version. This value is calculated after a version is |
versionBytes |
Output only. The total stored bytesize of the version. This value is calculated after a version is |
VersionStatus
The current known status of a specific version in the deploy lifecycle.
Enums | |
---|---|
VERSION_STATUS_UNSPECIFIED |
The default status; should not be intentionally used. |
CREATED |
The version has been created, and content is currently being added to the version. |
FINALIZED |
All content has been added to the version, and the version can no longer be changed. |
DELETED |
The version has been deleted. |
ABANDONED |
The version was not updated to FINALIZED within 12 hours and was automatically deleted. |
EXPIRED |
The version is outside the site-configured limit for the number of retained versions, so the version's content is scheduled for deletion. |
CLONING |
The version is being cloned from another version. All content is still being copied over. |
ServingConfig
The configuration for how incoming requests to a site should be routed and processed before serving content. The URL request paths are matched against the specified URL patterns in the configuration, then Hosting applies the applicable configuration according to a specific priority order.
JSON representation |
---|
{ "headers": [ { object ( |
Fields | |
---|---|
headers[] |
An array of objects, where each object specifies a URL pattern that, if matched to the request URL path, triggers Hosting to apply the specified custom response headers. |
redirects[] |
An array of objects (called redirect rules), where each rule specifies a URL pattern that, if matched to the request URL path, triggers Hosting to respond with a redirect to the specified destination path. |
rewrites[] |
An array of objects (called rewrite rules), where each rule specifies a URL pattern that, if matched to the request URL path, triggers Hosting to respond as if the service were given the specified destination URL. |
cleanUrls |
Defines whether to drop the file extension from uploaded files. |
trailingSlashBehavior |
Defines how to handle a trailing slash in the URL path. |
i18n |
Optional. Defines i18n rewrite behavior. |
Header
A Header
specifies a URL pattern that, if matched to the request URL path, triggers Hosting to apply the specified custom response headers.
JSON representation |
---|
{ "headers": { string: string, ... }, // Union field |
Fields | |
---|---|
headers |
Required. The additional headers to add to the response. An object containing a list of |
Union field pattern . Required. A string URL pattern to match against the request URL path to determine whether to apply this custom response header. Can be either a Bash-style glob or a RE2 regular expression. pattern can be only one of the following: |
|
glob |
The user-supplied glob to match against the request URL path. |
regex |
The user-supplied RE2 regular expression to match against the request URL path. |
Redirect
A Redirect
specifies a URL pattern that, if matched to the request URL path, triggers Hosting to respond with a redirect to the specified destination path.
JSON representation |
---|
{ "statusCode": integer, "location": string, // Union field |
Fields | |
---|---|
statusCode |
Required. The status HTTP code to return in the response. It must be a valid 3xx status code. |
location |
Required. The value to put in the HTTP location header of the response. The location can contain capture group values from the pattern using a
|
Union field pattern . Required. A string URL pattern to match against the request URL path to determine whether to apply this redirect. Can be either a Bash-style glob or a RE2 regular expression. pattern can be only one of the following: |
|
glob |
The user-supplied glob to match against the request URL path. |
regex |
The user-supplied RE2 regular expression to match against the request URL path. |
Rewrite
A Rewrite
specifies a URL pattern that, if matched to the request URL path, triggers Hosting to respond as if the service were given the specified destination URL.
JSON representation |
---|
{ "functionRegion": string, // Union field |
Fields | |
---|---|
functionRegion |
Optional. Specify a Cloud region for rewritten Functions invocations. If not provided, defaults to us-central1. |
Union field pattern . Required. A string URL pattern to match against the request URL path to determine whether to apply this rewrite. Can be either a Bash-style glob or a RE2 regular expression. pattern can be only one of the following: |
|
glob |
The user-supplied glob to match against the request URL path. |
regex |
The user-supplied RE2 regular expression to match against the request URL path. |
Union field behavior . Required. The behavior of the rewrite. behavior can be only one of the following: |
|
path |
The URL path to rewrite the request to. |
function |
The function to proxy requests to. Must match the exported function name exactly. |
run |
The request will be forwarded to Cloud Run. |
CloudRunRewrite
A configured rewrite that directs requests to a Cloud Run service. If the Cloud Run service does not exist when setting or updating your Firebase Hosting configuration, then the request fails. Any errors from the Cloud Run service are passed to the end user (for example, if you delete a service, any requests directed to that service receive a 404
error).
JSON representation |
---|
{ "serviceId": string, "region": string, "tag": string } |
Fields | |
---|---|
serviceId |
Required. User-defined ID of the Cloud Run service. |
region |
Optional. User-provided region where the Cloud Run service is hosted. Defaults to |
tag |
Optional. User-provided TrafficConfig tag to send traffic to. When omitted, traffic is sent to the service-wide URI |
TrailingSlashBehavior
Defines whether a trailing slash should be added or removed from the request URL path.
Enums | |
---|---|
TRAILING_SLASH_BEHAVIOR_UNSPECIFIED |
No behavior is specified. Files are served at their exact location only, and trailing slashes are only added to directory indexes. |
ADD |
Trailing slashes are added to directory indexes as well as to any URL path not ending in a file extension. |
REMOVE |
Trailing slashes are removed from directory indexes as well as from any URL path not ending in a file extension. |
I18nConfig
If provided, i18n rewrites are enabled.
JSON representation |
---|
{ "root": string } |
Fields | |
---|---|
root |
Required. The user-supplied path where country and language specific content will be looked for within the public directory. |
Methods |
|
---|---|
|
Creates a new version on the specified target site using the content of the specified version. |
|
Creates a new version for the specified site. |
|
Deletes the specified version. |
|
Get the specified version that has been created for the specified site. |
|
Lists the versions that have been created for the specified site. |
|
Updates the specified metadata for the specified version. |
|
Adds content files to the specified version. |