Replace asset type by name

put

/assetMonitoring/clientapi/v2/assetTypes/{asset-type-name}

This operation replaces the details by the definition that is provided for a given asset type name.

Request

Supported Media Types
Path Parameters
Body ()
Root Schema : AssetTypeImpl_create
Type: object
Show Source
Nested Schema : attributes
Type: array
List of asset types attributes
Show Source
Nested Schema : maintenanceActivities
Type: array
List of maintenance activities for the particular asset
Show Source
Nested Schema : metrics
Type: array
List of asset type metrics
Show Source
Nested Schema : AssetAttributeDefinition_create
Type: object
Show Source
Nested Schema : allowedValues
Type: array
List of allowed values for the given field e.g. For the type field, it can be the names of all the asset types registered with the system.
Show Source
Nested Schema : properties
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 : SamplingPolicy_create
Type: object
Show Source
Nested Schema : sensorAttributes
Type: array
Property description was not set
Show Source
Nested Schema : Simulation_create
Type: object
Show Source
Nested Schema : AssetAttributeValuePropagation_create
Type: object
Show Source
Nested Schema : items
Type: object
Nested Schema : SensorAttributeType_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
Nested Schema : AssetMaintenanceActivity_create
Type: object
Show Source
Nested Schema : AssetMetric_create
Type: object
Show Source
  • Description of the metric. This can be used in the UI.
  • User-friendly name of the metric to be used in UI
  • How frequently this metric would be computedOne of [HOURLY, DAILY, WEEKLY, MONTHLY].
  • Unique and immutable id of the asset metric
  • Name of the metric. e.g. mileage, utilization, totalUsage, efficiency, lifespan, currentLocation, energySavings, presenceInPlace, etc. Name of the metric should be unique across all the metrics defined for an asset type
  • parameters
    Additional Properties Allowed: additionalProperties
    List of parameters provided by user that would be required for computing the metric. For example, for tracking "availability", or "ghost assets", parameter can be "duration". In this case all the assets that have not reported in last time interval greater than or equal to "duration" would be considered unavailable.
  • One of [STRING, NUMBER, BOOLEAN, PERCENTAGE].
Nested Schema : parameters
Type: object
Additional Properties Allowed
Show Source
  • A map of the following type: Map<String, String>
List of parameters provided by user that would be required for computing the metric. For example, for tracking "availability", or "ghost assets", parameter can be "duration". In this case all the assets that have not reported in last time interval greater than or equal to "duration" would be considered unavailable.
Show Source
Back to Top

Response

Supported Media Types

200 Response

Successfully processed.
Body ()
Root Schema : AssetTypeImpl_receive
Type: object
Show Source
Nested Schema : actions
Type: object
Access actions definitions for the given asset type
Show Source
Nested Schema : attributes
Type: array
List of asset types attributes
Show Source
Nested Schema : classes
Type: array
Read-only set of classes assigned to the given asset type
Show Source
Nested Schema : icon
Type: object
Binary object representing asset type icon. To set asset icon, binary stream with image data should be posted to the server as a multipart request
Show Source
Nested Schema : maintenanceActivities
Type: array
List of maintenance activities for the particular asset
Show Source
Nested Schema : metrics
Type: array
List of asset type metrics
Show Source
Nested Schema : AssetAttributeDefinition_receive
Type: object
Show Source
Nested Schema : allowedValues
Type: array
List of allowed values for the given field e.g. For the type field, it can be the names of all the asset types registered with the system.
Show Source
Nested Schema : properties
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 : SamplingPolicy_receive
Type: object
Show Source
  • Property description was not set
  • One of [NONE, LAST_VALUE, MINIMUM_VALUE, MAXIMUM_VALUE, MEAN_VALUE, THRESHOLD_VIOLATIONS].
