Create factory
post
/productionMonitoring/clientapi/v2/factories
This operation creates a new instance of a factory. 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
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 : Factory_create
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.
-
extId:
string
The external identifier representing the external factory imported
-
factoryManager(optional):
object FactoryManager_create
-
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:
object properties
Additional Properties Allowed: additionalPropertiesProperty description was not set
Nested Schema : FactoryManager_create
Type:
Show Source
object
-
email(optional):
string
The email address of the factory manager.
-
name:
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_create
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.
-
name:
string
The unique name of the factory floor plan.
-
organizationId:
string
Property description was not set
-
referencePoints(optional):
object FloorPlanReferencePoints_create
Nested Schema : FloorPlanReferencePoints_create
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
201 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.
Examples
curl -X POST
-u <username>:<password>
-H 'Accept: application/json'
https://iotserver/productionMonitoring/clientapi/v2/factories
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.",
"extId":"29ae4cd67981-2a9c",
"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":"552f1ca03ee6-249f",
"id":"6445a5363cb-2791",
"name":"The unique name of the factory floor plan.",
"organizationId":"4d3382552ad-4486",
"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":"67e5263781b-42a1",
"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":"6e847bef4f08-6c60",
"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":"70f65a443c41-78fb",
"id":"2ec457a67021-33b6",
"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":"2b6118766273-1ce4",
"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":"7bb06f3e7f89-2f56",
"integrationId":"29bb53a024dd-294b",
"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'
-d '{"address":"The street address of the factory.","code":"The unique code of the factory.","description":"The description of the factory.","extId":"29ae4cd67981-2a9c","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":"552f1ca03ee6-249f","id":"6445a5363cb-2791","name":"The unique name of the factory floor plan.","organizationId":"4d3382552ad-4486","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":"67e5263781b-42a1","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
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.