Giter Site home page Giter Site logo

Comments (6)

typhonius avatar typhonius commented on June 16, 2024 2

The best way to implement this would be through the use of a command line option e.g. --format=json. What I'm not sure about is whether this should be implemented as a trait or as an entirely separate class. I may even look at how the Symfony Table component is made and try and replicate with a JSON output component.

from acquia_cli.

lnunesbr avatar lnunesbr commented on June 16, 2024 1

No specific example for the data structure... i'd say fit the data in a key/value format

from acquia_cli.

typhonius avatar typhonius commented on June 16, 2024

Interesting idea. I'd probably want to have some kind of formatter class for outputs here so they could be overridden globally. Do you have an example of the data structure that would be of benefit here?

from acquia_cli.

willjackson avatar willjackson commented on June 16, 2024

I found this thread searching for the same option. In my case, I'm trying to retrieve a list of databases via acquiacli database:list prod:sitename to script the creation of sites.php for a multisite installation. Having the ability to return json/csv results in this case would be helpful.

from acquia_cli.

typhonius avatar typhonius commented on June 16, 2024

I've just pushed some code into a new branch #129 to test out how this could work. If you could test this out to make sure it matches what you're expecting (domain:info, domain:list, and account) then I can change some more commands over.

from acquia_cli.

lnunesbr avatar lnunesbr commented on June 16, 2024

so far, so good

~/Sites/devops/acquia/typhonius/acquia_cli : outputformats $ ./bin/acquiacli domain:list prod:mysitename dev --format=json

PHP Notice:  Trying to get property 'id' of non-object in /Users/lnunes/Sites/devops/acquia/typhonius/acquia_cli/src/Cli/CloudApi.php on line 73

Notice: Trying to get property 'id' of non-object in /Users/lnunes/Sites/devops/acquia/typhonius/acquia_cli/src/Cli/CloudApi.php on line 73
{"0":{"hostname":"mysitenamedev.prod.acquia-sites.com","flags":{"default":true,"active":false,"uptime":false,"wildcard":false},"ip_addresses":null,"cnames":null,"environment":{"id":"999999999999999999","name":"dev"},"links":{"self":{"href":"https:\/\/cloud.acquia.com\/api\/environments\/999999999999999999\/domains\/mysitenamedev.prod.acquia-sites.com"},"status":{"href":"https:\/\/cloud.acquia.com\/api\/environments\/999999999999999999\/domains\/mysitenamedev.prod.acquia-sites.com\/status"}}},"1":{"hostname":"mysitename-dev.domain.io","flags":{"default":false,"active":true,"uptime":false,"wildcard":false},"ip_addresses":null,"cnames":null,"environment":{"id":"999999999999999999","name":"dev"},"links":{"self":{"href":"https:\/\/cloud.acquia.com\/api\/environments\/999999999999999999\/domains\/mysitename-dev.domain.io"},"status":{"href":"https:\/\/cloud.acquia.com\/api\/environments\/999999999999999999\/domains\/mysitename-dev.domain.io\/status"}}}}

from acquia_cli.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.