SlideShare a Scribd company logo
1 of 13
Download to read offline
promoter
A Python module for migrating
objects between JSSs
A bit of backstory
• A topic came in from the internal all.tech@ list:
“promote everything from a test environment to prod”
• Discussion was focused on migrating or promoting a policy from test/
staging to prod
• It was agreed that it was better done manually
• I took the idea and starting looking into scripting
The original idea:
• Migrate a policy from one JSS to another
• Policies are complex JSS objects
• To ‘promote’ a policy you need to fulfill its dependencies first
• Parse through the XML, find these dependencies and migrate them
one-by-one before finally posting the policy
The holdup?
• The 8.x series REST API lacked support for some of the objects that
would be in a policy (e.g. scripts)
• A shell script wasn’t the right means to accomplish this…
• …I didn’t know Python
So, here comes v9…
• Didn’t do much work on promoter
• A PSE found out about it from a Developer…
• The first version of promoter written over the weekend
Some good stuff
• The first Python project I ever wrote
• Decent command line interface
• Standard library only
• Multi-platform
In hindsight, it was ugly
• Monolithic script
• All function and no class
• Written as a stand-alone utility
• Well recieved, but other priorities took up my time
Coming back to promoter
• JAMF’s Production JSS is hosted
• No direct database access
• How do I replicate my production environment as closely as
possible?
• Hey, I think I wrote something that handled a similar idea once…
A JSS to JSS replication in 14 seconds

(at 25000% speed…)
The new version
• Ditched utility concept, now a module
• A few core functions using a lightweight JSS REST API wrapper
• ‘Manifests’ are used to manipulate the XML into the desired state
Manifest?
• A dictionary that defines actions to take on the
XML of an object
• ‘exclude’ will remove elements
• ‘override’ will replace the value for an element
with a new one
• ‘inject’ will create an element with a value at the
provided path in the XML
• ‘collections’ is the path to a collection in the XML
where the ID elements need to be removed
{

objectName: {

'exclude': [

Element/Path1,

Element/Path2

],

'override': {

Element/Path1: NewValue,

Element/Path2: NewValue

},

'inject': {

NewElement/Path1: Value,

NewElement/Path2: Value

},

'collections': [

Element/Path1,

Element/Path2,

]

}

}
So where is it?
• Not quite ready for primetime
• Supports migrating whole resources, but not individual objects and
does not handle dependencies (being worked on)
• Adding in some more advanced features to address some
shortcomings (borrowing the concept of Autopkg’s Processors)
• It will be available in GitHub (remains to be seen if on my profile or
the JAMF IT Open Source project)
Thank You!
Maybe some brief Q&A?

More Related Content

What's hot

AngularJS - the folly of choice
AngularJS - the folly of choiceAngularJS - the folly of choice
AngularJS - the folly of choiceOleg Podsechin
 
Actors and Microservices - Can two walk together? - Rotem Hermon, Gigya
Actors and Microservices - Can two walk together? - Rotem Hermon, GigyaActors and Microservices - Can two walk together? - Rotem Hermon, Gigya
Actors and Microservices - Can two walk together? - Rotem Hermon, GigyaCodemotion Tel Aviv
 
Avoid memory leaks using unit tests - Swift Delhi Meetup - Chapter 15
Avoid memory leaks using unit tests - Swift Delhi Meetup - Chapter 15Avoid memory leaks using unit tests - Swift Delhi Meetup - Chapter 15
Avoid memory leaks using unit tests - Swift Delhi Meetup - Chapter 15Raunak Talwar
 
RubyConf China 2015 - Rails off assets pipeline
RubyConf China 2015 - Rails off assets pipelineRubyConf China 2015 - Rails off assets pipeline
RubyConf China 2015 - Rails off assets pipelineFlorian Dutey
 
How to build a rest api
How to build a rest apiHow to build a rest api
How to build a rest apiHoang Nguyen
 
We don't need consensus: All agreed?
We don't need consensus: All agreed?We don't need consensus: All agreed?
We don't need consensus: All agreed?Weaveworks
 
RubyConf Taiwan 2016 - Large scale Rails applications
RubyConf Taiwan 2016 - Large scale Rails applicationsRubyConf Taiwan 2016 - Large scale Rails applications
RubyConf Taiwan 2016 - Large scale Rails applicationsFlorian Dutey
 
Introduction to react native with redux
Introduction to react native with reduxIntroduction to react native with redux
Introduction to react native with reduxMike Melusky
 