Nested Schema : sensorAttributes
Type: array
Property description was not set
Show Source
Nested Schema : Simulation_receive
Type: object
Show Source
Nested Schema : AssetAttributeValuePropagation_receive
Type: object
Show Source
Nested Schema : items
Type: object
Nested Schema : SensorAttributeType_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
Nested Schema : AssetMaintenanceActivity_receive
Type: object
Show Source
Nested Schema : AssetMetric_receive
Type: object
Show Source
  • Description of the metric. This can be used in the UI.
  • User-friendly name of the metric to be used in UI
  • How frequently this metric would be computedOne of [HOURLY, DAILY, WEEKLY, MONTHLY].
  • Name of the metric. e.g. mileage, utilization, totalUsage, efficiency, lifespan, currentLocation, energySavings, presenceInPlace, etc. Name of the metric should be unique across all the metrics defined for an asset type
  • parameters
    Additional Properties Allowed: additionalProperties
    List of parameters provided by user that would be required for computing the metric. For example, for tracking "availability", or "ghost assets", parameter can be "duration". In this case all the assets that have not reported in last time interval greater than or equal to "duration" would be considered unavailable.
  • One of [STRING, NUMBER, BOOLEAN, PERCENTAGE].
Nested Schema : parameters
Type: object
Additional Properties Allowed
Show Source
  • A map of the following type: Map<String, String>
List of parameters provided by user that would be required for computing the metric. For example, for tracking "availability", or "ghost assets", parameter can be "duration". In this case all the assets that have not reported in last time interval greater than or equal to "duration" would be considered unavailable.
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.

404 Response

Not Found. The server has not found anything matching the Request-URI. No indication is given of whether the condition is temporary or permanent.

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 PUT 
   -u <username>:<password>
   -H 'Accept: application/json'
   https://iotserver/assetMonitoring/clientapi/v2/assetTypes/{asset-type-name}

Example of Request Body

The following example shows the content of the request body in JSON format:


{
"attributes":[
{
"assetTypeId":"b0f154894d-22e9",
"dataType":"Applicable only when 'type' is sensor. If type is sensor, then dataType must be specified.One of [STRING, NUMBER, BOOLEAN, INTEGER, DATETIME, URI, DATE].",
"deviceModel":"Applicable only when 'type' is device. If type is device, then deviceModel must be specified.",
"instructions":"A human friendly instructions on how to fill given attribute",
"kind":"Type of the asset attribute. Following types would be supported &qot;string&qot;, &qot;number&qot;, &qot;boolean&qot;, &qot;date&qot;, &qot;binary&qot;, &qot;device&qot;, &qot;asset&qot;, &qot;sensor&qot;One of [STATIC, DYNAMIC, ASSET, DEVICE, BINARY, ALERT, SENSOR, CONTROL].",
"legacySensorAttribute":false,
"name":"Name of the asset attribute e.g. &qot;name&qot;, &qot;manufacturer&qot;, &qot;brand&qot;, &qot;status&qot; etc. Name should be unique across asset attributes of a given type",
"partitioningByAllowedValues":false,
"properties":{
"properties_key1":"properties_value1",
"properties_key2":"properties_value2",
"properties_key3":"properties_value3"
},
"referencedEntityIdentifier":"Property description was not set",
"required":false,
"samplingPolicy":{
"entityTypeId":"33162c96cf6-30a4",
"id":"385577d266c7-6c06"
},
"sensorAttributes":[
{
"field":"The name of the field.",
"fieldType":"The type of the field.",
"format":"The format asssociated with this attribute.",
"id":"1f147eee35a5-14f",
"keepHistory":false,
"name":"The name of this attribute."
}
],
"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]."
},
"static":false,
"type":"Type of the asset attribute. Following types would be supported &qot;string&qot;, &qot;number&qot;, &qot;boolean&qot;, &qot;date&qot;, &qot;binary&qot;, &qot;device&qot;, &qot;asset&qot;, &qot;sensor&qot;",
"unique":false,
"valuePropagation":{
"assetAttributeId":"492f33da7677-2c43",
"reverseDirection":false,
"sourceAttributeId":"148a65336f34-4df1"
}
}
],
"description":"Description of the asset type provided by the user",
"lastModifiedBy":"Name of the user who last modified the definition of asset type.",
"maintenanceActivities":[
{
"description":"Description of the asset maintenance activity",
"id":"35b7283e1cd3-5c4f",
"name":"Name of the asset maintenance activity"
}
],
"metrics":[
{
"description":"Description of the metric. This can be used in the UI.",
"displayName":"User-friendly name of the metric to be used in UI",
"frequency":"How frequently this metric would be computedOne of [HOURLY, DAILY, WEEKLY, MONTHLY].",
"id":"6bdb1fd14db9-b61",
"name":"Name of the metric. e.g. mileage, utilization, totalUsage, efficiency, lifespan, currentLocation, energySavings, presenceInPlace, etc. Name of the metric should be unique across all the metrics defined for an asset type",
"parameters":{
"parameters_key1":"parameters_value1",
"parameters_key2":"parameters_value2",
"parameters_key3":"parameters_value3"
},
"type":"One of [STRING, NUMBER, BOOLEAN, PERCENTAGE]."
}
],
"name":"Unique mutable name of the asset type object. If name is not specified during asset creation, it will be set to the same value as generated uniqu asset type ID",
"organizationId":"775fa8c6099-4cb0"
}

