-
Notifications
You must be signed in to change notification settings - Fork 7
Can't get values from jobDocument #346
Description
Description
I am struggling to use the job feature provided. The job document is returned as "interface{}", I didn't find any good way to unmarshall the json job file to a struct.
What I planned to do was to cast the interface to a string so that I can parse the json. But everytime I do that, I end up having map mention in the string.
If I have an example job like this, what is the good way to have each of the fields (Type, Properties, etc.) in a variable (or struct) ?
{
"Type" : "AWS::IoT::JobTemplate",
"Properties" : {
"AbortConfig" : String,
"Description" : String,
"Document" : String,
}
}
When using the DescribeJob function, I will get a jobDocument like this (for the above job file) which a pain to work with because it's nested map :
map[
Type : AWS::IoT::JobTemplate,
Properties :[map[
AbortConfig : String,
Description : String,
Document : String,
]
]
]
The example available only show the whole raw data and I was wondering how to get values from the job document easily, if you had any good workflow to get the job in json.
Thanks in advance for the help.