Building Codealike: a journey into the developers analytics world
Building Codealike: a journey into the developers analytics worldBuilding Codealike: a journey into the developers analytics world
Building Codealike: a journey into the developers analytics worldOren Eini
 
Threading Made Easy! A Busy Developer’s Guide to Kotlin Coroutines
Threading Made Easy! A Busy Developer’s Guide to Kotlin CoroutinesThreading Made Easy! A Busy Developer’s Guide to Kotlin Coroutines
Threading Made Easy! A Busy Developer’s Guide to Kotlin CoroutinesLauren Yew
 
18 Months of Event Sourcing and CQRS Using Microsoft Orleans
18 Months of Event Sourcing and CQRS Using Microsoft Orleans18 Months of Event Sourcing and CQRS Using Microsoft Orleans
18 Months of Event Sourcing and CQRS Using Microsoft OrleansAndy Hoyle
 
Ruby is dying. What languages are cool now?
Ruby is dying. What languages are cool now?Ruby is dying. What languages are cool now?
Ruby is dying. What languages are cool now?Michał Konarski
 
Java reference objects basic
Java reference objects   basicJava reference objects   basic
Java reference objects basicIsaac Liao
 
Semi-automated bank transfers with Rails and Shinsei
Semi-automated bank transfers with Rails and ShinseiSemi-automated bank transfers with Rails and Shinsei
Semi-automated bank transfers with Rails and ShinseiDavid Stosik
 

What's hot (19)

Api crash
Api crashApi crash
Api crash
 
AngularJS - the folly of choice
AngularJS - the folly of choiceAngularJS - the folly of choice
AngularJS - the folly of choice
 
Vert.x
Vert.xVert.x
Vert.x
 
Actors and Microservices - Can two walk together? - Rotem Hermon, Gigya
Actors and Microservices - Can two walk together? - Rotem Hermon, GigyaActors and Microservices - Can two walk together? - Rotem Hermon, Gigya
Actors and Microservices - Can two walk together? - Rotem Hermon, Gigya
 
Avoid memory leaks using unit tests - Swift Delhi Meetup - Chapter 15
Avoid memory leaks using unit tests - Swift Delhi Meetup - Chapter 15Avoid memory leaks using unit tests - Swift Delhi Meetup - Chapter 15
Avoid memory leaks using unit tests - Swift Delhi Meetup - Chapter 15
 
RubyConf China 2015 - Rails off assets pipeline
RubyConf China 2015 - Rails off assets pipelineRubyConf China 2015 - Rails off assets pipeline
RubyConf China 2015 - Rails off assets pipeline
 
How to build a rest api
How to build a rest apiHow to build a rest api
How to build a rest api
 
We don't need consensus: All agreed?
We don't need consensus: All agreed?We don't need consensus: All agreed?
We don't need consensus: All agreed?
 
RubyConf Taiwan 2016 - Large scale Rails applications
RubyConf Taiwan 2016 - Large scale Rails applicationsRubyConf Taiwan 2016 - Large scale Rails applications
RubyConf Taiwan 2016 - Large scale Rails applications
 
Introduction to react native with redux
Introduction to react native with reduxIntroduction to react native with redux
Introduction to react native with redux
 
Building Codealike: a journey into the developers analytics world
Building Codealike: a journey into the developers analytics worldBuilding Codealike: a journey into the developers analytics world
Building Codealike: a journey into the developers analytics world
 
Threading Made Easy! A Busy Developer’s Guide to Kotlin Coroutines
Threading Made Easy! A Busy Developer’s Guide to Kotlin CoroutinesThreading Made Easy! A Busy Developer’s Guide to Kotlin Coroutines
Threading Made Easy! A Busy Developer’s Guide to Kotlin Coroutines
 
18 Months of Event Sourcing and CQRS Using Microsoft Orleans
18 Months of Event Sourcing and CQRS Using Microsoft Orleans18 Months of Event Sourcing and CQRS Using Microsoft Orleans
18 Months of Event Sourcing and CQRS Using Microsoft Orleans
 
Ruby is dying. What languages are cool now?
Ruby is dying. What languages are cool now?Ruby is dying. What languages are cool now?
Ruby is dying. What languages are cool now?
 
Java reference objects basic
Java reference objects   basicJava reference objects   basic
Java reference objects basic
 
Munchkin
MunchkinMunchkin
Munchkin
 
Intro to React
Intro to ReactIntro to React
Intro to React
 
