Set a work zone

post

/rest/ofscCore/v1/resources/{resourceId}/workZones

This operation assigns a work zone to the specified resource.

Request

Path Parameters
Body ()
Root Schema : Work Zone
Type: object
Title: Work Zone
Show Source
  • Title: End Date
    The date until when the work zone assignment is effective. Specify the date in 'YYYY-MM-DD' format.
  • Title: Ratio
    Minimum Value: 1
    Maximum Value: 100
    The work zone ratio of the resource. The default value is 100.
  • Title: Recur Every
    Minimum Value: 1
    Maximum Value: 10000
    The time between each recurrence of the work zone assignment. Depending on the value selected for 'recurrence', the value of the parameter indicates the time between recurrence in days or weeks. For example, if '4' is the value of this parameter, and the 'recurrence' is 'daily', it indicates that the time between each recurrence is four days.
  • Title: Recurrence
    Allowed Values: [ "weekly", "daily" ]
    The value of this parameter along with the 'Recur Every' parameter defines the time between each recurrence of the work zone assignment. For example, if you specify 'daily' as the value of this parameter and '4' as the value of the 'recurEvery' parameter, then the time between each recurrence is four days.
  • Title: Start Date
    The date when the work zone assignment takes effect. Specify the date in 'YYYY-MM-DD' format.
  • Title: Type
    Allowed Values: [ "regular", "override" ]
    The type of the work zone assignment.
  • Weekdays
    Title: Weekdays
    Unique Items Required: true
    The weekdays on which the work zone is assigned to the resources. This parameter is mandatory when the recurrence is weekly.
  • Title: Work Zone Label
    Maximum Length: 255
    The identifier of the work zone.
  • Title: Work Zone Item ID
    The identifier of the work zone assignment.
Nested Schema : Weekdays
Type: array
Title: Weekdays
Unique Items Required: true
The weekdays on which the work zone is assigned to the resources. This parameter is mandatory when the recurrence is weekly.
Show Source
  • Allowed Values: [ "Sun", "Mon", "Tue", "Wed", "Thu", "Fri", "Sat" ]
Back to Top

Response

Supported Media Types

204 Response

This section describes the 204 status response for this operation.

Default Response

This section describes the default error response for this operation.
Body ()
Root Schema : Error
Type: object
Error response
Show Source
Back to Top

Examples

The following example shows how to set work zones for a resource by submitting a POST request on the REST resource.

Example of Request Header

The following shows an example of the request header.

POST /rest/ofscCore/v1/resources/resource_work_zones/workZones HTTP/1.0

Example of Request Body

The following example shows the contents of the request body in JSON format.

{
        "workZone": "GENEVA",
        "startDate": "2015-09-16",
        "endDate": "2015-09-18",
        "ratio": 100,
        "weekdays": [
            "Tue",
            "Sat"
        ],
        "recurEvery": 1,
        "recurrence": "weekly"
}

Example of Response Header

The following shows an example of the response header.

HTTP/1.1 204 No Content
Back to Top