Github Connections - Update

Add/Remove list of repos within specified github connection.

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

URI-Parameter

Name In Erforderlich Typ Beschreibung
connectionId
path True

string (uuid)

organization
path True

string

Der Name der Azure DevOps-Organisation.

project
path True

string

Projekt-ID oder Projektname

api-version
query True

string

Version der zu verwendenden API. Dies sollte auf "7.2-preview.1" festgelegt werden, um diese Version der API zu verwenden.

Anforderungstext

Name Typ Beschreibung
gitHubRepositoryUrls

GitHubConnectionRepoModel[]

Angeforderte Repos-URLs

gitHubUserToken

string

Optionaler GitHub Zugriffstoken, das zum Authentifizieren der Bereitstellung für die Add- und Remove-Vorgänge verwendet wird. "Hinzufügen" erfordert außerdem Administratorzugriff auf die Repositorys.

operationType

string

Betriebsart (z. B. Hinzufügen, Entfernen)

Antworten

Name Typ Beschreibung
200 OK

GitHubConnectionRepoModel[]

Erfolgreicher Vorgang

Sicherheit

oauth2

Typ: oauth2
Ablauf: accessCode
Autorisierungs-URL: https://app.vssps.visualstudio.com/oauth2/authorize&response_type=Assertion
Token-URL: 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

Bereiche

Name Beschreibung
vso.githubconnections_manage Gewährt die Möglichkeit, GitHub-Verbindungen und GitHub-Repositorydaten zu lesen und zu verwalten

Beispiele

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

Beispielanforderung

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"
}

Beispiel für eine Antwort

{
  "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

Beispielanforderung

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"
}

Beispiel für eine Antwort

{
  "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"
    }
  ]
}

Definitionen

Name Beschreibung
GitHubConnectionRepoModel

Beschreibt das Repository der Github-Verbindung.

GitHubConnectionReposBatchRequest

Beschreibt die Massenanfrage für das Repo-Repository der Github-Verbindung

GitHubConnectionRepoModel

Beschreibt das Repository der Github-Verbindung.

Name Typ Beschreibung
errorMessage

string

Fehlernachricht

gitHubRepositoryUrl

string

Repository-Web-URL

GitHubConnectionReposBatchRequest

Beschreibt die Massenanfrage für das Repo-Repository der Github-Verbindung

Name Typ Beschreibung
gitHubRepositoryUrls

GitHubConnectionRepoModel[]

Angeforderte Repos-URLs

gitHubUserToken

string

Optionaler GitHub Zugriffstoken, das zum Authentifizieren der Bereitstellung für die Add- und Remove-Vorgänge verwendet wird. "Hinzufügen" erfordert außerdem Administratorzugriff auf die Repositorys.

operationType

string

Betriebsart (z. B. Hinzufügen, Entfernen)