Zooz / predator

A powerful open-source platform for load testing APIs.
https://zooz.github.io/predator/
Apache License 2.0
576 stars 109 forks source link

Add Contexts API #497

Open NivLipetz opened 4 years ago

NivLipetz commented 4 years ago

Is your feature request related to a problem? Please describe. Predator is missing the functionality of grouping resources (tests/reports/jobs) to different contexts (teams, users, organizations, etc).

Describe the solution you'd like In order to add this desired groupings so it's easier to filter and divide the resources into more relevant subgroups, a new resource context needs to be defined.

  1. Define new contexts API
    • POST /v1/contexts
    • GET /v1/contexts
    • DELETE /v1/contexts/{contextID}
  2. Context should be a simple list of values saved in the db (create new contexts table) with the following fields:
    id: STRING (primary key - string)
    name: STRING
  3. Limitations: name and id should be unique => can't create a context with the same name of one that's already created (return 400 BAD_REQUEST in this case).

Additional context Use the following file structure as a guide on how to create this new API and resource in Predator's architecture: https://github.com/Zooz/predator/blob/master/CONTRIBUTING.md#system-resource-folder-structure

sprakash57 commented 4 years ago

May i take this up?

NivLipetz commented 4 years ago

Hi @sprakash57 that would be great! We are available on our slack workspace for any questions.

sprakash57 commented 4 years ago

Sure.

sprakash57 commented 4 years ago

@NivLipetz I saw @tomcorey26 already raised a PR against it. Let me know if it needs additional work.

NivLipetz commented 4 years ago

Hi @sprakash57 I see that someone raised a PR against this issue already although it was assigned to you.. Sorry about that.

Moving forward, if you like there's an open issue that integrates this context_id to all of the other relevant Predator resources (tests, jobs, reports, etc). It's an issue with the same amount of code needed to be complete as this one. Take a look maybe you will find it suiting 😄 https://github.com/Zooz/predator/issues/495

sprakash57 commented 4 years ago

@NivLipetz can you assign #495 to me?

NivLipetz commented 4 years ago

@sprakash57 can you please request on the issue itself? won't let me assign you otherwise