Example of Response Body

The following example shows the content of the response body in JSON format:


{
"actions":{
"links":[
{
"href":"https://iotserver/assetMonitoring/clientapi/version/resource/path",
"rel":"self"
},
{
"href":"https://iotserver/assetMonitoring/clientapi/version/resource/path",
"rel":"canonical"
}
]
},
"attributes":[
{
"assetTypeId":"443baec443e-d61",
"dataType":"Applicable only when 'type' is sensor. If type is sensor, then dataType must be specified.One of [STRING, NUMBER, BOOLEAN, INTEGER, DATETIME, URI, DATE].",
"deviceModel":"Applicable only when 'type' is device. If type is device, then deviceModel must be specified.",
"id":"17e05caf34-2b56",
"instructions":"A human friendly instructions on how to fill given attribute",
"kind":"Type of the asset attribute. Following types would be supported &qot;string&qot;, &qot;number&qot;, &qot;boolean&qot;, &qot;date&qot;, &qot;binary&qot;, &qot;device&qot;, &qot;asset&qot;, &qot;sensor&qot;One of [STATIC, DYNAMIC, ASSET, DEVICE, BINARY, ALERT, SENSOR, CONTROL].",
"name":"Name of the asset attribute e.g. &qot;name&qot;, &qot;manufacturer&qot;, &qot;brand&qot;, &qot;status&qot; etc. Name should be unique across asset attributes of a given type",
"partitioningByAllowedValues":false,
"properties":{
"properties_key1":"properties_value1",
"properties_key2":"properties_value2",
"properties_key3":"properties_value3"
},
"required":false,
"samplingPolicy":{
"interval":12345,
"type":"One of [NONE, LAST_VALUE, MINIMUM_VALUE, MAXIMUM_VALUE, MEAN_VALUE, THRESHOLD_VIOLATIONS]."
},
"sensorAttributes":[
{
"field":"The name of the field.",
"format":"The format asssociated with this attribute.",
"id":"1d52372f5e40-22a5",
"name":"The name of this attribute."
}
],
"simulation":{
"extensions":{
"extensions_key1":"extensions_value1",
"extensions_key2":"extensions_value2",
"extensions_key3":"extensions_value3"
},
"type":"Type of simulationOne of [PATTERN, FORMULA, CSV_REFERENCE]."
},
"static":false,
"type":"Type of the asset attribute. Following types would be supported &qot;string&qot;, &qot;number&qot;, &qot;boolean&qot;, &qot;date&qot;, &qot;binary&qot;, &qot;device&qot;, &qot;asset&qot;, &qot;sensor&qot;",
"unique":false,
"valuePropagation":{
"assetAttributeId":"7b962a65a93-65e4",
"reverseDirection":false,
"sourceAttributeId":"52c6574e3c9f-24c9"
}
}
],
"classes":[
"classes_1",
"classes_2",
"classes_3"
],
"description":"Description of the asset type provided by the user",
"icon":{
"links":[
{
"href":"https://iotserver/assetMonitoring/clientapi/version/resource/path",
"rel":"self"
},
{
"href":"https://iotserver/assetMonitoring/clientapi/version/resource/path",
"rel":"canonical"
}
]
},
"id":"5e5a7bbbdd7-6e36",
"lastModifiedBy":"Name of the user who last modified the definition of asset type.",
"lastModifiedTime":1469184297746,
"lastModifiedTimeAsString":1469184297746,
"maintenanceActivities":[
{
"description":"Description of the asset maintenance activity",
"name":"Name of the asset maintenance activity"
}
],
"metrics":[
{
"description":"Description of the metric. This can be used in the UI.",
"displayName":"User-friendly name of the metric to be used in UI",
"frequency":"How frequently this metric would be computedOne of [HOURLY, DAILY, WEEKLY, MONTHLY].",
"name":"Name of the metric. e.g. mileage, utilization, totalUsage, efficiency, lifespan, currentLocation, energySavings, presenceInPlace, etc. Name of the metric should be unique across all the metrics defined for an asset type",
"parameters":{
"parameters_key1":"parameters_value1",
"parameters_key2":"parameters_value2",
"parameters_key3":"parameters_value3"
},
"type":"One of [STRING, NUMBER, BOOLEAN, PERCENTAGE]."
}
],
"name":"Unique mutable name of the asset type object. If name is not specified during asset creation, it will be set to the same value as generated uniqu asset type ID",
"organizationId":"3dcc1815368-309c"
}



