search cancel

Export Folder in Version 21.0 REST API

book

Article ID: 228610

calendar_today

Updated On:

Products

CA Automic One Automation

Issue/Introduction

Here is a GET REST call to export a folder and its contents.  The folder here is:

REST/EXAMPLES/FOLDEROBJECTS

and within it are two objects:
JOB1
JOB2

GET {{URLROOT}}://{{HOSTNAME}}:{{PORT}}/{{APIURL}}/{{APIVERSION}}/{{CLIENT}}/folderobjects/REST/EXAMPLES/FOLDEROBJECTS

See alsoAE REST API documentation 

 

GET /{client_id}/folderobjects/{folder_path} Export all objects from a folder recursively

Cause

How To

Environment

Release : 21.0

Component :

Resolution

The result of the GET:

{
  "data" : [ {
    "data" : {
      "fold" : {
        "metadata" : {
          "version" : "21.0.0"
        },
        "general_attributes" : {
          "type" : "FOLD",
          "name" : "FOLDEROBJECTS"
        }
      }
    },
    "path" : ""
  }, {
    "data" : {
      "jobs" : {
        "metadata" : {
          "version" : "21.0.0"
        },
        "general_attributes" : {
          "type" : "JOBS",
          "name" : "JOB1",
          "max_parallel_action" : 1,
          "mrt_time" : "000000",
          "inherit_output_filter" : "N",
          "platform" : "WINDOWS",
          "queue" : "CLIENT_QUEUE",
          "auto_deactivation" : "A",
          "minimum_ae_version" : "11.2"
        },
        "job_attributes" : {
          "agent" : "<WIN>",
          "job_report_path" : "2",
          "platform" : "WINDOWS",
          "win_report_by_script" : "0",
          "win_work_dir" : "c:\\",
          "win_view" : "0",
          "win_logon_as_batch" : "0",
          "job_object" : "",
          "win_cmd" : "",
          "win_typ" : "0",
          "win_show_at_desktop" : "0"
        },
        "scripts" : [ {
          "process" : [ "! insert these lines in your script to determine if an error occurred", "!", "! @set retcode=%errorlevel%", "! @if NOT %ERRORLEVEL% == 0 goto :retcode", null ]
        } ]
      }
    },
    "path" : "FOLDEROBJECTS"
  }, {
    "data" : {
      "jobs" : {
        "metadata" : {
          "version" : "21.0.0"
        },
        "general_attributes" : {
          "type" : "JOBS",
          "name" : "JOB2",
          "max_parallel_action" : 1,
          "mrt_time" : "000000",
          "inherit_output_filter" : "N",
          "platform" : "WINDOWS",
          "queue" : "CLIENT_QUEUE",
          "auto_deactivation" : "A",
          "minimum_ae_version" : "11.2"
        },
        "job_attributes" : {
          "agent" : "<WIN>",
          "job_report_path" : "2",
          "platform" : "WINDOWS",
          "win_report_by_script" : "0",
          "win_work_dir" : "c:\\",
          "win_view" : "0",
          "win_logon_as_batch" : "0",
          "job_object" : "",
          "win_cmd" : "",
          "win_typ" : "0",
          "win_show_at_desktop" : "0"
        },
        "scripts" : [ {
          "process" : [ "! insert these lines in your script to determine if an error occurred", "!", "! @set retcode=%errorlevel%", "! @if NOT %ERRORLEVEL% == 0 goto :retcode", null ]
        } ]
      }
    },
    "path" : "FOLDEROBJECTS"
  } ]
}

 

Additional Information

For an example of Importing a folder and objects, please see the article: Import Folder in Version 21.0 REST API

Attachments