Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

RFE: Provide a parseable output (JSON / YAML) #83

Closed
nmasse-itix opened this issue Dec 14, 2018 · 3 comments
Closed

RFE: Provide a parseable output (JSON / YAML) #83

nmasse-itix opened this issue Dec 14, 2018 · 3 comments

Comments

@nmasse-itix
Copy link
Contributor

nmasse-itix commented Dec 14, 2018

The 3scale toolbox is being improved to become the recommended way to configure and deploy services in 3scale. This fits in a broader approach of Continuous Delivery that has been started by several customers / communities (I personally maintain the threescale-cicd ansible role. Those approaches are using different means to drive the 3scale admin portal, some are using the 3scale-cli other (like the threescale-cicd role) are using the 3scale REST APIs.

If we want to make the 3scale_toolbox the de facto standard for interacting with 3scale, we need it to be usable in a CI/CD approach.

At a glance, here are the features I expect from the 3scale toolbox :

Outputting JSON or YAML

Since the 3scale toolbox will be used from scripts / pipelines / etc, its output must be easily parseable by a program without any ambiguity. 

Proposition

Akin to the "oc" or "kubectl" command, 3scale toolbox output can be changed by specifying a flag in the command line. 

Exemple

By default, the 3scale toolbox output human readable information

$ 3scale-toolbox services
my-service1 (My Service 1)
my-service2 (My Service 2)
...

But a YAML output can be used instead

$ 3scale-toolbox services -o yaml
services:
- system_name: my-service1
  name: My Service 1
- system_name: my-service2
  name: My Service 2

This feature needs to be in the toolbox's core so that every plugin can leverage this feature.

@eguzki
Copy link
Member

eguzki commented Dec 12, 2019

For commands fetching a single resource or a collection of resources, json/yaml output makes all the sense.

However, for "action commands" like 3scale import openapi, what should the output look like in json/yaml format?
For example, the openapi import command, currently output looks like this:

3scale import openapi -d mytenant petstore.yaml
Updated service id: 2555417834399, name: Swagger Petstore
Service proxy updated
destroying all mapping rules
Created POST /v2/pet$ endpoint
Created PUT /v2/pet$ endpoint
Created GET /v2/pet/findByStatus$ endpoint
Activedocs exists, update!

wdyt @nmasse-itix?

@eguzki
Copy link
Member

eguzki commented Jan 31, 2020

Implemented for some commands #229

Pending to decide what to do with "task based" commands, i.e. those commands not returning resources, but runnning a list of task, like 3scale import openapi or 3scale product copy

@eguzki
Copy link
Member

eguzki commented Mar 12, 2020

Fixed #229

@eguzki eguzki closed this as completed Mar 12, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants