Hi all,

I’m currently implementing an Admin API resource to get all bot detection
data.

Related Issue: https://github.com/wso2/product-apim/issues/8119


   - Please find the OAS definition below.

  /bot-data:

  #-----------------------------------------------------

  # Get all bot detection data

  #-----------------------------------------------------

    get:

      security:

        - OAuth2Security:

            - apim:admin

            - apim:bot_data

      produces:

        - application/json

      summary: |

        Get all bot detected data

      description: |

        Get all bot detected data

      responses:

        200:

          description: |

            OK.

            Bot detected data returned.

          headers:

            Content-Type:

              description: |

                The content type of the body.

              type: string

          schema:

            $ref: '#/definitions/BotDetectionDataList'

        500:

          description: |

            Internal Server Error.

            Analytics not enabled.

          schema:

            $ref: '#/definitions/Error'


   - The relevant schemas are shown below.

  #-----------------------------------------------------

  # The Bot Detection Data List resource

  #-----------------------------------------------------

  BotDetectionDataList:

    title: Bot Detection Data List

    properties:

      count:

        type: integer

        description: |

          Number of Bot Detection Data returned.

        example: 1

      list:

        type: array

        items:

          $ref: '#/definitions/BotDetectionData'

  #-----------------------------------------------------

  # The Bot Detection Data resource

  #-----------------------------------------------------

  BotDetectionData:

    title: Bot Detection Data

    properties:

      currentTime:

        type: integer

        description: The time of detection

        example: 1591734138413

      messageID:

        type: string

        description: The message ID

        example: urn:uuid:1ed6d2de-29df-4fed-a96a-46d2329dce65

      apiMethod:

        type: string

        description: The api method

        example: GET

      headerSet:

        type: string

        description: The header set

        example: [Accept=*/*, Host=localhost:8243, User-Agent=curl/7.58.0]

      messageBody:

        type: string

        description: The content of the message body

        example: <soapenv:Body xmlns:soapenv=\"
http://www.w3.org/2003/05/soap-envelope\"/>

      clientIp:

        type: string

        description: The IP of the client

        example: 127.0.0.1


   - The Admin API has the following resources which manages emails related
   to bot data.


*Purpose*

*Resource*

*Operation*

*Parameters*

*Parameter type*

Get configured email list

/botData/getEmailList

GET

tenantDomain

query

Add email

/botData/addEmail

POST

Email schema containing email address

body

Delete email

/botData/deleteEmail

DELETE

Uuid

query


   - In my opinion, these resources should be revamped as follows.

Description

Resource

Revamped Resource

Operation

Get configured email list

/botData/getEmailList

/bot-data/emails

GET

Add email

/botData/addEmail

/bot-data/emails

POST

Delete email

/botData/deleteEmail

/bot-data/emails/{uuid}

DELETE

Your feedback regarding this is highly appreciated.

Thank you!
-- 

*Hisan Hunais* | Software Engineer | WSO2 Inc.
(m) +94768526186 | (e) [email protected]

[image: https://wso2.com/signature] <https://wso2.com/signature>
_______________________________________________
Architecture mailing list
[email protected]
https://mail.wso2.org/cgi-bin/mailman/listinfo/architecture

Reply via email to