Use the commands below to ensure you are using your service principal profile before you execute the fsoc solution commands in the following sections.
Windows Example Commands:
cd C:\fsoc_projects\my_tenant
fsoc config use my-sp-profile
Unix-Mac Example Commands:
cd /fsoc_projects/my_tenant
fsoc config use my-sp-profile
Our new solution will need its own directory where all the files for the solution will be stored as well as a manifest file that contains high-level information about our solution.
Use the commands below to initialize your new solution and go to the directory that was created fo the solution.
fsoc command to initialize your solution | |
Command Format: | fsoc solution init <solution_name> |
Command Documentation: | https://developer.cisco.com/docs/fso/#!init/fsoc-solution-init |
Windows Example Commands:
cd C:\fsoc_projects\my_tenant
fsoc solution init ugottaride
cd ugottaride
Unix-Mac Example Commands:
cd /fsoc_projects/my_tenant
fsoc solution init ugottaride
cd ugottaride
You can update the various properties for your solution in the manifest.json file, but for now, you will change just one of them.
Now change your “solutionVersion” value to “0.0.1” in your manifest.json file.
While you’re developing your solution, you will likely be pushing/deploying your solution many times when iteratively making changes to it. Each time you push your solution, you must increment the version number in the manifest.json file.
Once you push a specific version of your solution, you shouldn’t push/deploy your solution again without incrementing your version number. The platform does not allow you to push a prior version.
After you push/deploy your solution for the very first time (with version 0.0.1) fsoc provides a convienient way to push/deploy your solution while automatically bumping up your version in the manifest.json file so you don’t need to manually edit the manifest.json file each time you push/deploy your solution (fsoc solution push –bump –tag dev).
Dev Tip Look at line 5 in the image below. The dependecies section will have system solution domain names added as you build out your solution using the fsoc solution commands. Take note that there will be artifacts that you manually add to your solution (without fsoc solution commands) that require you manually update your manifest.json file in the dependencies section.
Here is an example where the fmm (entitiy / topology solution) and dashui (ui solution) system solutions domain names were added by fsoc solution commands.
"dependencies": [
"fmm",
"dashui"
],
Dev Tip When using the fsoc solution commands to iteratively build your solution, you will notice that it creates new directories for the json files it creates and then adds a reference to that directory in the manifest.json file based on the type of object represented by the json files in a directory as well as the relative path to the directory containing the json files for that object type.
Notice line 43 - 46 in the image below. In later sections we will be manually adding the dashui:entityPresentation object type and location in the manifest.json file.
So What? What happens if I create the json file(s) for this in their own directory but don’t add the object definition for it in the manifest.json file?
Well, Guess What? Your solution will validate and deploy just fine, however, the Platform won’t even recognize that new object type from your json files, it simply ignores that directory and the json files within it if you don’t add an entry in the objects section in the manifest.json file.
We’ll create several new entities for our solution.