Create asset type what-if scenario
post
/assetMonitoring/clientapi/v2/assetTypes/{asset-type-name}/whatIfs
This operation creates a new asset type what-if scenario in the Oracle IoT Asset Monitoring Cloud Service instance.
Request
Supported Media Types
- multipart/form-data
Path Parameters
-
asset-type-name: string
Entity description is undefined
Root Schema : AssetTypeWhatIfEventImpl_create
Type:
Show Source
object
-
assetTypeId:
string
Property description was not set
-
description(optional):
string
Description of the asset type what-if event
-
duration(optional):
integer
Duration of what-if event simulation. If duration <= 0 runs forever until manually stopped< div> =>
-
enabled(optional):
boolean
True if asset type what-if event could be used, null or false - otherwise
-
id:
string
Unique immutable id of the asset type what-if event
-
imagePartNo:
integer
Property description was not set
-
imageReference:
string
Property description was not set
-
items(optional):
array items
Simulation details of the asset type what-if event
-
name:
string
Unique name of the asset type what-if event
Nested Schema : SensorAttributeSimulationDetails_create
Type:
Show Source
object
-
sensorAttributeId:
string
Asset sensor attribute id
-
sensorAttributeName:
string
Asset sensor attribute name
-
simulation:
object Simulation_create
Nested Schema : Simulation_create
Type:
Show Source
object
-
actionStepSimulationDuration:
array actionStepSimulationDuration
Property description was not set
-
anomalyDuration:
array anomalyDuration
Property description was not set
-
anomalySimulation:
array anomalySimulation
Property description was not set
-
extensions:
object extensions
Additional Properties Allowed: additionalPropertiesProperty description was not set
-
frequency:
array frequency
Property description was not set
-
interval:
array interval
Property description was not set
-
intervalRequired:
boolean
Property description was not set
-
probability:
array probability
Property description was not set
-
type:
string
Type of simulationOne of [PATTERN, FORMULA, CSV_REFERENCE].
Nested Schema : actionStepSimulationDuration
Type:
array
Property description was not set
Show Source
Nested Schema : extensions
Type:
object
Additional Properties Allowed
Show Source
-
string
A map of the following type: Map<String, String>
Property description was not set
Show Source
Nested Schema : items
Type:
object
Response
Supported Media Types
- application/json
202 Response
Successfully processed.
Root Schema : AssetTypeWhatIfEventImpl_receive
Type:
Show Source
object
-
description:
string
Description of the asset type what-if event
-
duration:
integer
Duration of what-if event simulation. If duration <= 0 runs forever until manually stopped< div> =>
-
enabled:
boolean
True if asset type what-if event could be used, null or false - otherwise
-
id:
string
Unique immutable id of the asset type what-if event
-
image:
object image
-
invocations:
array invocations
What-if event invocation list
-
items:
array items
Simulation details of the asset type what-if event
-
name:
string
Unique name of the asset type what-if event
Nested Schema : image
Type:
Show Source
object
-
links(optional):
array links
The set of API navigation links.
Nested Schema : items
Type:
Show Source
object
-
href(optional):
string
The target resource URIExample:
https://iotserver/iot/api/vX/some/API/path
-
rel(optional):
string
Relation typeExample:
canonical
Nested Schema : AssetWhatIfInvocation_receive
Type:
Show Source
object
-
duration:
integer
Property description was not set
-
endTime:
integer
Property description was not set
-
id:
string
Property description was not set
-
lastModifiedBy:
string
Property description was not set
-
scenarioId:
string
Property description was not set
-
startedBy:
string
Property description was not set
-
startTime:
integer
Property description was not set
-
status:
string
One of [CREATED, RUNNING, COMPLETED, STOPPED, FAILED].
Nested Schema : SensorAttributeSimulationDetails_receive
Type:
Show Source
object
-
sensorAttributeId:
string
Asset sensor attribute id
-
sensorAttributeName:
string
Asset sensor attribute name
-
simulation:
object Simulation_receive
Nested Schema : Simulation_receive
Type:
Show Source
object
-
extensions:
object extensions
Additional Properties Allowed: additionalPropertiesProperty description was not set
-
type:
string
Type of simulationOne of [PATTERN, FORMULA, CSV_REFERENCE].
Nested Schema : extensions
Type:
object
Additional Properties Allowed
Show Source
-
string
A map of the following type: Map<String, String>
Property description was not set
Show Source
400 Response
Bad Request. The request could not be understood by the server due to malformed syntax. The client SHOULD NOT repeat the request without modifications.
401 Response
Unauthorized. The request requires user authentication.
403 Response
Forbidden. The server understood the request, but is refusing to fulfill it. Authorization will not help and the request SHOULD NOT be repeated.
406 Response
Request Not Acceptable. The resource identified by the request is only capable of generating response entities which have content characteristics not acceptable according to the accept headers sent in the request.
415 Response
Unsupported Media Type. The request entity has a media type which the server or resource does not support.
Examples
curl -X POST
-u <username>:<password>
-H 'Accept: application/json'
https://iotserver/assetMonitoring/clientapi/v2/assetTypes/{asset-type-name}/whatIfs
Example of Request Body
The following example shows the content of the request body in JSON format:
{
"assetTypeId":"25bd13132ebf-5c1a",
"description":"Description of the asset type what-if event",
"duration":12345,
"enabled":false,
"id":"17d2588a3a4e-643c",
"imagePartNo":12345,
"imageReference":"Property description was not set",
"items":[
{
"sensorAttributeId":"5623246f7f43-7796",
"sensorAttributeName":"Asset sensor attribute name",
"simulation":{
"actionStepSimulationDuration":[
"actionStepSimulationDuration_1",
"actionStepSimulationDuration_2",
"actionStepSimulationDuration_3"
],
"anomalyDuration":[
"anomalyDuration_1",
"anomalyDuration_2",
"anomalyDuration_3"
],
"extensions":{
"extensions_key1":"extensions_value1",
"extensions_key2":"extensions_value2",
"extensions_key3":"extensions_value3"
},
"frequency":[
"frequency_1",
"frequency_2",
"frequency_3"
],
"interval":[
"interval_1",
"interval_2",
"interval_3"
],
"intervalRequired":false,
"probability":[
"probability_1",
"probability_2",
"probability_3"
],
"type":"Type of simulationOne of [PATTERN, FORMULA, CSV_REFERENCE]."
}
}
],
"name":"Unique name of the asset type what-if event"
}
Example of Response Body
The following example shows the content of the response body in JSON format:
{
"description":"Description of the asset type what-if event",
"duration":12345,
"enabled":false,
"id":"6840680b69b8-1bdf",
"image":{
"links":[
{
"href":"https://iotserver/assetMonitoring/clientapi/version/resource/path",
"rel":"self"
},
{
"href":"https://iotserver/assetMonitoring/clientapi/version/resource/path",
"rel":"canonical"
}
]
},
"invocations":[
{
"duration":12345,
"endTime":1469184297746,
"id":"25db7ec5777-6db6",
"lastModifiedBy":"Property description was not set",
"scenarioId":"713f35c53de6-5bf5",
"startTime":1469184297746,
"startedBy":"Property description was not set",
"status":"One of [CREATED, RUNNING, COMPLETED, STOPPED, FAILED]."
}
],
"items":[
{
"sensorAttributeId":"cea519c550d-4df8",
"sensorAttributeName":"Asset sensor attribute name",
"simulation":{
"extensions":{
"extensions_key1":"extensions_value1",
"extensions_key2":"extensions_value2",
"extensions_key3":"extensions_value3"
},
"type":"Type of simulationOne of [PATTERN, FORMULA, CSV_REFERENCE]."
}
}
],
"name":"Unique name of the asset type what-if event"
}
Complete cURL Example
The following example shows a complete cURL command that you can use to perform the described operation:
curl -X POST
-u <username>:<password>
-H 'Accept: application/json'
-d '{"assetTypeId":"25bd13132ebf-5c1a","description":"Description of the asset type what-if event","duration":12345,"enabled":false,"id":"17d2588a3a4e-643c","imagePartNo":12345,"imageReference":"Property description was not set","items":[{"sensorAttributeId":"5623246f7f43-7796","sensorAttributeName":"Asset sensor attribute name","simulation":{"actionStepSimulationDuration":["actionStepSimulationDuration_1","actionStepSimulationDuration_2","actionStepSimulationDuration_3"],"anomalyDuration":["anomalyDuration_1","anomalyDuration_2","anomalyDuration_3"],"extensions":{"extensions_key1":"extensions_value1","extensions_key2":"extensions_value2","extensions_key3":"extensions_value3"},"frequency":["frequency_1","frequency_2","frequency_3"],"interval":["interval_1","interval_2","interval_3"],"intervalRequired":false,"probability":["probability_1","probability_2","probability_3"],"type":"Type of simulationOne of [PATTERN, FORMULA, CSV_REFERENCE]."}}],"name":"Unique name of the asset type what-if event"}'
https://iotserver/assetMonitoring/clientapi/v2/assetTypes/{asset-type-name}/whatIfs
Note that in the request,
https://iotserver
will be replaced by the name and port of your assigned IoT Cloud Service instance. The format of the Cloud Service instance is
https://myinstance-myidentitydomain.iot.us.oraclecloud.com
and the default port is 443.