The update operation is used to update settings of a Git repository.

Request Packet Structure

A request XML packet updating a Git repository, includes the update operation node:

<packet>
  <extension>
    <call>
      <git>
        <update>
          ...
        </update>
      </git>
    </call>
  </extension>
</packet>

The update node has the following structure:

  • 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 new-name node is optional. It specifies the new name of the repository. 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 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: string.
  • The active-branch node is optional. It specifies the name of the active branch of the repository. 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: “&gt;”. Data type: string.

Response Packet Structure

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

<packet>
  <extension>
    <call>
      <result>
        <status>...</status>
        ...
        <git>
          <update>
            <repository>
            ...
            </repository>
          <update>
        </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 update operation. Data type: result_status. Allowed values: ok | error.
    • The errcode node is optional. It is used to return the error code when the update operation fails. Data type: unsignedInt.
    • The errtext node is optional. It is used to return the error message if the update operation fails. Data type: string.
    • The git node is optional. It contains information about the created repository. This node contains the required update node that includes a repository node containing settings of the updated repository. This 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 if the automatic deployment mode is used (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: “&gt;”. Data type: string.

Samples

This packet changes the name and the deployment path of a repository and adds the deployment actions:

<packet>
  <extension>
    <call>
      <git>
        <update>
          <domain>example.com</domain>
          <name>repo1</name>
          <new-name>new-repo1</new-name>
          <deployment-path>httpdocs</deployment-path>
          <actions>touch /tmp/test.txt</actions>
        </update>
      </git>
    </call>
  </extension>
</packet>

Response:

<packet>
  <extension>
    <call>
      <result>
        <status>ok</status>
        <git>
          <update>
            <repository>
              <uid>4ee69d1c-10a4-bc48-dda7-aab486467e0f</uid>
              <domain>example.com</domain>
              <name>new-repo1</name>
              <deployment-path>httpdocs</deployment-path>
              <deployment-mode>auto</deployment-mode>
              <url>user_1@example.com:~/git/new-repo1</url>
              <actions>touch /tmp/test.txt</actions>
            </repository>
          </update>
        </git>
      </result>
    </call>
  </extension>
</packet>