Semi-automated bank transfers with Rails and Shinsei
Semi-automated bank transfers with Rails and ShinseiSemi-automated bank transfers with Rails and Shinsei
Semi-automated bank transfers with Rails and Shinsei
 
React101 v3
React101 v3React101 v3
React101 v3
 

Similar to Promoter – A Python Project for Replicating a JSS via the API

MVC and Entity Framework 4
MVC and Entity Framework 4MVC and Entity Framework 4
MVC and Entity Framework 4James Johnson
 
React talk, GrunnJs 24 September 2014
React talk, GrunnJs 24 September 2014React talk, GrunnJs 24 September 2014
React talk, GrunnJs 24 September 2014_jjoos_
 
Javascript classes and scoping
Javascript classes and scopingJavascript classes and scoping
Javascript classes and scopingPatrick Sheridan
 
ASP.NET MVC and Entity Framework 4
ASP.NET MVC and Entity Framework 4ASP.NET MVC and Entity Framework 4
ASP.NET MVC and Entity Framework 4James Johnson
 
Introduction to React native
Introduction to React nativeIntroduction to React native
Introduction to React nativeDhaval Barot
 
How to use UseContext Hook in React.pptx
How to use UseContext Hook in React.pptxHow to use UseContext Hook in React.pptx
How to use UseContext Hook in React.pptxBOSC Tech Labs
 
Kevin Whinnery: Write Better JavaScript
Kevin Whinnery: Write Better JavaScriptKevin Whinnery: Write Better JavaScript
Kevin Whinnery: Write Better JavaScriptAxway Appcelerator
 
xAPI Vocabulary Stone Soup: LAK 2016 JISC Learning Analytics Hackathon
xAPI Vocabulary Stone Soup: LAK 2016 JISC Learning Analytics HackathonxAPI Vocabulary Stone Soup: LAK 2016 JISC Learning Analytics Hackathon
xAPI Vocabulary Stone Soup: LAK 2016 JISC Learning Analytics HackathonRussell Duhon
 
React JS; all concepts. Contains React Features, JSX, functional & Class comp...
React JS; all concepts. Contains React Features, JSX, functional & Class comp...React JS; all concepts. Contains React Features, JSX, functional & Class comp...
React JS; all concepts. Contains React Features, JSX, functional & Class comp...Karmanjay Verma
 
Professionalizing the Front-end
Professionalizing the Front-endProfessionalizing the Front-end
Professionalizing the Front-endJordi Anguela
 
Introduction to React by Ebowe Blessing
Introduction to React by Ebowe BlessingIntroduction to React by Ebowe Blessing
Introduction to React by Ebowe BlessingBlessing Ebowe
 
Building an Activity Feed with Cassandra
Building an Activity Feed with CassandraBuilding an Activity Feed with Cassandra
Building an Activity Feed with CassandraMark Dunphy
 
Introduction to Design Patterns in Javascript
Introduction to Design Patterns in JavascriptIntroduction to Design Patterns in Javascript
Introduction to Design Patterns in JavascriptSanthosh Kumar Srinivasan
 
DCI DDD-BE April 2015
DCI DDD-BE April 2015DCI DDD-BE April 2015
DCI DDD-BE April 2015Herman Peeren
 
OOP History and Core Concepts
OOP History and Core ConceptsOOP History and Core Concepts
OOP History and Core ConceptsNghia Bui Van
 
NinjaScript 2010-10-14
NinjaScript 2010-10-14NinjaScript 2010-10-14
NinjaScript 2010-10-14lrdesign
 
SharePoint and the User Interface with JavaScript
SharePoint and the User Interface with JavaScriptSharePoint and the User Interface with JavaScript
SharePoint and the User Interface with JavaScriptRegroove
 

Similar to Promoter – A Python Project for Replicating a JSS via the API (20)

MVC and Entity Framework 4
MVC and Entity Framework 4MVC and Entity Framework 4
MVC and Entity Framework 4
 
React talk, GrunnJs 24 September 2014
React talk, GrunnJs 24 September 2014React talk, GrunnJs 24 September 2014
React talk, GrunnJs 24 September 2014
 
Javascript classes and scoping
Javascript classes and scopingJavascript classes and scoping
Javascript classes and scoping
 
ASP.NET MVC and Entity Framework 4
ASP.NET MVC and Entity Framework 4ASP.NET MVC and Entity Framework 4
ASP.NET MVC and Entity Framework 4
 
Real World MVC
Real World MVCReal World MVC
Real World MVC
 
