REST Environment API
REST Environment APIs used for Extraction, Download and Integration of Environment transfer
Extraction
URL Pattern |
/manage/environment/transfer/extraction |
Method |
POST |
Content types |
application/json, application/xml |
Parameters |
transferHandlers (eg: characteristics,lookups) |
Returns |
jobId, currentState and progress of extraction job If the job is finished, also the link to download the extraction archive as well as the protocol of the job will be returned |
Query Parameters
Parameter |
Required |
Default |
Datatype |
Parameter description |
transferHandlers |
no |
all the available handlers |
String |
A comma separated string of transfer handlers that specify the required transfer parameters for extraction of the environment. |
curl -u rest:heiler -H
"Accept: application/json"
"Content-Type: application/json"
-X POST http:
//localhost:1512/rest/V1.0/manage/environment/transfer/extraction?transferHandlers=lookups,characteristics
Result
An object including required details as follows:
JSON Result:
{
"job"
: {
"id"
:
"615"
},
"currentState"
:
"scheduled"
,
"progress"
:
0
}
XML Result:
<?xml version=
"1.0"
encoding=
"UTF-8"
standalone=
"yes"
?>
<jobProgress>
<job>
<id>
615
</id>
</job>
<currentState>scheduled</currentState>
<progress>
0
</progress>
</jobProgress>
Download
URL Pattern |
/manage/environment/transfer/{jobId}/archive |
Method |
GET |
Content types |
application/json, application/xml |
Parameters |
jobId received by triggering the extraction job |
Returns |
stream of the object to be downloaded. |
URL Parameters
Parameter |
Required |
Default |
Datatype |
Parameter description |
{jobId} |
yes |
Integer |
Unique ID of the job responsible for extraction |
curl -u rest:heiler -H
"Accept: application/octet-stream"
"Content-Type: application/json"
-X GET http:
//localhost:1512/rest/V1.0/manage/environment/transfer/615/archive
Result
A stream of the object to be downloaded is returned.
Integration
URL Pattern |
/manage/environment/transfer/integrate |
Method |
POST |
Content types |
multipart/form-data |
Parameters |
transferHandlers (eg: characteristics,lookups) |
Returns |
jobId and currentState and progress of integrate job |
Query Parameters
Parameter |
Required |
Default |
Datatype |
Parameter description |
transferHandlers |
no |
all the available handlers |
String |
A comma separated string of transfer handlers that specify the required transfer parameters for integration of the environment. |
Form Data Parameters
Parameter |
Required |
Default |
Datatype |
Parameter description |
file |
yes |
Stream |
An handler for the file stream that is required for environment integration |
curl -u rest:heiler -H
"Accept: application/json"
"Content-Type: multipart/form-data"
--data-binary
"@C:/users/shared/pim_2018-08-22_05_23_24.428.zip"
-X POST http:
//localhost:1512/rest/V1.0/manage/environment/transfer/integrate?transferHanlers=lookups,characteristics
Result
An object including required details as follows:
JSON Result:
{
"job"
: {
"id"
:
"616"
},
"currentState"
:
"scheduled"
,
"progress"
:
0
}
XML Result:
<?xml version=
"1.0"
encoding=
"UTF-8"
standalone=
"yes"
?>
<jobProgress>
<job>
<id>
616
</id>
</job>
<currentState>scheduled</currentState>
<progress>
0
</progress>
</jobProgress>
Checking the Progress of the Extraction/Integration Job
URL Pattern |
/manage/environment/transfer/{jobId} |
Method |
GET |
Content types |
application/json, application/xml |
Parameters |
jobId received by triggering the extraction job |
Returns |
jobId and currentState and progress of extraction job If the job is finished, also the link to download the extraction archive as well as the protocol of the job will be returned only for extraction job |
URL Parameters
Parameter |
Required |
Default |
Datatype |
Parameter description |
{jobId} |
yes |
Integer |
Unique ID of the job to check progress |
curl -u rest:heiler -H
"Accept: application/json"
"Content-Type: application/json"
-X GET http:
//localhost:1512/rest/V1.0/manage/environment/transfer/615
Result
An object including required details as follows:
JSON Result:
{
"job"
: {
"id"
:
"615"
},
"currentState"
:
"finished.info"
,
"progress"
:
100
,
"archiveUrl"
:
"http://localhost:1512/rest/V1.0/manage/environment/transfer/615/archive"
,
"protocol"
: {
"infoCounter"
:
0
,
"warningCounter"
:
0
,
"errorCounter"
:
0
,
"entries"
: []
}
}
XML Result:
<?xml version=
"1.0"
encoding=
"UTF-8"
standalone=
"yes"
?>
<jobProgress>
<job>
<id>
615
</id>
</job>
<currentState>finished.info</currentState>
<progress>
100
</progress>
<archiveUrl>http:
//localhost:1512/rest/V1.0/manage/environment/transfer/615/archive</archiveUrl>
<protocol>
<infoCounter>
0
</infoCounter>
<warningCounter>
0
</warningCounter>
<errorCounter>
0
</errorCounter>
<entries/>
</protocol>
</jobProgress>
Possible Values of "currentState"
State |
Value |
Discription |
SCHEDULED |
scheduled |
Server Job state constant which indicated that the job is currently scheduled |
RUNNING_OK |
running.ok |
Server Job state constant which indicated that the job is currently running and no protocol info is available, till now |
RUNNING_INFO |
running.info |
Server Job state constant which indicated that the job is currently running and info protocol entries are available |
RUNNING_WARNING |
running.warning |
Server Job state constant which indicated that the job is currently running and warning protocol entries are available |
RUNNING_ERROR |
running.error |
Server Job state constant which indicated that the job is currently running and error protocol entries are available |
FINISHED_OK |
finished.ok |
Server Job state constant which indicated that the job is currently currently finished, having only info protocol entries |
FINISHED_INFO |
finished.info |
Server Job state constant which indicated that the job is currently finished, having at least one warning protocol entry |
FINISHED_WARNING |
finished.warning |
Server Job state constant which indicated that the job is currently finished, having at least one error protocol entry |
FINISHED_ERROR |
finished.error |
Server Job state constant which indicated that the job has been canceled by the user |
CANCELED_OK |
canceled.ok |
Server Job state constant which indicated that the job has been canceled by the user, having only info protocol entries |
CANCELED_INFO |
canceled.info |
Server Job state constant which indicated that the job has been canceled by the user, having at least one warning protocol entry |
CANCELED_WARNING |
canceled.warning |
Server Job state constant which indicated that the job has been canceled by the user, having at least one error protocol entry |
CANCELED_ERROR |
canceled.error |
Server Job state constant which indicated that the job has been canceled by a kill of the server (and not a proper shutdown) |
CANCELED_SYSTEM |
canceled.system |
Server Job state constant which indicated that the job has been canceled due to a serious exception |
CANCELED_CRITICAL |
canceled.critical |
Server Job state constant which indicated that the job has been canceled during a proper server shutdown |
CANCELED_SHUTDOWN |
canceled.shutdown |
Server Job state constant which indicated that the job is still running, but a cancel has been requested, either by the user or by a server shutdown |
CANCELED_PENDING |
canceled.pending |
Server Job state constant which indicates that the job is queued and waiting for the next free execution slot |
QUEUED_WORKLOAD |
queued.workload |
All Job States, which indicate, that the job is running. |