Retrieving Information on Git Repositories

The get operation is used to retrieve the information about the settings of Git repositories on a specified domain or on all domains.

Next in this section:

Request Packet Structure

Response Packet Structure

Samples

 

Request Packet Structure

The request XML packet retrieving information on Git repositories settings includes the get operation node:

<packet>
    <extension>
        <call>
            <git>
                <get/>
            </git>
        </call>
    </extension>
</packet>

The get node contains the following nodes:

  • The domain node is optional. It specifies the domain in the case when the information on all repositories of a specified domain is retrieved. If this node is not specified, the information of all repositories on all domains is retrieved. Data type: string.
 

Response Packet Structure

The get node of the output XML packet is is structured as follows:

<packet>
  <extension>
    <call>
      <result>
        <status>...</status>
        ...
        <git>
          <get>
            <repository>
              ...
            </repository>
            ...
            <repository>
              ...
            </repository>
           </get>
        </git>
      </result>
    </call>
  </extension>
</packet>
  • The result node is required. It wraps the response received from the server. This node contains the following nodes:
    • The status node is required. It specifies the execution status of the get operation. Data type: result_status. Allowed values: ok | error.
    • The errcode node is optional. It is used to return the error code when the get operation fails. Data type: unsignedInt.
    • The errtext node is optional. It is used to return the error message if the get operation fails. Data type: string.
    • The git node is optional. It contains information about the found repositories. This node contains the required get node that includes one or more optional repository nodes containing settings of a found repository. The repository node contains the following nodes:
      • The uid node is required. It specifies the unique identifier of the repository. Data type: string.
      • The domain node is required. It specifies the domain. Data type: string.
      • The name node is required. It specifies the repository name. Data type: string.
      • The deployment-path node is optional. It specifies the deployment path of the repository. Data type: string.
      • The deployment-mode node is optional. It specifies the deployment mode (auto, manual, or none). Data type: string.
      • The url node is optional. It specifies the URL of the repository of the Using local repository type. Data type: string.
      • The remote-url node is optional. It specifies the URL of the remote repository for a repository of the Using remote Git hosting type. Data type: string.
      • The webhook-url node is optional. It specifies the webhook URL that should be set in a remote repository settings for automatic pulling data for a repository of the Using remote Git hosting type. Data type: string.
      • The skip-ssl-verification node is optional. It specifies if SSL/TLS verification of a remote repository is switched on or off during pulling the data to a repository of the Using remote Git hosting type. Data type: boolean.
      • The public-key node is optional. It specifies the public-key that should be added to a remote repository settings for a repository of the Using remote Git hosting type. Data type: string.
      • The active-branch node is optional. It specifies the name of the active branch of the repository. Data type: string.
      • The last-commit node is optional. It specifies the information on the last commit. Data type: string.
      • The actions node is optional. It specifies the list of additional actions that will be performed each time when the files are deployed to the web site. The actions are shell commands delimited by ";" symbol that should be used with an escape character: ">". Data type: string.
 

Samples

Retrieving information about all Git repositories

This package retrieves information about all Git repositories found on the domain example.com .

<packet>
    <extension>
        <call>
            <git>
              <get>
                <domain>example.com</domain>
              </get>
            </git>
        </call>
    </extension>
</packet>

Response:

<packet>
  <extension>
    <call>
      <result>
        <status>ok</status>
        <git>
          <get>
            <repository>
              <uid>97b87ce5-172c-589c-89fc-22fcfeb5006c</uid>
              <domain>example.com</domain>
              <name>repo1.git</name>
              <deployment-path>httpdocs</deployment-path>
              <deployment-mode>auto</deployment-mode>
              <url>https://example.com/plesk-git/repo1.git</url>
            </repository>
            <repository>
              <uid>e8cc22b2-28bd-9d80-1d95-5734f670f09e</uid>
              <domain>example.com</domain>
              <name>repo2.git</name>
              <deployment-path>httpdocs</deployment-path>
              <deployment-mode>none</deployment-mode>
              <url>https://example.com/plesk-git/repo2.git</url>
            </repository>
            <repository>
              <uid>4979ef8a-907c-0713-3c19-69bd6bf7b0c0</uid>
              <domain>example.com</domain>
              <name>demo.git</name>
              <deployment-path>httpdocs</deployment-path>
              <deployment-mode>none</deployment-mode>
              <remote-url>http://https://github.com/user1/demo.git</remote-url>
              <webhook-url>https://a10-52-145-187.qa.plesk.ru:8443/modules/git/public/web-hook.php?uuid=4979ef8a-907c-0713-3c19-69bd6bf7b0c0</webhook-url>
              <skip-ssl-verification>false</skip-ssl-verification>
              <public-key>ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAACAQC+cb0VTc...</public-key>
              <active-branch>master</active-branch>
              <last-commit>commit 148e7837cc25a02537f019261baf69b50e4b29fd...</last-commit>
            </repository>
          </get>
        </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.