Oden Technologies Dashboards API

The Dashboards API from Oden Technologies — 1 operation(s) for dashboards.

OpenAPI Specification

oden-technologies-dashboards-api-openapi.yml Raw ↑
openapi: 3.0.0
info:
  version: 2.0.0
  title: Oden Dashboards API
  contact:
    name: Oden Support
    email: support@oden.io
    url: https://oden.io/contact/
  description: "The Oden Private Partner API exposes RESTful API endpoints for clients to get, create and update data on the Oden Platform.\n\nThe API is based on the OpenAPI 3.0 specification.\n### Current Version\nThe URL, and host, for the current version is [https://api.oden.app/v2](https://api.oden.app/v2).\n\n### Oden's Data Model\n- **Organization**: This represents the Organization registered as an Oden customer. An organization has an associated collection of users, factories, lines, etc. This is the entity a specific authentication token is associated with.\n- **Asset** or **Machinegroup**: Assets, or machinegroups, are collections of machines, which may either be a **Factory** or a **Line**:\n  - **Factory**: Factories are collections of lines, representing a particular manufacturing location.\n    - **Line**: Lines are collections of machines, often representing a particular production line. Lines may also have **Products** mapped to them, indicating what is currently being manufactured by the specific line.\n      - **Machine**: Machines are the physical machines that make up a line\n- **Product**: Products capture what entities a manufacturer produces\n- **Interval**: An interval is a period of time that takes place on a manufacturing line and expresses some business concern. It's Oden's way of making metrics aggregatable, traceable, and relatable to a manufacturer.\n  - **Run**: A run is a production interval that labels a period of production as being work on some single product\n  - **Batch**: A batch is a production interval that represents a portion of a particular run\n  - **State**: A state is an interval that tracks the availability or utilization of a line\n    - **State Category**: A state category describes what state a line is in - such as ex. uptime, downtime, scrapping, etc.\n    - **State Reason**: A state reason describes why a line is in a particular state - such as \"maintenance\" being a reason for the category \"downtime\".\n  - **Custom**: A custom interval can track any other type of interval-based data a manufacturer might want to analyze. These are created on a per-factory basis.\n- **Target**: Targets specify values and upper/lower thresholds for metrics when specific products are running on specific lines\n- **Scrap/Yield**: Scrap/yield output specifies amount of produced product on a line during either a run or batch interval. Oden will categorize all output as either scrap or yield - as specified by the Scrap Yield Schema for a given factory. If you have other categories, like rework/blocked/off-grade, you must choose between categorizing those amounts as either good or bad production by specifying as scrap or yield. Clients may also add scrap codes (i.e., reasons) to a given Scrap Yield Data entry.\n  - **Scrap Code**: A scrap code is a code that explains the reason for a scrap/yield raw data input - such as \"Rework\"\n- **Quality Test**: Quality Tests are results of quality assurance tests done on site, and uploaded to Oden. They may be attached to a single Batch or Run.\n- **Metric**: Known in factories as \"tags\", metrics are the raw data that is collected by Oden from the machines and devices on the factory floor.\n- **Metric Group**: Metric groups are metrics that represent the same thing across different lines. They provide common display names for tags and allow labeling groups of tags as measuring key types of data like performance or production.\n- **Maintenance Work Order**: A maintenance work order can be used to track work orders maintained in MaintainX and associate them with an Oden line. \n\n### Best Practices\nUnder the current implementation, the Oden API does not rate limit requests from clients.\n\nHowever, rate limiting will be introduced in the near future and it is recommended that users design their API\nclients to not exceed a request rate of **one per second**.\n\n### Schema\nAll v2 API access is over HTTPS and accessed from https://api.oden.app/v2\nAll data is sent and received as JSON.\n\nAPI requests with duplicate keys will process only the data for the first key detected and ignore the rest, so it's not recommended. Batching multiple messages in this way is currently not possible.\n  - Example of duplicate key in JSON: {\"raw_data\":{\"scrap\":\"10\",\"scrap\":\"100\"}}\n\nAll timestamps are returned in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601#Times) format:\n\n  `YYYY-MM-DDTHH:MM:SSZ`\n\nAll durations are returned in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601#Times) format with the largest unit of time being the hour:\n\n   `PT[n]H[n]M[n]S`\n\nAll timestamps sent to the API in POST requests should be in ISO 8601 format.\n### HTTP Verbs\nThe ONLY HTTP call type (sometimes called *verb* or *method*) used within Oden's API is **POST**.\nThere are three actions supported via a **POST**; call, search, set, and delete, together supporting CRUD operations;\n  - **search** requests are used to search for and *read* objects in the Oden Platform\n      - All Oden Objects may be uniquely identified by some combination of, or a single, parameter.\n        - Ex a `line` my be identified by either:\n          - `id`\n          - `name` AND `factory`\n  - **set** requests are used to *create* or *update* objects\n  - **delete** requests are used to *delete* objects. If a delete endpoint is not yet implemented for a given object, users may choose to update the values of a specific entity to null or 0 values.\n\n### URI Components\nAll endpoints may be accessed with the URI pattern:\n`https://api.oden.app/v2/{object}/{action}`\n\nWhere:\n  - `object` is the name of the object being requested:\n       - `factory`, `quality_test`, `interval`, `line`, etc...\n  - `action` is the name of the action being requested\n    - `search` , `set` , `delete`\n\ne.g. `https://api.oden.app/v2/factory/search`\n\n# Authentication\nClients can authenticate through the v2 API using a Token provided by Oden. Tokens are opaque strings similar to\n[Bearer](https://swagger.io/docs/specification/authentication/bearer-authentication/) tokens that the client must\npass in the [HTTP Authorization request header](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Authorization) in every request.\nThe syntax is as follows:\n\n`Authorization: <type> <credentials>`\n\nWhere \\<type\\> is \"Token\" and \\<credentials\\> is the Token string. For example:\n\n`Authorization: Token tokenStringProvidedByOden`\n\nAuthenticating with an invalid Token will return `401 Unauthorized Error`.\n\nAuthenticating with a Token that is not authorized to read requested data will return `403 Forbidden Error`.\n\nSome endpoints may require requests to be broken out by machinegroup (i.e., line or factory) and the number of\nrequests would scale accordingly. This multiplicity should be taken into consideration when deciding on the\nfrequency the API client makes requests to the Oden endpoints.\n\nTo authenticate in this [UI](https://api.oden.app/v2/ui/), click the Lock icon, and copy/paste the token into the Authorize box.\n"