Introduction to React native
Introduction to React nativeIntroduction to React native
Introduction to React native
 
How to use UseContext Hook in React.pptx
How to use UseContext Hook in React.pptxHow to use UseContext Hook in React.pptx
How to use UseContext Hook in React.pptx
 
Kevin Whinnery: Write Better JavaScript
Kevin Whinnery: Write Better JavaScriptKevin Whinnery: Write Better JavaScript
Kevin Whinnery: Write Better JavaScript
 
xAPI Vocabulary Stone Soup: LAK 2016 JISC Learning Analytics Hackathon
xAPI Vocabulary Stone Soup: LAK 2016 JISC Learning Analytics HackathonxAPI Vocabulary Stone Soup: LAK 2016 JISC Learning Analytics Hackathon
xAPI Vocabulary Stone Soup: LAK 2016 JISC Learning Analytics Hackathon
 
React introduction
React introductionReact introduction
React introduction
 
React JS; all concepts. Contains React Features, JSX, functional & Class comp...
React JS; all concepts. Contains React Features, JSX, functional & Class comp...React JS; all concepts. Contains React Features, JSX, functional & Class comp...
React JS; all concepts. Contains React Features, JSX, functional & Class comp...
 
React.js at Cortex
React.js at CortexReact.js at Cortex
React.js at Cortex
 
Professionalizing the Front-end
Professionalizing the Front-endProfessionalizing the Front-end
Professionalizing the Front-end
 
Introduction to React by Ebowe Blessing
Introduction to React by Ebowe BlessingIntroduction to React by Ebowe Blessing
Introduction to React by Ebowe Blessing
 
Building an Activity Feed with Cassandra
Building an Activity Feed with CassandraBuilding an Activity Feed with Cassandra
Building an Activity Feed with Cassandra
 
Introduction to Design Patterns in Javascript
Introduction to Design Patterns in JavascriptIntroduction to Design Patterns in Javascript
Introduction to Design Patterns in Javascript
 
DCI DDD-BE April 2015
DCI DDD-BE April 2015DCI DDD-BE April 2015
DCI DDD-BE April 2015
 
OOP History and Core Concepts
OOP History and Core ConceptsOOP History and Core Concepts
OOP History and Core Concepts
 
NinjaScript 2010-10-14
NinjaScript 2010-10-14NinjaScript 2010-10-14
NinjaScript 2010-10-14
 
SharePoint and the User Interface with JavaScript
SharePoint and the User Interface with JavaScriptSharePoint and the User Interface with JavaScript
SharePoint and the User Interface with JavaScript
 

More from macbrained

Munki at Facebook
Munki at FacebookMunki at Facebook
Munki at Facebookmacbrained
 
Provisioning Certificates
Provisioning CertificatesProvisioning Certificates
Provisioning Certificatesmacbrained
 
Macbrained Mentors: Career Dev Tools
Macbrained Mentors: Career Dev ToolsMacbrained Mentors: Career Dev Tools
Macbrained Mentors: Career Dev Toolsmacbrained
 
Career dev-tools
Career dev-toolsCareer dev-tools
Career dev-toolsmacbrained
 
Introducing Docker to Mac Management – Nick McSpadden
Introducing Docker to Mac Management – Nick McSpaddenIntroducing Docker to Mac Management – Nick McSpadden
Introducing Docker to Mac Management – Nick McSpaddenmacbrained
 
Imaging, The Facebook Way by Luke Robles
Imaging, The Facebook Way by Luke RoblesImaging, The Facebook Way by Luke Robles
Imaging, The Facebook Way by Luke Roblesmacbrained
 

More from macbrained (6)

Munki at Facebook
Munki at FacebookMunki at Facebook
Munki at Facebook
 
Provisioning Certificates
Provisioning CertificatesProvisioning Certificates
Provisioning Certificates
 
Macbrained Mentors: Career Dev Tools
Macbrained Mentors: Career Dev ToolsMacbrained Mentors: Career Dev Tools
Macbrained Mentors: Career Dev Tools
 
Career dev-tools
Career dev-toolsCareer dev-tools
Career dev-tools
 
Introducing Docker to Mac Management – Nick McSpadden
Introducing Docker to Mac Management – Nick McSpaddenIntroducing Docker to Mac Management – Nick McSpadden
Introducing Docker to Mac Management – Nick McSpadden
 
