<html>
<head>
<style><!--
.hmmessage P
{
margin:0px;
padding:0px
}
body.hmmessage
{
font-size: 12pt;
font-family:Calibri
}
--></style></head>
<body class='hmmessage'><div dir='ltr'>Thank you Katarina for the information. Using the REST API seems simple enough. I will try different solutions and choose the best one for my needs.<br><br>BR<br>Samu<br><br><div><hr id="stopSpelling">Date: Wed, 21 Oct 2015 15:03:16 +0200<br>From: katkav@evolveum.com<br>To: midpoint@lists.evolveum.com<br>Subject: Re: [midPoint] Importing objects remotely<br><br><div style="font-family:times new roman, new york, times, serif;font-size:12pt;color:#000000;"><div class="ecxmoz-cite-prefix"><p style="" data-mce-style="margin: 0px;">Hi Samu,</p><p style="" data-mce-style="margin: 0px;"><br></p><p style="" data-mce-style="margin: 0px;">there is also possibility to create objects without accessing midPoint GUI using REST API. For example, if you want to import resource definition, you can use following curl command:</p><br> <span style="color:#333333;font-family:Arial, sans-serif;font-size:14px;line-height:1.42857;" data-mce-style="color: #333333; font-family: Arial, sans-serif; font-size: 14px; line-height: 1.42857;">curl --user </span><a class="ecxexternal-link" rel="nofollow" style="color:#326ca6;text-decoration:none;font-family:Arial, sans-serif;font-size:14px;line-height:1.42857;" data-mce-href="http://administrator:5ecr3t/" data-mce-style="color: #326ca6; text-decoration: none; font-family: Arial, sans-serif; font-size: 14px; line-height: 1.42857;" target="_blank">administrator:5ecr3t</a><span style="color:#333333;font-family:Arial, sans-serif;font-size:14px;line-height:1.42857;" data-mce-style="color: #333333; font-family: Arial, sans-serif; font-size: 14px; line-height: 1.42857;"> -H "Content-Type: application/xml" -X POST </span><a href="http://localhost:8080/midpoint/ws/rest/resources" class="ecxexternal-link" rel="nofollow" style="color:#326ca6;text-decoration:none;font-family:Arial, sans-serif;font-size:14px;line-height:20px;background-color:#ffffff;" data-mce-href="http://localhost:8080/midpoint/ws/rest/resources" data-mce-style="color: #326ca6; text-decoration: none; font-family: Arial, sans-serif; font-size: 14px; line-height: 20px; background-color: #ffffff;" target="_blank">http://localhost:8080/midpoint/ws/rest/resources</a><span style="color:#333333;font-family:Arial, sans-serif;font-size:14px;line-height:1.42857;" data-mce-style="color: #333333; font-family: Arial, sans-serif; font-size: 14px; line-height: 1.42857;"> -d <strong>@</strong>pathToYourXmls\resource.xml -v<br> <br> for other types of objects, you will need to update url with the appropriate type, e.g:<br> </span><ul><li>create connector host: <span style="color:#333333;font-family:Arial, sans-serif;font-size:14px;line-height:1.42857;" data-mce-style="color: #333333; font-family: Arial, sans-serif; font-size: 14px; line-height: 1.42857;"></span><a href="http://localhost:8080/midpoint/ws/rest/resources" class="ecxexternal-link" rel="nofollow" style="color:#326ca6;text-decoration:none;font-family:Arial, sans-serif;font-size:14px;line-height:20px;background-color:#ffffff;" data-mce-href="http://localhost:8080/midpoint/ws/rest/resources" data-mce-style="color: #326ca6; text-decoration: none; font-family: Arial, sans-serif; font-size: 14px; line-height: 20px; background-color: #ffffff;" target="_blank">http://localhost:8080/midpoint/ws/rest/connectorHosts</a></li><li>create object template: <span style="color:#333333;font-family:Arial, sans-serif;font-size:14px;line-height:20px;background-color:#ffffff;" data-mce-style="color: #333333; font-family: Arial, sans-serif; font-size: 14px; line-height: 20px; background-color: #ffffff;"><span style="line-height:1.42857;background-color:transparent;" data-mce-style="line-height: 1.42857; background-color: transparent;"></span><a href="http://localhost:8080/midpoint/ws/rest/resources" class="ecxexternal-link" rel="nofollow" style="color:#326ca6;text-decoration:none;" data-mce-href="http://localhost:8080/midpoint/ws/rest/resources" data-mce-style="color: #326ca6; text-decoration: none;" target="_blank">http://localhost:8080/midpoint/ws/rest/objectTemplates</a></span><span style="color:#333333;font-family:Arial, sans-serif;font-size:14px;line-height:20px;background-color:#ffffff;" data-mce-style="color: #333333; font-family: Arial, sans-serif; font-size: 14px; line-height: 20px; background-color: #ffffff;"></span></li></ul><br> More documentation for REST API can be found <a data-mce-href="https://wiki.evolveum.com/display/midPoint/REST+API" href="https://wiki.evolveum.com/display/midPoint/REST+API" target="_blank">in wiki</a>.<br> <br> Best regards,<br> Katarina Valalikova<br> <br> <br> Dňa 21. 10. 2015 o 13:32 Samu Viitanen napísal(a):<br></div><blockquote cite="mid:DUB117-W80D217FA9ABADFF64E72C8D1380@phx.gbl"><div dir="ltr">Thank you for your quick response Pavol. I will use the executeChanges method for now.<br> <br> - Samu<br> <br><div><hr id="ecxstopSpelling">To: <a class="ecxmoz-txt-link-abbreviated" href="mailto:midpoint@lists.evolveum.com" target="_blank" data-mce-href="mailto:midpoint@lists.evolveum.com">midpoint@lists.evolveum.com</a><br> From: <a class="ecxmoz-txt-link-abbreviated" href="mailto:mederly@evolveum.com" target="_blank" data-mce-href="mailto:mederly@evolveum.com">mederly@evolveum.com</a><br> Date: Wed, 21 Oct 2015 12:10:05 +0200<br> Subject: Re: [midPoint] Importing objects remotely<br> <br><div class="ecxmoz-cite-prefix">Samu,<br> <br> you're right: the model WS interface doesn't contain such a method. (I consider implementing it, but it's a low priority for me, mainly because of 3.3 release that is quickly coming.)<br> <br> In the meanwhile, you can safely use executeChanges method. But you need to call it one-object-at-a-time. And perhaps don't forget to set "overwrite" option. Also, set "isImport" option, if you want to evaluate search filters in the imported objects.<br> <br> Best regards,<br> Pavol<br> <br></div><blockquote cite="mid:DUB117-W9F82740047606ED1D6624D1380@phx.gbl"><div dir="ltr">Hello,<br> <br> I want to import certain objects (Connector hosts, resource references, user templates, etc.) without accessing the midPoint GUI. Is it possible to import objects through the Model WS Interface, or do I have to write a program with the Model interface to import such objects? I did not find any references or guides on how to import objects like this into midPoint.<br> <br> Best Regards<br> Samu Viitanen<br></div><br><fieldset class="ecxmimeAttachmentHeader"></fieldset><br><pre>_______________________________________________
midPoint mailing list
<a class="ecxmoz-txt-link-abbreviated" href="mailto:midPoint@lists.evolveum.com" target="_blank" data-mce-href="mailto:midPoint@lists.evolveum.com">midPoint@lists.evolveum.com</a>
<a class="ecxmoz-txt-link-freetext" href="http://lists.evolveum.com/mailman/listinfo/midpoint" target="_blank" data-mce-href="http://lists.evolveum.com/mailman/listinfo/midpoint">http://lists.evolveum.com/mailman/listinfo/midpoint</a>
</pre></blockquote><br> <br> _______________________________________________ midPoint mailing list <a class="ecxmoz-txt-link-abbreviated" href="mailto:midPoint@lists.evolveum.com" target="_blank" data-mce-href="mailto:midPoint@lists.evolveum.com">midPoint@lists.evolveum.com</a> <a class="ecxmoz-txt-link-freetext" href="http://lists.evolveum.com/mailman/listinfo/midpoint" target="_blank" data-mce-href="http://lists.evolveum.com/mailman/listinfo/midpoint">http://lists.evolveum.com/mailman/listinfo/midpoint</a></div></div><br><fieldset class="ecxmimeAttachmentHeader"></fieldset><br><pre>_______________________________________________
midPoint mailing list
<a class="ecxmoz-txt-link-abbreviated" href="mailto:midPoint@lists.evolveum.com" target="_blank" data-mce-href="mailto:midPoint@lists.evolveum.com">midPoint@lists.evolveum.com</a>
<a class="ecxmoz-txt-link-freetext" href="http://lists.evolveum.com/mailman/listinfo/midpoint" target="_blank" data-mce-href="http://lists.evolveum.com/mailman/listinfo/midpoint">http://lists.evolveum.com/mailman/listinfo/midpoint</a>
</pre></blockquote><br></div><br>_______________________________________________
midPoint mailing list
midPoint@lists.evolveum.com
http://lists.evolveum.com/mailman/listinfo/midpoint</div>                                           </div></body>
</html>