Use cases

This article describes a use case of REST API available for GitProtect product.

Getting the last backup plan status(GitHub/Bitbucket/GitLab only)

At first, use the authorization method to get the token that will allow you to proceed with further operations.

After getting the token, select the proper authentication method as described in the API Authentication article.

As you're properly authorized you can now use Get many method, which will list all of your organizations with backup plans and their last statuses.

Activating the license for the repository

At first, use the authorization method to get the token that will allow you to proceed with further operations.

After getting the token, select the proper authentication method as described in the API Authentication.

As you're properly authorized you can now use the Get many method, where you'll find the repository name and repository ID that will be required in the next step.

After gathering the IDs of your repositories use Activate method with an array of selected repository IDs that you want to activate the license for.

Deactivating the license for the repository

At first, use the authorization method to get the token that will allow you to proceed with further operations.

After getting the token, select the proper authentication method as described in the API Authentication.

As you're properly authorized you can now use the Get many method, where you'll find the repository name and repository ID that will be required in the next step.

After gathering the IDs of your repositories use Deactivate method with an array of selected repository IDs that you want to deactivate the license for.

Attach repository to a backup plan

At first, use the authorization method to get the token that will allow you to proceed with further operations.

After getting the token, select the proper authentication method as described in the API Authentication.

As you're properly authorized you can now use the Get many method (GitOrganizationController) to find the backup plan ID Get many method (GitRepositoryController) to get the repository ID.

After gathering the IDs of your repositories and plans use Attach method with a pair of selected repository ID and plan ID.

Last updated