Pull project files from Git

POST /project/pull/{project_path}

Overview

This API updates the specified project with the latest files from the associated Git repository. Equivalent to git pull.

You can use Git APIs in Continuous Integration / Continuous Deployment (CI/CD) workflows to pull files from Git repositories.

Note:
  • The project must already be associated with a Git repository.
  • You can track a maximum of 1000 assets per project. If a check-in would exceed 1000 assets in the repository or if you try to check out a project with more than 1000 assets, an error is thrown.
  • You must use the SnapLogic Manager UI or Git tools to commit changes to your repository.

Prerequisites

  • Write access to the assets to be added or updated

Limitations

  • You cannot use SnapLogic service accounts to call any of the SnapLogic Git operation APIs.

Request

 POST https://{controlplane_path}/api/1/rest/public/project/pull/{project_path}

Path parameters

Key Description
controlplane_path Required. The path to the SnapLogic Control Plane: elastic.snaplogic.com
For the UAT or EMEA control plane, substitute the name for elastic. For example:
  • uat.snaplogic.com
  • emea.snaplogic.com
project_path
Required. The path to the SnapLogic project.

Format: /{env_org}/{project_space}/{project_name}

Important: The path comparison is case-sensitive.

Query parameters

None.

Request header

In the request header, specify Basic for authorization, add your credentials, and specify application/json for content type:


Authorization: Basic {your_encoded_security_credentials}
Content-Type: application/json
          

Request body

   //To overwrite local changes with the versions in the repository.
  {
  "use_theirs": ["65e12ed44f526dee5878a380","65e12ed482f42d881560dfca"]
  }
  
  //To keep local changes and ignore conflicting versions from the repository.
  {
  "use_ours":["65e12ed44f526dee5878a380","65e12ed482f42d881560dfca"]
  }
Key Type Description
use_theirs array An array containing the snode IDs of the assets in the local project to be overwritten with those from the git repository.
use_ours array An array containing the snode IDs of the assets in the local project to retain their state ignoring the corresponding updates to them in the git repository.
Note: Use Retrieve the Status of the Git Repository API to retrieve the asset snode IDs.

Response

Status code only.