Azure / service-catalog-cli

See the upstream repository ->
https://github.com/kubernetes-incubator/service-catalog
MIT License
33 stars 14 forks source link

Use consistent formatting for all resources #37

Closed carolynvs closed 6 years ago

carolynvs commented 6 years ago

This doesn't change the behavior of any commands, just makes the output match for each resource. Closes #32

Open questions:

carolynvs commented 6 years ago

Sample output from the modified commands:

$ svc-cat get broker asb
  NAME                            URL                            STATUS
+------+-------------------------------------------------------+--------+
  asb    http://asb-azure-service-broker.asb.svc.cluster.local   Ready

$ svc-cat describe broker asb
  Name:     asb
  URL:      http://asb-azure-service-broker.asb.svc.cluster.local
  Status:   Ready - Successfully fetched catalog entries from broker @ 2017-11-21 08:40:58 -0600 CST

$ svc-cat get class azure-mysqldb
      NAME                 DESCRIPTION                             UUID
+---------------+--------------------------------+--------------------------------------+
  azure-mysqldb   Azure Database for MySQL         997b8372-8dac-40ac-ae65-758b4a5075a5
                  Service

$ svc-cat describe class azure-mysqldb
  Name:          azure-mysqldb
  Description:   Azure Database for MySQL Service
  UUID:          997b8372-8dac-40ac-ae65-758b4a5075a5
  Status:        Active
  Tags:          Azure, MySQL, Database

$ svc-cat get plan standard800
     NAME           CLASS             DESCRIPTION                         UUID
+-------------+---------------+-------------------------+--------------------------------------+
  standard800   azure-mysqldb   Standard Tier, 800 DTUs   08e4b43a-36bc-447e-a81f-8202b13e339c

$ svc-cat describe plan standard800
  Name:          standard800
  Description:   Standard Tier, 800 DTUs
  UUID:          08e4b43a-36bc-447e-a81f-8202b13e339c
  Class:         azure-mysqldb
  Status:        Active
  Free:          false

$ svc-cat get instance eager-goat-wordpress-mysql-instance
                 NAME                   NAMESPACE       CLASS          PLAN       STATUS
+-------------------------------------+-----------+---------------+-------------+--------+
  eager-goat-wordpress-mysql-instance   default     azure-mysqldb   standard800   Ready

$ svc-cat describe instance eager-goat-wordpress-mysql-instance
  Name:        eager-goat-wordpress-mysql-instance
  Namespace:   default
  Status:      Ready - The instance was provisioned successfully @ 2017-11-21 08:46:38 -0600 CST
  Class:       azure-mysqldb
  Plan:        standard800

$ svc-cat get binding eager-goat-wordpress-mysql-binding
                 NAME                  NAMESPACE                INSTANCE                 STATUS
+------------------------------------+-----------+-------------------------------------+--------+
  eager-goat-wordpress-mysql-binding   default     eager-goat-wordpress-mysql-instance   Ready

$ svc-cat describe binding eager-goat-wordpress-mysql-binding
  Name:        eager-goat-wordpress-mysql-binding
  Namespace:   default
  Status:      Ready - Injected bind result @ 2017-11-21 08:46:41 -0600 CST
  Instance:    eager-goat-wordpress-mysql-instance

I haven't change the traversal code (that's for #22 ) but I have made the formatting consistent as well

$ svc-cat describe binding eager-goat-wordpress-mysql-binding --traverse
  Name:        eager-goat-wordpress-mysql-binding
  Namespace:   default
  Status:      Ready - Injected bind result @ 2017-11-21 08:46:41 -0600 CST
  Instance:    eager-goat-wordpress-mysql-instance

Instance:
  Name:        eager-goat-wordpress-mysql-instance
  Namespace:   default
  Status:      Ready

Class:
  Name:     azure-mysqldb
  UUID:     997b8372-8dac-40ac-ae65-758b4a5075a5
  Status:   Active

Plan:
  Name:     standard800
  UUID:     08e4b43a-36bc-447e-a81f-8202b13e339c
  Status:   Active

Broker:
  Name:     asb
  Status:   Ready