FetchState

Use this resource with the loadState resource to synchronize object states across organizations.

Use the fetchState resource to create an object states package that you upload into other organizations using the loadState resource.

Creating the object states package includes a series of requests and responses, similar to the process of exporting assets. The end result is a ZIP file that contains the object states that you want to load to other organizations. To create the object states package, you perform the following tasks:
Send a lookup GET request to receive the object IDs for the object states you want to synchronize.
Informatica Intelligent Cloud Services returns the object IDs.
See lookup.
Send a fetchState POST request to start the job, using the object IDs returned in the lookup response.
Informatica Intelligent Cloud Services returns the job ID for the fetchState job.
See Starting a fetchState job.
Send a fetchState GET request to get the status of the job, using the fetchState job ID for the object state package.
Informatica Intelligent Cloud Services returns the job ID and status. The response can also include a list of the object IDs and associated object states that are in the package.
See Getting the fetchState job status.
Send a fetchState GET request to download the package.
Informatica Intelligent Cloud Services returns the package in a ZIP file.
See Downloading an object states package.
The object states package contains state information in a JSON file for each object. Each file name uses the following format

<task name>.<task type>.runtime.json

For example, a file with the name of mt_MappingTask106.MTT.runtime.json might contain the following data:

{
  "taskRun" : {
    "lastRuntime" : "2018-12-13T09:05:17.000Z"
  },
  "taskStateVariables" : [ {
    "category" : "TX_VARIABLE",
    "name" : "Sequence",
    "value" : "26908"
  } ]
}

You can change the following attributes in an object state file if required:
lastRuntime in the taskRun object
value in the taskStateVariables object (for mapping tasks only)
Other changes to the files in the package can cause unexpected behavior or errors.

Starting a fetchState job

Use a POST request to start a fetchState job.

POST request

To start the job, use the following URI:

/public/core/v3/fetchState

Include the following fields in the request:

Field

Type

Required

Description

name

String

Name of the fetchState job. If blank, default is job-

objects

Collection

Yes

Object IDs for the states to include in the object state package.
Informatica recommends that you include no more than 1000 objects in a package.

id

String

Yes

Included in the objects object.
Global ID for the object for which the state is requested. This can be a project, folder, or asset ID.

includeDependencies

Boolean

Included in the objects object.
Determines whether to include the dependent objects' states.
Default is True.

POST request example

You might use a request similar to the following example:

POST <baseApiUrl>/public/core/v3/fetchstate
Content-Type: application/json
Accept: application/json
INFA-SESSION-ID: <sessionId>

{
    "name" : "fetchStateJob1",
    "objects" : [
        {
            "id": "l7bgB85m5oGiXObDxwnvK9",
            "includeDependencies" : true
        },
        {
            "id": "1MW0GDAE1sFgnvWkvom7mK",
            "includeDependencies" : false
        },
        {
            "id": "iIVBNZSpUKFg4N6g2PKUox"
        }
    ]
}

POST response

If successful, returns the following information for the fetchState job:

Field

Type

Description

id

String

ID of the fetchState job.

createTime

String

Time object state package was created.

updateTime

String

Time object state package was last updated.

name

String

Name of the fetchState job.

startTime

String

Time the fetchState job was started.

endTime

String

Time the fetchState job ended.

status

Complex type

Status of the job.

state

String

Returned in the status object.
Status of the fetchState job, such as In Progress, Success, or Failed.

message

String

Returned in the status object.
Job status message.

objects

Collection

Collection of objects and object level status. Returns null if blank.

POST response examples

If successful, you might receive a response similar to the following example:

{
  "id": "7evG9CokA1whk8ehF3opKM",
  "createTime": "2018-10-26T08:15:48.502Z",
  "updateTime": "2018-10-26T08:15:48.502Z",
  "name": "fetchStateJob1",
  "startTime": "2018-10-26T08:15:48.501Z",
  "endTime": null,
  "status": {
    "state": "IN_PROGRESS",
    "message": "In Progress"
  },
  "objects": null
}

If you receive an error, you might see a response similar to the following example:

{
  "error": {
    "code": "MigrationSvc_034",
    "message": "User does not have required permissions.",
    "requestId": "2ataXVlgw3ydI1Yb2MA4sq"
  }
}

Getting the fetchState job status

Use a GET request to get the status of a fetchState job.

GET request

To get status of the fetchState job, use one of the following URIs:
To receive status of the fetchState job, use the following URI, where is the fetchState job ID

/public/core/v3/fetchState/<job id>

To receive status for each object's state in the fetchState job, use the following URI:

