Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Can't get values from jobDocument #346

Open
YannickRiou opened this issue Mar 31, 2022 · 0 comments
Open

Can't get values from jobDocument #346

YannickRiou opened this issue Mar 31, 2022 · 0 comments
Labels
bug Something isn't working

Comments

@YannickRiou
Copy link

YannickRiou commented Mar 31, 2022

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.

@YannickRiou YannickRiou added the bug Something isn't working label Mar 31, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant