> For the complete documentation index, see [llms.txt](https://edgex-api-advantech.gitbook.io/edgex-api-doc/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://edgex-api-advantech.gitbook.io/edgex-api-doc/advanteched-services-apis/meta-data-service-apis.md).

# Meta Data Service APIs

**Content**

* Meta Data's purpose
* Data dictionary
* REST API outline
* Reference

## Meta Data’s Purpose

* Is the repository of knowledge about the devices and sensors and how to communicate with them that is used by the other services, such as Core Data, Command, analytics, etc.
* Specifically, Metadata has the following abilities:
  * **Manages information about the devices and sensors connected to, and operated by, EdgeX Foundry**
  * Knows the type, and organization of data reported by the devices and sensors
  * Knows how to command the devices and sensors

## Data Dictionary

* A Device represents a physical device or sensor
  * However, another EdgeX gateway or a system could be a “device”
  * Each device / sensor that is managed by EdgeX Foundry must be registered with Metadata and have a unique ID and name associated to it.
* Device services represent other micro services that manage one or more devices
  * Each device is associated to one and only one device service
  * Each device service has a unique ID and name
* A Device Profile can be thought of as a template of a type or classification of Device.
  * A device profile provides general characteristics for the types of data a device sends and what types of commands or actions can be sent to the device
  * A device must be associated to a single device profile
  * Each profile has a unique ID and name
* Addressable represents some way to address a device or service, and managed by Meta Data
  * Could be an HTTP/REST address/endpoint
  * Could be an MQTT topic

## REST API Outline

* Device and Device Service APIs
  * GET's galore to query for Device by id, name, label, associated elements, etc.
* Device Profile APIs
  * GET's galore to query for profile by id, name, label, manufacturer, etc.
* Addressable APIs
  * GET's galore to query for Addressable by id, topic, address url, port, etc.

### Some API Examples

#### GET device by name&#x20;

`http://localhost:48081/api/v1/device/name/{name}`

Return Device matching given name (device names should be unique). The information includes the device, device service and device profile.

#### GET device by addressable name&#x20;

`http://localhost:48081/api/v1/device/addressablename/{addressablename}`

Find all devices associated to the Addressable with the specified addressable name.

#### GET devices by service name&#x20;

`http://localhost:48081/api/v1/device/servicename/{servicename}`

Find all devices associated to the Device Service with the specified service name (DeviceService names must be unique).

#### GET all devices

`http://localhost:48081/api/v1/device`

Return all devices sorted by id.

#### GET all device services

`http://localhost:48081/api/v1/deviceservice`

Return all device services sorted by id.

## Reference

Core-metadata API document link: <https://docs.edgexfoundry.org/core-metadata.html>
