Create a work zone
post
/rest/ofscMetadata/v1/workZones
This operation creates a new work zone.
The following criteria applies while creating a work zone:
- Fields must not have any blank spaces at the end, for example 'a '. All white spaces are ignored.
- Values in the keys arrays must be unique.
- Same key may be present only once across all the active work zones (inactive work zones are ignored).
- Values in the shapes arrays must be unique.
- Same shape may be present only once across the all active work zones (inactive work zones are ignored).
- Validation is not case sensitive, that is 'a' is the same as 'A'.
Request
Query Parameters
-
autoResolveConflicts: boolean
This parameter automatically resolves conflicts in work zone keys. If the value of this parameter is specified, then Oracle Field Service automatically removes the specified work zone keys from other active work zones. This parameter applies only if the work zone being created or updated is active.
The work zone object that needs to be created.
Root Schema : Work Zone
Type:
object
Title:
Show Source
Work Zone
-
keys:
array Keys
Title:
Keys
-
organization:
string
Title:
The organization label
Minimum Length:1
Maximum Length:255
-
shapes:
array Shapes
Title:
Shapes
-
status:
string
Title:
Status
Allowed Values:[ "active", "inactive" ]
-
travelArea(required):
string
Title:
Travel Area
Allowed Values:[ "sunrise_enterprise", "New" ]
-
workZoneLabel(required):
string
Title:
Work Zone Label
Minimum Length:1
Maximum Length:255
-
workZoneName(required):
string
Title:
Work Zone Name
Minimum Length:1
Maximum Length:255
Nested Schema : Keys
Type:
array
Title:
Show Source
Keys
-
Array of:
string
Minimum Length:
1
Maximum Length:50
Nested Schema : Shapes
Type:
array
Title:
Show Source
Shapes
-
Array of:
string
Minimum Length:
1
Maximum Length:50
Response
Supported Media Types
- application/json
- application/schema+json
201 Response
This section describes the 201 status response for this operation. This code indicates that the work zone object is created.
Root Schema : Work Zone
Type:
object
Title:
Show Source
Work Zone
-
keys:
array Keys
Title:
Keys
-
organization:
string
Title:
The organization label
Minimum Length:1
Maximum Length:255
-
shapes:
array Shapes
Title:
Shapes
-
status:
string
Title:
Status
Allowed Values:[ "active", "inactive" ]
-
travelArea(required):
string
Title:
Travel Area
Allowed Values:[ "sunrise_enterprise", "New" ]
-
workZoneLabel(required):
string
Title:
Work Zone Label
Minimum Length:1
Maximum Length:255
-
workZoneName(required):
string
Title:
Work Zone Name
Minimum Length:1
Maximum Length:255
Nested Schema : Keys
Type:
array
Title:
Show Source
Keys
-
Array of:
string
Minimum Length:
1
Maximum Length:50
Nested Schema : Shapes
Type:
array
Title:
Show Source
Shapes
-
Array of:
string
Minimum Length:
1
Maximum Length:50
Default Response
This section describes the default error response for this operation.
Root Schema : Error
Type:
Show Source
object
-
detail:
string
The detailed description of this error.
-
status:
string
The HTTP status code of this error.
-
title(required):
string
The brief description of this error.
-
type(required):
string
The URL of the web page containing more details about this error.
Examples
The following example shows how to create work zone by submitting a POST request on the REST resource using cURL.
curl -X POST -H "Authorization: Basic c29hcEBtYXAtd3o6MQ==" -H "Cache-Control: no-cache" -H "Postman-Token: fcde2e14-b148-1920-876a-c00fef9b0355" -d ' { "workZoneLabel": "RESTZONE", "status": "active", "travelArea": "New", "keys": ["KYiV","KHrK"], "shapes": ["SHAPE1A", "SHAPE2b"] } ' "https://ofsc1.vm/master/wwwroot/rest/ofscMetadata/v1/workZones?request_auth_basic&pretty"
Example of Response Header
The following shows an example of the response header.
HTTP/1.1 200 Ok Server: nginx/1.6.2 Date: Fri, 24 Jul 2015 08:35:48 GMT Content-Type: application/json; charset=utf-8 Connection: close
Example of Response Body
The following example shows the contents of the response body in JSON format.
{ "workZoneLabel": "RESTZONE", "status": "active", "travelArea": "New", "keys": [ "KYiV", "KHrK" ], "shapes": [ "SHAPE1A", "SHAPE2b" ], "links": [ { "rel": "canonical", "href": "https://ofsc1.vm/master/wwwroot/rest/ofscMetadata/v1/workZones/RESTZONE" }, { "rel": "describedby", "href": "https://ofsc1.vm/master/wwwroot/rest/ofscMetadata/v1/metadata-catalog/workZones" } ] }