Update factory by ID
post
/productionMonitoring/clientapi/v2/factories/{factory-id}
This operation updates information about a factory that is specified by its ID, with partial or complete factory 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
-
factory-id: string
The unique identifier of the factory.
Header Parameters
-
X-HTTP-Method-Override: string
To perform a partial update of the factory, the POST request should be orchestrated with method override set to PATCH.
-
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 : Factory_update
Type:
Show Source
object
-
address(optional):
string
The street address of the factory.
-
code(optional):
string
The unique code of the factory.
-
description(optional):
string
The description of the factory.
-
factoryManager(optional):
object FactoryManager_update
-
floorPlans(optional):
array floorPlans
The list of floor plans for the factory.
-
geoLocation(optional):
string
The geographic location of the factory specified as {latitude},{longitude}.
-
id(optional):
string
The unique identifier of the factory.
-
name(optional):
string
The unique name of the factory.
-
properties(optional):
object properties
Additional Properties Allowed: additionalPropertiesProperty description was not set
Nested Schema : FactoryManager_update
Type:
Show Source
object
-
email(optional):
string
The email address of the factory manager.
-
name(optional):
string
The name of the factory manager.
-
phone(optional):
string
The phone number of the factory manager.
Nested Schema : properties
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 : FactoryFloorPlan_update
Type:
Show Source
object
-
externalId(optional):
string
Property description was not set
-
factoryId(optional):
string
Property description was not set
-
id(optional):
string
The identifier created by Oracle IoT Cloud Service for the factory floor plan.
-
name(optional):
string
The unique name of the factory floor plan.
-
organizationId(optional):
string
Property description was not set
-
referencePoints(optional):
object FloorPlanReferencePoints_update
Nested Schema : FloorPlanReferencePoints_update
Type:
Show Source
object
-
imageP1(optional):
string
Coordinates of the first point on image.
-
imageP2(optional):
string
Coordinates of the second point on image
-
mapP1(optional):
string
Geographic coordinates of the first point
-
mapP2(optional):
string
Geographic coordinates of the second point
Response
Supported Media Types
- application/json
- application/vnd.oracle.resource+json;type=singular
200 Response
Successfully processed.
Root Schema : Factory_receive
Type:
Show Source
object
-
address:
string
The street address of the factory.
-
code:
string
The unique code of the factory.
-
description:
string
The description of the factory.
-
extId:
string
The external identifier representing the external factory imported
-
factoryManager:
object FactoryManager_receive
-
floorPlans:
array floorPlans
The list of floor plans for the factory.
-
geoLocation:
string
The geographic location of the factory specified as {latitude},{longitude}.
-
id:
string
The unique identifier of the factory.
-
integrationId:
string
The integration identifier that imported the factory
-
iotEnabled:
boolean
The field value indicates the factory is available for working in the integration with Manufacturing Cloud
-
lastModifiedBy:
string
The name of the user who last modified the definition of the factory.
-
lastModifiedTime:
integer
The time when the factory definition was last updated as milliseconds since the epoch.
-
lastModifiedTimeAsString:
integer
The time when the factory definition was last updated as an ISO-8601 formatted string.
-
metrics:
object metrics
Set of factory metrics
-
name:
string
The unique name of the factory.
-
productionLines:
array productionLines
The list of identifiers of production lines that are part of this factory.
-
registeredBy:
string
The name of the user who registered this factory.
-
registrationTime:
integer
The time when the factory was registered with the app as an epoch milliseconds.
-
registrationTimeAsString:
integer
The time when the factory was registered with the app as an ISO-8601 formatted string.
Nested Schema : FactoryManager_receive
Type:
Show Source
object
-
email:
string
The email address of the factory manager.
-
name:
string
The name of the factory manager.
-
phone:
string
The phone number of the factory manager.
Nested Schema : metrics
Type:
object
Set of factory metrics
Show Source
-
links(optional):
array links
The set of API navigation links.
Nested Schema : productionLines
Type:
array
The list of identifiers of production lines that are part of this factory.
Show Source
Nested Schema : FactoryFloorPlan_receive
Type:
Show Source
object
-
externalId:
string
Property description was not set
-
id:
string
The identifier created by Oracle IoT Cloud Service for the factory floor plan.
-
image:
object image
The reference ID for the factory floor plan image.
-
name:
string
The unique name of the factory floor plan.
-
organizationId:
string
Property description was not set
-
referencePoints:
object FloorPlanReferencePoints_receive
Nested Schema : image
Type:
object
The reference ID for the factory floor plan image.
Show Source
-
links(optional):
array links
The set of API navigation links.
Nested Schema : FloorPlanReferencePoints_receive
Type:
Show Source
object
-
imageP1:
string
Coordinates of the first point on image.
-
imageP2:
string
Coordinates of the second point on image
-
mapP1:
string
Geographic coordinates of the first point
-
mapP2:
string
Geographic coordinates of the second point
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.
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.
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.
405 Response
Method Not Allowed. The method specified in the Request-Line is not allowed for the resource identified by the Request-URI.
Examples
curl -X POST
-u <username>:<password>
-H 'Accept: application/json'
--header "X-HTTP-Method-Override: PATCH"
https://iotserver/productionMonitoring/clientapi/v2/factories/{factory-id}
Example of Request Body
The following example shows the content of the request body in JSON format:
{
"address":"The street address of the factory.",
"code":"The unique code of the factory.",
"description":"The description of the factory.",
"factoryManager":{
"email":"The email address of the factory manager.",
"name":"The name of the factory manager.",
"phone":"The phone number of the factory manager."
},
"floorPlans":[
{
"externalId":"125363624f0-8af",
"factoryId":"10b87ee25dd8-6300",
"id":"3acac62bc3-2a9c",
"name":"The unique name of the factory floor plan.",
"organizationId":"6c174a4d18dc-5f4a",
"referencePoints":{
"imageP1":"Coordinates of the first point on image.",
"imageP2":"Coordinates of the second point on image",
"mapP1":"Geographic coordinates of the first point",
"mapP2":"Geographic coordinates of the second point"
}
}
],
"geoLocation":"The geographic location of the factory specified as {latitude},{longitude}.",
"id":"28d14d7310a7-2970",
"name":"The unique name of the factory.",
"properties":{
"properties_key1":"properties_value1",
"properties_key2":"properties_value2",
"properties_key3":"properties_value3"
}
}
Example of Response Body
The following example shows the content of the response body in JSON format:
{
"address":"The street address of the factory.",
"code":"The unique code of the factory.",
"description":"The description of the factory.",
"extId":"73dc76c66b27-1a24",
"factoryManager":{
"email":"The email address of the factory manager.",
"name":"The name of the factory manager.",
"phone":"The phone number of the factory manager."
},
"floorPlans":[
{
"externalId":"5a547638746f-20e7",
"id":"44c463386c6a-188a",
"image":{
"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 factory floor plan.",
"organizationId":"1ce935661b9e-6138",
"referencePoints":{
"imageP1":"Coordinates of the first point on image.",
"imageP2":"Coordinates of the second point on image",
"mapP1":"Geographic coordinates of the first point",
"mapP2":"Geographic coordinates of the second point"
}
}
],
"geoLocation":"The geographic location of the factory specified as {latitude},{longitude}.",
"id":"556b2a5ac5-57ae",
"integrationId":"599a4a155f44-6dcf",
"iotEnabled":false,
"lastModifiedBy":"The name of the user who last modified the definition of the factory.",
"lastModifiedTime":1469184297746,
"lastModifiedTimeAsString":1469184297746,
"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 factory.",
"productionLines":[
"productionLines_1",
"productionLines_2",
"productionLines_3"
],
"registeredBy":"The name of the user who registered this factory.",
"registrationTime":1469184297746,
"registrationTimeAsString":1469184297746
}
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'
--header "X-HTTP-Method-Override: PATCH"
-d '{"address":"The street address of the factory.","code":"The unique code of the factory.","description":"The description of the factory.","factoryManager":{"email":"The email address of the factory manager.","name":"The name of the factory manager.","phone":"The phone number of the factory manager."},"floorPlans":[{"externalId":"125363624f0-8af","factoryId":"10b87ee25dd8-6300","id":"3acac62bc3-2a9c","name":"The unique name of the factory floor plan.","organizationId":"6c174a4d18dc-5f4a","referencePoints":{"imageP1":"Coordinates of the first point on image.","imageP2":"Coordinates of the second point on image","mapP1":"Geographic coordinates of the first point","mapP2":"Geographic coordinates of the second point"}}],"geoLocation":"The geographic location of the factory specified as {latitude},{longitude}.","id":"28d14d7310a7-2970","name":"The unique name of the factory.","properties":{"properties_key1":"properties_value1","properties_key2":"properties_value2","properties_key3":"properties_value3"}}'
https://iotserver/productionMonitoring/clientapi/v2/factories/6c2172eb20af-225b
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.