servers:
- url: https://api.oden.app
  description: Oden API server
security:
- APIKeyAuth: []
tags:
- name: Dashboards
paths:
  /v2/dashboard/execute:
    post:
      operationId: execute_dashboard
      summary: Execute a dashboard
      tags:
      - Dashboards
      description: "Execute every module in a dashboard with shared time-range and filter\noverrides, returning the columns and rows produced by each module.\n\nModules execute in parallel and are reported in the dashboard's stored\nmodule order. Per-module failures (parse, dispatch) land in the\n`error` field of that module's result; siblings continue to run.\n\nKnown v1 limitations:\n- Template variables (`{var_name}` in stored OQL) are not substituted\n  server-side. Modules containing unsubstituted placeholders will\n  fail at parse time.\n"
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/DashboardExecuteRequest'
      responses:
        '200':
          description: 'Dashboard loaded and each module executed. Individual modules may still report `error` in their result; this is not a 200/non-200 distinction.

            '
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/DashboardExecuteResult'
        '400':
          $ref: '#/components/responses/ParameterError'
        '401':
          $ref: '#/components/responses/UnauthorizedError'
        '403':
          $ref: '#/components/responses/ForbiddenError'
        '404':
          $ref: '#/components/responses/NotFoundError'
        '429':
          $ref: '#/components/responses/TooManyRequestsError'
        '500':
          $ref: '#/components/responses/InternalError'
        '501':
          $ref: '#/components/responses/UnimplementedError'