Imaging, The Facebook Way by Luke Robles
Imaging, The Facebook Way by Luke RoblesImaging, The Facebook Way by Luke Robles
Imaging, The Facebook Way by Luke Robles
 

Recently uploaded

Streamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project SetupStreamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project SetupFlorian Wilhelm
 
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek SchlawackFwdays
 
Unleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding ClubUnleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding ClubKalema Edgar
 
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)Mark Simos
 
Beyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
Beyond Boundaries: Leveraging No-Code Solutions for Industry InnovationBeyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
Beyond Boundaries: Leveraging No-Code Solutions for Industry InnovationSafe Software
 
Search Engine Optimization SEO PDF for 2024.pdf
Search Engine Optimization SEO PDF for 2024.pdfSearch Engine Optimization SEO PDF for 2024.pdf
Search Engine Optimization SEO PDF for 2024.pdfRankYa
 
"Federated learning: out of reach no matter how close",Oleksandr Lapshyn
"Federated learning: out of reach no matter how close",Oleksandr Lapshyn"Federated learning: out of reach no matter how close",Oleksandr Lapshyn
"Federated learning: out of reach no matter how close",Oleksandr LapshynFwdays
 
Story boards and shot lists for my a level piece
Story boards and shot lists for my a level pieceStory boards and shot lists for my a level piece
Story boards and shot lists for my a level piececharlottematthew16
 
"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr Bagan"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr BaganFwdays
 
Commit 2024 - Secret Management made easy
Commit 2024 - Secret Management made easyCommit 2024 - Secret Management made easy
Commit 2024 - Secret Management made easyAlfredo García Lavilla
 
Connect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck PresentationConnect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck PresentationSlibray Presentation
 
Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?Mattias Andersson
 
Designing IA for AI - Information Architecture Conference 2024
Designing IA for AI - Information Architecture Conference 2024Designing IA for AI - Information Architecture Conference 2024
Designing IA for AI - Information Architecture Conference 2024Enterprise Knowledge
 
Anypoint Exchange: It’s Not Just a Repo!
Anypoint Exchange: It’s Not Just a Repo!Anypoint Exchange: It’s Not Just a Repo!
Anypoint Exchange: It’s Not Just a Repo!Manik S Magar
 
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...Patryk Bandurski
 
Artificial intelligence in cctv survelliance.pptx
Artificial intelligence in cctv survelliance.pptxArtificial intelligence in cctv survelliance.pptx
Artificial intelligence in cctv survelliance.pptxhariprasad279825
 
My INSURER PTE LTD - Insurtech Innovation Award 2024
My INSURER PTE LTD - Insurtech Innovation Award 2024My INSURER PTE LTD - Insurtech Innovation Award 2024
My INSURER PTE LTD - Insurtech Innovation Award 2024The Digital Insurer
 
Advanced Test Driven-Development @ php[tek] 2024
Advanced Test Driven-Development @ php[tek] 2024Advanced Test Driven-Development @ php[tek] 2024
Advanced Test Driven-Development @ php[tek] 2024Scott Keck-Warren
 
Developer Data Modeling Mistakes: From Postgres to NoSQL
Developer Data Modeling Mistakes: From Postgres to NoSQLDeveloper Data Modeling Mistakes: From Postgres to NoSQL
Developer Data Modeling Mistakes: From Postgres to NoSQLScyllaDB
 

Recently uploaded (20)

Streamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project SetupStreamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project Setup
 
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
 
Unleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding ClubUnleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding Club
 
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
 
Beyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
Beyond Boundaries: Leveraging No-Code Solutions for Industry InnovationBeyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
Beyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
 
Search Engine Optimization SEO PDF for 2024.pdf
Search Engine Optimization SEO PDF for 2024.pdfSearch Engine Optimization SEO PDF for 2024.pdf
Search Engine Optimization SEO PDF for 2024.pdf
 
"Federated learning: out of reach no matter how close",Oleksandr Lapshyn
"Federated learning: out of reach no matter how close",Oleksandr Lapshyn"Federated learning: out of reach no matter how close",Oleksandr Lapshyn
"Federated learning: out of reach no matter how close",Oleksandr Lapshyn
 
Story boards and shot lists for my a level piece
Story boards and shot lists for my a level pieceStory boards and shot lists for my a level piece
Story boards and shot lists for my a level piece
 
"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr Bagan"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr Bagan
 
Commit 2024 - Secret Management made easy
Commit 2024 - Secret Management made easyCommit 2024 - Secret Management made easy
Commit 2024 - Secret Management made easy
 
