3scale_toolbox icon indicating copy to clipboard operation
3scale_toolbox copied to clipboard

Manage Mapping Rules from commands

Open r-lam opened this issue 3 years ago • 1 comments

The toolbox can update proxy related configuration but, limited to proxy endpoint on API, it can't access proxy mapping rules endpoints since there's no command for it.

My use case is a client requirement for translate this process to CI/CD environment with scripts and is getting complex to do with API requests only.

I've already take hands on it: fork the project and start the journey with ruby. So far, manage to code list, create subcommands like:

#3scale mapping-rules list [opts] <remote> <service>
3scale -k mapping-rules create remote 2 --metric-id=6 --http-method=GET --pattern=/api 
3scale -k mapping-rules list remote 2

Any ideas or if this is useful or not?

r-lam avatar Jun 09 '22 06:06 r-lam

I think it might be useful.

JFYI, there are "indirect" ways to manage mapping rules. I can think about two ways:

  • Product export to yaml, then add/delete/update mapping rules in the yaml, product import from the yaml. The toolbox will ensure that 3scale configuration matches the one in the yaml doc.
  • Manage the mapping rules from the OpenAPI spec doc. Change your OAS operations (translated to 3scale mapping rules) and run 3scale import openapi. The toolbox will ensure that 3scale configuration matches the one in the OAS doc.

eguzki avatar Jun 09 '22 08:06 eguzki