Changing Project with powershell | Nutanix Community
Skip to main content
Solved

Changing Project with powershell

  • October 7, 2019
  • 5 replies
  • 1492 views

Hi guys,

I'm somewhat new to Nutanix and I was curious if there was a powershell command that will allow you to set the project for a VM.

Essentially I want to use scripts to deploy VM's and then when the VM is deployed move it into a project so we can track resources.

The deployment part of this is easy enough, but nothing in powershell seems to indicate it can even do this.

Is this something that can even be done? I really like the powershell integration, and I really like the SSP Prism Central and Projects. I'd really really like to be able to use both of these together.

Thanks

Best answer by Alona

Hi @ITNINJA!

I am a big PowerShell fan myself and I can see how this option would help in streamlining VMs' deployment and assignment. I had a look at several resources:
I was not able to find any reference to projects in the first two options however there is projects option in Rest API v3.0

More on API versions Nutanix API versions – What are they and what does each one do?

Hope that helps.
View original
Did this topic help you find an answer to your question?
This topic has been closed for comments

5 replies

Alona
Nutanix Employee
Forum|alt.badge.img+5
  • Nutanix Employee
  • 432 replies
  • Answer
  • October 10, 2019
Hi @ITNINJA!

I am a big PowerShell fan myself and I can see how this option would help in streamlining VMs' deployment and assignment. I had a look at several resources:
I was not able to find any reference to projects in the first two options however there is projects option in Rest API v3.0

More on API versions Nutanix API versions – What are they and what does each one do?

Hope that helps.

HITESH0801
Nutanix Employee
Forum|alt.badge.img+5
  • Nutanix Employee
  • 104 replies
  • October 22, 2019

Hello  @ITNINJA 

 @Alona answered the question beautifully. 

Just to add a new feature here of dev.nutanix.com API reference where you can generate code for the API requests. 
You can use the below-mentioned guide, select the generate code option after filling the required details(UUID of the entity in this scenario)  and select Powershell
https://www.nutanix.dev/reference/prism_central/v3/api/projects/putprojectsuuid 


  • Author
  • Voyager
  • 1 reply
  • October 22, 2019

With a little push in the right direction by Alona I was able to conjure something together.  Using a combination of Powershell and REST API.   

Thanks for the assist!


HITESH0801
Nutanix Employee
Forum|alt.badge.img+5
  • Nutanix Employee
  • 104 replies
  • October 22, 2019

That's really nice to hear @ITNINJA 

Maybe you can write a post about how you wrote the scripts and help the community grow more?

 


Alona
Nutanix Employee
Forum|alt.badge.img+5
  • Nutanix Employee
  • 432 replies
  • October 22, 2019

@ITNINJA Glad I was able to help and that you made it work in the end!