Replace machine by ID
put
/productionMonitoring/clientapi/v2/machines/{machine-id}
This operation replaces information about a machine specified by its ID with the provided machine definition. This method supports the request header with name 'X-ORACLE-IOT-ORG', which allows targeting requests to different organizations. The value of this request header should contain the organization identifier.
Request
Supported Media Types
- multipart/form-data
Path Parameters
-
machine-id: string
The unique identifier of the machine.
Header Parameters
-
X-ORACLE-IOT-ORG: string
This method supports the request header with name 'X-ORACLE-IOT-ORG', which allows targeting requests to different organizations. The value of this request header should contain the organization identifier.
Root Schema : Machine_create
Type:
Show Source
object
-
attributes(optional):
array attributes
The custom machine attributes provided by the user as {name, type, value, deviceModel} tuples.
-
connectivity:
object EntityConnectivity_create
-
description(optional):
string
The description of the machine.
-
displayName(optional):
string
The display name of the machine.
-
factory(optional):
string
The factory this machine belongs to or is located at.
-
floorCoordinates(optional):
string
The machine coordinates bound to a floor plan of the factory.
-
floorPlan(optional):
string
The floor plan of the factory the machine is bound to.
-
geoLocation(optional):
string
The geographic location of the factory the machine is located at.
-
id:
string
The unique identifier of the machine.
-
name(optional):
string
The unique name of the machine.
-
state(optional):
string
The state of the machine, by default UNKNOWN. One of [DOWN, INUSE, IDLE, UNKNOWN].
-
status(optional):
string
The status of the machine, by default ACTIVE. One of [DRAFT, ACTIVE, INACTIVE].
-
tags(optional):
array tags
The user defined tags for the machine. Can be used by users for quick search, logical grouping, etc.
-
type:
string
The type of the machine.
-
typeName:
string
Property description was not set
Nested Schema : attributes
Type:
array
The custom machine attributes provided by the user as {name, type, value, deviceModel} tuples.
Show Source
Nested Schema : EntityConnectivity_create
Type:
Show Source
object
-
authentication:
object Authentication_create
-
authenticationValid:
boolean
Property description was not set
-
connectorIds:
array connectorIds
Connector authentication configuration
-
directConnection:
boolean
Property description was not set
-
empty:
boolean
Property description was not set
-
externalIds:
array externalIds
External Device identifiers
-
externalIdsValid:
boolean
Property description was not set
-
interpreterId:
string
Interpreter identifier
-
lastHeardTime:
integer
Connector last heard time
-
payloadFormat:
string
One of [CUSTOM, SCHEMA].
-
state:
string
Connector stateOne of [INUSE, IDLE, DOWN, UNKNOWN].
Nested Schema : Attribute_create
Type:
Show Source
object
-
dataType(optional):
string
Following types are supported: {"BOOLEAN", "INTEGER", "NUMBER", "STRING", "URI", "DATETIME"}.One of [STRING, NUMBER, BOOLEAN, INTEGER, DATETIME, URI, DATE].
-
deviceModel(optional):
string
The device model URN, applicable and must be specified when attribute type is 'device', 'sensor', 'alert'.
-
name:
string
The name of the attribute.
-
type:
string
The type of the attribute.One of [STRING, NUMBER, BOOLEAN, DATE, BINARY, DEVICE, SENSOR, ALERT, URI].
Nested Schema : Authentication_create
Type:
Show Source
object
-
secret:
string
Property description was not set
-
symmetricKeys:
array symmetricKeys
Property description was not set
-
type:
string
One of [CLIENT_CERTIFICATE, BASIC].
Response
Supported Media Types
- application/json
- application/vnd.oracle.resource+json;type=singular
200 Response
Successfully processed.
Root Schema : Machine_receive
Type:
Show Source
object
-
attributes:
array attributes
The custom machine attributes provided by the user as {name, type, value, deviceModel} tuples.
-
connectivity:
object EntityConnectivity_receive
-
description:
string
The description of the machine.
-
displayName:
string
The display name of the machine.
-
extId:
string
The external identifier representing the external machine imported
-
factory:
string
The factory this machine belongs to or is located at.
-
floorCoordinates:
string
The machine coordinates bound to a floor plan of the factory.
-
floorPlan:
string
The floor plan of the factory the machine is bound to.
-
geoLocation:
string
The geographic location of the factory the machine is located at.
-
id:
string
The unique identifier of the machine.
-
incidents:
object incidents
Set of machine incidents
-
integrationId:
string
The integration identifier that imported the machine
-
lastModifiedBy:
string
The name of the user who last modified the definition of the machine.
-
lastModifiedTime:
integer
The time when the machine definition was last updated as an epoch milliseconds.
-
lastModifiedTimeAsString:
integer
The time when the machine definition was last updated as an ISO-8601 formatted string.
-
metrics:
object metrics
Set of machine metrics
-
metricValues:
object metricValues
Set of machine metrics
-
name:
string
The unique name of the machine.
-
productionLine:
string
The production line the machine belongs to.
-
properties:
object properties
Additional Properties Allowed: additionalPropertiesThe machine's external entity properties as key, value pairs.
-
registeredBy:
string
The name of the user who registered this machine
-
registrationTime:
integer
The time when the machine was registered with the app as an epoch milliseconds.
-
registrationTimeAsString:
integer
The time when the machine was registered with the app as an ISO-8601 formatted string.
-
state:
string
The state of the machine, by default UNKNOWN. One of [DOWN, INUSE, IDLE, UNKNOWN].
-
status:
string
The status of the machine, by default ACTIVE. One of [DRAFT, ACTIVE, INACTIVE].
-
tags:
array tags
The user defined tags for the machine. Can be used by users for quick search, logical grouping, etc.
-
type:
string
The type of the machine.
-
typeName:
string
Property description was not set
Nested Schema : attributes
Type:
array
The custom machine attributes provided by the user as {name, type, value, deviceModel} tuples.
Show Source
Nested Schema : EntityConnectivity_receive
Type:
Show Source
object
-
authentication:
object Authentication_receive
-
connectorIds:
array connectorIds
Connector authentication configuration
-
externalIds:
array externalIds
External Device identifiers
-
interpreterId:
string
Interpreter identifier
-
lastHeardTime:
integer
Connector last heard time
-
state:
string
Connector stateOne of [INUSE, IDLE, DOWN, UNKNOWN].
Nested Schema : incidents
Type:
object
Set of machine incidents
Show Source
-
links(optional):
array links
The set of API navigation links.
Nested Schema : metrics
Type:
object
Set of machine metrics
Show Source
-
links(optional):
array links
The set of API navigation links.
Nested Schema : metricValues
Type:
object
Set of machine metrics
Show Source
-
links(optional):
array links
The set of API navigation links.
Nested Schema : properties
Type:
object
Additional Properties Allowed
Show Source
-
string
A map of the following type: Map<String, String>
The machine's external entity properties as key, value pairs.
Show Source
Nested Schema : Attribute_receive
Type:
Show Source
object
-
deviceModel:
string
The device model URN, applicable and must be specified when attribute type is 'device', 'sensor', 'alert'.
-
name:
string
The name of the attribute.
-
type:
string
The type of the attribute. One of [STRING, NUMBER, BOOLEAN, DATE, BINARY, DEVICE, SENSOR, ALERT].
Nested Schema : Authentication_receive
Type:
Show Source
object
-
secret:
string
Property description was not set
-
type:
string
One of [CLIENT_CERTIFICATE, BASIC].
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 : 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 : 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
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.
Examples
curl -X PUT
-u <username>:<password>
-H 'Accept: application/json'
https://iotserver/productionMonitoring/clientapi/v2/machines/{machine-id}
Example of Request Body
The following example shows the content of the request body in JSON format:
{
"connectivity":{
"authentication":{
"secret":"Property description was not set",
"symmetricKeys":[
"symmetricKeys_1",
"symmetricKeys_2",
"symmetricKeys_3"
],
"type":"One of [CLIENT_CERTIFICATE, BASIC]."
},
"authenticationValid":false,
"connectorIds":[
"connectorIds_1",
"connectorIds_2",
"connectorIds_3"
],
"directConnection":false,
"empty":false,
"externalIds":[
"externalIds_1",
"externalIds_2",
"externalIds_3"
],
"externalIdsValid":false,
"interpreterId":"7df87db67b9e-724d",
"lastHeardTime":1469184297746,
"payloadFormat":"One of [CUSTOM, SCHEMA].",
"state":"Connector stateOne of [INUSE, IDLE, DOWN, UNKNOWN]."
},
"description":"The description of the machine.",
"displayName":"The display name of the machine.",
"factory":"The factory this machine belongs to or is located at.",
"floorCoordinates":"The machine coordinates bound to a floor plan of the factory.",
"floorPlan":"The floor plan of the factory the machine is bound to.",
"geoLocation":"The geographic location of the factory the machine is located at.",
"id":"6f8a6b652c60-7679",
"name":"The unique name of the machine.",
"state":"The state of the machine, by default UNKNOWN. One of [DOWN, INUSE, IDLE, UNKNOWN].",
"status":"The status of the machine, by default ACTIVE. One of [DRAFT, ACTIVE, INACTIVE].",
"tags":[
"tags_1",
"tags_2",
"tags_3"
],
"type":"The type of the machine.",
"typeName":"Property description was not set"
}
Example of Response Body
The following example shows the content of the response body in JSON format:
{
"connectivity":{
"authentication":{
"secret":"Property description was not set",
"type":"One of [CLIENT_CERTIFICATE, BASIC]."
},
"connectorIds":[
"connectorIds_1",
"connectorIds_2",
"connectorIds_3"
],
"externalIds":[
"externalIds_1",
"externalIds_2",
"externalIds_3"
],
"interpreterId":"b962d1d60dc-2a5",
"lastHeardTime":1469184297746,
"state":"Connector stateOne of [INUSE, IDLE, DOWN, UNKNOWN]."
},
"description":"The description of the machine.",
"displayName":"The display name of the machine.",
"extId":"5a69576b314c-5000",
"factory":"The factory this machine belongs to or is located at.",
"floorCoordinates":"The machine coordinates bound to a floor plan of the factory.",
"floorPlan":"The floor plan of the factory the machine is bound to.",
"geoLocation":"The geographic location of the factory the machine is located at.",
"id":"654f2f074590-33c4",
"incidents":{
"links":[
{
"href":"https://iotserver/productionMonitoring/clientapi/version/resource/path",
"rel":"self"
},
{
"href":"https://iotserver/productionMonitoring/clientapi/version/resource/path",
"rel":"canonical"
}
]
},
"integrationId":"aa57cd5f19-122d",
"lastModifiedBy":"The name of the user who last modified the definition of the machine.",
"lastModifiedTime":1469184297746,
"lastModifiedTimeAsString":1469184297746,
"metricValues":{
"links":[
{
"href":"https://iotserver/productionMonitoring/clientapi/version/resource/path",
"rel":"self"
},
{
"href":"https://iotserver/productionMonitoring/clientapi/version/resource/path",
"rel":"canonical"
}
]
},
"metrics":{
"links":[
{
"href":"https://iotserver/productionMonitoring/clientapi/version/resource/path",
"rel":"self"
},
{
"href":"https://iotserver/productionMonitoring/clientapi/version/resource/path",
"rel":"canonical"
}
]
},
"name":"The unique name of the machine.",
"productionLine":"The production line the machine belongs to.",
"properties":{
"properties_key1":"properties_value1",
"properties_key2":"properties_value2",
"properties_key3":"properties_value3"
},
"registeredBy":"The name of the user who registered this machine",
"registrationTime":1469184297746,
"registrationTimeAsString":1469184297746,
"state":"The state of the machine, by default UNKNOWN. One of [DOWN, INUSE, IDLE, UNKNOWN].",
"status":"The status of the machine, by default ACTIVE. One of [DRAFT, ACTIVE, INACTIVE].",
"tags":[
"tags_1",
"tags_2",
"tags_3"
],
"type":"The type of the machine.",
"typeName":"Property description was not set"
}
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 '{"connectivity":{"authentication":{"secret":"Property description was not set","symmetricKeys":["symmetricKeys_1","symmetricKeys_2","symmetricKeys_3"],"type":"One of [CLIENT_CERTIFICATE, BASIC]."},"authenticationValid":false,"connectorIds":["connectorIds_1","connectorIds_2","connectorIds_3"],"directConnection":false,"empty":false,"externalIds":["externalIds_1","externalIds_2","externalIds_3"],"externalIdsValid":false,"interpreterId":"7df87db67b9e-724d","lastHeardTime":1469184297746,"payloadFormat":"One of [CUSTOM, SCHEMA].","state":"Connector stateOne of [INUSE, IDLE, DOWN, UNKNOWN]."},"description":"The description of the machine.","displayName":"The display name of the machine.","factory":"The factory this machine belongs to or is located at.","floorCoordinates":"The machine coordinates bound to a floor plan of the factory.","floorPlan":"The floor plan of the factory the machine is bound to.","geoLocation":"The geographic location of the factory the machine is located at.","id":"6f8a6b652c60-7679","name":"The unique name of the machine.","state":"The state of the machine, by default UNKNOWN. One of [DOWN, INUSE, IDLE, UNKNOWN].","status":"The status of the machine, by default ACTIVE. One of [DRAFT, ACTIVE, INACTIVE].","tags":["tags_1","tags_2","tags_3"],"type":"The type of the machine.","typeName":"Property description was not set"}'
https://iotserver/productionMonitoring/clientapi/v2/machines/207b3886a9f-33aa
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.