Bu Sun Kim | 715bd7f | 2019-06-14 16:50:42 -0700 | [diff] [blame] | 1 | <html><body> |
| 2 | <style> |
| 3 | |
| 4 | body, h1, h2, h3, div, span, p, pre, a { |
| 5 | margin: 0; |
| 6 | padding: 0; |
| 7 | border: 0; |
| 8 | font-weight: inherit; |
| 9 | font-style: inherit; |
| 10 | font-size: 100%; |
| 11 | font-family: inherit; |
| 12 | vertical-align: baseline; |
| 13 | } |
| 14 | |
| 15 | body { |
| 16 | font-size: 13px; |
| 17 | padding: 1em; |
| 18 | } |
| 19 | |
| 20 | h1 { |
| 21 | font-size: 26px; |
| 22 | margin-bottom: 1em; |
| 23 | } |
| 24 | |
| 25 | h2 { |
| 26 | font-size: 24px; |
| 27 | margin-bottom: 1em; |
| 28 | } |
| 29 | |
| 30 | h3 { |
| 31 | font-size: 20px; |
| 32 | margin-bottom: 1em; |
| 33 | margin-top: 1em; |
| 34 | } |
| 35 | |
| 36 | pre, code { |
| 37 | line-height: 1.5; |
| 38 | font-family: Monaco, 'DejaVu Sans Mono', 'Bitstream Vera Sans Mono', 'Lucida Console', monospace; |
| 39 | } |
| 40 | |
| 41 | pre { |
| 42 | margin-top: 0.5em; |
| 43 | } |
| 44 | |
| 45 | h1, h2, h3, p { |
| 46 | font-family: Arial, sans serif; |
| 47 | } |
| 48 | |
| 49 | h1, h2, h3 { |
| 50 | border-bottom: solid #CCC 1px; |
| 51 | } |
| 52 | |
| 53 | .toc_element { |
| 54 | margin-top: 0.5em; |
| 55 | } |
| 56 | |
| 57 | .firstline { |
| 58 | margin-left: 2 em; |
| 59 | } |
| 60 | |
| 61 | .method { |
| 62 | margin-top: 1em; |
| 63 | border: solid 1px #CCC; |
| 64 | padding: 1em; |
| 65 | background: #EEE; |
| 66 | } |
| 67 | |
| 68 | .details { |
| 69 | font-weight: bold; |
| 70 | font-size: 14px; |
| 71 | } |
| 72 | |
| 73 | </style> |
| 74 | |
| 75 | <h1><a href="firebasehosting_v1beta1.html">Firebase Hosting API</a> . <a href="firebasehosting_v1beta1.sites.html">sites</a> . <a href="firebasehosting_v1beta1.sites.versions.html">versions</a></h1> |
| 76 | <h2>Instance Methods</h2> |
| 77 | <p class="toc_element"> |
| 78 | <code><a href="firebasehosting_v1beta1.sites.versions.files.html">files()</a></code> |
| 79 | </p> |
| 80 | <p class="firstline">Returns the files Resource.</p> |
| 81 | |
| 82 | <p class="toc_element"> |
Bu Sun Kim | 6502091 | 2020-05-20 12:08:20 -0700 | [diff] [blame^] | 83 | <code><a href="#create">create(parent, body=None, sizeBytes=None, versionId=None, x__xgafv=None)</a></code></p> |
Bu Sun Kim | 715bd7f | 2019-06-14 16:50:42 -0700 | [diff] [blame] | 84 | <p class="firstline">Creates a new version for a site.</p> |
| 85 | <p class="toc_element"> |
| 86 | <code><a href="#delete">delete(name, x__xgafv=None)</a></code></p> |
| 87 | <p class="firstline">Deletes the specified version.</p> |
| 88 | <p class="toc_element"> |
Bu Sun Kim | 6502091 | 2020-05-20 12:08:20 -0700 | [diff] [blame^] | 89 | <code><a href="#list">list(parent, filter=None, pageToken=None, pageSize=None, x__xgafv=None)</a></code></p> |
Dan O'Meara | dd49464 | 2020-05-01 07:42:23 -0700 | [diff] [blame] | 90 | <p class="firstline">Lists the versions that have been created on the specified site.</p> |
| 91 | <p class="toc_element"> |
| 92 | <code><a href="#list_next">list_next(previous_request, previous_response)</a></code></p> |
| 93 | <p class="firstline">Retrieves the next page of results.</p> |
| 94 | <p class="toc_element"> |
| 95 | <code><a href="#patch">patch(name, body=None, updateMask=None, x__xgafv=None)</a></code></p> |
Bu Sun Kim | 715bd7f | 2019-06-14 16:50:42 -0700 | [diff] [blame] | 96 | <p class="firstline">Updates the specified metadata for a version. Note that this method will</p> |
| 97 | <p class="toc_element"> |
Dan O'Meara | dd49464 | 2020-05-01 07:42:23 -0700 | [diff] [blame] | 98 | <code><a href="#populateFiles">populateFiles(parent, body=None, x__xgafv=None)</a></code></p> |
Bu Sun Kim | 715bd7f | 2019-06-14 16:50:42 -0700 | [diff] [blame] | 99 | <p class="firstline">Adds content files to a version.</p> |
| 100 | <h3>Method Details</h3> |
| 101 | <div class="method"> |
Bu Sun Kim | 6502091 | 2020-05-20 12:08:20 -0700 | [diff] [blame^] | 102 | <code class="details" id="create">create(parent, body=None, sizeBytes=None, versionId=None, x__xgafv=None)</code> |
Bu Sun Kim | 715bd7f | 2019-06-14 16:50:42 -0700 | [diff] [blame] | 103 | <pre>Creates a new version for a site. |
| 104 | |
| 105 | Args: |
| 106 | parent: string, Required. The parent to create the version for, in the format: |
Dan O'Meara | dd49464 | 2020-05-01 07:42:23 -0700 | [diff] [blame] | 107 | <code>sites/<var>site-name</var></code> (required) |
| 108 | body: object, The request body. |
Bu Sun Kim | 715bd7f | 2019-06-14 16:50:42 -0700 | [diff] [blame] | 109 | The object takes the form of: |
| 110 | |
| 111 | { # A `Version` is the collection of configuration and |
| 112 | # [static files](sites.versions.files) that determine how a site is displayed. |
Bu Sun Kim | 6502091 | 2020-05-20 12:08:20 -0700 | [diff] [blame^] | 113 | "fileCount": "A String", # Output only. The total number of files associated with the version. |
| 114 | # <br>This value is calculated after a version is `FINALIZED`. |
| 115 | "deleteUser": { # Contains metadata about the user who performed an action, such as creating # Output only. Identifies the user who `DELETED` the version. |
| 116 | # a release or finalizing a version. |
| 117 | "email": "A String", # The email address of the user when the user performed the action. |
| 118 | "imageUrl": "A String", # A profile image URL for the user. May not be present if the user has |
| 119 | # changed their email address or deleted their account. |
| 120 | }, |
| 121 | "deleteTime": "A String", # Output only. The time at which the version was `DELETED`. |
| 122 | "finalizeUser": { # Contains metadata about the user who performed an action, such as creating # Output only. Identifies the user who `FINALIZED` the version. |
| 123 | # a release or finalizing a version. |
| 124 | "email": "A String", # The email address of the user when the user performed the action. |
| 125 | "imageUrl": "A String", # A profile image URL for the user. May not be present if the user has |
| 126 | # changed their email address or deleted their account. |
| 127 | }, |
| 128 | "preview": { # Version preview configuration. If active and unexpired, # Version preview configuration for the site version. This configuration |
| 129 | # specfies whether previewing is enabled for this site version. Version |
| 130 | # previews allow you to preview your site at a custom URL before |
| 131 | # releasing it as the live version. |
| 132 | # this version will be accessible via a custom URL even |
| 133 | # if it is not the currently released version. |
| 134 | "active": True or False, # If true, preview URLs are enabled for this version. |
| 135 | "expireTime": "A String", # Indicates the expiration time for previewing this |
| 136 | # version; preview URL requests received after this time will 404. |
| 137 | }, |
| 138 | "labels": { # The labels used for extra metadata and/or filtering. |
| 139 | "a_key": "A String", |
| 140 | }, |
| 141 | "createTime": "A String", # Output only. The time at which the version was created. |
| 142 | "versionBytes": "A String", # Output only. The total stored bytesize of the version. |
| 143 | # <br>This value is calculated after a version is `FINALIZED`. |
| 144 | "finalizeTime": "A String", # Output only. The time at which the version was `FINALIZED`. |
| 145 | "status": "A String", # The deploy status of a version. |
Dan O'Meara | dd49464 | 2020-05-01 07:42:23 -0700 | [diff] [blame] | 146 | # <br> |
| 147 | # <br>For a successful deploy, call the |
Bu Sun Kim | 715bd7f | 2019-06-14 16:50:42 -0700 | [diff] [blame] | 148 | # [`CreateVersion`](sites.versions/create) endpoint to make a new version |
| 149 | # (`CREATED` status), |
| 150 | # [upload all desired files](sites.versions/populateFiles) to the version, |
| 151 | # then [update](sites.versions/patch) the version to the `FINALIZED` status. |
Dan O'Meara | dd49464 | 2020-05-01 07:42:23 -0700 | [diff] [blame] | 152 | # <br> |
| 153 | # <br>Note that if you leave the version in the `CREATED` state for more |
| 154 | # than 12&nbsp;hours, the system will automatically mark the version as |
Bu Sun Kim | 715bd7f | 2019-06-14 16:50:42 -0700 | [diff] [blame] | 155 | # `ABANDONED`. |
Dan O'Meara | dd49464 | 2020-05-01 07:42:23 -0700 | [diff] [blame] | 156 | # <br> |
| 157 | # <br>You can also change the status of a version to `DELETED` by calling the |
Bu Sun Kim | 715bd7f | 2019-06-14 16:50:42 -0700 | [diff] [blame] | 158 | # [`DeleteVersion`](sites.versions/delete) endpoint. |
Bu Sun Kim | 6502091 | 2020-05-20 12:08:20 -0700 | [diff] [blame^] | 159 | "config": { # The configuration for how incoming requests to a site should be routed and # The configuration for the behavior of the site. This configuration exists |
Bu Sun Kim | 715bd7f | 2019-06-14 16:50:42 -0700 | [diff] [blame] | 160 | # in the [`firebase.json`](/docs/cli/#the_firebasejson_file) file. |
| 161 | # processed before serving content. The patterns are matched and applied |
| 162 | # according to a specific |
| 163 | # [priority order](/docs/hosting/full-config#hosting_priority_order). |
Bu Sun Kim | 6502091 | 2020-05-20 12:08:20 -0700 | [diff] [blame^] | 164 | "headers": [ # A list of custom response headers that are added to the content if the |
Bu Sun Kim | 715bd7f | 2019-06-14 16:50:42 -0700 | [diff] [blame] | 165 | # request URL path matches the glob. |
| 166 | { # A [`header`](/docs/hosting/full-config#headers) defines custom headers to |
| 167 | # add to a response should the request URL path match the pattern. |
Bu Sun Kim | 6502091 | 2020-05-20 12:08:20 -0700 | [diff] [blame^] | 168 | "headers": { # Required. The additional headers to add to the response. |
| 169 | "a_key": "A String", |
Bu Sun Kim | 715bd7f | 2019-06-14 16:50:42 -0700 | [diff] [blame] | 170 | }, |
Bu Sun Kim | 6502091 | 2020-05-20 12:08:20 -0700 | [diff] [blame^] | 171 | "regex": "A String", # The user-supplied RE2 regular expression to match against the request |
| 172 | # URL path. |
| 173 | "glob": "A String", # The user-supplied [glob |
Dan O'Meara | dd49464 | 2020-05-01 07:42:23 -0700 | [diff] [blame] | 174 | # pattern](/docs/hosting/full-config#glob_pattern_matching) to match |
Bu Sun Kim | 715bd7f | 2019-06-14 16:50:42 -0700 | [diff] [blame] | 175 | # against the request URL path. |
| 176 | }, |
| 177 | ], |
Bu Sun Kim | 6502091 | 2020-05-20 12:08:20 -0700 | [diff] [blame^] | 178 | "appAssociation": "A String", # How to handle well known App Association files. |
| 179 | "cleanUrls": True or False, # Defines whether to drop the file extension from uploaded files. |
| 180 | "trailingSlashBehavior": "A String", # Defines how to handle a trailing slash in the URL path. |
| 181 | "rewrites": [ # A list of rewrites that will act as if the service were given the |
Bu Sun Kim | 715bd7f | 2019-06-14 16:50:42 -0700 | [diff] [blame] | 182 | # destination URL. |
| 183 | { # A [`rewrite`](/docs/hosting/full-config#rewrites) represents an internal |
| 184 | # content rewrite on the version. If the pattern matches, the request will be |
| 185 | # handled as if it were to the destination path specified in the |
| 186 | # configuration. |
Bu Sun Kim | 6502091 | 2020-05-20 12:08:20 -0700 | [diff] [blame^] | 187 | "function": "A String", # The function to proxy requests to. Must match the exported function |
Bu Sun Kim | 715bd7f | 2019-06-14 16:50:42 -0700 | [diff] [blame] | 188 | # name exactly. |
Bu Sun Kim | 6502091 | 2020-05-20 12:08:20 -0700 | [diff] [blame^] | 189 | "regex": "A String", # The user-supplied RE2 regular expression to match against the request |
| 190 | # URL path. |
| 191 | "dynamicLinks": True or False, # The request will be forwarded to Firebase Dynamic Links. |
| 192 | "run": { # A configured rewrite that directs requests to a Cloud Run service. If the # The request will be forwarded to Cloud Run. |
Bu Sun Kim | 715bd7f | 2019-06-14 16:50:42 -0700 | [diff] [blame] | 193 | # Cloud Run service does not exist when setting or updating your Firebase |
| 194 | # Hosting configuration, then the request fails. Any errors from the Cloud Run |
| 195 | # service are passed to the end user (for example, if you delete a service, any |
| 196 | # requests directed to that service receive a `404` error). |
Bu Sun Kim | 6502091 | 2020-05-20 12:08:20 -0700 | [diff] [blame^] | 197 | "region": "A String", # Optional. User-provided region where the Cloud Run service is hosted.<br> |
Bu Sun Kim | 715bd7f | 2019-06-14 16:50:42 -0700 | [diff] [blame] | 198 | # Defaults to `us-central1` if not supplied. |
Bu Sun Kim | 6502091 | 2020-05-20 12:08:20 -0700 | [diff] [blame^] | 199 | "serviceId": "A String", # Required. User-defined ID of the Cloud Run service. |
Bu Sun Kim | 715bd7f | 2019-06-14 16:50:42 -0700 | [diff] [blame] | 200 | }, |
Bu Sun Kim | 6502091 | 2020-05-20 12:08:20 -0700 | [diff] [blame^] | 201 | "glob": "A String", # The user-supplied [glob |
Dan O'Meara | dd49464 | 2020-05-01 07:42:23 -0700 | [diff] [blame] | 202 | # pattern](/docs/hosting/full-config#glob_pattern_matching) to match |
| 203 | # against the request URL path. |
Bu Sun Kim | 6502091 | 2020-05-20 12:08:20 -0700 | [diff] [blame^] | 204 | "path": "A String", # The URL path to rewrite the request to. |
| 205 | }, |
| 206 | ], |
| 207 | "redirects": [ # A list of globs that will cause the response to redirect to another |
| 208 | # location. |
| 209 | { # A [`redirect`](/docs/hosting/full-config#redirects) represents the |
| 210 | # configuration for returning an HTTP redirect response given a matching |
| 211 | # request URL path. |
| 212 | "glob": "A String", # The user-supplied [glob |
| 213 | # pattern](/docs/hosting/full-config#glob_pattern_matching) to match |
| 214 | # against the request URL path. |
| 215 | "statusCode": 42, # Required. The status HTTP code to return in the response. It must be a |
| 216 | # valid 3xx status code. |
| 217 | "regex": "A String", # The user-supplied RE2 regular expression to match against the request |
| 218 | # URL path. |
| 219 | "location": "A String", # Required. The value to put in the HTTP location header of the response. |
| 220 | # <br>The location can contain capture group values from the pattern using |
| 221 | # a `:` prefix to identify the segment and an optional `*` to capture the |
| 222 | # rest of the URL. |
| 223 | # For example: |
| 224 | # <code>"glob": "/:capture*", |
| 225 | # <br>"statusCode": 301, |
| 226 | # <br>"location": "https://example.com/foo/:capture"</code> |
Bu Sun Kim | 715bd7f | 2019-06-14 16:50:42 -0700 | [diff] [blame] | 227 | }, |
| 228 | ], |
| 229 | }, |
Bu Sun Kim | 6502091 | 2020-05-20 12:08:20 -0700 | [diff] [blame^] | 230 | "name": "A String", # The unique identifier for a version, in the format: |
| 231 | # <code>sites/<var>site-name</var>/versions/<var>versionID</var></code> |
| 232 | # This name is provided in the response body when you call the |
| 233 | # [`CreateVersion`](../sites.versions/create) endpoint. |
| 234 | "createUser": { # Contains metadata about the user who performed an action, such as creating # Output only. Identifies the user who created the version. |
| 235 | # a release or finalizing a version. |
| 236 | "email": "A String", # The email address of the user when the user performed the action. |
| 237 | "imageUrl": "A String", # A profile image URL for the user. May not be present if the user has |
| 238 | # changed their email address or deleted their account. |
| 239 | }, |
Bu Sun Kim | 715bd7f | 2019-06-14 16:50:42 -0700 | [diff] [blame] | 240 | } |
| 241 | |
Bu Sun Kim | 6502091 | 2020-05-20 12:08:20 -0700 | [diff] [blame^] | 242 | sizeBytes: string, The self-reported size of the version. This value is used for a pre-emptive |
| 243 | quota check for legacy version uploads. |
Bu Sun Kim | 715bd7f | 2019-06-14 16:50:42 -0700 | [diff] [blame] | 244 | versionId: string, A unique id for the new version. This is only specified for legacy version |
| 245 | creations. |
| 246 | x__xgafv: string, V1 error format. |
| 247 | Allowed values |
| 248 | 1 - v1 error format |
| 249 | 2 - v2 error format |
Bu Sun Kim | 715bd7f | 2019-06-14 16:50:42 -0700 | [diff] [blame] | 250 | |
| 251 | Returns: |
| 252 | An object of the form: |
| 253 | |
| 254 | { # A `Version` is the collection of configuration and |
| 255 | # [static files](sites.versions.files) that determine how a site is displayed. |
Bu Sun Kim | 6502091 | 2020-05-20 12:08:20 -0700 | [diff] [blame^] | 256 | "fileCount": "A String", # Output only. The total number of files associated with the version. |
| 257 | # <br>This value is calculated after a version is `FINALIZED`. |
| 258 | "deleteUser": { # Contains metadata about the user who performed an action, such as creating # Output only. Identifies the user who `DELETED` the version. |
| 259 | # a release or finalizing a version. |
| 260 | "email": "A String", # The email address of the user when the user performed the action. |
| 261 | "imageUrl": "A String", # A profile image URL for the user. May not be present if the user has |
| 262 | # changed their email address or deleted their account. |
| 263 | }, |
| 264 | "deleteTime": "A String", # Output only. The time at which the version was `DELETED`. |
| 265 | "finalizeUser": { # Contains metadata about the user who performed an action, such as creating # Output only. Identifies the user who `FINALIZED` the version. |
| 266 | # a release or finalizing a version. |
| 267 | "email": "A String", # The email address of the user when the user performed the action. |
| 268 | "imageUrl": "A String", # A profile image URL for the user. May not be present if the user has |
| 269 | # changed their email address or deleted their account. |
| 270 | }, |
| 271 | "preview": { # Version preview configuration. If active and unexpired, # Version preview configuration for the site version. This configuration |
| 272 | # specfies whether previewing is enabled for this site version. Version |
| 273 | # previews allow you to preview your site at a custom URL before |
| 274 | # releasing it as the live version. |
| 275 | # this version will be accessible via a custom URL even |
| 276 | # if it is not the currently released version. |
| 277 | "active": True or False, # If true, preview URLs are enabled for this version. |
| 278 | "expireTime": "A String", # Indicates the expiration time for previewing this |
| 279 | # version; preview URL requests received after this time will 404. |
| 280 | }, |
| 281 | "labels": { # The labels used for extra metadata and/or filtering. |
| 282 | "a_key": "A String", |
| 283 | }, |
| 284 | "createTime": "A String", # Output only. The time at which the version was created. |
| 285 | "versionBytes": "A String", # Output only. The total stored bytesize of the version. |
| 286 | # <br>This value is calculated after a version is `FINALIZED`. |
| 287 | "finalizeTime": "A String", # Output only. The time at which the version was `FINALIZED`. |
| 288 | "status": "A String", # The deploy status of a version. |
Dan O'Meara | dd49464 | 2020-05-01 07:42:23 -0700 | [diff] [blame] | 289 | # <br> |
| 290 | # <br>For a successful deploy, call the |
Bu Sun Kim | 715bd7f | 2019-06-14 16:50:42 -0700 | [diff] [blame] | 291 | # [`CreateVersion`](sites.versions/create) endpoint to make a new version |
| 292 | # (`CREATED` status), |
| 293 | # [upload all desired files](sites.versions/populateFiles) to the version, |
| 294 | # then [update](sites.versions/patch) the version to the `FINALIZED` status. |
Dan O'Meara | dd49464 | 2020-05-01 07:42:23 -0700 | [diff] [blame] | 295 | # <br> |
| 296 | # <br>Note that if you leave the version in the `CREATED` state for more |
| 297 | # than 12&nbsp;hours, the system will automatically mark the version as |
Bu Sun Kim | 715bd7f | 2019-06-14 16:50:42 -0700 | [diff] [blame] | 298 | # `ABANDONED`. |
Dan O'Meara | dd49464 | 2020-05-01 07:42:23 -0700 | [diff] [blame] | 299 | # <br> |
| 300 | # <br>You can also change the status of a version to `DELETED` by calling the |
Bu Sun Kim | 715bd7f | 2019-06-14 16:50:42 -0700 | [diff] [blame] | 301 | # [`DeleteVersion`](sites.versions/delete) endpoint. |
Bu Sun Kim | 6502091 | 2020-05-20 12:08:20 -0700 | [diff] [blame^] | 302 | "config": { # The configuration for how incoming requests to a site should be routed and # The configuration for the behavior of the site. This configuration exists |
Bu Sun Kim | 715bd7f | 2019-06-14 16:50:42 -0700 | [diff] [blame] | 303 | # in the [`firebase.json`](/docs/cli/#the_firebasejson_file) file. |
| 304 | # processed before serving content. The patterns are matched and applied |
| 305 | # according to a specific |
| 306 | # [priority order](/docs/hosting/full-config#hosting_priority_order). |
Bu Sun Kim | 6502091 | 2020-05-20 12:08:20 -0700 | [diff] [blame^] | 307 | "headers": [ # A list of custom response headers that are added to the content if the |
Bu Sun Kim | 715bd7f | 2019-06-14 16:50:42 -0700 | [diff] [blame] | 308 | # request URL path matches the glob. |
| 309 | { # A [`header`](/docs/hosting/full-config#headers) defines custom headers to |
| 310 | # add to a response should the request URL path match the pattern. |
Bu Sun Kim | 6502091 | 2020-05-20 12:08:20 -0700 | [diff] [blame^] | 311 | "headers": { # Required. The additional headers to add to the response. |
| 312 | "a_key": "A String", |
Bu Sun Kim | 715bd7f | 2019-06-14 16:50:42 -0700 | [diff] [blame] | 313 | }, |
Bu Sun Kim | 6502091 | 2020-05-20 12:08:20 -0700 | [diff] [blame^] | 314 | "regex": "A String", # The user-supplied RE2 regular expression to match against the request |
| 315 | # URL path. |
| 316 | "glob": "A String", # The user-supplied [glob |
Dan O'Meara | dd49464 | 2020-05-01 07:42:23 -0700 | [diff] [blame] | 317 | # pattern](/docs/hosting/full-config#glob_pattern_matching) to match |
Bu Sun Kim | 715bd7f | 2019-06-14 16:50:42 -0700 | [diff] [blame] | 318 | # against the request URL path. |
| 319 | }, |
| 320 | ], |
Bu Sun Kim | 6502091 | 2020-05-20 12:08:20 -0700 | [diff] [blame^] | 321 | "appAssociation": "A String", # How to handle well known App Association files. |
| 322 | "cleanUrls": True or False, # Defines whether to drop the file extension from uploaded files. |
| 323 | "trailingSlashBehavior": "A String", # Defines how to handle a trailing slash in the URL path. |
| 324 | "rewrites": [ # A list of rewrites that will act as if the service were given the |
Bu Sun Kim | 715bd7f | 2019-06-14 16:50:42 -0700 | [diff] [blame] | 325 | # destination URL. |
| 326 | { # A [`rewrite`](/docs/hosting/full-config#rewrites) represents an internal |
| 327 | # content rewrite on the version. If the pattern matches, the request will be |
| 328 | # handled as if it were to the destination path specified in the |
| 329 | # configuration. |
Bu Sun Kim | 6502091 | 2020-05-20 12:08:20 -0700 | [diff] [blame^] | 330 | "function": "A String", # The function to proxy requests to. Must match the exported function |
Bu Sun Kim | 715bd7f | 2019-06-14 16:50:42 -0700 | [diff] [blame] | 331 | # name exactly. |
Bu Sun Kim | 6502091 | 2020-05-20 12:08:20 -0700 | [diff] [blame^] | 332 | "regex": "A String", # The user-supplied RE2 regular expression to match against the request |
| 333 | # URL path. |
| 334 | "dynamicLinks": True or False, # The request will be forwarded to Firebase Dynamic Links. |
| 335 | "run": { # A configured rewrite that directs requests to a Cloud Run service. If the # The request will be forwarded to Cloud Run. |
Bu Sun Kim | 715bd7f | 2019-06-14 16:50:42 -0700 | [diff] [blame] | 336 | # Cloud Run service does not exist when setting or updating your Firebase |
| 337 | # Hosting configuration, then the request fails. Any errors from the Cloud Run |
| 338 | # service are passed to the end user (for example, if you delete a service, any |
| 339 | # requests directed to that service receive a `404` error). |
Bu Sun Kim | 6502091 | 2020-05-20 12:08:20 -0700 | [diff] [blame^] | 340 | "region": "A String", # Optional. User-provided region where the Cloud Run service is hosted.<br> |
Bu Sun Kim | 715bd7f | 2019-06-14 16:50:42 -0700 | [diff] [blame] | 341 | # Defaults to `us-central1` if not supplied. |
Bu Sun Kim | 6502091 | 2020-05-20 12:08:20 -0700 | [diff] [blame^] | 342 | "serviceId": "A String", # Required. User-defined ID of the Cloud Run service. |
Bu Sun Kim | 715bd7f | 2019-06-14 16:50:42 -0700 | [diff] [blame] | 343 | }, |
Bu Sun Kim | 6502091 | 2020-05-20 12:08:20 -0700 | [diff] [blame^] | 344 | "glob": "A String", # The user-supplied [glob |
Dan O'Meara | dd49464 | 2020-05-01 07:42:23 -0700 | [diff] [blame] | 345 | # pattern](/docs/hosting/full-config#glob_pattern_matching) to match |
| 346 | # against the request URL path. |
Bu Sun Kim | 6502091 | 2020-05-20 12:08:20 -0700 | [diff] [blame^] | 347 | "path": "A String", # The URL path to rewrite the request to. |
| 348 | }, |
| 349 | ], |
| 350 | "redirects": [ # A list of globs that will cause the response to redirect to another |
| 351 | # location. |
| 352 | { # A [`redirect`](/docs/hosting/full-config#redirects) represents the |
| 353 | # configuration for returning an HTTP redirect response given a matching |
| 354 | # request URL path. |
| 355 | "glob": "A String", # The user-supplied [glob |
| 356 | # pattern](/docs/hosting/full-config#glob_pattern_matching) to match |
| 357 | # against the request URL path. |
| 358 | "statusCode": 42, # Required. The status HTTP code to return in the response. It must be a |
| 359 | # valid 3xx status code. |
| 360 | "regex": "A String", # The user-supplied RE2 regular expression to match against the request |
| 361 | # URL path. |
| 362 | "location": "A String", # Required. The value to put in the HTTP location header of the response. |
| 363 | # <br>The location can contain capture group values from the pattern using |
| 364 | # a `:` prefix to identify the segment and an optional `*` to capture the |
| 365 | # rest of the URL. |
| 366 | # For example: |
| 367 | # <code>"glob": "/:capture*", |
| 368 | # <br>"statusCode": 301, |
| 369 | # <br>"location": "https://example.com/foo/:capture"</code> |
Bu Sun Kim | 715bd7f | 2019-06-14 16:50:42 -0700 | [diff] [blame] | 370 | }, |
| 371 | ], |
| 372 | }, |
Bu Sun Kim | 6502091 | 2020-05-20 12:08:20 -0700 | [diff] [blame^] | 373 | "name": "A String", # The unique identifier for a version, in the format: |
| 374 | # <code>sites/<var>site-name</var>/versions/<var>versionID</var></code> |
| 375 | # This name is provided in the response body when you call the |
| 376 | # [`CreateVersion`](../sites.versions/create) endpoint. |
| 377 | "createUser": { # Contains metadata about the user who performed an action, such as creating # Output only. Identifies the user who created the version. |
| 378 | # a release or finalizing a version. |
| 379 | "email": "A String", # The email address of the user when the user performed the action. |
| 380 | "imageUrl": "A String", # A profile image URL for the user. May not be present if the user has |
| 381 | # changed their email address or deleted their account. |
| 382 | }, |
Bu Sun Kim | 715bd7f | 2019-06-14 16:50:42 -0700 | [diff] [blame] | 383 | }</pre> |
| 384 | </div> |
| 385 | |
| 386 | <div class="method"> |
| 387 | <code class="details" id="delete">delete(name, x__xgafv=None)</code> |
| 388 | <pre>Deletes the specified version. |
| 389 | |
| 390 | Args: |
| 391 | name: string, Required. The name of the version to be deleted, in the format: |
Dan O'Meara | dd49464 | 2020-05-01 07:42:23 -0700 | [diff] [blame] | 392 | <code>sites/<var>site-name</var>/versions/<var>versionID</var></code> (required) |
Bu Sun Kim | 715bd7f | 2019-06-14 16:50:42 -0700 | [diff] [blame] | 393 | x__xgafv: string, V1 error format. |
| 394 | Allowed values |
| 395 | 1 - v1 error format |
| 396 | 2 - v2 error format |
| 397 | |
| 398 | Returns: |
| 399 | An object of the form: |
| 400 | |
| 401 | { # A generic empty message that you can re-use to avoid defining duplicated |
| 402 | # empty messages in your APIs. A typical example is to use it as the request |
| 403 | # or the response type of an API method. For instance: |
| 404 | # |
| 405 | # service Foo { |
| 406 | # rpc Bar(google.protobuf.Empty) returns (google.protobuf.Empty); |
| 407 | # } |
| 408 | # |
| 409 | # The JSON representation for `Empty` is empty JSON object `{}`. |
| 410 | }</pre> |
| 411 | </div> |
| 412 | |
| 413 | <div class="method"> |
Bu Sun Kim | 6502091 | 2020-05-20 12:08:20 -0700 | [diff] [blame^] | 414 | <code class="details" id="list">list(parent, filter=None, pageToken=None, pageSize=None, x__xgafv=None)</code> |
Dan O'Meara | dd49464 | 2020-05-01 07:42:23 -0700 | [diff] [blame] | 415 | <pre>Lists the versions that have been created on the specified site. |
| 416 | Will include filtering in the future. |
| 417 | |
| 418 | Args: |
| 419 | parent: string, Required. The parent for which to list files, in the format: |
| 420 | <code>sites/<var>site-name</var></code> (required) |
Dan O'Meara | dd49464 | 2020-05-01 07:42:23 -0700 | [diff] [blame] | 421 | filter: string, The filter string used to return a subset of versions in the response. |
| 422 | Currently supported fields for filtering are: name, status, |
| 423 | and create_time. Filter processing will be implemented in accordance |
| 424 | with go/filtering. |
Bu Sun Kim | 6502091 | 2020-05-20 12:08:20 -0700 | [diff] [blame^] | 425 | pageToken: string, The next_page_token from a previous request, if provided. |
| 426 | pageSize: integer, The maximum number of versions to return. The service may return fewer than |
| 427 | this value. |
| 428 | If unspecified, at most 25 versions will be returned. |
| 429 | The maximum value is 100; values above 100 will be coerced to 100 |
| 430 | x__xgafv: string, V1 error format. |
| 431 | Allowed values |
| 432 | 1 - v1 error format |
| 433 | 2 - v2 error format |
Dan O'Meara | dd49464 | 2020-05-01 07:42:23 -0700 | [diff] [blame] | 434 | |
| 435 | Returns: |
| 436 | An object of the form: |
| 437 | |
Bu Sun Kim | 6502091 | 2020-05-20 12:08:20 -0700 | [diff] [blame^] | 438 | { |
| 439 | "nextPageToken": "A String", # The pagination token, if more results exist |
| 440 | "versions": [ # The list of versions, if any exist. |
Dan O'Meara | dd49464 | 2020-05-01 07:42:23 -0700 | [diff] [blame] | 441 | { # A `Version` is the collection of configuration and |
| 442 | # [static files](sites.versions.files) that determine how a site is displayed. |
Bu Sun Kim | 6502091 | 2020-05-20 12:08:20 -0700 | [diff] [blame^] | 443 | "fileCount": "A String", # Output only. The total number of files associated with the version. |
| 444 | # <br>This value is calculated after a version is `FINALIZED`. |
| 445 | "deleteUser": { # Contains metadata about the user who performed an action, such as creating # Output only. Identifies the user who `DELETED` the version. |
| 446 | # a release or finalizing a version. |
| 447 | "email": "A String", # The email address of the user when the user performed the action. |
| 448 | "imageUrl": "A String", # A profile image URL for the user. May not be present if the user has |
| 449 | # changed their email address or deleted their account. |
| 450 | }, |
| 451 | "deleteTime": "A String", # Output only. The time at which the version was `DELETED`. |
| 452 | "finalizeUser": { # Contains metadata about the user who performed an action, such as creating # Output only. Identifies the user who `FINALIZED` the version. |
| 453 | # a release or finalizing a version. |
| 454 | "email": "A String", # The email address of the user when the user performed the action. |
| 455 | "imageUrl": "A String", # A profile image URL for the user. May not be present if the user has |
| 456 | # changed their email address or deleted their account. |
| 457 | }, |
| 458 | "preview": { # Version preview configuration. If active and unexpired, # Version preview configuration for the site version. This configuration |
| 459 | # specfies whether previewing is enabled for this site version. Version |
| 460 | # previews allow you to preview your site at a custom URL before |
| 461 | # releasing it as the live version. |
| 462 | # this version will be accessible via a custom URL even |
| 463 | # if it is not the currently released version. |
| 464 | "active": True or False, # If true, preview URLs are enabled for this version. |
| 465 | "expireTime": "A String", # Indicates the expiration time for previewing this |
| 466 | # version; preview URL requests received after this time will 404. |
| 467 | }, |
| 468 | "labels": { # The labels used for extra metadata and/or filtering. |
| 469 | "a_key": "A String", |
| 470 | }, |
| 471 | "createTime": "A String", # Output only. The time at which the version was created. |
| 472 | "versionBytes": "A String", # Output only. The total stored bytesize of the version. |
| 473 | # <br>This value is calculated after a version is `FINALIZED`. |
| 474 | "finalizeTime": "A String", # Output only. The time at which the version was `FINALIZED`. |
| 475 | "status": "A String", # The deploy status of a version. |
Dan O'Meara | dd49464 | 2020-05-01 07:42:23 -0700 | [diff] [blame] | 476 | # <br> |
| 477 | # <br>For a successful deploy, call the |
| 478 | # [`CreateVersion`](sites.versions/create) endpoint to make a new version |
| 479 | # (`CREATED` status), |
| 480 | # [upload all desired files](sites.versions/populateFiles) to the version, |
| 481 | # then [update](sites.versions/patch) the version to the `FINALIZED` status. |
| 482 | # <br> |
| 483 | # <br>Note that if you leave the version in the `CREATED` state for more |
| 484 | # than 12&nbsp;hours, the system will automatically mark the version as |
| 485 | # `ABANDONED`. |
| 486 | # <br> |
| 487 | # <br>You can also change the status of a version to `DELETED` by calling the |
| 488 | # [`DeleteVersion`](sites.versions/delete) endpoint. |
Bu Sun Kim | 6502091 | 2020-05-20 12:08:20 -0700 | [diff] [blame^] | 489 | "config": { # The configuration for how incoming requests to a site should be routed and # The configuration for the behavior of the site. This configuration exists |
Dan O'Meara | dd49464 | 2020-05-01 07:42:23 -0700 | [diff] [blame] | 490 | # in the [`firebase.json`](/docs/cli/#the_firebasejson_file) file. |
| 491 | # processed before serving content. The patterns are matched and applied |
| 492 | # according to a specific |
| 493 | # [priority order](/docs/hosting/full-config#hosting_priority_order). |
Bu Sun Kim | 6502091 | 2020-05-20 12:08:20 -0700 | [diff] [blame^] | 494 | "headers": [ # A list of custom response headers that are added to the content if the |
Dan O'Meara | dd49464 | 2020-05-01 07:42:23 -0700 | [diff] [blame] | 495 | # request URL path matches the glob. |
| 496 | { # A [`header`](/docs/hosting/full-config#headers) defines custom headers to |
| 497 | # add to a response should the request URL path match the pattern. |
Bu Sun Kim | 6502091 | 2020-05-20 12:08:20 -0700 | [diff] [blame^] | 498 | "headers": { # Required. The additional headers to add to the response. |
| 499 | "a_key": "A String", |
Dan O'Meara | dd49464 | 2020-05-01 07:42:23 -0700 | [diff] [blame] | 500 | }, |
Bu Sun Kim | 6502091 | 2020-05-20 12:08:20 -0700 | [diff] [blame^] | 501 | "regex": "A String", # The user-supplied RE2 regular expression to match against the request |
| 502 | # URL path. |
| 503 | "glob": "A String", # The user-supplied [glob |
Dan O'Meara | dd49464 | 2020-05-01 07:42:23 -0700 | [diff] [blame] | 504 | # pattern](/docs/hosting/full-config#glob_pattern_matching) to match |
| 505 | # against the request URL path. |
| 506 | }, |
| 507 | ], |
Bu Sun Kim | 6502091 | 2020-05-20 12:08:20 -0700 | [diff] [blame^] | 508 | "appAssociation": "A String", # How to handle well known App Association files. |
| 509 | "cleanUrls": True or False, # Defines whether to drop the file extension from uploaded files. |
| 510 | "trailingSlashBehavior": "A String", # Defines how to handle a trailing slash in the URL path. |
| 511 | "rewrites": [ # A list of rewrites that will act as if the service were given the |
Dan O'Meara | dd49464 | 2020-05-01 07:42:23 -0700 | [diff] [blame] | 512 | # destination URL. |
| 513 | { # A [`rewrite`](/docs/hosting/full-config#rewrites) represents an internal |
| 514 | # content rewrite on the version. If the pattern matches, the request will be |
| 515 | # handled as if it were to the destination path specified in the |
| 516 | # configuration. |
Bu Sun Kim | 6502091 | 2020-05-20 12:08:20 -0700 | [diff] [blame^] | 517 | "function": "A String", # The function to proxy requests to. Must match the exported function |
Dan O'Meara | dd49464 | 2020-05-01 07:42:23 -0700 | [diff] [blame] | 518 | # name exactly. |
Bu Sun Kim | 6502091 | 2020-05-20 12:08:20 -0700 | [diff] [blame^] | 519 | "regex": "A String", # The user-supplied RE2 regular expression to match against the request |
| 520 | # URL path. |
| 521 | "dynamicLinks": True or False, # The request will be forwarded to Firebase Dynamic Links. |
| 522 | "run": { # A configured rewrite that directs requests to a Cloud Run service. If the # The request will be forwarded to Cloud Run. |
Dan O'Meara | dd49464 | 2020-05-01 07:42:23 -0700 | [diff] [blame] | 523 | # Cloud Run service does not exist when setting or updating your Firebase |
| 524 | # Hosting configuration, then the request fails. Any errors from the Cloud Run |
| 525 | # service are passed to the end user (for example, if you delete a service, any |
| 526 | # requests directed to that service receive a `404` error). |
Bu Sun Kim | 6502091 | 2020-05-20 12:08:20 -0700 | [diff] [blame^] | 527 | "region": "A String", # Optional. User-provided region where the Cloud Run service is hosted.<br> |
Dan O'Meara | dd49464 | 2020-05-01 07:42:23 -0700 | [diff] [blame] | 528 | # Defaults to `us-central1` if not supplied. |
Bu Sun Kim | 6502091 | 2020-05-20 12:08:20 -0700 | [diff] [blame^] | 529 | "serviceId": "A String", # Required. User-defined ID of the Cloud Run service. |
Dan O'Meara | dd49464 | 2020-05-01 07:42:23 -0700 | [diff] [blame] | 530 | }, |
Bu Sun Kim | 6502091 | 2020-05-20 12:08:20 -0700 | [diff] [blame^] | 531 | "glob": "A String", # The user-supplied [glob |
Dan O'Meara | dd49464 | 2020-05-01 07:42:23 -0700 | [diff] [blame] | 532 | # pattern](/docs/hosting/full-config#glob_pattern_matching) to match |
| 533 | # against the request URL path. |
Bu Sun Kim | 6502091 | 2020-05-20 12:08:20 -0700 | [diff] [blame^] | 534 | "path": "A String", # The URL path to rewrite the request to. |
| 535 | }, |
| 536 | ], |
| 537 | "redirects": [ # A list of globs that will cause the response to redirect to another |
| 538 | # location. |
| 539 | { # A [`redirect`](/docs/hosting/full-config#redirects) represents the |
| 540 | # configuration for returning an HTTP redirect response given a matching |
| 541 | # request URL path. |
| 542 | "glob": "A String", # The user-supplied [glob |
| 543 | # pattern](/docs/hosting/full-config#glob_pattern_matching) to match |
| 544 | # against the request URL path. |
| 545 | "statusCode": 42, # Required. The status HTTP code to return in the response. It must be a |
| 546 | # valid 3xx status code. |
| 547 | "regex": "A String", # The user-supplied RE2 regular expression to match against the request |
| 548 | # URL path. |
| 549 | "location": "A String", # Required. The value to put in the HTTP location header of the response. |
| 550 | # <br>The location can contain capture group values from the pattern using |
| 551 | # a `:` prefix to identify the segment and an optional `*` to capture the |
| 552 | # rest of the URL. |
| 553 | # For example: |
| 554 | # <code>"glob": "/:capture*", |
| 555 | # <br>"statusCode": 301, |
| 556 | # <br>"location": "https://example.com/foo/:capture"</code> |
Dan O'Meara | dd49464 | 2020-05-01 07:42:23 -0700 | [diff] [blame] | 557 | }, |
| 558 | ], |
| 559 | }, |
Bu Sun Kim | 6502091 | 2020-05-20 12:08:20 -0700 | [diff] [blame^] | 560 | "name": "A String", # The unique identifier for a version, in the format: |
| 561 | # <code>sites/<var>site-name</var>/versions/<var>versionID</var></code> |
| 562 | # This name is provided in the response body when you call the |
| 563 | # [`CreateVersion`](../sites.versions/create) endpoint. |
| 564 | "createUser": { # Contains metadata about the user who performed an action, such as creating # Output only. Identifies the user who created the version. |
| 565 | # a release or finalizing a version. |
| 566 | "email": "A String", # The email address of the user when the user performed the action. |
| 567 | "imageUrl": "A String", # A profile image URL for the user. May not be present if the user has |
| 568 | # changed their email address or deleted their account. |
| 569 | }, |
Dan O'Meara | dd49464 | 2020-05-01 07:42:23 -0700 | [diff] [blame] | 570 | }, |
| 571 | ], |
| 572 | }</pre> |
| 573 | </div> |
| 574 | |
| 575 | <div class="method"> |
| 576 | <code class="details" id="list_next">list_next(previous_request, previous_response)</code> |
| 577 | <pre>Retrieves the next page of results. |
| 578 | |
| 579 | Args: |
| 580 | previous_request: The request for the previous page. (required) |
| 581 | previous_response: The response from the request for the previous page. (required) |
| 582 | |
| 583 | Returns: |
Bu Sun Kim | 6502091 | 2020-05-20 12:08:20 -0700 | [diff] [blame^] | 584 | A request object that you can call 'execute()' on to request the next |
Dan O'Meara | dd49464 | 2020-05-01 07:42:23 -0700 | [diff] [blame] | 585 | page. Returns None if there are no more items in the collection. |
| 586 | </pre> |
| 587 | </div> |
| 588 | |
| 589 | <div class="method"> |
| 590 | <code class="details" id="patch">patch(name, body=None, updateMask=None, x__xgafv=None)</code> |
Bu Sun Kim | 715bd7f | 2019-06-14 16:50:42 -0700 | [diff] [blame] | 591 | <pre>Updates the specified metadata for a version. Note that this method will |
| 592 | fail with `FAILED_PRECONDITION` in the event of an invalid state |
| 593 | transition. The only valid transition for a version is currently from a |
| 594 | `CREATED` status to a `FINALIZED` status. |
| 595 | Use [`DeleteVersion`](../sites.versions/delete) to set the status of a |
| 596 | version to `DELETED`. |
| 597 | |
| 598 | Args: |
| 599 | name: string, The unique identifier for a version, in the format: |
Dan O'Meara | dd49464 | 2020-05-01 07:42:23 -0700 | [diff] [blame] | 600 | <code>sites/<var>site-name</var>/versions/<var>versionID</var></code> |
Bu Sun Kim | 715bd7f | 2019-06-14 16:50:42 -0700 | [diff] [blame] | 601 | This name is provided in the response body when you call the |
| 602 | [`CreateVersion`](../sites.versions/create) endpoint. (required) |
Dan O'Meara | dd49464 | 2020-05-01 07:42:23 -0700 | [diff] [blame] | 603 | body: object, The request body. |
Bu Sun Kim | 715bd7f | 2019-06-14 16:50:42 -0700 | [diff] [blame] | 604 | The object takes the form of: |
| 605 | |
| 606 | { # A `Version` is the collection of configuration and |
| 607 | # [static files](sites.versions.files) that determine how a site is displayed. |
Bu Sun Kim | 6502091 | 2020-05-20 12:08:20 -0700 | [diff] [blame^] | 608 | "fileCount": "A String", # Output only. The total number of files associated with the version. |
| 609 | # <br>This value is calculated after a version is `FINALIZED`. |
| 610 | "deleteUser": { # Contains metadata about the user who performed an action, such as creating # Output only. Identifies the user who `DELETED` the version. |
| 611 | # a release or finalizing a version. |
| 612 | "email": "A String", # The email address of the user when the user performed the action. |
| 613 | "imageUrl": "A String", # A profile image URL for the user. May not be present if the user has |
| 614 | # changed their email address or deleted their account. |
| 615 | }, |
| 616 | "deleteTime": "A String", # Output only. The time at which the version was `DELETED`. |
| 617 | "finalizeUser": { # Contains metadata about the user who performed an action, such as creating # Output only. Identifies the user who `FINALIZED` the version. |
| 618 | # a release or finalizing a version. |
| 619 | "email": "A String", # The email address of the user when the user performed the action. |
| 620 | "imageUrl": "A String", # A profile image URL for the user. May not be present if the user has |
| 621 | # changed their email address or deleted their account. |
| 622 | }, |
| 623 | "preview": { # Version preview configuration. If active and unexpired, # Version preview configuration for the site version. This configuration |
| 624 | # specfies whether previewing is enabled for this site version. Version |
| 625 | # previews allow you to preview your site at a custom URL before |
| 626 | # releasing it as the live version. |
| 627 | # this version will be accessible via a custom URL even |
| 628 | # if it is not the currently released version. |
| 629 | "active": True or False, # If true, preview URLs are enabled for this version. |
| 630 | "expireTime": "A String", # Indicates the expiration time for previewing this |
| 631 | # version; preview URL requests received after this time will 404. |
| 632 | }, |
| 633 | "labels": { # The labels used for extra metadata and/or filtering. |
| 634 | "a_key": "A String", |
| 635 | }, |
| 636 | "createTime": "A String", # Output only. The time at which the version was created. |
| 637 | "versionBytes": "A String", # Output only. The total stored bytesize of the version. |
| 638 | # <br>This value is calculated after a version is `FINALIZED`. |
| 639 | "finalizeTime": "A String", # Output only. The time at which the version was `FINALIZED`. |
| 640 | "status": "A String", # The deploy status of a version. |
Dan O'Meara | dd49464 | 2020-05-01 07:42:23 -0700 | [diff] [blame] | 641 | # <br> |
| 642 | # <br>For a successful deploy, call the |
Bu Sun Kim | 715bd7f | 2019-06-14 16:50:42 -0700 | [diff] [blame] | 643 | # [`CreateVersion`](sites.versions/create) endpoint to make a new version |
| 644 | # (`CREATED` status), |
| 645 | # [upload all desired files](sites.versions/populateFiles) to the version, |
| 646 | # then [update](sites.versions/patch) the version to the `FINALIZED` status. |
Dan O'Meara | dd49464 | 2020-05-01 07:42:23 -0700 | [diff] [blame] | 647 | # <br> |
| 648 | # <br>Note that if you leave the version in the `CREATED` state for more |
| 649 | # than 12&nbsp;hours, the system will automatically mark the version as |
Bu Sun Kim | 715bd7f | 2019-06-14 16:50:42 -0700 | [diff] [blame] | 650 | # `ABANDONED`. |
Dan O'Meara | dd49464 | 2020-05-01 07:42:23 -0700 | [diff] [blame] | 651 | # <br> |
| 652 | # <br>You can also change the status of a version to `DELETED` by calling the |
Bu Sun Kim | 715bd7f | 2019-06-14 16:50:42 -0700 | [diff] [blame] | 653 | # [`DeleteVersion`](sites.versions/delete) endpoint. |
Bu Sun Kim | 6502091 | 2020-05-20 12:08:20 -0700 | [diff] [blame^] | 654 | "config": { # The configuration for how incoming requests to a site should be routed and # The configuration for the behavior of the site. This configuration exists |
Bu Sun Kim | 715bd7f | 2019-06-14 16:50:42 -0700 | [diff] [blame] | 655 | # in the [`firebase.json`](/docs/cli/#the_firebasejson_file) file. |
| 656 | # processed before serving content. The patterns are matched and applied |
| 657 | # according to a specific |
| 658 | # [priority order](/docs/hosting/full-config#hosting_priority_order). |
Bu Sun Kim | 6502091 | 2020-05-20 12:08:20 -0700 | [diff] [blame^] | 659 | "headers": [ # A list of custom response headers that are added to the content if the |
Bu Sun Kim | 715bd7f | 2019-06-14 16:50:42 -0700 | [diff] [blame] | 660 | # request URL path matches the glob. |
| 661 | { # A [`header`](/docs/hosting/full-config#headers) defines custom headers to |
| 662 | # add to a response should the request URL path match the pattern. |
Bu Sun Kim | 6502091 | 2020-05-20 12:08:20 -0700 | [diff] [blame^] | 663 | "headers": { # Required. The additional headers to add to the response. |
| 664 | "a_key": "A String", |
Bu Sun Kim | 715bd7f | 2019-06-14 16:50:42 -0700 | [diff] [blame] | 665 | }, |
Bu Sun Kim | 6502091 | 2020-05-20 12:08:20 -0700 | [diff] [blame^] | 666 | "regex": "A String", # The user-supplied RE2 regular expression to match against the request |
| 667 | # URL path. |
| 668 | "glob": "A String", # The user-supplied [glob |
Dan O'Meara | dd49464 | 2020-05-01 07:42:23 -0700 | [diff] [blame] | 669 | # pattern](/docs/hosting/full-config#glob_pattern_matching) to match |
Bu Sun Kim | 715bd7f | 2019-06-14 16:50:42 -0700 | [diff] [blame] | 670 | # against the request URL path. |
| 671 | }, |
| 672 | ], |
Bu Sun Kim | 6502091 | 2020-05-20 12:08:20 -0700 | [diff] [blame^] | 673 | "appAssociation": "A String", # How to handle well known App Association files. |
| 674 | "cleanUrls": True or False, # Defines whether to drop the file extension from uploaded files. |
| 675 | "trailingSlashBehavior": "A String", # Defines how to handle a trailing slash in the URL path. |
| 676 | "rewrites": [ # A list of rewrites that will act as if the service were given the |
Bu Sun Kim | 715bd7f | 2019-06-14 16:50:42 -0700 | [diff] [blame] | 677 | # destination URL. |
| 678 | { # A [`rewrite`](/docs/hosting/full-config#rewrites) represents an internal |
| 679 | # content rewrite on the version. If the pattern matches, the request will be |
| 680 | # handled as if it were to the destination path specified in the |
| 681 | # configuration. |
Bu Sun Kim | 6502091 | 2020-05-20 12:08:20 -0700 | [diff] [blame^] | 682 | "function": "A String", # The function to proxy requests to. Must match the exported function |
Bu Sun Kim | 715bd7f | 2019-06-14 16:50:42 -0700 | [diff] [blame] | 683 | # name exactly. |
Bu Sun Kim | 6502091 | 2020-05-20 12:08:20 -0700 | [diff] [blame^] | 684 | "regex": "A String", # The user-supplied RE2 regular expression to match against the request |
| 685 | # URL path. |
| 686 | "dynamicLinks": True or False, # The request will be forwarded to Firebase Dynamic Links. |
| 687 | "run": { # A configured rewrite that directs requests to a Cloud Run service. If the # The request will be forwarded to Cloud Run. |
Bu Sun Kim | 715bd7f | 2019-06-14 16:50:42 -0700 | [diff] [blame] | 688 | # Cloud Run service does not exist when setting or updating your Firebase |
| 689 | # Hosting configuration, then the request fails. Any errors from the Cloud Run |
| 690 | # service are passed to the end user (for example, if you delete a service, any |
| 691 | # requests directed to that service receive a `404` error). |
Bu Sun Kim | 6502091 | 2020-05-20 12:08:20 -0700 | [diff] [blame^] | 692 | "region": "A String", # Optional. User-provided region where the Cloud Run service is hosted.<br> |
Bu Sun Kim | 715bd7f | 2019-06-14 16:50:42 -0700 | [diff] [blame] | 693 | # Defaults to `us-central1` if not supplied. |
Bu Sun Kim | 6502091 | 2020-05-20 12:08:20 -0700 | [diff] [blame^] | 694 | "serviceId": "A String", # Required. User-defined ID of the Cloud Run service. |
Bu Sun Kim | 715bd7f | 2019-06-14 16:50:42 -0700 | [diff] [blame] | 695 | }, |
Bu Sun Kim | 6502091 | 2020-05-20 12:08:20 -0700 | [diff] [blame^] | 696 | "glob": "A String", # The user-supplied [glob |
Dan O'Meara | dd49464 | 2020-05-01 07:42:23 -0700 | [diff] [blame] | 697 | # pattern](/docs/hosting/full-config#glob_pattern_matching) to match |
| 698 | # against the request URL path. |
Bu Sun Kim | 6502091 | 2020-05-20 12:08:20 -0700 | [diff] [blame^] | 699 | "path": "A String", # The URL path to rewrite the request to. |
| 700 | }, |
| 701 | ], |
| 702 | "redirects": [ # A list of globs that will cause the response to redirect to another |
| 703 | # location. |
| 704 | { # A [`redirect`](/docs/hosting/full-config#redirects) represents the |
| 705 | # configuration for returning an HTTP redirect response given a matching |
| 706 | # request URL path. |
| 707 | "glob": "A String", # The user-supplied [glob |
| 708 | # pattern](/docs/hosting/full-config#glob_pattern_matching) to match |
| 709 | # against the request URL path. |
| 710 | "statusCode": 42, # Required. The status HTTP code to return in the response. It must be a |
| 711 | # valid 3xx status code. |
| 712 | "regex": "A String", # The user-supplied RE2 regular expression to match against the request |
| 713 | # URL path. |
| 714 | "location": "A String", # Required. The value to put in the HTTP location header of the response. |
| 715 | # <br>The location can contain capture group values from the pattern using |
| 716 | # a `:` prefix to identify the segment and an optional `*` to capture the |
| 717 | # rest of the URL. |
| 718 | # For example: |
| 719 | # <code>"glob": "/:capture*", |
| 720 | # <br>"statusCode": 301, |
| 721 | # <br>"location": "https://example.com/foo/:capture"</code> |
Bu Sun Kim | 715bd7f | 2019-06-14 16:50:42 -0700 | [diff] [blame] | 722 | }, |
| 723 | ], |
| 724 | }, |
Bu Sun Kim | 6502091 | 2020-05-20 12:08:20 -0700 | [diff] [blame^] | 725 | "name": "A String", # The unique identifier for a version, in the format: |
| 726 | # <code>sites/<var>site-name</var>/versions/<var>versionID</var></code> |
| 727 | # This name is provided in the response body when you call the |
| 728 | # [`CreateVersion`](../sites.versions/create) endpoint. |
| 729 | "createUser": { # Contains metadata about the user who performed an action, such as creating # Output only. Identifies the user who created the version. |
| 730 | # a release or finalizing a version. |
| 731 | "email": "A String", # The email address of the user when the user performed the action. |
| 732 | "imageUrl": "A String", # A profile image URL for the user. May not be present if the user has |
| 733 | # changed their email address or deleted their account. |
| 734 | }, |
Bu Sun Kim | 715bd7f | 2019-06-14 16:50:42 -0700 | [diff] [blame] | 735 | } |
| 736 | |
| 737 | updateMask: string, A set of field names from your [version](../sites.versions) that you want |
| 738 | to update. |
Bu Sun Kim | 6502091 | 2020-05-20 12:08:20 -0700 | [diff] [blame^] | 739 | <br>A field will be overwritten if, and only if, it's in the mask. |
Dan O'Meara | dd49464 | 2020-05-01 07:42:23 -0700 | [diff] [blame] | 740 | <br>If a mask is not provided then a default mask of only |
Bu Sun Kim | 715bd7f | 2019-06-14 16:50:42 -0700 | [diff] [blame] | 741 | [`status`](../sites.versions#Version.FIELDS.status) will be used. |
| 742 | x__xgafv: string, V1 error format. |
| 743 | Allowed values |
| 744 | 1 - v1 error format |
| 745 | 2 - v2 error format |
| 746 | |
| 747 | Returns: |
| 748 | An object of the form: |
| 749 | |
| 750 | { # A `Version` is the collection of configuration and |
| 751 | # [static files](sites.versions.files) that determine how a site is displayed. |
Bu Sun Kim | 6502091 | 2020-05-20 12:08:20 -0700 | [diff] [blame^] | 752 | "fileCount": "A String", # Output only. The total number of files associated with the version. |
| 753 | # <br>This value is calculated after a version is `FINALIZED`. |
| 754 | "deleteUser": { # Contains metadata about the user who performed an action, such as creating # Output only. Identifies the user who `DELETED` the version. |
| 755 | # a release or finalizing a version. |
| 756 | "email": "A String", # The email address of the user when the user performed the action. |
| 757 | "imageUrl": "A String", # A profile image URL for the user. May not be present if the user has |
| 758 | # changed their email address or deleted their account. |
| 759 | }, |
| 760 | "deleteTime": "A String", # Output only. The time at which the version was `DELETED`. |
| 761 | "finalizeUser": { # Contains metadata about the user who performed an action, such as creating # Output only. Identifies the user who `FINALIZED` the version. |
| 762 | # a release or finalizing a version. |
| 763 | "email": "A String", # The email address of the user when the user performed the action. |
| 764 | "imageUrl": "A String", # A profile image URL for the user. May not be present if the user has |
| 765 | # changed their email address or deleted their account. |
| 766 | }, |
| 767 | "preview": { # Version preview configuration. If active and unexpired, # Version preview configuration for the site version. This configuration |
| 768 | # specfies whether previewing is enabled for this site version. Version |
| 769 | # previews allow you to preview your site at a custom URL before |
| 770 | # releasing it as the live version. |
| 771 | # this version will be accessible via a custom URL even |
| 772 | # if it is not the currently released version. |
| 773 | "active": True or False, # If true, preview URLs are enabled for this version. |
| 774 | "expireTime": "A String", # Indicates the expiration time for previewing this |
| 775 | # version; preview URL requests received after this time will 404. |
| 776 | }, |
| 777 | "labels": { # The labels used for extra metadata and/or filtering. |
| 778 | "a_key": "A String", |
| 779 | }, |
| 780 | "createTime": "A String", # Output only. The time at which the version was created. |
| 781 | "versionBytes": "A String", # Output only. The total stored bytesize of the version. |
| 782 | # <br>This value is calculated after a version is `FINALIZED`. |
| 783 | "finalizeTime": "A String", # Output only. The time at which the version was `FINALIZED`. |
| 784 | "status": "A String", # The deploy status of a version. |
Dan O'Meara | dd49464 | 2020-05-01 07:42:23 -0700 | [diff] [blame] | 785 | # <br> |
| 786 | # <br>For a successful deploy, call the |
Bu Sun Kim | 715bd7f | 2019-06-14 16:50:42 -0700 | [diff] [blame] | 787 | # [`CreateVersion`](sites.versions/create) endpoint to make a new version |
| 788 | # (`CREATED` status), |
| 789 | # [upload all desired files](sites.versions/populateFiles) to the version, |
| 790 | # then [update](sites.versions/patch) the version to the `FINALIZED` status. |
Dan O'Meara | dd49464 | 2020-05-01 07:42:23 -0700 | [diff] [blame] | 791 | # <br> |
| 792 | # <br>Note that if you leave the version in the `CREATED` state for more |
| 793 | # than 12&nbsp;hours, the system will automatically mark the version as |
Bu Sun Kim | 715bd7f | 2019-06-14 16:50:42 -0700 | [diff] [blame] | 794 | # `ABANDONED`. |
Dan O'Meara | dd49464 | 2020-05-01 07:42:23 -0700 | [diff] [blame] | 795 | # <br> |
| 796 | # <br>You can also change the status of a version to `DELETED` by calling the |
Bu Sun Kim | 715bd7f | 2019-06-14 16:50:42 -0700 | [diff] [blame] | 797 | # [`DeleteVersion`](sites.versions/delete) endpoint. |
Bu Sun Kim | 6502091 | 2020-05-20 12:08:20 -0700 | [diff] [blame^] | 798 | "config": { # The configuration for how incoming requests to a site should be routed and # The configuration for the behavior of the site. This configuration exists |
Bu Sun Kim | 715bd7f | 2019-06-14 16:50:42 -0700 | [diff] [blame] | 799 | # in the [`firebase.json`](/docs/cli/#the_firebasejson_file) file. |
| 800 | # processed before serving content. The patterns are matched and applied |
| 801 | # according to a specific |
| 802 | # [priority order](/docs/hosting/full-config#hosting_priority_order). |
Bu Sun Kim | 6502091 | 2020-05-20 12:08:20 -0700 | [diff] [blame^] | 803 | "headers": [ # A list of custom response headers that are added to the content if the |
Bu Sun Kim | 715bd7f | 2019-06-14 16:50:42 -0700 | [diff] [blame] | 804 | # request URL path matches the glob. |
| 805 | { # A [`header`](/docs/hosting/full-config#headers) defines custom headers to |
| 806 | # add to a response should the request URL path match the pattern. |
Bu Sun Kim | 6502091 | 2020-05-20 12:08:20 -0700 | [diff] [blame^] | 807 | "headers": { # Required. The additional headers to add to the response. |
| 808 | "a_key": "A String", |
Bu Sun Kim | 715bd7f | 2019-06-14 16:50:42 -0700 | [diff] [blame] | 809 | }, |
Bu Sun Kim | 6502091 | 2020-05-20 12:08:20 -0700 | [diff] [blame^] | 810 | "regex": "A String", # The user-supplied RE2 regular expression to match against the request |
| 811 | # URL path. |
| 812 | "glob": "A String", # The user-supplied [glob |
Dan O'Meara | dd49464 | 2020-05-01 07:42:23 -0700 | [diff] [blame] | 813 | # pattern](/docs/hosting/full-config#glob_pattern_matching) to match |
Bu Sun Kim | 715bd7f | 2019-06-14 16:50:42 -0700 | [diff] [blame] | 814 | # against the request URL path. |
| 815 | }, |
| 816 | ], |
Bu Sun Kim | 6502091 | 2020-05-20 12:08:20 -0700 | [diff] [blame^] | 817 | "appAssociation": "A String", # How to handle well known App Association files. |
| 818 | "cleanUrls": True or False, # Defines whether to drop the file extension from uploaded files. |
| 819 | "trailingSlashBehavior": "A String", # Defines how to handle a trailing slash in the URL path. |
| 820 | "rewrites": [ # A list of rewrites that will act as if the service were given the |
Bu Sun Kim | 715bd7f | 2019-06-14 16:50:42 -0700 | [diff] [blame] | 821 | # destination URL. |
| 822 | { # A [`rewrite`](/docs/hosting/full-config#rewrites) represents an internal |
| 823 | # content rewrite on the version. If the pattern matches, the request will be |
| 824 | # handled as if it were to the destination path specified in the |
| 825 | # configuration. |
Bu Sun Kim | 6502091 | 2020-05-20 12:08:20 -0700 | [diff] [blame^] | 826 | "function": "A String", # The function to proxy requests to. Must match the exported function |
Bu Sun Kim | 715bd7f | 2019-06-14 16:50:42 -0700 | [diff] [blame] | 827 | # name exactly. |
Bu Sun Kim | 6502091 | 2020-05-20 12:08:20 -0700 | [diff] [blame^] | 828 | "regex": "A String", # The user-supplied RE2 regular expression to match against the request |
| 829 | # URL path. |
| 830 | "dynamicLinks": True or False, # The request will be forwarded to Firebase Dynamic Links. |
| 831 | "run": { # A configured rewrite that directs requests to a Cloud Run service. If the # The request will be forwarded to Cloud Run. |
Bu Sun Kim | 715bd7f | 2019-06-14 16:50:42 -0700 | [diff] [blame] | 832 | # Cloud Run service does not exist when setting or updating your Firebase |
| 833 | # Hosting configuration, then the request fails. Any errors from the Cloud Run |
| 834 | # service are passed to the end user (for example, if you delete a service, any |
| 835 | # requests directed to that service receive a `404` error). |
Bu Sun Kim | 6502091 | 2020-05-20 12:08:20 -0700 | [diff] [blame^] | 836 | "region": "A String", # Optional. User-provided region where the Cloud Run service is hosted.<br> |
Bu Sun Kim | 715bd7f | 2019-06-14 16:50:42 -0700 | [diff] [blame] | 837 | # Defaults to `us-central1` if not supplied. |
Bu Sun Kim | 6502091 | 2020-05-20 12:08:20 -0700 | [diff] [blame^] | 838 | "serviceId": "A String", # Required. User-defined ID of the Cloud Run service. |
Bu Sun Kim | 715bd7f | 2019-06-14 16:50:42 -0700 | [diff] [blame] | 839 | }, |
Bu Sun Kim | 6502091 | 2020-05-20 12:08:20 -0700 | [diff] [blame^] | 840 | "glob": "A String", # The user-supplied [glob |
Dan O'Meara | dd49464 | 2020-05-01 07:42:23 -0700 | [diff] [blame] | 841 | # pattern](/docs/hosting/full-config#glob_pattern_matching) to match |
| 842 | # against the request URL path. |
Bu Sun Kim | 6502091 | 2020-05-20 12:08:20 -0700 | [diff] [blame^] | 843 | "path": "A String", # The URL path to rewrite the request to. |
| 844 | }, |
| 845 | ], |
| 846 | "redirects": [ # A list of globs that will cause the response to redirect to another |
| 847 | # location. |
| 848 | { # A [`redirect`](/docs/hosting/full-config#redirects) represents the |
| 849 | # configuration for returning an HTTP redirect response given a matching |
| 850 | # request URL path. |
| 851 | "glob": "A String", # The user-supplied [glob |
| 852 | # pattern](/docs/hosting/full-config#glob_pattern_matching) to match |
| 853 | # against the request URL path. |
| 854 | "statusCode": 42, # Required. The status HTTP code to return in the response. It must be a |
| 855 | # valid 3xx status code. |
| 856 | "regex": "A String", # The user-supplied RE2 regular expression to match against the request |
| 857 | # URL path. |
| 858 | "location": "A String", # Required. The value to put in the HTTP location header of the response. |
| 859 | # <br>The location can contain capture group values from the pattern using |
| 860 | # a `:` prefix to identify the segment and an optional `*` to capture the |
| 861 | # rest of the URL. |
| 862 | # For example: |
| 863 | # <code>"glob": "/:capture*", |
| 864 | # <br>"statusCode": 301, |
| 865 | # <br>"location": "https://example.com/foo/:capture"</code> |
Bu Sun Kim | 715bd7f | 2019-06-14 16:50:42 -0700 | [diff] [blame] | 866 | }, |
| 867 | ], |
| 868 | }, |
Bu Sun Kim | 6502091 | 2020-05-20 12:08:20 -0700 | [diff] [blame^] | 869 | "name": "A String", # The unique identifier for a version, in the format: |
| 870 | # <code>sites/<var>site-name</var>/versions/<var>versionID</var></code> |
| 871 | # This name is provided in the response body when you call the |
| 872 | # [`CreateVersion`](../sites.versions/create) endpoint. |
| 873 | "createUser": { # Contains metadata about the user who performed an action, such as creating # Output only. Identifies the user who created the version. |
| 874 | # a release or finalizing a version. |
| 875 | "email": "A String", # The email address of the user when the user performed the action. |
| 876 | "imageUrl": "A String", # A profile image URL for the user. May not be present if the user has |
| 877 | # changed their email address or deleted their account. |
| 878 | }, |
Bu Sun Kim | 715bd7f | 2019-06-14 16:50:42 -0700 | [diff] [blame] | 879 | }</pre> |
| 880 | </div> |
| 881 | |
| 882 | <div class="method"> |
Dan O'Meara | dd49464 | 2020-05-01 07:42:23 -0700 | [diff] [blame] | 883 | <code class="details" id="populateFiles">populateFiles(parent, body=None, x__xgafv=None)</code> |
Bu Sun Kim | 715bd7f | 2019-06-14 16:50:42 -0700 | [diff] [blame] | 884 | <pre>Adds content files to a version. |
| 885 | |
| 886 | Args: |
| 887 | parent: string, Required. The version to add files to, in the format: |
Dan O'Meara | dd49464 | 2020-05-01 07:42:23 -0700 | [diff] [blame] | 888 | <code>sites/<var>site-name</var>/versions/<var>versionID</var></code> (required) |
| 889 | body: object, The request body. |
Bu Sun Kim | 715bd7f | 2019-06-14 16:50:42 -0700 | [diff] [blame] | 890 | The object takes the form of: |
| 891 | |
Bu Sun Kim | 6502091 | 2020-05-20 12:08:20 -0700 | [diff] [blame^] | 892 | { # The request to populate a Version's Files. |
| 893 | "files": { # A set of file paths to the hashes corresponding to assets that should be |
Bu Sun Kim | 715bd7f | 2019-06-14 16:50:42 -0700 | [diff] [blame] | 894 | # added to the version. Note that a file path to an empty hash will remove |
| 895 | # the path from the version. Calculate a hash by Gzipping the file then |
| 896 | # taking the SHA256 hash of the newly compressed file. |
Bu Sun Kim | 6502091 | 2020-05-20 12:08:20 -0700 | [diff] [blame^] | 897 | "a_key": "A String", |
Bu Sun Kim | 715bd7f | 2019-06-14 16:50:42 -0700 | [diff] [blame] | 898 | }, |
| 899 | } |
| 900 | |
| 901 | x__xgafv: string, V1 error format. |
| 902 | Allowed values |
| 903 | 1 - v1 error format |
| 904 | 2 - v2 error format |
| 905 | |
| 906 | Returns: |
| 907 | An object of the form: |
| 908 | |
Bu Sun Kim | 6502091 | 2020-05-20 12:08:20 -0700 | [diff] [blame^] | 909 | { |
| 910 | "uploadRequiredHashes": [ # The content hashes of the specified files that need to be uploaded to the |
Bu Sun Kim | 715bd7f | 2019-06-14 16:50:42 -0700 | [diff] [blame] | 911 | # specified endpoint. |
Bu Sun Kim | 6502091 | 2020-05-20 12:08:20 -0700 | [diff] [blame^] | 912 | "A String", |
Bu Sun Kim | 715bd7f | 2019-06-14 16:50:42 -0700 | [diff] [blame] | 913 | ], |
Bu Sun Kim | 6502091 | 2020-05-20 12:08:20 -0700 | [diff] [blame^] | 914 | "uploadUrl": "A String", # The URL to which the files should be uploaded, in the format: |
| 915 | # <br>"https://upload-firebasehosting.googleapis.com/upload/sites/<var>site-name</var>/versions/<var>versionID</var>/files". |
Dan O'Meara | dd49464 | 2020-05-01 07:42:23 -0700 | [diff] [blame] | 916 | # <br>Perform a multipart `POST` of the Gzipped file contents to the URL |
Bu Sun Kim | 715bd7f | 2019-06-14 16:50:42 -0700 | [diff] [blame] | 917 | # using a forward slash and the hash of the file appended to the end. |
| 918 | }</pre> |
| 919 | </div> |
| 920 | |
| 921 | </body></html> |