Skip to content

Latest commit

 

History

History
88 lines (61 loc) · 2.57 KB

HttpProtocolV1.md

File metadata and controls

88 lines (61 loc) · 2.57 KB

HTTP Protocol (version 1)
Mappings Microservice

Jobs microservice implements a HTTP compatible API, that can be accessed on configured port. All input and output data is serialized in JSON format. Errors are returned in standard format.

Operations

Method: 'POST', route '/v1/mappings/get_collection_names'

Get all collections names

Request body:

  • none

Response body: items:Arary - array with collection names

Method: 'POST', route '/v1/mappings/get_mappings'

Get mapping by filter

Request body:

  • filter: Object
    • id: string - (optional) unique mapping id
    • collection: string - (optional) mapping collection name
    • internal_id: string - (optional) internal id
    • external_id: string - (optional) external id
    • search: string - (optional) search pattern in internal_id and external_id fields
  • paging: Object
    • skip: int - (optional) start of page (default: 0). Operation returns paged result
    • take: int - (optional) page length (max: 100). Operation returns paged result

Response body:

  • page: DataPage - page with retrived mappings

Method: 'POST', route '/v1/mappings/add_mapping'

Add mapping

Request body:

  • collection: string - collection name
  • internal_id: string - internal id
  • external_id: string - external id
  • ttl: number - Time to live in ms

Response body:

  • none

Method: 'POST', route '/v1/mappings/map_to_internal'

Get internal id by external id and collection name

Request body:

  • collection: string - collecton name
  • external_id: string - external id value

Response body:

  • internal_id: string - internal id value

Method: 'POST', route 'map_to_external'

Get external id by internal id and collection name

Request body:

  • collection: string - collecton name
  • internal_id: string - external id value

Response body:

  • external_id: string - external id value

Method: 'POST', route '/v1/mappings/delete_mapping'

Delete mapping by

Request body:

  • collection: string - collecton name
  • internal_id: string - external id value
  • external_id: string - external id value

Response body:

  • none