Re: [smartos-discuss] Troubleshooting "Invalid JSON payload: Unexpected string" (LX Zone)

2016-09-26 Thread Nahum Shalman
Yup, looks like the missing comma was my fault... Should be fixed now:
https://wiki.smartos.org/pages/diffpages.action?pageId=3604602&originalId=5373984

As for getting a wiki account, you'll have to get one of the Joyent folks
to set you up with that.

Sorry for the confusion!
-Nahum

On Thu, Sep 22, 2016 at 12:44 PM, Matthew Parsons <
matt...@aspergerexperts.com> wrote:

>
>
> On Thu, Sep 22, 2016 at 1:24 AM, Johan Claesson  wrote:
>
>>
>>> I'm attempting to create a pretty bog-standard LX zone, copying and
>>> barely modifying the example from https://wiki.smartos.org/displ
>>> ay/DOC/LX+Branded+Zones [1] like so:
>>>
>>>

>
>> The problem is you're missing a comma on line 12.
>>
>> Tip: Use the json command to get more help regarding syntax errors.
>>
>> Eg. json -f /path/to/json_file
>> json: error: input is not JSON: Expected ',' instead of '"' at line 13,
>> column 5:
>> "primary": true
>> 
>>
>
> Excellent, that worked, thank you! (My first time using json, so not
> familiar w/ it, closest seems to be yaml which I use(d) w/ Puppet.)
>
> I checked the Wiki entry, the last edit that affected it was by a Mr.
> Shalman - I attempted to edit it, but there doesn't appear to be a location
> to create/request an account.
>
>
>
> *smartos-discuss* | Archives
> 
>  |
> Modify
> 
> Your Subscription 
>



---
smartos-discuss
Archives: https://www.listbox.com/member/archive/184463/=now
RSS Feed: https://www.listbox.com/member/archive/rss/184463/25769125-55cfbc00
Modify Your Subscription: 
https://www.listbox.com/member/?member_id=25769125&id_secret=25769125-7688e9fb
Powered by Listbox: http://www.listbox.com


Re: [smartos-discuss] Troubleshooting "Invalid JSON payload: Unexpected string" (LX Zone)

2016-09-22 Thread Daniel Carosone
JSON is not UI.

For those who don't use it regularly, there's an easy constructor for vmadm
at datasets.at that will help avoid mistakes and frustration.



---
smartos-discuss
Archives: https://www.listbox.com/member/archive/184463/=now
RSS Feed: https://www.listbox.com/member/archive/rss/184463/25769125-55cfbc00
Modify Your Subscription: 
https://www.listbox.com/member/?member_id=25769125&id_secret=25769125-7688e9fb
Powered by Listbox: http://www.listbox.com


Re: [smartos-discuss] Troubleshooting "Invalid JSON payload: Unexpected string" (LX Zone)

2016-09-22 Thread Matthew Parsons
On Thu, Sep 22, 2016 at 3:39 AM, Seth Tunstall  wrote:

> Hi Matthew,
>
> I've also found that copy-pasting from the Joyent wiki introduces
> 'something' which the json parser doesn't like, maybe nulls or tabs or
> unicode whitespace chars or whatever.
>

I figured, so that's why I turned on "show hidden" characters. :)


> Doing 'vmadm get' on one of your VMs returns nicely formatted json which
> can be easily modified.
>
> Seth
>

Excellent tip - obvious/elegant in hindsight, which is closer to how
unix(ish) should be.



---
smartos-discuss
Archives: https://www.listbox.com/member/archive/184463/=now
RSS Feed: https://www.listbox.com/member/archive/rss/184463/25769125-55cfbc00
Modify Your Subscription: 
https://www.listbox.com/member/?member_id=25769125&id_secret=25769125-7688e9fb
Powered by Listbox: http://www.listbox.com


Re: [smartos-discuss] Troubleshooting "Invalid JSON payload: Unexpected string" (LX Zone)

2016-09-22 Thread Matthew Parsons
On Thu, Sep 22, 2016 at 1:24 AM, Johan Claesson  wrote:

>
>> I'm attempting to create a pretty bog-standard LX zone, copying and
>> barely modifying the example from https://wiki.smartos.org/displ
>> ay/DOC/LX+Branded+Zones [1] like so:
>>
>>
>>>

> The problem is you're missing a comma on line 12.
>
> Tip: Use the json command to get more help regarding syntax errors.
>
> Eg. json -f /path/to/json_file
> json: error: input is not JSON: Expected ',' instead of '"' at line 13,
> column 5:
> "primary": true
> 
>

Excellent, that worked, thank you! (My first time using json, so not
familiar w/ it, closest seems to be yaml which I use(d) w/ Puppet.)

I checked the Wiki entry, the last edit that affected it was by a Mr.
Shalman - I attempted to edit it, but there doesn't appear to be a location
to create/request an account.



---
smartos-discuss
Archives: https://www.listbox.com/member/archive/184463/=now
RSS Feed: https://www.listbox.com/member/archive/rss/184463/25769125-55cfbc00
Modify Your Subscription: 
https://www.listbox.com/member/?member_id=25769125&id_secret=25769125-7688e9fb
Powered by Listbox: http://www.listbox.com


Re: [smartos-discuss] Troubleshooting "Invalid JSON payload: Unexpected string" (LX Zone)

2016-09-22 Thread Seth Tunstall
Hi Matthew,

I've also found that copy-pasting from the Joyent wiki introduces
'something' which the json parser doesn't like, maybe nulls or tabs or
unicode whitespace chars or whatever.

Doing 'vmadm get' on one of your VMs returns nicely formatted json which
can be easily modified.

Seth

On 22 September 2016 at 09:24, Johan Claesson  wrote:

