Calling Extensions Operaions

To call an operation specific to a particular Plesk extension, use the call operation.

In this chapter:

Request Packet Structure

Response Packet Structure

Samples

 

Request Packet Structure

A request XML packet for an extension operation call contains the call operation node:

<packet>   
  <extension>
    <call>
      ...
    </call>
  </extension>
</packet>

 

The call node is structured as follows:

extension_call

Note: The interactive schema navigator for all request packets is available here: http://plesk.github.io/api-schemas/1.6.8.0/agent_input.svg.

It contains at least one node with an extension ID (e.g., git or nodejs) and any number of nodes of a particular extension XML API calls (see the corresponding sections of this guide).

 

Response Packet Structure

The call node of the output XML packet is of complex type which has the following presentation:

extension_call_response

Note: The interactive schema navigator for all response packets is available here: http://plesk.github.io/api-schemas/1.6.8.0/agent_output.svg.

  • result, required.
    It wraps the result of the install operation. Data type: resultType (common.xsd).
  • status, required.
    It returns the execution status of the operation. Data type: string. Allowed values: ok | error.
  • errcode, required if the operation fails.
    Returns error code. Data type: unsignedInt.
  • errtext, required if the operation fails.
    Returns error message. Data type: string.
  • any nodes of a particular extension operation response (see the corresponding sections of this guide).
 

Samples

This package calls the remove operation of the git operator available for the Git Manager extansion and removes a Git repository:

<packet>
  <extension>
    <call>
      <git>
        <remove>
          <domain>example.com</domain>
          <name>repo2</name>
        </remove>
      </git>
    </call>
  </extension>
</packet>

Response:

<packet>
  <extension>
    <call>
      <result>
        <status>ok</status>
        <git>
          <remove/>
        </git>
      </result>
    </call>
  </extension>
</packet>
 

Leave your feedback on this topic here

If you have questions or need support, please visit the Plesk forum or contact your hosting provider.
The comments below are for feedback on the documentation only. No timely answers or help will be provided.