Connect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck PresentationConnect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck Presentation
 
Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?
 
Designing IA for AI - Information Architecture Conference 2024
Designing IA for AI - Information Architecture Conference 2024Designing IA for AI - Information Architecture Conference 2024
Designing IA for AI - Information Architecture Conference 2024
 
DMCC Future of Trade Web3 - Special Edition
DMCC Future of Trade Web3 - Special EditionDMCC Future of Trade Web3 - Special Edition
DMCC Future of Trade Web3 - Special Edition
 
Anypoint Exchange: It’s Not Just a Repo!
Anypoint Exchange: It’s Not Just a Repo!Anypoint Exchange: It’s Not Just a Repo!
Anypoint Exchange: It’s Not Just a Repo!
 
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
 
Artificial intelligence in cctv survelliance.pptx
Artificial intelligence in cctv survelliance.pptxArtificial intelligence in cctv survelliance.pptx
Artificial intelligence in cctv survelliance.pptx
 
My INSURER PTE LTD - Insurtech Innovation Award 2024
My INSURER PTE LTD - Insurtech Innovation Award 2024My INSURER PTE LTD - Insurtech Innovation Award 2024
My INSURER PTE LTD - Insurtech Innovation Award 2024
 
Advanced Test Driven-Development @ php[tek] 2024
Advanced Test Driven-Development @ php[tek] 2024Advanced Test Driven-Development @ php[tek] 2024
Advanced Test Driven-Development @ php[tek] 2024
 
Developer Data Modeling Mistakes: From Postgres to NoSQL
Developer Data Modeling Mistakes: From Postgres to NoSQLDeveloper Data Modeling Mistakes: From Postgres to NoSQL
Developer Data Modeling Mistakes: From Postgres to NoSQL
 

Promoter – A Python Project for Replicating a JSS via the API

  • 1. promoter A Python module for migrating objects between JSSs
  • 2. A bit of backstory • A topic came in from the internal all.tech@ list: “promote everything from a test environment to prod” • Discussion was focused on migrating or promoting a policy from test/ staging to prod • It was agreed that it was better done manually • I took the idea and starting looking into scripting
  • 3. The original idea: • Migrate a policy from one JSS to another • Policies are complex JSS objects • To ‘promote’ a policy you need to fulfill its dependencies first • Parse through the XML, find these dependencies and migrate them one-by-one before finally posting the policy
  • 4. The holdup? • The 8.x series REST API lacked support for some of the objects that would be in a policy (e.g. scripts) • A shell script wasn’t the right means to accomplish this… • …I didn’t know Python
  • 5. So, here comes v9… • Didn’t do much work on promoter • A PSE found out about it from a Developer… • The first version of promoter written over the weekend
  • 6. Some good stuff • The first Python project I ever wrote • Decent command line interface • Standard library only • Multi-platform
  • 7. In hindsight, it was ugly • Monolithic script • All function and no class • Written as a stand-alone utility • Well recieved, but other priorities took up my time
  • 8. Coming back to promoter • JAMF’s Production JSS is hosted • No direct database access • How do I replicate my production environment as closely as possible? • Hey, I think I wrote something that handled a similar idea once…
  • 9. A JSS to JSS replication in 14 seconds
 (at 25000% speed…)
  • 10. The new version • Ditched utility concept, now a module • A few core functions using a lightweight JSS REST API wrapper • ‘Manifests’ are used to manipulate the XML into the desired state
  • 11. Manifest? • A dictionary that defines actions to take on the XML of an object • ‘exclude’ will remove elements • ‘override’ will replace the value for an element with a new one • ‘inject’ will create an element with a value at the provided path in the XML • ‘collections’ is the path to a collection in the XML where the ID elements need to be removed {
 objectName: {
 'exclude': [
 Element/Path1,
 Element/Path2
 ],
 'override': {
 Element/Path1: NewValue,
 Element/Path2: NewValue
 },
 'inject': {
 NewElement/Path1: Value,
 NewElement/Path2: Value
 },
 'collections': [
 Element/Path1,
 Element/Path2,
 ]
 }
 }
  • 12. So where is it? • Not quite ready for primetime • Supports migrating whole resources, but not individual objects and does not handle dependencies (being worked on) • Adding in some more advanced features to address some shortcomings (borrowing the concept of Autopkg’s Processors) • It will be available in GitHub (remains to be seen if on my profile or the JAMF IT Open Source project)
  • 13. Thank You! Maybe some brief Q&A?