joyent/node-smartdc — Issue #9: package name encoding for space in sdc-getpackage sdc-createmachine 
Author: kevpie
Created: 2011-10-14 20:07:51+00:00
State: open

The package names returned by sdc-listpackages are unusable due to the spaces.

The package name needs to be urlencoded for scd-getpackage to work.

$ sdc-getpackage "Small 1GB"
Maximum number of retries exceeded: 4

$ scd-getpackage Small+1GB
{
"name": "Small 1GB",
"memory": 1024,
"disk": 30720,
"swap": 2048,
"default": false
}

or

$ scd-getpackage Small%201GB
{
"name": "Small 1GB",
"memory": 1024,
"disk": 30720,
"swap": 2048,
"default": false
}

scd-createmachine does not work with any of the following values for --package
* "Small 1GB"
* Small+1GB
* Small%201GB
* regular_1024
* Small\ 1GB

A space returns "Invalid request parameters"
Any other character returns "Small+1GB is an invalid package" substituting the joining charcter

The API Doc will need to be update as well.