BazeField Services

<back to all web services

ReadMeasurementMetaData

Measurement API
Requires Authentication
The following routes are available for this service:
GET,POST/measurements/{Keys}/metadata
<?php namespace dtos;

use DateTime;
use Exception;
use DateInterval;
use JsonSerializable;
use ServiceStack\{IReturn,IReturnVoid,IGet,IPost,IPut,IDelete,IPatch,IMeta,IHasSessionId,IHasBearerToken,IHasVersion};
use ServiceStack\{ICrud,ICreateDb,IUpdateDb,IPatchDb,IDeleteDb,ISaveDb,AuditBase,QueryDb,QueryDb2,QueryData,QueryData2,QueryResponse};
use ServiceStack\{ResponseStatus,ResponseError,EmptyResponse,IdResponse,ArrayList,KeyValuePair2,StringResponse,StringsResponse,Tuple2,Tuple3,ByteArray};
use ServiceStack\{JsonConverters,Returns,TypeContext};


class ReadMeasurementMetaData implements IPost, JsonSerializable
{
    public function __construct(
        /** @var string[]|null */
        public ?array $keys=null,
        /** @var int|null */
        public ?int $maxResults=null
    ) {
    }

    /** @throws Exception */
    public function fromMap($o): void {
        if (isset($o['keys'])) $this->keys = JsonConverters::fromArray('string', $o['keys']);
        if (isset($o['maxResults'])) $this->maxResults = $o['maxResults'];
    }
    
    /** @throws Exception */
    public function jsonSerialize(): mixed
    {
        $o = [];
        if (isset($this->keys)) $o['keys'] = JsonConverters::toArray('string', $this->keys);
        if (isset($this->maxResults)) $o['maxResults'] = $this->maxResults;
        return empty($o) ? new class(){} : $o;
    }
}

PHP ReadMeasurementMetaData DTOs

To override the Content-type in your clients, use the HTTP Accept Header, append the .jsv suffix or ?format=jsv

HTTP + JSV

The following are sample HTTP requests and responses. The placeholders shown need to be replaced with actual values.

POST /measurements/{Keys}/metadata HTTP/1.1 
Host: monitoring.ox2.com 
Accept: text/jsv
Content-Type: text/jsv
Content-Length: length

{
	keys: 
	[
		String
	],
	maxResults: 0
}
HTTP/1.1 200 OK
Content-Type: text/jsv
Content-Length: length

[
	{
		id: 0,
		accessType: Read,
		attributes: String,
		coerceType: None,
		description: String,
		deviceId: 0,
		driverSource: String,
		engineDeadBand: 0,
		engineId: 0,
		euFullScale: 0,
		euZeroScale: 0,
		initialNumericValue: 0,
		initialStringValue: String,
		inverted: False,
		ioDataType: Default,
		ioServerId: 0,
		itemId: 0,
		libraryId: 0,
		logData: False,
		logDeadBand: 0,
		logResolution: String,
		logType: Always,
		memoryDataType: Default,
		originalName: String,
		parameterTypeId: 0,
		rawFullScale: 0,
		rawZeroScale: 0,
		scaleEquation: String,
		scaleType: None,
		setInitialValue: False,
		tagId: 0,
		tagName: String,
		tagStatus: String,
		tagType: NON_CONTROL,
		unitId: 0,
		unitName: String,
		update: 0,
		userId: 0,
		createdOn: 0001-01-01,
		databaseId: 0,
		deviceGuid: 00000000-0000-0000-0000-000000000000,
		systemAttributes: String,
		disabled: False
	}
]