openapi: 3.1.0
info:
  title: ows-location
  description: Location
  version: 1.0.0
servers:
- url: https://qa-ows-location.theorchard.io/
paths:
  /hello/:
    get:
      tags:
      - infra
      summary: Hello
      operationId: hello
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HelloResponse'
  /lookup/{ip}:
    get:
      tags:
      - location
      summary: Lookup
      operationId: lookupIP
      parameters:
      - name: ip
        in: path
        required: true
        schema:
          type: string
          format: ipvanyaddress
          title: Ip
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/LookupIPResponse'
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
  /lookup/batch:
    post:
      tags:
      - location
      summary: Lookup Batch
      operationId: lookupIPBatch
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/LookupIPBatchRequest'
        required: true
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                additionalProperties:
                  $ref: '#/components/schemas/LookupIPResponse'
                type: object
                title: Response Lookupipbatch
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
components:
  schemas:
    HTTPValidationError:
      properties:
        detail:
          items:
            $ref: '#/components/schemas/ValidationError'
          type: array
          title: Detail
      type: object
      title: HTTPValidationError
    HelloResponse:
      properties:
        status:
          type: string
          title: Status
          default: ok
      type: object
      title: HelloResponse
    LookupIPBatchRequest:
      properties:
        ips:
          items:
            type: string
            format: ipvanyaddress
          type: array
          maxItems: 10000
          minItems: 1
          title: Ips
        only_resolved:
          type: boolean
          title: Only Resolved
          description: Return only resolved IP addresses
          default: false
      type: object
      required:
      - ips
      title: LookupIPBatchRequest
    LookupIPResponse:
      properties:
        ip:
          type: string
          title: Ip
        resolved:
          type: boolean
          title: Resolved
          description: Indicates that provided IP address is successfully resolved.
        country_short:
          type: string
          title: Country Short
        country_long:
          type: string
          title: Country Long
        region:
          type: string
          title: Region
        city:
          type: string
          title: City
        latitude:
          type: number
          title: Latitude
        longitude:
          type: number
          title: Longitude
      type: object
      required:
      - ip
      - resolved
      - country_short
      - country_long
      - region
      - city
      - latitude
      - longitude
      title: LookupIPResponse
    ValidationError:
      properties:
        loc:
          items:
            anyOf:
            - type: string
            - type: integer
          type: array
          title: Location
        msg:
          type: string
          title: Message
        type:
          type: string
          title: Error Type
      type: object
      required:
      - loc
      - msg
      - type
      title: ValidationError
