vsts_run_command: Azure DevOps Custom API Calls

View source: R/custom.R

vsts_run_commandR Documentation

Azure DevOps Custom API Calls

Description

For any requirement not currently in place in the vstsr package, then this function will allow you to use the relevant API call without any extra requirements.

For the most part it is just a shell of VERB but will have the auth_key set up already.

Usage

vsts_run_command(url, verb, auth_key, body = NULL, query = NULL)

Arguments

url

the URI of the API call to run

verb

name of the verb to use

auth_key

authentication key generated by using vsts_auth_key

body

check VERB for more details. If the object is a named list, then it will be transformed into a JSON string so that can be added to the call. Use https://docs.microsoft.com/en-us/rest/api/azure/devops to find out any required parameter for the body.

query

a list of extra parameters that can be sent to the API call. If not required then leave as NULL

Examples

## Not run: 
auth_key <- vsts_auth_key("<username>", "<password>")
# Get commits of a repository
URL <- file.path(
  "https://dev.azure.com",
  domain,
  project,
  "_apis/git/repositories",
  repository_id,
  "commits?api-version=5.0"
)
vsts_run_command(URL, "GET", auth_key)

## End(Not run)


ashbaldry/vstsr documentation built on Aug. 24, 2023, 12:11 a.m.