/public/core/v3/fetchState/<job id>?expand=objects

Continue polling the request until the state is SUCCESSFUL.

GET response

A request for status returns the following status information:

Field

Type

Description

id

String

ID of the fetchState job.

createTime

String

Time the fetchState job was created.

updateTime

String

Last time the fetchState job was updated.

name

String

Name of the fetchState job.

startTime

String

Start time of the fetchState job.

endTime

String

End time of the fetchState job.

status

Complex type

Status of the fetchState job.

state

String

Returned in the status object.
State of the fetchState job, such as In Progress, Success, or Failed.

message

String

Returned in the status object.
Job status message.

objects

Collection

Objects in the fetchState job. Returned when the URI includes ?expand=objects

id

String

Returned in the objects object.
Global ID of the object requested.

name

String

Returned in the objects object.
Name of the object..

path

String

Returned in the objects object.
Complete path of the object.

description

String

Returned in the objects object.
Description of the object.

status

Complex type

Returned in the objects object.
Status of the objec

state

String

Returned in the objects.status object.
Status of the object, such as IN PROGRESS, SUCCESS, FAILED, or SKIPPED.

message

String

Returned in the objects.status object.
Status message for the object.

GET response example

If your request for a fetchState job's status is successful, you might receive a response similar to the following example:

{
  "id": "7evG9CokA1whk8ehF3opKM",
  "createTime": "2018-10-26T08:15:48.502Z",
  "updateTime": "2018-10-26T08:15:48.502Z",
  "name": "fetchStateJob1",
  "startTime": "2018-10-26T08:15:48.501Z",
  "endTime": "2018-10-26T08:15:49.501Z",
  "status": {
    "state": "SUCCESSFUL",
    "message": "Export completed successfully."
  },
  "objects": null
}

If your request included status for individual objects, a successful response might be similar to the following example:

{
  "id": "7evG9CokA1whk8ehF3opKM",
  "createTime": "2017-10-26T08:15:49.000Z",
  "updateTime": "2017-10-26T08:15:50.000Z",
  "name": "fetchStateJob1",
  "startTime": "2018-10-26T08:15:49.000Z",
  "endTime": "2018-10-26T08:15:50.000Z",
  "status": {
    "state": "SUCCESSFUL",
    "message": "Export completed successfully."
  },
  "objects": [
    {
      "id": "1YmwRT083ZtfO04mUABaGF",
      "name": "Mapping1",
      "path": "/Mappings",
      "type": "DTEMPLATE",
      "description": "",
      "status": {
        "state": "SKIPPED",
        "message": null
      }
    },
    {
      "id": "46MhQv9oxrgbOD6qtosF8t",
      "name": "MappingTask1",
      "path": "/Tasks",
      "type": "MTT",
      "description": "",
      "status": {
        "state": "SUCCESSFUL",
        "message": null
      }
    },
    {
      "id": "7rM2ll1YjWYgHz4xiqRQO3",
      "name": "Default",
      "path": "/",
      "type": "Project",
      "description": "Auto-generated Default Project",
      "status": {
        "state": "SKIPPED",
        "message": null
      }
    },
    {
      "id": "8suj2pxCujqh5Vtmv0DsyP",
      "name": "Destination",
      "path": "null",
      "type": "Connection",
      "description": "Dst Connection",
      "status": {
        "state": "SKIPPED",
        "message": null
      }
    },
    {
            "id": "cpnxnIQMIYvkDOemLhFJ2q",
            "name": "03",
            "path": null,
            "type": "AgentGroup",
            "description": null,
            "status": {
                "state": "SKIPPED",
                "message": null
            }
        },
        {
            "id": "gJvuKZZuBifk9MfZFxtPAb",
            "name": "Source",
            "path": null,
            "type": "Connection",
            "description": "Src Connection",
            "status": {
                "state": "SKIPPED",
                "message": null
            }
        }
    ]
}

Downloading an object states package

Use a GET request to download an object states package.

GET request

To download the object states package, use the following URI:

/public/core/v3/fetchState/<id>/package

The is the fetchState job ID.

GET response

If successful, you receive the ZIP stream in the response body and the response type is application/zip.
If unsuccessful, you might receive a response similar to the following example:

{
    "error": {
        "code": "MigrationSvc_017",
        "message": "Export request with identifier [6GnKs0tkLHdE6Hpd5nsWD] doesnt exist.",
        "debugMessage": "Export request with identifier [6GnKs0tkLHdE6Hpd5nsWD] doesnt exist.",
        "requestId": "0FrZZzXiEoafqCZUPqJsYd"
    }
}