Resource
Measurement
A measurement from a set ofDataProviders requested by a MeasurementConsumer.
Resource name pattern: measurementConsumers/{measurement_consumer}/measurements/{measurement}
Resource name identifier.
Resource name of the
Certificate belonging to the parent MeasurementConsumer.Serialized
MeasurementSpec for requisitions, which can be verified using measurement_consumer_certificate.The version of the MeasurementSpec message type must correspond to the API version that this resource was created in.Map of
DataProvider name to parameters for that DataProvider.The
ProtocolConfig selected for this measurement according to the measurement_spec. Output only.State of this
Measurement. Output only.Possible values:STATE_UNSPECIFIED- Default value used if the state is omittedAWAITING_REQUISITION_FULFILLMENT- Waiting for all linkedRequisitions to be fulfilledCOMPUTING- Computation is runningSUCCEEDED- Completed successfully (terminal state)FAILED- Completed with failure (terminal state)CANCELLED- Cancelled by Measurement Consumer (terminal state)
Results of this
Measurement. Only set if state is SUCCEEDED. Output only.ID referencing the
Measurement in an external system, provided by the MeasurementConsumer.Information about the failure of this
Measurement. Set when the state is set to FAILED. Output only.When the
Measurement was created. Output only.When the
Measurement was last updated. Output only.DataProviderEntry
Entry fordata_providers map.
Key of the map entry, which is a
DataProvider resource name.Value of the map entry.
Result
The result of aMeasurement.
The reach result.
The frequency result.
The impression result.
The watch duration result.
The population result.
Failure
Information about a failure.Reason for this
Failure.Possible values:REASON_UNSPECIFIED- Default value used if the reason is omittedCERTIFICATE_REVOKED- An associated certificate was revokedREQUISITION_REFUSED- Requisition state was set to REFUSEDCOMPUTATION_PARTICIPANT_FAILED- ComputationParticipant state was set to FAILED
Human-readable message. This should not contain any sensitive information.
Methods
GetMeasurement
Returns theMeasurement with the specified resource key.
Request
Resource name of the Measurement.Format:
measurementConsumers/{measurement_consumer}/measurements/{measurement}Measurement resource.
Example
CreateMeasurement
Creates (registers) aMeasurement.
Request
Resource name of the parent
MeasurementConsumer.Format: measurementConsumers/{measurement_consumer}The
Measurement to create. The name field will be ignored, and the system will assign an ID.Unique identifier for this request. If specified, the request will be idempotent. See https://google.aip.dev/155.
Measurement resource.
Example
ListMeasurements
ListsMeasurements for the parent MeasurementConsumer.
Request
Resource name of the parent
MeasurementConsumer.Format: measurementConsumers/{measurement_consumer}The maximum number of
Measurements to return. The service may return fewer than this value.If unspecified, at most 50 Measurements will be returned. The maximum value is 1000; values above 1000 will be coerced to 1000.A page token, received from a previous
ListMeasurementsRequest call. Provide this to retrieve the subsequent page.When paginating, all other parameters provided to ListMeasurementsRequest must match the call that provided the page token.Filter criteria. Repeated fields are treated as logical ORs, and multiple fields specified as logical ANDs.
List of
Measurements that has all of the tags in the ListMeasurementsRequest.A token, which can be sent as
page_token to retrieve the next page. If this field is omitted, there are no subsequent pages.CancelMeasurement
Transitions aMeasurement to the CANCELLED state. This is a terminal state for the Measurement.
This is a state transition method (see https://aip.dev/216).
Request
Resource name of the
Measurement to mark as CANCELLED.Format: measurementConsumers/{measurement_consumer}/measurements/{measurement}Measurement resource with state set to CANCELLED.
Example
BatchCreateMeasurements
Batch createsMeasurements. Results in an error if any of the specified Measurements fail to be created.
Request
Resource name of the parent
MeasurementConsumer.Format: measurementConsumers/{measurement_consumer}The requests specifying the
Measurements to create. Either all requests must have the same parent and the parent must match the top-level parent, or all requests must leave the parent unset.A maximum of 50 Measurements can be created in a single batch.The
Measurement resources.BatchGetMeasurements
Batch getsMeasurements. Results in a NOT_FOUND error if any of the specified Measurements do not exist.
Request
Resource name of the parent
MeasurementConsumer.Format: measurementConsumers/{measurement_consumer}List of resource names. A maximum of 50
Measurements can be retrieved in a single batch.The
Measurement resources.State Transitions
Measurements follow a specific state transition workflow:State Descriptions
- AWAITING_REQUISITION_FULFILLMENT: The measurement is waiting for all linked requisitions to be fulfilled by data providers.
- COMPUTING: All requisitions have been fulfilled and the computation is running.
- SUCCEEDED: The measurement completed successfully and results are available.
- FAILED: The measurement failed due to an error (e.g., certificate revoked, requisition refused, computation participant failed).
- CANCELLED: The measurement was cancelled by the measurement consumer.
Workflow
- Create Measurement: A MeasurementConsumer creates a measurement specifying the data providers and measurement specifications.
- Requisition Creation: The system automatically creates requisitions for each data provider.
- Await Fulfillment: The measurement enters
AWAITING_REQUISITION_FULFILLMENTstate while waiting for data providers. - Data Collection: Data providers fulfill requisitions by providing the requested data.
- Computation: Once all requisitions are fulfilled, the measurement transitions to
COMPUTINGstate. - Result: The measurement transitions to either
SUCCEEDEDwith results orFAILEDwith failure information.
