Previous Topic: Content REST ExamplesNext Topic: Export


Import

You can import a local file of CA Process Automation objects.

For example, send an HTTP POST request to:

http://<hostname>:7000/node/rest/CA:00074_CA:00074:01/_ops/Import

Include a request header:

Content-Type=application/xml

For example:

<ImportRequest xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
               xsi:type="p1:ImportRequest"
               xmlns:p1="http://ns.ca.com/2011/09/pam-ops" >
  <ImportLocation>/TestContent/</ImportLocation>
  <SourceLocation>C:\Program Files\CA\PAM40\standalone\.c2orepository\public\content\ITPAMContent.xml</SourceLocation>
  <OverwriteAction>ImportAndReplace</OverwriteAction>
  <SetCurrent>true</SetCurrent>
</ImportRequest>

If the library already contains an object with the specified name, set <OverwriteAction> to one of the following options:

Import

Increase the version of the imported object if an object of the same exists in the specified import folder. Overrides the release version if the same release version exists.

DoNotImport

Do not import objects with the same name as an existing object.

ImportAndReplace

Import and replace the existing object. It deletes the previous versions of the object.

The response indicates whether the import was successful:

<?xml version="1.0" encoding="utf-8"?>
<pam-ops:ImportResponse xmlns:pam-ops="http://ns.ca.com/2011/09/pam-ops"
                        xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
                        xsi:type="pam-ops:ImportResponse">
  <SuccessMessage>The specified object imported successfully.</SuccessMessage>
</pam-ops:ImportResponse>