> 2016-09-22 10:09 Matthew Parsons wrote:
>
> (I'm not sure if it's traditional to introduce oneself here, I'll include
>> the standard "I'm new here, feel free to point to me existing
>> posts/documentation" disclaimer.)
>>
>
> Hi and welcome to the community!
>
>
>> I'm attempting to create a pretty bog-standard LX zone, copying and
>> barely modifying the example from https://wiki.smartos.org/displ
>> ay/DOC/LX+Branded+Zones [1] like so:
>>
>> {
>>> "alias": "lxtest",
>>> "brand": "lx",
>>> "kernel_version": "4.3.0",
>>> "max_physical_memory": 2048,
>>> "quota": 20,
>>> "image_uuid": "05140a7e-279f-11e6-aedf-47d4f69d2887",
>>>
>>
>> "resolvers": ["192.168.1.1","8.8.4.4"],
>>> "nics": [
>>> {
>>> "nic_tag": "admin",
>>> "ips": ["dhcp"]
>>> "primary": true
>>> }
>>> ]
>>> }
>>>
>>
>> Note that I've successfully created/run a native (joyent) zone and a KVM
>> guest, I've checked the file for hidden characters, even deleted tabs.
>> Anyone see anything here? Is that example documentation wrong? Running
>> joyent_20160915T211220Z. Thanks for any help.
>>
>>
> The problem is you're missing a comma on line 12.
> 
> Tip: Use the json command to get more help regarding syntax errors.
> 
> Eg. json -f /path/to/json_file
> json: error: input is not JSON: Expected ',' instead of '"' at line 13,
> column 5:
> "primary": true
> 
> 
> BR /Johan
> 



---
smartos-discuss
Archives: https://www.listbox.com/member/archive/184463/=now
RSS Feed: https://www.listbox.com/member/archive/rss/184463/25769125-55cfbc00
Modify Your Subscription: 
https://www.listbox.com/member/?member_id=25769125&id_secret=25769125-7688e9fb
Powered by Listbox: http://www.listbox.com


Re: [smartos-discuss] Troubleshooting "Invalid JSON payload: Unexpected string" (LX Zone)

2016-09-22 Thread Johan Claesson

2016-09-22 10:09 Matthew Parsons wrote:

(I'm not sure if it's traditional to introduce oneself here, I'll 
include the standard "I'm new here, feel free to point to me existing 
posts/documentation" disclaimer.)


Hi and welcome to the community!



I'm attempting to create a pretty bog-standard LX zone, copying and 
barely modifying the example from 
https://wiki.smartos.org/display/DOC/LX+Branded+Zones [1] like so:



{
"alias": "lxtest",
"brand": "lx",
"kernel_version": "4.3.0",
"max_physical_memory": 2048,
"quota": 20,
"image_uuid": "05140a7e-279f-11e6-aedf-47d4f69d2887",



"resolvers": ["192.168.1.1","8.8.4.4"],
"nics": [
{
"nic_tag": "admin",
"ips": ["dhcp"]
"primary": true
}
]
}


Note that I've successfully created/run a native (joyent) zone and a 
KVM guest, I've checked the file for hidden characters, even deleted 
tabs. Anyone see anything here? Is that example documentation wrong? 
Running joyent_20160915T211220Z. Thanks for any help.




The problem is you're missing a comma on line 12.

Tip: Use the json command to get more help regarding syntax errors.

Eg. json -f /path/to/json_file
json: error: input is not JSON: Expected ',' instead of '"' at line 13, 
column 5:

"primary": true



BR /Johan


---
smartos-discuss
Archives: https://www.listbox.com/member/archive/184463/=now
RSS Feed: https://www.listbox.com/member/archive/rss/184463/25769125-55cfbc00
Modify Your Subscription: 
https://www.listbox.com/member/?member_id=25769125&id_secret=25769125-7688e9fb
Powered by Listbox: http://www.listbox.com


[smartos-discuss] Troubleshooting "Invalid JSON payload: Unexpected string" (LX Zone)

2016-09-22 Thread Matthew Parsons
(I’m not sure if it’s traditional to introduce oneself here, I’ll include the 
standard “I’m new here, feel free to point to me existing posts/documentation” 
disclaimer.)

I’m attempting to create a pretty bog-standard LX zone, copying and barely 
modifying the example from 
https://wiki.smartos.org/display/DOC/LX+Branded+Zones 
 like so:

> {
>   "alias": "lxtest",
>   "brand": "lx",
>   "kernel_version": "4.3.0",
>   "max_physical_memory": 2048,
>   "quota": 20,
>   "image_uuid": "05140a7e-279f-11e6-aedf-47d4f69d2887",
>   "resolvers": ["192.168.1.1","8.8.4.4"],
>   "nics": [
> {
> "nic_tag": "admin",
> "ips": ["dhcp"]
> "primary": true
> }
>   ]
> }

Note that I’ve successfully created/run a native (joyent) zone and a KVM guest, 
I’ve checked the file for hidden characters, even deleted tabs. Anyone see 
anything here? Is that example documentation wrong? Running 
joyent_20160915T211220Z. Thanks for any help.


I suppose this could be my first feature request (once I figure out where those 
are tracked ;) - better error reporting on the validate method, at least spit 
out a line #.

-- 
“Never underestimate the bandwidth of a station wagon full of tape."


---
smartos-discuss
Archives: https://www.listbox.com/member/archive/184463/=now
RSS Feed: https://www.listbox.com/member/archive/rss/184463/25769125-55cfbc00
Modify Your Subscription: 
https://www.listbox.com/member/?member_id=25769125&id_secret=25769125-7688e9fb
Powered by Listbox: http://www.listbox.com