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
Path Parameters
Body ()
Root Schema : AssetTypeWhatIfEventImpl_create
Type: object
Show Source
Nested Schema : items
Type: array
Simulation details of the asset type what-if event
Show Source
Nested Schema : SensorAttributeSimulationDetails_create
Type: object
Show Source
Nested Schema : Simulation_create
Type: object
Show Source
Nested Schema : actionStepSimulationDuration
Type: array
Property description was not set
Show Source
Nested Schema : anomalyDuration
Type: array
Property description was not set
Show Source
Nested Schema : anomalySimulation
Type: array
Property description was not set
Show Source
Nested Schema : extensions
Type: object
Additional Properties Allowed
Show Source
  • A map of the following type: Map<String, String>
Property description was not set
Show Source
Nested Schema : frequency
Type: array
Property description was not set
Show Source
Nested Schema : interval
Type: array
Property description was not set
Show Source
Nested Schema : probability
Type: array
Property description was not set
Show Source
Nested Schema : items
Type: object
Back to Top

Response

Supported Media Types

202 Response

Successfully processed.
Body ()
Root Schema : AssetTypeWhatIfEventImpl_receive
Type: object
Show Source
Nested Schema : image
Type: object
Show Source
Nested Schema : invocations
Type: array
What-if event invocation list
Show Source
Nested Schema : items
Type: array
Simulation details of the asset type what-if event
Show Source
Nested Schema : AssetWhatIfInvocation_receive
Type: object
Show Source
Nested Schema : SensorAttributeSimulationDetails_receive
Type: object
Show Source
Nested Schema : Simulation_receive
Type: object
Show Source
Nested Schema : extensions
Type: object
Additional Properties Allowed
Show Source
  • 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.
Back to Top

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.
Back to Top