Api query


I want to get the packages deployed currently on a particular machine. How can I go about getting that from the api?



Hi Richard,

Thanks for reaching out.

Octopus doesn’t quite track the currently deployed packages on particular machines. What it does track is:

A) Which package was used during a specific deployment. It involves quite a few API calls, but it can be achieved. You can use the cmdlet Get-OctopusDeployment from the Octoposh module for this. If you don’t want to use Powershell, you can check that cmdlet’s code to see how to get the package.

OSS module site: http://octoposh.net/

Cmdlet wiki: https://github.com/Dalmirog/OctoPosh/wiki/Get-OctopusDeployment (see attached screenshot for output example)

Piece of cmdlet code to pay attention to: https://github.com/Dalmirog/OctoPosh/blob/master/Scripts/Get-OctopusDeployment.ps1#L112-L137

B) Which packages were deployed to a machine. This information is stored on a local file on each Tentacle dir on a file called DeploymentJournal.xml

If you can give me a bit more information about how and why are you trying to get this info, I could help you figuring out which method to use.

Best regards,

Thanks for the response!

I work in a large development team and we are developing a tool to very quickly see what is deployed on a particular box. The octopus interface satisfies this functionally, but we are looking to build this as a chrome plugin and get it really close to the user.

We attach the branch the name to the package after the version number. This is the information I really need to be able to show the user about the functionality currently deployed. We have alot of small separate applications and it’s very easy to lose track.

I would have thought I could have got the last deployment for each project for a particular environment and found the packages within that?

Hi Richard,

Sorry for the delay here. I actually took some time before replying back cause I wanted to discuss this with the team. Your thought that by just getting the deployment you could get the packages that were used on it is completely valid, and we believe it might be a good enhancement for us to consider in the future.

At the current state of things, the only way to get the package info is the way I explained on my previous reply. Here’s also a LinqPad script to get this information in case you’d rather see it in C#: http://help.octopusdeploy.com/discussions/questions/7205/r?go=aHR0cHM6Ly9naXRodWIuY29tL09jdG9wdXNEZXBsb3kvT2N0b3B1c0RlcGxveS1BcGkvYmxvYi9tYXN0ZXIvT2N0b3B1cy5DbGllbnQvTElOUVBhZC9MaXN0UGFja2FnZVZlcnNpb25zVXNlZEluUmVsZWFzZS5saW5x

Best regards,

Thanks, I’ll break this down and try it out!