Get available capacity

get

/rest/ofscCapacity/v1/capacity

This operation returns the maximum available capacity and the estimated availability for each capacity area according to the working calendars.

Request

Query Parameters
  • Contains one of the following values: true or false. If true and if multiple capacity areas are selected, then the max capacity values for each area are aggregated and returned as a single structure. If false, then the max capacity values for each area are returned separately. The default value is false.
  • Collection Format: csv
    The labels of the capacity areas or the capacity area groups.
  • The list of time intervals for which the available capacity is calculated. Use the following format to specify the time intervals: all | [:] | [[:]]-[[[:]]. The default value is all.
  • Collection Format: csv
    The comma-separated list of time intervals for which the calendar capacity is calculated. Each item in the list represents a particular interval. Use the following format to specify the comma-separated list of time intervals: all | [:] | [[:]]-[[[:]] 'all' represents a whole working day. Valid values for hours: [0 to 48] The dash sign after 24, for example, 24 - represents overnight work. Minutes are optional. Valid values for minutes: [0 to 59]. A single time value specified as the interval determines the number of resources available on a given moment. Separate intervals can be specified for the 'calendar' and 'available' capacity. The system allows intersected (for example, 9-10, 9.30-12) and duplicated intervals (for example, 12-12:30, 12:30-13) within the same request. The default value is all.
  • Collection Format: csv
    The labels of the capacity categories in the capacity category filter. If there are no capacity categories in the filter, then all capacity categories available for the specified area(s) are returned.
  • Collection Format: csv
    The dates for which the available capacity is calculated. The date is specified in YYYY-MM-DD format.
  • Collection Format: csv
    The list of fields that should be returned in the response. Supported fields: - area.name; - area.calendar.count; - area.calendar.minutes; - area.available.count; - area.available.minutes; - area.category.calendar.count; - area.category.calendar.minutes; - area.category.available.count; - area.category.available.minutes; Default value: - date (returned regardless "fields"); - area.label (returned regardless "fields"); - area.calendar.count; - area.category.label (returned regardless "fields"); - area.category.calendar.count
Back to Top

Response

Supported Media Types

200 Response

This section describes the 200 status response for this operation.
Body ()
Root Schema : capacityList
Type: object
The collection of available capacity returned from the capacity areas and the working calendars.
Show Source
Nested Schema : items
Type: array
Show Source
Nested Schema : capacity
Type: object
Show Source
  • areas
    The array of objects containing data (that is, the maximum available capacity and the estimated availability) of a single capacity area or the aggregated result from multiple capacity areas.
  • The date for which the data (that is, the maximum available capacity and the estimated availability) is returned.
    Example: 2016-07-22
Nested Schema : areas
Type: array
The array of objects containing data (that is, the maximum available capacity and the estimated availability) of a single capacity area or the aggregated result from multiple capacity areas.
Show Source
Nested Schema : items
Type: object
Show Source
  • available
    The information about the available capacity. The number and order of items in the "count" and "minutes" arrays that are returned correspond to the time intervals specified in the "available TimeIntervals" parameter. The returned values are calculated based on the following criteria: - Working calendars of resources that belong to the specified area. - Activities in existing routes of the resources that belong to the specified area. - Time of activation, reactivation, and deactivation for the routes of the resources. - Scheduled activities that are currently located in different areas but belong to the specified area.
  • calendar
    The information about resources that belong to a capacity area and have a working calendar for a particular day. The number and order of items in the "count" and "minutes" arrays that are returned correspond to the time intervals specified in the "calendarTimeIntervals" parameter.
  • categories
    The array of objects containing data (that is, the maximum available capacity and the estimated availability) for a single capacity category.
  • The label that identifies the capacity area. The object is not returned if the 'aggregateResults' option is enabled.
  • The name of the capacity area. The object is not returned if the 'aggregateResults' option is enabled.
Nested Schema : available
Type: array
The information about the available capacity. The number and order of items in the "count" and "minutes" arrays that are returned correspond to the time intervals specified in the "available TimeIntervals" parameter. The returned values are calculated based on the following criteria: - Working calendars of resources that belong to the specified area. - Activities in existing routes of the resources that belong to the specified area. - Time of activation, reactivation, and deactivation for the routes of the resources. - Scheduled activities that are currently located in different areas but belong to the specified area.
Show Source
Nested Schema : calendar
Type: array
The information about resources that belong to a capacity area and have a working calendar for a particular day. The number and order of items in the "count" and "minutes" arrays that are returned correspond to the time intervals specified in the "calendarTimeIntervals" parameter.
Show Source
Nested Schema : categories
Type: array
The array of objects containing data (that is, the maximum available capacity and the estimated availability) for a single capacity category.
Show Source
Nested Schema : items
Type: object
Show Source
  • count
    The number of available resources within the time intervals.
  • minutes
    The maximum available capacity according to the calendars of the resources. The maximum available capacity value is also calculated for the time intervals specified in the "calendarTimeIntervals" parameter.
Nested Schema : count
Type: array
The number of available resources within the time intervals.
Show Source
Nested Schema : minutes
Type: array
The maximum available capacity according to the calendars of the resources. The maximum available capacity value is also calculated for the time intervals specified in the "calendarTimeIntervals" parameter.
Show Source
Nested Schema : items
Type: object
Show Source
Nested Schema : count
Type: array
The number of available resources within the time intervals.
Show Source
Nested Schema : minutes
Type: array
The maximum available capacity according to the calendars of the resources.
Show Source
Nested Schema : items
Type: object
Show Source
  • available
    The information about the available capacity. The number and order of items in the "count" and "minutes" arrays that are returned correspond to the time intervals specified in the "available TimeIntervals" parameter. The returned values are calculated based on the following criteria: - Working calendars of resources that belong to the specified area. - Activities in existing routes of the resources that belong to the specified area. - Time of activation, reactivation, and deactivation for the routes of the resources. - Scheduled activities that are currently located in different areas but belong to the specified area.
  • calendar
    The information about resources that belong to a capacity area and have a working calendar for a particular day. The number and order of items in the "count" and "minutes" arrays that are returned correspond to the time intervals specified in the "calendarTimeIntervals" parameter.
  • The label of the specified capacity category.
Nested Schema : available
Type: array
The information about the available capacity. The number and order of items in the "count" and "minutes" arrays that are returned correspond to the time intervals specified in the "available TimeIntervals" parameter. The returned values are calculated based on the following criteria: - Working calendars of resources that belong to the specified area. - Activities in existing routes of the resources that belong to the specified area. - Time of activation, reactivation, and deactivation for the routes of the resources. - Scheduled activities that are currently located in different areas but belong to the specified area.
Show Source
Nested Schema : calendar
Type: array
The information about resources that belong to a capacity area and have a working calendar for a particular day. The number and order of items in the "count" and "minutes" arrays that are returned correspond to the time intervals specified in the "calendarTimeIntervals" parameter.
Show Source
Nested Schema : items
Type: object
Show Source
Nested Schema : count
Type: array
The number of available resources within the time intervals.
Show Source
Nested Schema : minutes
Type: array
The available capacity within the time intervals.
Show Source
Nested Schema : items
Type: object
Show Source
  • count
    The number of available resources within the time intervals.
  • minutes
    The maximum available capacity according to the calendars of the resources. The maximum available capacity value is also calculated for the time intervals specified in the "calendarTimeIntervals" parameter.
Nested Schema : count
Type: array
The number of available resources within the time intervals.
Show Source
Nested Schema : minutes
Type: array
The maximum available capacity according to the calendars of the resources. The maximum available capacity value is also calculated for the time intervals specified in the "calendarTimeIntervals" parameter.
Show Source

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 get the available capacity by submitting a GET request on the REST resource.

Example of Request Header

The following shows an example of the request header.

GET /rest/ofscCapacity/v1/capacity?dates=2017-08-23&areas=Texasin%2CCapacityArea=true&calendarTimeIntervals=10-12&categories=IN%2CTC%2C%2CUP&availableTimeIntervals=01-06&fields=area.name%2C%20area.calendar.count%2Carea.calendar.minutes%2Carea.available.count%2Carea.available.minutes%2Carea.category.calendar.count%2Carea.category.calendar.minutes%2Carea.category.available.count%2Carea.category.available.minutes HTTP/1.1A
Connection: close
Accept-Encoding: gzip,deflate
Host: <instance_name>.etadirect.com
User-Agent: Apache-HttpClient/4.1.1 (java 1.5)

Example of Response Header

The following shows an example of the response header.

HTTP/1.1 200 OK
Server: nginx
Date: Wed, 23 Aug 2017 12:02:47 GMT
Content-Type: application/json; charset=utf-8
Transfer-Encoding: chunked
Connection: keep-alive
Access-Control-Allow-Credentials: true
Strict-Transport-Security: max-age=31536000; includeSubDomains;

Example of Response Body

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

{"items": [{
   "date": "2017-08-23",
   "areas": [   {
      "calendar":       {
         "count": [86],
         "minutes": [10080]
      },
      "available":       {
         "count": [0],
         "minutes": [0]
      },
      "categories":       [
                  {
            "label": "IN",
            "calendar":             {
               "count": [85],
               "minutes": [10080]
            },
            "available":             {
               "count": [0],
               "minutes": [0]
            }
         },
                  {
            "label": "TC",
            "calendar":             {
               "count": [86],
               "minutes": [10080]
            },
            "available":             {
               "count": [0],
               "minutes": [0]
            }
         },
                  {
            "label": "UP",
            "calendar":             {
               "count": [80],
               "minutes": [9600]
            },
            "available":             {
               "count": [0],
               "minutes": [0]
            }
         }
      ]
   }]
}]}
Back to Top