Github Connections - Update Github Connection Repos

指定した github 接続内のリポジトリの一覧を追加または削除します。

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

URI パラメーター

Name / 必須 型 説明
connectionId
path True

string (uuid)

organization
path True

string

Azure DevOps 組織の名前です。

project
path True

string

プロジェクト ID またはプロジェクト名

api-version
query True

string

使う API のバージョン。 このバージョンの API を使用するには、これを '7.2-preview.1' に設定する必要があります。

要求本文

Name 型 説明
gitHubRepositoryUrls

GitHubConnectionRepoModel[]

要求されたリポジトリ URL

gitHubUserToken

string

オプションGitHub追加操作と削除操作のプロビジョニングを認証するために使用されるアクセス トークンです。 追加するには、リポジトリへの管理者アクセスも必要です。

operationType

string

操作タイプ(追加、削除など)

応答

Name 型 説明
200 OK

GitHubConnectionRepoModel[]

成功した操作

セキュリティ

oauth2

型: oauth2
フロー: accessCode
Authorization URL (承認 URL): https://app.vssps.visualstudio.com/oauth2/authorize&response_type=Assertion
Token URL (トークン 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

スコープ

Name 説明
vso.githubconnections_manage github 接続と github リポジトリ データの読み取りと管理を行う機能を付与します

例

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

要求のサンプル

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

応答のサンプル

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

要求のサンプル

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

応答のサンプル

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

定義

Name 説明
GitHubConnectionRepoModel

Github接続のリポジトリを説明しています。

GitHubConnectionReposBatchRequest

Github 接続のリポジトリ一括要求について説明します

GitHubConnectionRepoModel

Github接続のリポジトリを説明しています。

Name 型 説明
errorMessage

string

エラー メッセージ

gitHubRepositoryUrl

string

リポジトリの Web URL

GitHubConnectionReposBatchRequest

Github 接続のリポジトリ一括要求について説明します

Name 型 説明
gitHubRepositoryUrls

GitHubConnectionRepoModel[]

要求されたリポジトリ URL

gitHubUserToken

string

オプションGitHub追加操作と削除操作のプロビジョニングを認証するために使用されるアクセス トークンです。 追加するには、リポジトリへの管理者アクセスも必要です。

operationType

string

操作タイプ(追加、削除など)