components:
  schemas:
    GenericError:
      type: object
      required:
      - error
      - retryable
      properties:
        error:
          type: string
        retryable:
          type: boolean
    DashboardExecuteResult:
      type: object
      description: Executed output of a single dashboard module.
      required:
      - module_id
      - module_name
      - module_type
      properties:
        module_id:
          type: string
          format: uuid
        module_name:
          type: string
        module_type:
          type: string
          description: 'The module''s stored visualization (e.g. `table`, `line_chart`, `bar_chart`). Type label only — does not change the response shape.

            '
        range:
          type: object
          description: 'Resolved absolute time window the executed query actually covers. For relative requests this is the concrete window the anchor/offset resolved to.

            '
          properties:
            start:
              type: string
              format: date-time
            end:
              type: string
              format: date-time
        filters_applied:
          type: object
          description: 'Echo of the filter dimensions that were applied, resolved to human-readable values where possible (e.g. line names instead of IDs).

            '
          additionalProperties: true
        columns:
          type: array
          nullable: true
          description: 'Column metadata. `type` is derived from the first non-null cell in the column. Null when the module errored.

            '
          items:
            $ref: '#/components/schemas/DashboardColumnSpec'
        rows:
          type: array
          nullable: true
          description: 'Row data as objects keyed by column name (not positional arrays). Values are typed JSON natively. Null when the module errored.

            '
          items:
            type: object
            additionalProperties: true
        error:
          type: string
          nullable: true
          description: 'Set to a short message when the module failed to parse or execute. Null on success.

            '
    DashboardExecuteRange:
      type: object
      description: 'Time window applied to every module. Either supply an absolute window (`start` and `end`) OR a relative window (`anchor` and `offset`, optionally with `timezone`), not both.

        '
      properties:
        start:
          type: string
          format: date-time
        end:
          type: string
          format: date-time
        anchor:
          type: string
          description: Anchor expression for a relative range, e.g. `now`.
        offset:
          type: string
          description: Offset expression for a relative range, e.g. `-7D`.
        timezone:
          type: string
          description: IANA timezone identifier (defaults to UTC).
    DashboardExecuteFilters:
      type: object
      description: 'Optional filter overrides applied to every module. Every field is optional; omitting one means "no override on that dimension".

        '
      properties:
        lines:
          type: array
          description: 'Lines to restrict to. Each entry must supply `id`, `name`, or both; entries that supply neither are rejected. Other Line fields (factory, secondary_name, match) are not used here and are intentionally omitted so generated clients don''t suggest them as inputs.

            '
          items:
            type: object
            anyOf:
            - required:
              - id
            - required:
              - name
            properties:
              id:
                type: string
                format: uuid
              name:
                type: string
        shifts:
          type: array
          items:
            type: integer
            format: int32
        product_ids:
          type: array
          items:
            type: string
            format: uuid
        product_attribute_value_ids:
          type: array
          items:
            type: string
            format: uuid
        scrap_categories:
          type: array
          items:
            type: string
            format: uuid
        states:
          type: object
          properties:
            state_types:
              type: array
              items:
                type: string
            state_category_and_reasons:
              type: array
              items:
                type: object
                required:
                - state_category
                properties:
                  state_category:
                    type: integer
                    format: int32
                  state_reason:
                    type: string
        custom_intervals:
          type: array
          items:
            type: object
            required:
            - type
            - value_contains
            properties:
              type:
                type: string
              value_contains:
                type: string
    DashboardExecuteRequest:
      type: object
      description: 'Request envelope for executing every module in a dashboard.

        '
      required:
      - dashboard
      properties:
        dashboard:
          type: object
          required:
          - id
          properties:
            id:
              type: string
              format: uuid
        range:
          $ref: '#/components/schemas/DashboardExecuteRange'
        filters:
          $ref: '#/components/schemas/DashboardExecuteFilters'
    DashboardColumnSpec:
      type: object
      required:
      - name
      - type
      properties:
        name:
          type: string
        type:
          type: string
          enum:
          - string
          - number
          - boolean
          - datetime
  responses:
    ParameterError:
      description: An error occurred regarding one of the input parameters
      content:
        application/json:
          schema:
            type: object
            required:
            - error
            - name
            - retryable
            properties:
              error:
                type: string
              name:
                type: string
              retryable:
                type: boolean
    UnimplementedError:
      description: Endpoint is not yet implemented
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/GenericError'
    ForbiddenError:
      description: 'User has provided valid credentials but is not authorized to access the entity

        '
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/GenericError'
    NotFoundError:
      description: Entity not found
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/GenericError'
    TooManyRequestsError:
      description: Too many requests
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/GenericError'
    InternalError:
      description: 'An internal server error has occurred. If reporting the error to Oden, include the ID returned in this response to aid in debugging.

        '
      content:
        application/json:
          schema:
            type: object
            required:
            - error
            - retryable
            - id
            properties:
              error:
                type: string
              retryable:
                type: boolean
              id:
                type: string
                format: uuid
    UnauthorizedError:
      description: User has provided either no credentials or invalid credentials
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/GenericError'
  securitySchemes:
    APIKeyAuth:
      type: apiKey
      in: header
      name: Authorization
      description: Prefix the value with \"Token\" to indicate the custom authorization type