Complete cURL Example

The following example shows a complete cURL command that you can use to perform the described operation:

curl -X PUT 
   -u <username>:<password>
   -H 'Accept: application/json'
   -d '{"attributes":[{"assetTypeId":"b0f154894d-22e9","dataType":"Applicable only when 'type' is sensor. If type is sensor, then dataType must be specified.One of [STRING, NUMBER, BOOLEAN, INTEGER, DATETIME, URI, DATE].","deviceModel":"Applicable only when 'type' is device. If type is device, then deviceModel must be specified.","instructions":"A human friendly instructions on how to fill given attribute","kind":"Type of the asset attribute. Following types would be supported &qot;string&qot;, &qot;number&qot;, &qot;boolean&qot;, &qot;date&qot;, &qot;binary&qot;, &qot;device&qot;, &qot;asset&qot;, &qot;sensor&qot;One of [STATIC, DYNAMIC, ASSET, DEVICE, BINARY, ALERT, SENSOR, CONTROL].","legacySensorAttribute":false,"name":"Name of the asset attribute e.g. &qot;name&qot;, &qot;manufacturer&qot;, &qot;brand&qot;, &qot;status&qot; etc. Name should be unique across asset attributes of a given type","partitioningByAllowedValues":false,"properties":{"properties_key1":"properties_value1","properties_key2":"properties_value2","properties_key3":"properties_value3"},"referencedEntityIdentifier":"Property description was not set","required":false,"samplingPolicy":{"entityTypeId":"33162c96cf6-30a4","id":"385577d266c7-6c06"},"sensorAttributes":[{"field":"The name of the field.","fieldType":"The type of the field.","format":"The format asssociated with this attribute.","id":"1f147eee35a5-14f","keepHistory":false,"name":"The name of this attribute."}],"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]."},"static":false,"type":"Type of the asset attribute. Following types would be supported &qot;string&qot;, &qot;number&qot;, &qot;boolean&qot;, &qot;date&qot;, &qot;binary&qot;, &qot;device&qot;, &qot;asset&qot;, &qot;sensor&qot;","unique":false,"valuePropagation":{"assetAttributeId":"492f33da7677-2c43","reverseDirection":false,"sourceAttributeId":"148a65336f34-4df1"}}],"description":"Description of the asset type provided by the user","lastModifiedBy":"Name of the user who last modified the definition of asset type.","maintenanceActivities":[{"description":"Description of the asset maintenance activity","id":"35b7283e1cd3-5c4f","name":"Name of the asset maintenance activity"}],"metrics":[{"description":"Description of the metric. This can be used in the UI.","displayName":"User-friendly name of the metric to be used in UI","frequency":"How frequently this metric would be computedOne of [HOURLY, DAILY, WEEKLY, MONTHLY].","id":"6bdb1fd14db9-b61","name":"Name of the metric. e.g. mileage, utilization, totalUsage, efficiency, lifespan, currentLocation, energySavings, presenceInPlace, etc. Name of the metric should be unique across all the metrics defined for an asset type","parameters":{"parameters_key1":"parameters_value1","parameters_key2":"parameters_value2","parameters_key3":"parameters_value3"},"type":"One of [STRING, NUMBER, BOOLEAN, PERCENTAGE]."}],"name":"Unique mutable name of the asset type object. If name is not specified during asset creation, it will be set to the same value as generated uniqu asset type ID","organizationId":"775fa8c6099-4cb0"}'
   https://iotserver/assetMonitoring/clientapi/v2/assetTypes/{asset-type-name}



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