Github Connections - Update

Agregue o quite la lista de repositorios dentro de la conexión de GitHub especificada.

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

Parámetros de identificador URI

Nombre En Requerido Tipo Description
connectionId
path True

string (uuid)

organization
path True

string

El nombre de la organización de Azure DevOps.

project
path True

string

Id. de proyecto o nombre del proyecto

api-version
query True

string

Versión de la API que se va a usar. Debe establecerse en "7.2-preview.1" para usar esta versión de la API.

Cuerpo de la solicitud

Nombre Tipo Description
gitHubRepositoryUrls

GitHubConnectionRepoModel[]

Direcciones URL de repositorio solicitadas

gitHubUserToken

string

Opcional GitHub token de acceso usado para autenticar el aprovisionamiento de las operaciones de adición y eliminación. Agregar también requiere acceso de administrador a los repositorios.

operationType

string

Tipo de operación (f. e. agregar, quitar)

Respuestas

Nombre Tipo Description
200 OK

GitHubConnectionRepoModel[]

operación correcta

Seguridad

oauth2

Tipo: oauth2
Flujo: accessCode
Dirección URL de autorización: https://app.vssps.visualstudio.com/oauth2/authorize&response_type=Assertion
Dirección URL del 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

Ámbitos

Nombre Description
vso.githubconnections_manage Concede la capacidad de leer y administrar conexiones de GitHub y datos de repositorios de GitHub.

Ejemplos

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

Solicitud de ejemplo

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

Respuesta de muestra

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

Solicitud de ejemplo

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

Respuesta de muestra

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

Definiciones

Nombre Description
GitHubConnectionRepoModel

Describe el repositorio de Github Connection.

GitHubConnectionReposBatchRequest

Describe la solicitud de repositorio masivo de la conexión de Github

GitHubConnectionRepoModel

Describe el repositorio de Github Connection.

Nombre Tipo Description
errorMessage

string

Mensaje de error

gitHubRepositoryUrl

string

Dirección URL web del repositorio

GitHubConnectionReposBatchRequest

Describe la solicitud de repositorio masivo de la conexión de Github

Nombre Tipo Description
gitHubRepositoryUrls

GitHubConnectionRepoModel[]

Direcciones URL de repositorio solicitadas

gitHubUserToken

string

Opcional GitHub token de acceso usado para autenticar el aprovisionamiento de las operaciones de adición y eliminación. Agregar también requiere acceso de administrador a los repositorios.

operationType

string

Tipo de operación (f. e. agregar, quitar)