Github Connections - Update

Dodaj/usuń listę repozytoriów w ramach określonego połączenia github.

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

Parametry identyfikatora URI

Nazwa W Wymagane Typ Opis
connectionId
path True

string (uuid)

organization
path True

string

Nazwa organizacji usługi Azure DevOps.

project
path True

string

Identyfikator projektu lub nazwa projektu

api-version
query True

string

Wersja interfejsu API do użycia. Należy ustawić wartość "7.2-preview.1", aby używać tej wersji interfejsu API.

Treść żądania

Nazwa Typ Opis
gitHubRepositoryUrls

GitHubConnectionRepoModel[]

Żądane adresy URL repozytoriów

gitHubUserToken

string

Opcjonalne GitHub token dostępu używany do uwierzytelniania aprowizacji dla operacji dodawania i usuwania. Dodaj również wymaga dostępu administratora do repozytoriów.

operationType

string

Typ operacji (np. dodawanie, usuwanie)

Odpowiedzi

Nazwa Typ Opis
200 OK

GitHubConnectionRepoModel[]

operacja zakończona powodzeniem

Zabezpieczenia

oauth2

Typ: oauth2
Flow: accessCode
Adres URL autoryzacji: https://app.vssps.visualstudio.com/oauth2/authorize&response_type=Assertion
Adres URL tokenu: 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

Zakresy

Nazwa Opis
vso.githubconnections_manage Umożliwia odczytywanie połączeń github i danych repozytoriów github oraz zarządzanie nimi

Przykłady

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

Przykładowe żądanie

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

Przykładowa odpowiedź

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

Przykładowe żądanie

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

Przykładowa odpowiedź

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

Definicje

Nazwa Opis
GitHubConnectionRepoModel

Opisuje repozytorium połączenia Github.

GitHubConnectionReposBatchRequest

Opisuje masowe żądanie repozytorium połączenia Github

GitHubConnectionRepoModel

Opisuje repozytorium połączenia Github.

Nazwa Typ Opis
errorMessage

string

Komunikat o błędzie

gitHubRepositoryUrl

string

Internetowy adres URL repozytorium

GitHubConnectionReposBatchRequest

Opisuje masowe żądanie repozytorium połączenia Github

Nazwa Typ Opis
gitHubRepositoryUrls

GitHubConnectionRepoModel[]

Żądane adresy URL repozytoriów

gitHubUserToken

string

Opcjonalne GitHub token dostępu używany do uwierzytelniania aprowizacji dla operacji dodawania i usuwania. Dodaj również wymaga dostępu administratora do repozytoriów.

operationType

string

Typ operacji (np. dodawanie, usuwanie)