Validere assets API

Assets

OpenAPI Specification

validere-assets-api-openapi.yml Raw ↑
openapi: 3.0.1
info:
  description: Activity Log
  title: CarbonHub activities assets API
  version: 1.0.0
servers:
- url: https://api.validere.io
security:
- Staging: []
- Integration: []
- Local: []
tags:
- description: Assets
  name: assets
paths:
  /app/v1/assets/search:
    post:
      operationId: searchAssets
      requestBody:
        content:
          application/json:
            schema:
              allOf:
              - $ref: '#/components/schemas/Paginated'
              - $ref: '#/components/schemas/AssetSort'
              - type: object
                properties:
                  filter:
                    $ref: '#/components/schemas/AssetFilterFields'
        required: true
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PagedAssetList'
          description: successful operation
      summary: Search Assets
      tags:
      - assets
components:
  schemas:
    FlowTypes:
      type: string
      description: Use `id` value of any index in `GET /v1/flow_types`
    AssetGroupFilterWithPrefix:
      properties:
        asset_group.id:
          type: string
        asset_group.name:
          type: string
        asset_group.status:
          $ref: '#/components/schemas/AssetGroupStatus'
        asset_group.asset_group_type_id:
          type: string
        asset_group.custom_attributes:
          type: object
      type: object
    CustomAttributes:
      example:
        attribute1: 12345
        attribute2: value1
      type: object
    DevicePrimaryFilterFieldsWithPrefix:
      properties:
        device.attributes:
          type: object
        device.custom_attributes:
          type: object
        device.id:
          type: string
        device.measurement_types:
          type: string
        device.name:
          type: string
        device.status:
          type: string
        device.type_id:
          type: string
    PagedAssetList:
      allOf:
      - $ref: '#/components/schemas/Pagination'
      - type: object
        properties:
          data:
            type: object
            properties:
              id:
                type: string
                format: uuid
              asset_type:
                $ref: '#/components/schemas/AssetType'
              name:
                type: string
    AssetType:
      type: string
      enum:
      - equipment
      - device
      - facility
      - flow
    ProductTypes:
      type: string
      description: Use `id` value of any index in `GET /v1/product_types`
    FlowStatus:
      type: string
      enum:
      - active
      - inactive
    ProductCategories:
      type: string
      description: Use `id` value of any index in `GET /v1/product_categories`
    AssetSort:
      properties:
        sort_by:
          enum:
          - id
          - asset_type
          type: string
        sort_direction:
          default: desc
          description: sort direction
          enum:
          - asc
          - desc
          example: desc
          type: string
    Pagination:
      properties:
        page_number:
          type: number
          example: 0
        page_size:
          type: number
          example: 10
        total_entries:
          type: number
          example: 58
        total_pages:
          type: number
          example: 6
      type: object
    EquipmentStatus:
      type: string
      enum:
      - active
      - inactive
      - deprecated
    FlowPrimaryFilterFieldsWithPrefix:
      properties:
        flow.id:
          type: string
        flow.name:
          type: string
        flow.status:
          $ref: '#/components/schemas/FlowStatus'
        flow.type:
          $ref: '#/components/schemas/FlowTypes'
        flow.product_type:
          $ref: '#/components/schemas/ProductTypes'
        flow.product_category:
          $ref: '#/components/schemas/ProductCategories'
        flow.custom_attributes:
          $ref: '#/components/schemas/CustomAttributes'
        flow.associated_facility_id:
          type: string
          format: uuid
        flow.associated_equipment_id:
          type: string
          format: uuid
      type: object
    AssetGroupStatus:
      type: string
      enum:
      - active
      - inactive
    FacilityPrimaryFilterFieldsWithPrefix:
      properties:
        facility.custom_attributes:
          type: object
        facility.id:
          type: string
        facility.name:
          type: string
        facility.status:
          type: string
      type: object
    Paginated:
      properties:
        page:
          default: 0
          description: Which page to return
          example: 0
          type: number
        page_size:
          default: 10
          description: How many items to list in a page
          example: 20
          type: number
    EquipmentPrimaryFilterFieldsWithPrefix:
      properties:
        equipment.custom_attributes:
          type: object
        equipment.id:
          type: string
        equipment.name:
          type: string
        equipment.status:
          $ref: '#/components/schemas/EquipmentStatus'
        equipment.type.id:
          type: string
        equipment.type.name:
          type: string
      type: object
    AssetFilterFields:
      allOf:
      - $ref: '#/components/schemas/FacilityPrimaryFilterFieldsWithPrefix'
      - $ref: '#/components/schemas/EquipmentPrimaryFilterFieldsWithPrefix'
      - $ref: '#/components/schemas/DevicePrimaryFilterFieldsWithPrefix'
      - $ref: '#/components/schemas/FlowPrimaryFilterFieldsWithPrefix'
      - $ref: '#/components/schemas/AssetGroupFilterWithPrefix'