github.com/optim-corp/cios-golang-sdk@v0.5.1/openapi/components/collection-component.openapi.yml (about)

     1  openapi: 3.0.3
     2  info:
     3    title: Collection Component
     4    description: Component
     5    version: 1.0.0
     6  
     7  paths: {}
     8  
     9  components:
    10    schemas:
    11      CollectionLatestRequest:
    12        required:
    13          - resource_owner_id
    14        type: object
    15        properties:
    16          resource_owner_id:
    17            type: string
    18            format: uuid
    19          limit:
    20            type: integer
    21            format: int64
    22          offset:
    23            type: integer
    24            format: int64
    25          projection:
    26            type: string
    27            default: data
    28            enum: [ data, thumbnail, image ]
    29      CollectionLatest:
    30        type: object
    31        properties:
    32          resource_owner_id:
    33            type: string
    34          location:
    35            $ref: '#/components/schemas/CollectionLocation'
    36          measurements:
    37            type: object
    38          series_id:
    39            type: string
    40          timestamp:
    41            type: string
    42          image:
    43            type: string
    44          image_type:
    45            type: string
    46            enum: [ jpeg, png ]
    47      CollectionLocation:
    48        type: object
    49        required:
    50          - coordinates
    51          - type
    52        properties:
    53          type:
    54            type: string
    55            enum: [ Point ]
    56            default: Point
    57          coordinates:
    58            type: array
    59            items:
    60  #            anyOf:
    61  #              - description: 経度
    62  #                example: 138.5
    63  #                format: double
    64  #                maximum: 180
    65  #                minimum: -180
    66  #              - description: 緯度
    67  #                example: 48.2
    68  #                format: double
    69  #                maximum: 90
    70  #                minimum: -90
    71  #              - description: 高度
    72  #                example: 12.3
    73  #                format: double
    74              type: number
    75            maxItems: 3
    76            minItems: 2
    77      CollectionStatus:
    78        example:
    79          status: READY
    80          properties:
    81            status:
    82              description: |-
    83                状態
    84  
    85                アーカイブ・リストア状態:
    86  
    87                | 状態 | 内容 | 遷移理由 | 使用可能なAPI |
    88                | :-- | :-- | :-- | :-- |
    89                | READY | 正常 | 指定されたresource_owner_idの時系列データに対しアーカイブ操作が加えられていない、もしくはリストアが正常終了した。 | Restore 以外 |
    90                | ARCHIVED | アーカイブ済み | 指定されたresource_owner_idの時系列データに対しアーカイブ操作が加えられ正常終了した。 | Restore |
    91                |ARCHIVING|アーカイブ実施中|指定されたresource_owner_idの時系列データに対しアーカイブ操作が加えられ、アーカイブ実行中|-|
    92                |ARCHIVE_ERROR|アーカイブ失敗|アーカイブ実行に失敗|Archive|
    93                |RESTORING|リストア実施中|アーカイブされた時系列データに対しリストア操作が加えられ、リストア実行中|-|
    94                |RESTORE_ERROR|リストア失敗|リストア実行に失敗|Restore|
    95              enum:
    96                - READY
    97                - ARCHIVING
    98                - ARCHIVE_ERROR
    99                - ARCHIVED
   100                - RESTORING
   101                - RESTORE_ERROR
   102              example: READY
   103              type: string
   104          required:
   105            - status
   106          type: object
   107      MultipleCollectionLatest:
   108        type: object
   109        required:
   110          - total
   111          - data
   112        properties:
   113          total:
   114            type: integer
   115            format: int64
   116          data:
   117            type: array
   118            items:
   119              $ref: '#/components/schemas/CollectionLatest'
   120          image_map:
   121            type: object
   122      MultipleSeriesDataLocationUnix:
   123        type: object
   124        required:
   125          - data
   126          - total
   127        properties:
   128          total:
   129            description: 検索条件にマッチする全結果数
   130            example: 1
   131            format: int64
   132            type: integer
   133          data:
   134            description: 時系列データ配列。データが0件の場合は空配列。
   135            items:
   136              $ref: '#/components/schemas/SeriesDataLocationUnix'
   137            nullable: true
   138            type: array
   139      MultipleSeriesImage:
   140        type: object
   141        properties:
   142          total:
   143            description: 検索条件にマッチする全結果数
   144            example: 1
   145            format: int64
   146            type: integer
   147          data:
   148            description: 画像データとタイムスタンプの配列。データが0件の場合は空配列。
   149            items:
   150              $ref: '#/components/schemas/SeriesImage'
   151            type: array
   152          image_map:
   153            additionalProperties:
   154              description: キーに対応する画像のindex
   155              minimum: 0
   156              type: integer
   157            description: timestampがキーとなってdataのindexが格納されているhashmap
   158            type: object
   159        required:
   160          - data
   161          - image_map
   162          - total
   163      SeriesAggregationRequest:
   164        type: object
   165  #      anyOf:
   166  #        - description: integer型の計測値の集計方法を指定する
   167  #          properties:
   168  #            target:
   169  #              description: コレクションに定義されているinteger型の計測値のプロパティをjsonpathで指定する
   170  #              pattern: ^$.measurements.[a-zA-Z][a-zA-Z0-9_]{1,34}[a-zA-Z]$
   171  #              type: string
   172  #            method:
   173  #              description: |-
   174  #                計測値をintervalごとに集計する方法として、以下からいずれかの値を指定する
   175  #
   176  #                |値|集約方法|
   177  #                |---|---|
   178  #                |first|単位時間(interval)ごとに区切り、先頭の値を使用する。先頭がnullの場合はnullとなる。|
   179  #                |last|単位時間(interval)ごとに区切り、末尾の値を使用する。末尾がnullの場合はnullとなる。|
   180  #                |average|単位時間(interval)ごとに区切り、平均値を算出する。レスポンスは64bit浮動小数点数となる。値がnullのデータは集計に使用しない。|
   181  #                |max|単位時間(interval)ごとに区切り、最大値を使用する。値がnullのデータは集計に使用しない。|
   182  #                |min|単位時間(interval)ごとに区切り、最小値を使用する。値がnullのデータは集計に使用しない。|
   183  #                |sum|単位時間(interval)ごとに区切り、合計値を算出する。64bit整数の範囲を超えた場合は、64bit整数の最大値/最小値に丸められる。値がnullのデータは集計に使用しない。|
   184  #              enum:
   185  #                - first
   186  #                - last
   187  #                - average
   188  #                - max
   189  #                - min
   190  #                - sum
   191  #              type: string
   192  #          required:
   193  #            - method
   194  #            - target
   195  #          title: Aggregation(Integer)
   196  #          type: object
   197  #        - description: number型の計測値の集計方法を指定する
   198  #          properties:
   199  #            target:
   200  #              description: コレクションに定義されているnumber型の計測値のプロパティをjsonpathで指定する
   201  #              pattern: ^$.measurements.[a-zA-Z][a-zA-Z0-9_]{1,34}[a-zA-Z]$
   202  #              type: string
   203  #            method:
   204  #              description: |-
   205  #                計測値をintervalごとに集約する方法として、以下からいずれかの値を指定する
   206  #
   207  #                |値|集約方法|
   208  #                |---|---|
   209  #                |first|単位時間(interval)ごとに区切り、先頭の値を使用する。先頭がnullの場合はnullとなる。|
   210  #                |last|単位時間(interval)ごとに区切り、末尾の値を使用する。末尾がnullの場合はnullとなる。|
   211  #                |average|単位時間(interval)ごとに区切り、平均値を算出する。値がnullのデータは集計に使用しない。|
   212  #                |max|単位時間(interval)ごとに区切り、最大値を使用する。値がnullのデータは集計に使用しない。|
   213  #                |min|単位時間(interval)ごとに区切り、最小値を使用する。値がnullのデータは集計に使用しない。|
   214  #                |sum|単位時間(interval)ごとに区切り、合計値を算出する。64bit浮動小数点数の範囲を超えた場合は、64bit浮動小数点数の最大値/最小値に丸められる。値がnullのデータは集計に使用しない。|
   215  #              enum:
   216  #                - first
   217  #                - last
   218  #                - average
   219  #                - max
   220  #                - min
   221  #                - sum
   222  #              type: string
   223  #          required:
   224  #            - method
   225  #            - target
   226  #          title: Aggregation(Number)
   227  #          type: object
   228  #        - description: string型の計測値の集計方法を指定する
   229  #          properties:
   230  #            target:
   231  #              description: コレクションに定義されているstring型の計測値のプロパティをjsonpathで指定する
   232  #              pattern: ^$.measurements.[a-zA-Z][a-zA-Z0-9_]{1,34}[a-zA-Z]$
   233  #              type: string
   234  #            method:
   235  #              description: |-
   236  #                計測値をintervalごとに集約する方法として、以下からいずれかの値を指定する
   237  #
   238  #                |値|集約方法|
   239  #                |---|---|
   240  #                |first|単位時間(interval)ごとに区切り、先頭の値を使用する。先頭がnullの場合はnullとなる。|
   241  #                |last|単位時間(interval)ごとに区切り、末尾の値を使用する。末尾がnullの場合はnullとなる。|
   242  #              enum:
   243  #                - first
   244  #                - last
   245  #              type: string
   246  #          required:
   247  #            - method
   248  #            - target
   249  #          title: Aggregation(String)
   250  #          type: object
   251  #        - description: boolean型の計測値の集計方法を指定する
   252  #          properties:
   253  #            target:
   254  #              description: コレクションに定義されているboolean型の計測値のプロパティをjsonpathで指定する
   255  #              pattern: ^$.measurements.[a-zA-Z][a-zA-Z0-9_]{1,34}[a-zA-Z]$
   256  #              type: string
   257  #            method:
   258  #              description: |-
   259  #                位置情報をintervalごとに集約する方法として、以下からいずれかの値を指定する
   260  #
   261  #                |値|集約方法|
   262  #                |---|---|
   263  #                |first|単位時間(interval)ごとに区切り、先頭の値を使用する。先頭がnullの場合はnullとなる。|
   264  #                |last|単位時間(interval)ごとに区切り、末尾の値を使用する。末尾がnullの場合はnullとなる。|
   265  #              enum:
   266  #                - first
   267  #                - last
   268  #              type: string
   269  #          required:
   270  #            - method
   271  #            - target
   272  #          title: Aggregation(Boolean)
   273  #          type: object
   274  #        - description: 位置情報の集計方法を指定する
   275  #          properties:
   276  #            target:
   277  #              description: $.locationを指定する
   278  #              example: $.location
   279  #              pattern: ^\$\.location$
   280  #              type: string
   281  #            method:
   282  #              description: |-
   283  #                値をintervalごとに集約する方法として、以下からいずれかの値を指定する
   284  #
   285  #                |値|集約方法|
   286  #                |---|---|
   287  #                |first|単位時間(interval)ごとに区切り、先頭の値を使用する。データが存在しないintervalはnullとなる。|
   288  #                |last|単位時間(interval)ごとに区切り、先頭の値を使用する。データが存在しないintervalはnullとなる。|
   289  #              enum:
   290  #                - first
   291  #                - last
   292  #              type: string
   293  #          required:
   294  #            - method
   295  #            - target
   296  #          title: Aggregation(Location)
   297  #          type: object
   298      SeriesRequest:
   299        type: object
   300        required:
   301          - series_id
   302          - timestamp
   303        properties:
   304          location:
   305            $ref: '#/components/schemas/CollectionLocation'
   306          measurements:
   307            type: object
   308            additionalProperties: true
   309          series_id:
   310            type: string
   311            pattern: ^[a-zA-Z0-9]{1,10}:[a-zA-Z0-9]{1}[a-zA-Z0-9-_]{1,34}[a-zA-Z0-9]{1}$
   312          timestamp:
   313            type: integer
   314            format: int64
   315      SeriesBulkRequest:
   316        type: object
   317        required:
   318          - data
   319          - series_id
   320        properties:
   321          data:
   322            type: array
   323            items:
   324              $ref: '#/components/schemas/SeriesRequest'
   325      SeriesDataBulkRequest:
   326        type: object
   327        properties:
   328          data:
   329            type: array
   330            maxItems: 36000
   331            description: 時系列データの配列、配列の長さ上限 36000
   332            items:
   333              $ref: '#/components/schemas/SeriesDataLocationUnix'
   334        required:
   335          - data
   336      SeriesDataRequest:
   337        type: object
   338        properties:
   339          location:
   340            $ref: '#/components/schemas/SeriesDataLocation'
   341          measurements:
   342            type: object
   343            additionalProperties: true
   344            description: |-
   345              計測値。送信可能なプロパティはcollectionによって異なる。
   346              collectionごとの定義は[Available Collections](./docs/available-collections.html)を参照。
   347  
   348              以下の場合はリクエスト不正となる。
   349              - collectionに定義されていないプロパティがmeasurementsに含まれる場合
   350              - measurementsのJSON Objectのサイズが350KB以上の場合
   351      SeriesImage:
   352        example:
   353          image: /9j/4AAQSkZJRgABAQEAYwBjAAD/4QBaRXhpZgAA...
   354          timestamp: '{}'
   355          image_type: jpeg
   356        properties:
   357          timestamp:
   358            type: string
   359          image:
   360            description: base64エンコードされた画像データ
   361            example: /9j/4AAQSkZJRgABAQEAYwBjAAD/4QBaRXhpZgAA...
   362            type: string
   363          image_type:
   364            description: 画像データのフォーマット
   365            enum:
   366              - jpeg
   367              - png
   368            example: jpeg
   369            type: string
   370        required:
   371          - image
   372          - image_type
   373          - timestamp
   374        type: object
   375      SeriesDataLocationUnix:
   376        type: object
   377        properties:
   378          location:
   379            $ref: '#/components/schemas/SeriesDataLocation'
   380          measurements:
   381            type: object
   382            additionalProperties: true
   383            description: |-
   384              計測値。送信可能なプロパティはcollectionによって異なる。
   385              collectionごとの定義は[Available Collections](./docs/available-collections.html)を参照。
   386  
   387              以下の場合はリクエスト不正となる。
   388              - collectionに定義されていないプロパティがmeasurementsに含まれる場合
   389              - measurementsのJSON Objectのサイズが350KB以上の場合
   390          timestamp:
   391            type: string
   392      SeriesDataLocation:
   393        description: デバイス位置情報。コレクションの定義に依存。schema.location_typeが”POINT“の場合必須、”NONE”の場合はlocationをリクエストに含めることはできない
   394        example:
   395          type: Point
   396          coordinates:
   397            - 138.5
   398            - 48.2
   399        nullable: true
   400        properties:
   401          type:
   402            description: Point固定
   403            enum:
   404              - Point
   405            example: Point
   406            type: string
   407          coordinates:
   408            type: array
   409            items:
   410              type: number
   411        required:
   412          - coordinates
   413          - type
   414        type: object
   415      SeriesAggregations:
   416        type: object
   417        properties:
   418          intervals:
   419            description: intervalの開始時刻の配列
   420            items:
   421              description: intervalの開始時刻。UNIXタイム(ミリ秒)
   422              example: 1594282220566
   423              format: int64
   424              maximum: 253402300799999
   425              type: integer
   426            type: array
   427          total_counts:
   428            description: intervalごとの時系列データ件数の配列
   429            items:
   430              description: intervalごとの時系列データ件数
   431              example: 10
   432              format: int64
   433              minimum: 0
   434              type: integer
   435            type: array
   436          aggregations:
   437            description: 集計結果の配列。リクエストで指定された集計対象・集計方法の順で並んでいる
   438            items: {}
   439  #            $ref: '#/components/schemas/SeriesAggregation'
   440            maxItems: 10
   441            type: array
   442        required:
   443          - intervals
   444          - total_counts
   445      SeriesAggregation:
   446        type: object
   447        properties:
   448          target:
   449            description: リクエストボディで指定された集計対象項目
   450            example: $.measurements.speed
   451            type: string
   452          method:
   453            description: リクエストボディで指定された集計方法
   454            enum:
   455              - first
   456              - last
   457              - average
   458              - max
   459              - min
   460              - sum
   461            example: average
   462            type: string
   463          counts:
   464            description: intervalごとの集計対象項目が有効だったデータ件数の配列
   465            items:
   466              description: intervalごとの集計対象項目が有効だったデータ件数
   467              example: 8
   468              format: int64
   469              minimum: 0
   470              type: integer
   471            type: array
   472          values:
   473            description: intervalごとの集計結果の配列
   474            type: array
   475  
   476        #          items:
   477  ##            anyOf:
   478  ##              - description: integer型の計測値の集計結果
   479  ##                type: integer
   480  ##              - description: number型の計測値の集計結果
   481  ##                type: number
   482  ##              - description: string型の計測値の集計結果
   483  ##                type: string
   484  ##              - description: boolean型の計測値の集計結果
   485  ##                type: boolean
   486  ##              - description: 位置情報の集計結果
   487  ##                items:
   488  ##                  anyOf:
   489  ##                    - description: 経度
   490  ##                      example: 138.5
   491  ##                      format: double
   492  ##                      maximum: 180
   493  ##                      minimum: -180
   494  ##                    - description: 緯度
   495  ##                      example: 48.2
   496  ##                      format: double
   497  ##                      maximum: 90
   498  ##                      minimum: -90
   499  ##                    - description: 高度
   500  ##                      example: 12.3
   501  ##                      format: double
   502  ##                  type: number
   503  #                maxItems: 3
   504  #                minItems: 2
   505  #                title: Coordinate
   506  #                type: array
   507        required:
   508          - counts
   509          - method
   510          - target
   511          - values
   512      RecordedDates:
   513        type: object
   514        properties:
   515          dates:
   516            description: データが存在する日付のリスト Ex.[1, 20, 22, 23]
   517            items:
   518              description: 該当するデータ
   519              example: 11
   520              format: int64
   521              maximum: 31
   522              minimum: 1
   523              type: integer
   524            maxItems: 31
   525            type: array
   526            uniqueItems: true
   527        required:
   528          - dates