Skip to main content

traffic

Creates, updates, deletes, gets or lists a traffic resource.

Overview

Nametraffic
TypeResource
Idfirebase.apphosting.traffic

Fields

The following fields are returned by SELECT queries:

Successful response

NameDatatypeDescription
namestringIdentifier. The resource name of the backend's traffic. Format: projects/{project}/locations/{locationId}/backends/{backendId}/traffic.
annotationsobjectOptional. Unstructured key value map that may be set by external tools to store and arbitrary metadata. They are not queryable and should be preserved when modifying objects.
createTimestring (google-datetime)Output only. Time at which the backend was created.
currentobjectOutput only. Current state of traffic allocation for the backend. When setting target, this field may differ for some time until the desired state is reached. (id: TrafficSet)
etagstringOutput only. Server-computed checksum based on other values; may be sent on update or delete to ensure operation is done on expected resource.
labelsobjectOptional. Unstructured key value map that can be used to organize and categorize objects.
reconcilingbooleanOutput only. A field that, if true, indicates that the system is working to make the backend's current match the requested target list.
rolloutPolicyobjectA rollout policy specifies how new builds and automatic deployments are created. (id: RolloutPolicy)
targetobjectSet to manually control the desired traffic for the backend. This will cause current to eventually match this value. The percentages must add up to 100%. (id: TrafficSet)
uidstringOutput only. System-assigned, unique identifier.
updateTimestring (google-datetime)Output only. Time at which the backend was last updated.

Methods

The following methods are available for this resource:

NameAccessible byRequired ParamsOptional ParamsDescription
getselectprojectsId, locationsId, backendsIdGets information about a backend's traffic.
patchupdateprojectsId, locationsId, backendsIdupdateMask, requestId, validateOnlyUpdates a backend's traffic.

Parameters

Parameters can be passed in the WHERE clause of a query. Check the Methods section to see which parameters are required or optional for each operation.

NameDatatypeDescription
backendsIdstring
locationsIdstring
projectsIdstring
requestIdstring
updateMaskstring (google-fieldmask)
validateOnlyboolean

SELECT examples

Gets information about a backend's traffic.

SELECT
name,
annotations,
createTime,
current,
etag,
labels,
reconciling,
rolloutPolicy,
target,
uid,
updateTime
FROM firebase.apphosting.traffic
WHERE projectsId = '{{ projectsId }}' -- required
AND locationsId = '{{ locationsId }}' -- required
AND backendsId = '{{ backendsId }}' -- required;

UPDATE examples

Updates a backend's traffic.

UPDATE firebase.apphosting.traffic
SET
data__target = '{{ target }}',
data__rolloutPolicy = '{{ rolloutPolicy }}',
data__name = '{{ name }}',
data__labels = '{{ labels }}',
data__annotations = '{{ annotations }}'
WHERE
projectsId = '{{ projectsId }}' --required
AND locationsId = '{{ locationsId }}' --required
AND backendsId = '{{ backendsId }}' --required
AND updateMask = '{{ updateMask}}'
AND requestId = '{{ requestId}}'
AND validateOnly = {{ validateOnly}}
RETURNING
name,
done,
error,
metadata,
response;