Measurements
Defined in dfx/api/MeasurementAPI.hpp
Used to manage the DeepAffex Measurements endpoint.
Note
Measurements are to manage existing measurements to create a new measurement, use MeasurementStream service.
CloudConfig config;
auto status = dfx::api::loadCloudConfig(config);
if ( status.OK() ) {
std::shared_ptr<CloudAPI> cloud;
status = CloudAPI::createInstance(config, cloud);
if ( status.OK() ) {
auto service = cloud->measurements(config);
// List out all measurements accessible to your user token
std::vector<Measurement> measurements;
uint16_t totalCount;
status = service->list(config, {}, 0, measurements, totalCount);
if ( status.OK() ) {
for (const auto& measurement : measurements) {
std::cout << measurement.id << std::endl;
}
}
}
}
Retrieve
-
virtual CloudStatus dfx::api::MeasurementAPI::list(const CloudConfig &config, const std::unordered_map<MeasurementFilter, std::string> &filters, uint16_t offset, std::vector<Measurement> &measurements, int16_t &totalCount)
Provides a historical list of measurements captured by the API store.
The results of the measurements are captured and only displayed for the current application providers token designator
- Parameters
config – provides all the cloud configuration settings
filters –
measurements –
- Returns
status of operation, CLOUD_OK on SUCCESS
-
virtual CloudStatus dfx::api::MeasurementAPI::retrieve(const CloudConfig &config, const std::string &measurementID, Measurement &measurementData)
Returns the results of a measurement request specified by the UUID.
- Parameters
config – provides all the cloud configuration settings
measurementID –
measurementData –
- Returns
status of operation, CLOUD_OK on SUCCESS
-
virtual CloudStatus dfx::api::MeasurementAPI::retrieveMultiple(const CloudConfig &config, const std::vector<std::string> &measurementIDs, std::vector<Measurement> &measurements)
Multiple retrieve results of a measurements.
- Parameters
config – provides all the cloud configuration settings
measurementIDs –
measurements –
- Returns
status of operation, CLOUD_OK on SUCCESS