Problem: I want to run an API or a script to import puppet env’s instead of going to the GUI dropdown Import-> Import from smart proxy -> Select env -> update
Is there a way to do this from the CLI or an API?
There is hammer proxy import-classes
command that uses /api/smart_proxies/:id/import_puppetclasses API endpoint.
What is :id in this case? Because this can be done in Python too.
I tried the API endpoint with :id 84 and it did not work. Or am I missing something?
- u’url’:u’https://ip-10-172-64-20.ec2.internal:8443’,
- u’id’:84,
- u’name’:u’ip-10-XXX-64-XX.internal’
EDIT: This worked in Python with :id 84
Thanks!
I will try with Hammer CLI to see if its faster cause it has more options
Can I import puppet classes for a specific Environment only? Also there is the fact that I dont see my env or env id if its not imported.
Is there any work around to this?