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
Path Parameters
Header Parameters
  • 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.
Body ()
Root Schema : Machine_create
Type: object
Show Source
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: object
Show Source
Nested Schema : tags
Type: array
The user defined tags for the machine. Can be used by users for quick search, logical grouping, etc.
Show Source
Nested Schema : Attribute_create
Type: object
Show Source
  • Following types are supported: {"BOOLEAN", "INTEGER", "NUMBER", "STRING", "URI", "DATETIME"}.One of [STRING, NUMBER, BOOLEAN, INTEGER, DATETIME, URI, DATE].
  • The device model URN, applicable and must be specified when attribute type is 'device', 'sensor', 'alert'.
  • The name of the attribute.
  • The type of the attribute.One of [STRING, NUMBER, BOOLEAN, DATE, BINARY, DEVICE, SENSOR, ALERT, URI].
Nested Schema : Authentication_create
Type: object
Show Source
Nested Schema : connectorIds
Type: array
Connector authentication configuration
Show Source
Nested Schema : externalIds
Type: array
External Device identifiers
Show Source
Nested Schema : symmetricKeys
Type: array
Property description was not set
Show Source
Back to Top

Response

Supported Media Types

200 Response

Successfully processed.
Body ()
Root Schema : Machine_receive
Type: object
Show Source
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: object
Show Source
Nested Schema : incidents
Type: object
Set of machine incidents
Show Source
Nested Schema : metrics
Type: object
Set of machine metrics
Show Source
Nested Schema : metricValues
Type: object
Set of machine metrics
Show Source
Nested Schema : properties
Type: object
Additional Properties Allowed
Show Source
  • A map of the following type: Map<String, String>
The machine's external entity properties as key, value pairs.
Show Source
Nested Schema : tags
Type: array
The user defined tags for the machine. Can be used by users for quick search, logical grouping, etc.
Show Source
Nested Schema : Attribute_receive
Type: object
Show Source
  • The device model URN, applicable and must be specified when attribute type is 'device', 'sensor', 'alert'.
  • The name of the attribute.
  • The type of the attribute. One of [STRING, NUMBER, BOOLEAN, DATE, BINARY, DEVICE, SENSOR, ALERT].
Nested Schema : Authentication_receive
Type: object
Show Source
Nested Schema : connectorIds
Type: array
Connector authentication configuration
Show Source
Nested Schema : externalIds
Type: array
External Device identifiers
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/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.
Back to Top