Github Connections - Update

Aggiungere/rimuovere un elenco di repository all'interno della connessione github specificata.

POST https://dev.azure.com/{organization}/{project}/_apis/githubconnections/{connectionId}/reposBatch?api-version=7.2-preview.1

Parametri dell'URI

Nome In Necessario Tipo Descrizione
connectionId
path True

string (uuid)

organization
path True

string

Nome dell'organizzazione di Azure DevOps.

project
path True

string

ID progetto o nome progetto

api-version
query True

string

Versione dell'API da usare. Deve essere impostato su '7.2-preview.1' per usare questa versione dell'API.

Corpo della richiesta

Nome Tipo Descrizione
gitHubRepositoryUrls

GitHubConnectionRepoModel[]

URL dei repository richiesti

gitHubUserToken

string

Facoltativo GitHub token di accesso usato per autenticare il provisioning per le operazioni di aggiunta e rimozione. L'aggiunta richiede anche l'accesso amministratore ai repository.

operationType

string

Tipo di operazione (f. e. add, remove)

Risposte

Nome Tipo Descrizione
200 OK

GitHubConnectionRepoModel[]

operazione riuscita

Sicurezza

oauth2

Tipo: oauth2
Flow: accessCode
URL di autorizzazione: https://app.vssps.visualstudio.com/oauth2/authorize&response_type=Assertion
URL token: https://app.vssps.visualstudio.com/oauth2/token?client_assertion_type=urn:ietf:params:oauth:client-assertion-type:jwt-bearer&grant_type=urn:ietf:params:oauth:grant-type:jwt-bearer

Ambiti

Nome Descrizione
vso.githubconnections_manage Concede la possibilità di leggere e gestire le connessioni GitHub e i dati dei repository GitHub

Esempio

Add list of repos to the specified github connection
Remove list of repos from the specified github connection

Add list of repos to the specified github connection

Esempio di richiesta

POST https://dev.azure.com/{organization}/{project}/_apis/githubconnections/{connectionId}/reposBatch?api-version=7.2-preview.1

{
  "gitHubRepositoryUrls": [
    {
      "gitHubRepositoryUrl": "https://github.com/test-account/repo1"
    },
    {
      "gitHubRepositoryUrl": "https://github.com/test-account/repo2"
    },
    {
      "gitHubRepositoryUrl": "https://github.com/test-account/repo3"
    },
    {
      "gitHubRepositoryUrl": "https://github.com/test-account/repo399"
    }
  ],
  "operationType": "add"
}

Risposta di esempio

{
  "count": 4,
  "value": [
    {
      "gitHubRepositoryUrl": "https://github.com/test-account/repo3"
    },
    {
      "gitHubRepositoryUrl": "https://github.com/test-account/repo2"
    },
    {
      "gitHubRepositoryUrl": "https://github.com/test-account/repo1",
      "errorMessage": "Failed to find repository"
    },
    {
      "gitHubRepositoryUrl": "https://github.com/test-account/repo399",
      "errorMessage": "Failed to find repository"
    }
  ]
}

Remove list of repos from the specified github connection

Esempio di richiesta

POST https://dev.azure.com/{organization}/{project}/_apis/githubconnections/{connectionId}/reposBatch?api-version=7.2-preview.1

{
  "gitHubRepositoryUrls": [
    {
      "gitHubRepositoryUrl": "https://github.com/test-account/repo1"
    },
    {
      "gitHubRepositoryUrl": "https://github.com/test-account/repo2"
    },
    {
      "gitHubRepositoryUrl": "https://github.com/test-account/repo3"
    },
    {
      "gitHubRepositoryUrl": "https://github.com/test-account/repo399"
    }
  ],
  "operationType": "remove"
}

Risposta di esempio

{
  "count": 4,
  "value": [
    {
      "gitHubRepositoryUrl": "https://github.com/test-account/repo3"
    },
    {
      "gitHubRepositoryUrl": "https://github.com/test-account/repo2"
    },
    {
      "gitHubRepositoryUrl": "https://github.com/test-account/repo1",
      "errorMessage": "Repository is not connected to this team project"
    },
    {
      "gitHubRepositoryUrl": "https://github.com/test-account/repo399",
      "errorMessage": "Repository is not connected to this team project"
    }
  ]
}

Definizioni

Nome Descrizione
GitHubConnectionRepoModel

Descrive il repository di connessione di Github.

GitHubConnectionReposBatchRequest

Descrive la richiesta di blocco del repository connection di Github

GitHubConnectionRepoModel

Descrive il repository di connessione di Github.

Nome Tipo Descrizione
errorMessage

string

Messaggio di errore

gitHubRepositoryUrl

string

URL web del repository

GitHubConnectionReposBatchRequest

Descrive la richiesta di blocco del repository connection di Github

Nome Tipo Descrizione
gitHubRepositoryUrls

GitHubConnectionRepoModel[]

URL dei repository richiesti

gitHubUserToken

string

Facoltativo GitHub token di accesso usato per autenticare il provisioning per le operazioni di aggiunta e rimozione. L'aggiunta richiede anche l'accesso amministratore ai repository.

operationType

string

Tipo di operazione (f. e. add, remove)