cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Move a system from Lost and Found to a group through API

Jump to solution

Hello,

I need to transfert automatically a system stored in LnF to a different Group through the API.

My first try was the system.move names autoSort command but it just returned OK: True without moving the appropriate system to the group I specified.

The exact command was: 

curl -k -u ga:ga "https://epo_server:8443/remote/system.move?names=system1?parentGroupId=5?autoSort"

I verified the name of the system with a system.find and the Id of the group with system.findGroups. 

 

I clearly see the system in LnF, can move it (drag and drop) on the HMI but nothing happens when I try through the API.

 

My version of the ePo is 5.10.0.

 

Thanks per advance for any help or clarification!

2 Solutions

Accepted Solutions
McAfee Employee
McAfee Employee
Report Inappropriate Content
Message 6 of 8

Re: Move a system from Lost and Found to a group through API

Jump to solution

Some of the other advanced team members were testing this.  Here is what worked.  You would need to find the right group ID.

The following command would move a machine called test to a group with ID 5:
/remote/system.move?names=test&parentGroupId=5

Was my reply helpful?
If this information was helpful in any way or answered your question, will you please select Accept as Solution in my reply and together we can help other members?

View solution in original post

McAfee Employee
McAfee Employee
Report Inappropriate Content
Message 7 of 8

Re: Move a system from Lost and Found to a group through API

Jump to solution

To clarify, the command in the original post is correct but has the wrong syntax

The syntax using HTTPS should be
 
Where you use ? after the command and & between the arguments. As cdinet listed the example to follow would be:
https://eposerver01:8443/remote/system.move?names=test&parentGroupId=5

One final note, the commands are also case sensitive. 

View solution in original post

7 Replies
McAfee Employee
McAfee Employee
Report Inappropriate Content
Message 2 of 8

Re: Move a system from Lost and Found to a group through API

Jump to solution

Sorting would need to be enabled on the system and sorting criteria met.  If you do a test sort in the system tree, will it sort properly?

Was my reply helpful?
If this information was helpful in any way or answered your question, will you please select Accept as Solution in my reply and together we can help other members?

Re: Move a system from Lost and Found to a group through API

Jump to solution
I meant using Salt by "automatically", not using the AutoSort parameter.
Even though, yes I tried activating the Sorting feature on a system and retry the curk command but still nothing happens.
My other possibility is to upload a system text file (wit hthe appropriate format) to the ePo through with a curl command but can't find it...
McAfee Employee
McAfee Employee
Report Inappropriate Content
Message 4 of 8

Re: Move a system from Lost and Found to a group through API

Jump to solution

I don't know if you can use a python script or not, I am not versed on the api commands.  You can run the help command to get a list of available commands - refer to the web api scripting guide.  

https://docs.mcafee.com/bundle/epolicy-orchestrator-web-api-reference-guide/page/GUID-2503B69D-2BCE-...

Was my reply helpful?
If this information was helpful in any way or answered your question, will you please select Accept as Solution in my reply and together we can help other members?

Re: Move a system from Lost and Found to a group through API

Jump to solution
I am not using any python script sorry. Yes the help command is a little bit limited. Here I just want some clarification about one specific command...
McAfee Employee
McAfee Employee
Report Inappropriate Content
Message 6 of 8

Re: Move a system from Lost and Found to a group through API

Jump to solution

Some of the other advanced team members were testing this.  Here is what worked.  You would need to find the right group ID.

The following command would move a machine called test to a group with ID 5:
/remote/system.move?names=test&parentGroupId=5

Was my reply helpful?
If this information was helpful in any way or answered your question, will you please select Accept as Solution in my reply and together we can help other members?

View solution in original post

McAfee Employee
McAfee Employee
Report Inappropriate Content
Message 7 of 8

Re: Move a system from Lost and Found to a group through API

Jump to solution

To clarify, the command in the original post is correct but has the wrong syntax

The syntax using HTTPS should be
 
Where you use ? after the command and & between the arguments. As cdinet listed the example to follow would be:
https://eposerver01:8443/remote/system.move?names=test&parentGroupId=5

One final note, the commands are also case sensitive. 

View solution in original post

Re: Move a system from Lost and Found to a group through API

Jump to solution
Thank you very much! I was looking at the parameter setup but not at the syntax... Works fine now.

Thank you again
You Deserve an Award
Don't forget, when your helpful posts earn a kudos or get accepted as a solution you can unlock perks and badges. Those aren't the only badges, either. How many can you collect? Click here to learn more.

Community Help Hub

    New to the forums or need help finding your way around the forums? There's a whole hub of community resources to help you.

  • Find Forum FAQs
  • Learn How to Earn Badges
  • Ask for Help
Go to Community Help

Join the Community

    Thousands of customers use the McAfee Community for peer-to-peer and expert product support. Enjoy these benefits with a free membership:

  • Get helpful solutions from McAfee experts.
  • Stay connected to product conversations that matter to you.
  • Participate in product groups led by McAfee employees.
Join the Community
Join the Community