Skip to content

Conversation

@FernandoOjeda
Copy link
Contributor

@FernandoOjeda FernandoOjeda commented Aug 11, 2020

Ordering price information improvements #1299.

Implemented:

slcli hw create-options
slcli order item-list

Things to take into implement:

Hourly and Monthly prices
Capacity restricted prices
User can pick a location to display prices in

@FernandoOjeda
Copy link
Contributor Author

FernandoOjeda commented Aug 11, 2020

I think the slcli vs create-optoins has to be refactored the same that slcli hw create-options to add the prices information:

image

Or maybe I can add a new request to shows the item prices in another table and not to add then to the existing table.

@FernandoOjeda FernandoOjeda self-assigned this Aug 11, 2020
@allmightyspiff allmightyspiff linked an issue Aug 13, 2020 that may be closed by this pull request
@allmightyspiff allmightyspiff added CLI Ordering Anything related to ordering labels Aug 13, 2020
@allmightyspiff
Copy link
Member

Yeah I agree about slcli vs|hw create-options, I'll have to think about it a bit and decide how I want the output to look while I review your current changes.

@allmightyspiff
Copy link
Member

Thanks, this is a big improvement I think. We'll tackle the vs create-options in another issue.

Big things to change:

  1. --prices should take either 0 arguments, meaning default prices. Or 1 argument, meaning location specific prices
  2. Capacity restrictions should be combined into a single column to make it easier to read
  3. When using location specific pricing, default pricing should still be shown if there is no location pricing. Hopefully that isn't too complicated to add.

Copy link
Member

@allmightyspiff allmightyspiff left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Overall this looks good, but I have some changes in mind for how location specific pricing works that I am still messing around with. I'll have the comments ready by tomorrow I hope, and will likely just push any changes to your branch.


@click.command()
@click.argument('location', required=False)
@click.option('--prices', '-p', is_flag=True, help='Use --prices to list the server item prices, and '
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

drop the help bit to the next line, so the help text doesn't have to be broken up so much

@allmightyspiff
Copy link
Member

TESTS

✔️ hw create-options --prices
✔️ hw create-options --prices dal13
✔️ hw create-options --prices tok02
✔️ order item-list --prices AMSTERDAM02 SINGLE_E31270_V6
order item-list SINGLE_E31270_V6 --prices dal13
I get the error Package dal13 does not exist, not quite sure from looking at the code why click isn't processing that field, maybe because you have type=click.UNPROCESSED?

Future Issues

Once this is merged I'll make issues for these other improvements. This change set is already getting kinda large and complex.

  • hw create-options --prices tok02 lists a few 0$ servers. I think that is because those are not available in tok02, as the others are priced correctly. These should be removed, or labeled as not available some way. We can solve that in a different issue though, since this one is already a big change.
$ ./slcli --format=table hardware create-options --prices tok02
:....................:
:    Datacenters     :
:............:.......:
: Datacenter : Value :
:............:.......:
: Tokyo 2    : tok02 :
:............:.......:
:.....................................................................................:
:                                     Sizes Prices                                    :
:...............................:.................................:........:..........:
: Size                          : Value                           : Hourly : Monthly  :
:...............................:.................................:........:..........:
: 1U 1270v3 32GB 2x2TB No-RAID  : 1U_1270_V3_2X2TB_NORAID         : 0.0000 : 0.0000   :
: 1U 1270v6 32GB 2x2TB No-RAID  : 1U_1270_V6_2X2TB_NORAID         : 0.0000 : 0.0000   :
: 1U 2174s x 64GB, 2x4TB, RAID1 : 1U_2174S_64GB_2X4TB_RAID_1      : 0.0770 : 57.0000  :
: 1U 4210s, 384GB, 2x4TB, RAID1 : 1U_4210S_384GB_2X4TB_RAID_1     : 0.0600 : 39.5500  :
: 1U 6248 384GB 1x3.8 SED JBOD  : 1U_6248S_384GB_1X3_8_SED_JBOD   : 0.4260 : 283.0000 :
: 1U 6248s, 384GB, 2x4TB, RAID1 : 1U_6248S_384GB_2X4TB_RAID_1     : 0.0770 : 57.0000  :
: 1U 6248 384 4x3.8 SED RAID-10 : 1U_6248S_384GB_4X_3_8TB_RAID_10 : 0.7400 : 492.0000 :
:...............................:.................................:........:..........:
  • break out order item-list by category, like hw create-options. Right now they are sorted by category, but I really like how hw create-options looks now. And Right Align the keyname/description fields to be easier to read.
  • I'd like item-list to behave like create-options with the datacenter name as well, instead of the keyname. I think most customers expect dal13 form, not the longer keyname form.
  • I'd like for the location specific prices to just be in the first table (replacing their generic item when applicable).

@FernandoOjeda
Copy link
Contributor Author

It is a good idea to open another issue for hw create-options --prices tok02 to avoid to lists the 0$ data.
And it would be good to open another issue to refactor the order item-list the same than hardware create-options.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

CLI Ordering Anything related to ordering

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Ordering price information improvements

2 participants