Child pages
  • Guide to Transfer and Restore API Functions - Monitor the Transfer Session

Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

Introduction

Excerpt

When you monitor the transfer session, you check the status of the transfer session.

Use the same process for both the root and transfer sessions.

Multiexcerpt include
SpaceWithExcerptcom.atlassian.confluence.content.render.xhtml.model.resource.identifiers.SpaceResourceIdentifier@880
MultiExcerptNameTandRExcerpt
PageWithExcerptGuide to Transfer and Restore API Functions - Plan the Transfer Session

Determine the state of the transfer session

To determine the state of a transfer session, use the WHM API 1 get_transfer_session_state function.

Select the tab below that corresponds to the method by which you wish to call the function:

Localtab Group


Localtab
titleJSON API

Multiexcerpt include
SpaceWithExcerptcom.atlassian.confluence.content.render.xhtml.model.resource.identifiers.SpaceResourceIdentifier@880
MultiExcerptNameJSONAPI
PageWithExcerptWHM API 1 Functions - get_transfer_session_state


Localtab
titlePHP


Code Block
languagetext
linenumberstrue
include_once '../xmlapi.php';

$ip = getenv('REMOTE_HOST');
$root_user = getenv('REMOTE_USER');
$root_pass = getenv('REMOTE_PASSWORD');

$xmlapi = new xmlapi($ip , $root_user , $root_pass);
$xmlapi->set_output('json');

$settings = array('api.version'=>1, 'transfer_session_id'=>'remoteexamplecomnoroo20140501194105g7qG');
$_result = $xmlapi->xmlapi_query('get_transfer_session_state' , $settings);

print $_result;



The function will respond with one of the following states:

  • TRANSFER_PENDING
  • TRANSFER_INPROGRESS
  • RESTORE_PENDING
  • RESTORE_INPROGRESS
  • PENDING
  • COMPLETED
  • FAILED

In the following example, the transfer session is in progress:

Expand
titleClick to view...

Multiexcerpt include
SpaceWithExcerptcom.atlassian.confluence.content.render.xhtml.model.resource.identifiers.SpaceResourceIdentifier@880
MultiExcerptNameOutputJSON
PageWithExcerptWHM API 1 Functions - get_transfer_session_state

Review the master log

Review the master log for the transfer session with the WHM API 1 fetch_transfer_session_log function.

Select the tab below that corresponds to the method by which you wish to call the function:

Localtab Group


Localtab
titleJSON API

Multiexcerpt include
SpaceWithExcerptcom.atlassian.confluence.content.render.xhtml.model.resource.identifiers.SpaceResourceIdentifier@880
MultiExcerptNameJSONAPI
PageWithExcerptWHM API 1 Functions - fetch_transfer_session_log


Localtab
titlePHP


Code Block
languagetext
linenumberstrue
include_once '../xmlapi.php';

$ip = getenv('REMOTE_HOST');
$root_user = getenv('REMOTE_USER');
$root_pass = getenv('REMOTE_PASSWORD');

$xmlapi = new xmlapi($ip , $root_user , $root_pass);
$xmlapi->set_output('json');

$settings = array(
    'api.version'=>1, 
    'transfer_session_id'=>'remoteexamplecomnoroo20140501194105g7qG' , 
    'logfile' => 'master.log'
);
$_result = $xmlapi->xmlapi_query('fetch_transfer_session_log' , $settings);

print $_result;



The following example shows the contents of a log file:

Expand
titleClick to view...

Multiexcerpt include
SpaceWithExcerptcom.atlassian.confluence.content.render.xhtml.model.resource.identifiers.SpaceResourceIdentifier@880
MultiExcerptNameOutputJSON
PageWithExcerptWHM API 1 Functions - fetch_transfer_session_log

Each log file contains the following information in a line-delimited JSON format:

Multiexcerpt include
SpaceWithExcerptcom.atlassian.confluence.content.render.xhtml.model.resource.identifiers.SpaceResourceIdentifier@104da
MultiExcerptNametransferlogs
PageWithExcerptCKB:The cPanel Log Files

Create a script to parse this log file to determine the progress of the transfer or restore operation.