{"_id":"582789acbe5c080f00a5a84d","category":{"_id":"582789abbe5c080f00a5a803","__v":0,"version":"582789aabe5c080f00a5a7fe","project":"568bdc1483d2061900d86cdc","sync":{"url":"","isSync":false},"reference":true,"createdAt":"2016-01-05T15:14:04.838Z","from_sync":false,"order":9,"slug":"something","title":"Devices"},"__v":2,"version":{"_id":"582789aabe5c080f00a5a7fe","__v":10,"project":"568bdc1483d2061900d86cdc","createdAt":"2016-11-12T21:29:14.915Z","releaseDate":"2016-11-12T21:29:14.915Z","categories":["582789abbe5c080f00a5a7ff","582789abbe5c080f00a5a800","582789abbe5c080f00a5a801","582789abbe5c080f00a5a802","582789abbe5c080f00a5a803","582789abbe5c080f00a5a804","582789abbe5c080f00a5a805","582789abbe5c080f00a5a806","582789abbe5c080f00a5a807","582789abbe5c080f00a5a808","5827ea984ca29e0f00137a9e","583df597887db62f00644283","583df5d9c622791900e78da5","5845cd8763c11b250037967d","5845d13063c11b2500379681","5859e859e3306d1900126725","587aeb9a01cf3a0f008359eb","587c422af45e2d0f005e200d","587d84dc82f6f30f004ceee5"],"is_deprecated":false,"is_hidden":false,"is_beta":true,"is_stable":true,"codename":"beta2","version_clean":"0.0.0","version":"0"},"user":"568bdbc4fe6fcc0d006dc970","parentDoc":null,"project":"568bdc1483d2061900d86cdc","updates":[],"next":{"pages":[],"description":""},"createdAt":"2016-05-09T14:22:25.707Z","link_external":false,"link_url":"","githubsync":"","sync_unique":"","hidden":false,"api":{"method":"post","results":{"codes":[{"status":201,"language":"json","code":"{\n  \"id\": \"D573bc694ae9ac9419f028b61\",\n  \"ecosystemId\": \"C573b86eeee43dd7ba0244f8a\",\n  \"environmentId\": \"E573bb9ffd717111220812c3a\",\n  \"type\": \"virtual\",\n  \"alias\": \"dev1\",\n  \"meta\": {\n    \"$label\": \"My awesome device\"\n  },\n  \"product\": {\n    \"productName\": \"Awesome Device™\",\n    \"productType\": \"Device o’ awesome\"\n  },\n  \"createdAt\": \"2016-05-18T01:50:00.669Z\"\n}","name":""},{"status":400,"language":"json","code":"{\n  \"errorType\": \"InvalidParams\",\n  \"errors\": [\n    {\n      \"in\": \"body\",\n      \"message\": \"invalid environment id\",\n      \"path\": \"environmentId\"\n    }\n  ]\n}","name":""},{"code":"","status":401,"language":"text"},{"language":"text","code":"","status":403},{"status":404,"language":"text","code":"Environment with id E573bb9ffd717111220812c3b does not exist."}]},"settings":"572c39957c8eff0e00aaa18b","examples":{"codes":[{"code":"POST https://ioe.droplit.io/api/devices HTTP/1.1\nauthorization: AUTH_TOKEN\ncontent-type: application/json\n\n{\n  \"environmentId\": \"E573bb9ffd717111220812c3a\",\n  \"meta\": {\n  \t\"$label\": \"My awesome device\"\n  },\n  \"alias\": \"dev1\",\n  \"services\": [ \"BinarySwitch\" ],\n  \"product\": {\n  \t\"productName\": \"Awesome Device™\",\n    \"productType\": \"Device o’ awesome\"\n  }\n}","language":"http"},{"code":"droplit device create","language":"text","name":"droplit console"}]},"auth":"required","params":[{"_id":"57309d21b16ed73200ddd182","ref":"","in":"body","required":true,"desc":"parent [environment](doc:environments) id or environment [alias](doc:aliases)","default":"","type":"string","name":"environmentId"},{"_id":"573bc854ee2b3b2200422989","ref":"","in":"body","required":false,"desc":"[metadata](doc:metadata) attached to the [device](doc:devices)","default":"","type":"object","name":"meta"},{"_id":"573bc854ee2b3b2200422988","ref":"","in":"body","required":false,"desc":"an environment level [alias](doc:aliases) for the [device](doc:devices)","default":"","type":"string","name":"alias"},{"_id":"573bc854ee2b3b2200422986","ref":"","in":"body","required":false,"desc":"[services](doc:services) this [device](doc:devices) implements","default":"","type":"array_string","name":"services"},{"_id":"58462fd68abd480f009125c8","ref":"","in":"header","required":false,"desc":"[metadata](doc:metadata) prefix","default":"$","type":"string","name":"x-system-meta-prefix"}],"url":"/devices"},"isReference":true,"order":1,"body":"[block:callout]\n{\n  \"type\": \"info\",\n  \"title\": \"Virtual devices only\",\n  \"body\": \"This endpoint is only used for creating _virtual_ devices. Physical devices, representing devices that physically exist in the real world, may only be created through a conduit.\"\n}\n[/block]\nCreate a virtual device. You can additional information such as an alias or metadata.\n[block:api-header]\n{\n  \"type\": \"basic\",\n  \"title\": \"Parameter notes\"\n}\n[/block]\n## alias\nDevice aliases are scoped to the environment such that they must be unique among aliases used at this level. Data using environment-level aliases include both devices and zones.\n\n## services\nThe services parameter is an array of strings representing the names of the service classes that the device implements. It is allowed to be able to specify services that are not installed to the Ecosystem that the device is under.","excerpt":"Create a virtual device","slug":"create-devices","type":"endpoint","title":"Create"}

postCreate

Create a virtual device

Definition

{{ api_url }}{{ page_api_url }}

Parameters

Body Params

environmentId:
required
string
parent [environment](doc:environments) id or environment [alias](doc:aliases)
meta:
object
[metadata](doc:metadata) attached to the [device](doc:devices)
alias:
string
an environment level [alias](doc:aliases) for the [device](doc:devices)
services:
array of strings
[services](doc:services) this [device](doc:devices) implements

Headers

x-system-meta-prefix:
string$
[metadata](doc:metadata) prefix

Examples


Result Format


Documentation

[block:callout] { "type": "info", "title": "Virtual devices only", "body": "This endpoint is only used for creating _virtual_ devices. Physical devices, representing devices that physically exist in the real world, may only be created through a conduit." } [/block] Create a virtual device. You can additional information such as an alias or metadata. [block:api-header] { "type": "basic", "title": "Parameter notes" } [/block] ## alias Device aliases are scoped to the environment such that they must be unique among aliases used at this level. Data using environment-level aliases include both devices and zones. ## services The services parameter is an array of strings representing the names of the service classes that the device implements. It is allowed to be able to specify services that are not installed to the Ecosystem that the device is under.

User Information

Try It Out

post
{{ tryResults.results }}
Method{{ tryResults.method }}
Request Headers
{{ tryResults.requestHeaders }}
URL{{ tryResults.url }}
Request Data
{{ tryResults.data }}
Status
Response Headers
{{ tryResults.responseHeaders }}