共用方式為


Approvals - Update

更新核准的狀態

PATCH https://vsrm.dev.azure.com/{organization}/{project}/_apis/release/approvals/{approvalId}?api-version=7.1-preview.3

URI 參數

名稱 位於 必要 類型 Description
approvalId
path True

integer

int32

核准的識別碼。

organization
path True

string

Azure DevOps 組織的名稱。

project
path True

string

專案識別碼或專案名稱

api-version
query True

string

要使用的 API 版本。 這應該設定為 '7.1-preview.3',以使用此版本的 API。

要求本文

名稱 類型 Description
approvalType

ApprovalType

取得或設定核准的類型。

approvedBy

IdentityRef

取得已核准的身分識別。

approver

IdentityRef

取得或設定應該核准的身分識別。

attempt

integer

取得或設定嘗試,指定其所屬的部署嘗試。

comments

string

取得或設定核准的批註。

createdOn

string

取得建立日期。

history

ReleaseApprovalHistory[]

取得記錄,指定與此核准相關聯的所有核准。

id

integer

取得這個欄位的唯一識別碼。

isAutomated

boolean

取得或設定為自動核准。

modifiedOn

string

取得修改日期。

rank

integer

取得或設定指定核准順序的排名。 例如,相同的排名表示平行核准。

release

ReleaseShallowReference

取得 releaseReference,指定與此核准相關聯的發行參考。

releaseDefinition

ReleaseDefinitionShallowReference

取得 releaseDefinitionReference,指定與此核准相關聯的發行定義參考。

releaseEnvironment

ReleaseEnvironmentShallowReference

取得 releaseEnvironmentReference,指定與此核准相關聯的發行環境參考。

revision

integer

取得修訂編號。

status

ApprovalStatus

取得或設定核准的狀態。

url

string

取得存取核准的 URL。

回應

名稱 類型 Description
200 OK

ReleaseApproval

成功的作業

安全性

oauth2

Type: oauth2
Flow: accessCode
Authorization 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

Scopes

名稱 Description
vso.release_manage 授與讀取、更新和刪除發行成品的能力,包括資料夾、發行、發行定義和發行環境,以及將新版本排入佇列和核准的能力。

範例

Approve a release

Sample Request

PATCH https://vsrm.dev.azure.com/fabrikam/MyFirstProject/_apis/release/approvals/{approvalId}?api-version=7.1-preview.3

{
  "status": "approved",
  "comments": "Good to go!"
}

Sample Response

{
  "id": 20,
  "revision": 1,
  "approver": {
    "id": "4adb1680-0eac-6149-b5ee-fc8b4f6ca227",
    "displayName": "Chuck Reinhart",
    "uniqueName": "fabfiber@outlook.com",
    "url": "https://vssps.dev.azure.com/fabrikam/_apis/Identities/4adb1680-0eac-6149-b5ee-fc8b4f6ca227",
    "imageUrl": "https://dev.azure.com/fabrikam/_api/_common/identityImage?id=4adb1680-0eac-6149-b5ee-fc8b4f6ca227"
  },
  "approvedBy": {
    "id": "4adb1680-0eac-6149-b5ee-fc8b4f6ca227",
    "displayName": "Chuck Reinhart",
    "uniqueName": "fabfiber@outlook.com",
    "url": "https://vssps.dev.azure.com/fabrikam/_apis/Identities/4adb1680-0eac-6149-b5ee-fc8b4f6ca227",
    "imageUrl": "https://dev.azure.com/fabrikam/_api/_common/identityImage?id=4adb1680-0eac-6149-b5ee-fc8b4f6ca227"
  },
  "approvalType": "preDeploy",
  "createdOn": "2017-05-31T18:07:40.45Z",
  "modifiedOn": "2017-05-31T18:08:09.577Z",
  "status": "approved",
  "comments": "Good to go!",
  "isAutomated": false,
  "isNotificationOn": true,
  "trialNumber": 1,
  "attempt": 1,
  "rank": 1,
  "history": [],
  "release": {
    "id": 3,
    "name": "Release-3",
    "url": "https://vsrm.dev.azure.com/fabrikam/MyFirstProject/_apis/Release/releases/3",
    "_links": {}
  },
  "releaseDefinition": {
    "id": 1,
    "name": "MyShuttle.CD",
    "url": "https://vsrm.dev.azure.com/fabrikam/d07908bc-118f-47d2-8a13-ff75601a6b1a/_apis/Release/definitions/1",
    "_links": {}
  },
  "releaseEnvironment": {
    "id": 9,
    "name": "Dev",
    "_links": {}
  },
  "url": "https://vsrm.dev.azure.com/fabrikam/MyFirstProject/_apis/Release/approvals/20"
}

定義

名稱 Description
ApprovalStatus

取得或設定核准的狀態。

ApprovalType

取得或設定核准的類型。

IdentityRef
ProjectReference
ReferenceLinks

表示 REST 參考連結集合的類別。

ReleaseApproval
ReleaseApprovalHistory
ReleaseDefinitionShallowReference
ReleaseEnvironmentShallowReference
ReleaseShallowReference

ApprovalStatus

取得或設定核准的狀態。

名稱 類型 Description
approved

string

表示核准已核准。

canceled

string

表示核准已取消。

pending

string

表示核准擱置中。

reassigned

string

表示已重新指派核准。

rejected

string

表示核准遭到拒絕。

skipped

string

表示已略過核准。

undefined

string

表示核准沒有狀態設定。

ApprovalType

取得或設定核准的類型。

名稱 類型 Description
all

string

表示所有核准。

postDeploy

string

指出部署之後執行的核准。

preDeploy

string

指出在部署之前執行的核准。

undefined

string

表示未設定核准類型。

IdentityRef

名稱 類型 Description
_links

ReferenceLinks

此欄位包含有關圖表主旨的零個或多個有趣連結。 您可以叫用這些連結來取得其他關聯性,或取得此圖表主體的詳細資訊。

descriptor

string

描述項是在系統執行時參考圖形主旨的主要方式。 此欄位可唯一識別帳戶和組織之間的相同圖表主旨。

directoryAlias

string

已淘汰 - 藉由查詢 IdentityRef 「_links」 字典之 「self」 專案中參考的 Graph 使用者,即可擷取

displayName

string

這是圖表主旨的非唯一顯示名稱。 若要變更此欄位,您必須在來源提供者中變更其值。

id

string

imageUrl

string

已淘汰 - 可在 IdentityRef 「_links」 字典的 「avatar」 專案中使用

inactive

boolean

已淘汰 - 您可以查詢 GraphUser 「_links」 字典的 「membershipState」 專案中參考的 Graph 成員資格狀態來擷取

isAadIdentity

boolean

已被取代 - 可以從描述元的主旨類型推斷 (Descriptor.IsAadUserType/Descriptor.IsAadGroupType)

isContainer

boolean

已被取代 - 可以從描述元的主旨類型推斷 (Descriptor.IsGroupType)

isDeletedInOrigin

boolean

profileUrl

string

已淘汰 - 不在 ToIdentityRef 的大多數既有實作中使用

uniqueName

string

已淘汰 - 請改用 Domain+PrincipalName

url

string

此 URL 是此圖表主體來源資源的完整路由。

ProjectReference

名稱 類型 Description
id

string

取得這個欄位的唯一識別碼。

name

string

取得專案的名稱。

表示 REST 參考連結集合的類別。

名稱 類型 Description
links

object

連結的唯讀檢視。 因為參考連結是唯讀的,所以我們只想要將它們公開為唯讀。

ReleaseApproval

名稱 類型 Description
approvalType

ApprovalType

取得或設定核准的類型。

approvedBy

IdentityRef

取得已核准的身分識別。

approver

IdentityRef

取得或設定應該核准的身分識別。

attempt

integer

取得或設定嘗試,指定其所屬的部署嘗試。

comments

string

取得或設定核准的批註。

createdOn

string

取得建立日期。

history

ReleaseApprovalHistory[]

取得記錄,指定與此核准相關聯的所有核准。

id

integer

取得這個欄位的唯一識別碼。

isAutomated

boolean

取得或設定為自動核准。

modifiedOn

string

取得修改日期。

rank

integer

取得或設定指定核准順序的排名。 例如,相同的排名表示平行核准。

release

ReleaseShallowReference

取得 releaseReference,指定與此核准相關聯的發行參考。

releaseDefinition

ReleaseDefinitionShallowReference

取得 releaseDefinitionReference,指定與此核准相關聯的發行定義參考。

releaseEnvironment

ReleaseEnvironmentShallowReference

取得 releaseEnvironmentReference,指定與此核准相關聯的發行環境參考。

revision

integer

取得修訂編號。

status

ApprovalStatus

取得或設定核准的狀態。

url

string

取得存取核准的 URL。

ReleaseApprovalHistory

名稱 類型 Description
approver

IdentityRef

核准者的身分識別。

changedBy

IdentityRef

變更核准之物件的身分識別。

comments

string

核准歷程記錄批註。

createdOn

string

建立此核准的時間。

modifiedOn

string

修改此核准的時間。

revision

integer

核准歷程記錄修訂。

ReleaseDefinitionShallowReference

名稱 類型 Description
_links

ReferenceLinks

取得發行定義之相關資源、API 和檢視的連結。

id

integer

取得發行定義的唯一識別碼。

name

string

取得或設定發行定義的名稱。

path

string

取得或設定發行定義的路徑。

projectReference

ProjectReference

取得或設定專案參考。

url

string

取得 REST API URL 以存取發行定義。

ReleaseEnvironmentShallowReference

名稱 類型 Description
_links

ReferenceLinks

取得發行環境相關資源、API 和檢視的連結。

id

integer

取得發行環境的唯一識別碼。

name

string

取得或設定發行環境的名稱。

url

string

取得 REST API URL 以存取發行環境。

ReleaseShallowReference

名稱 類型 Description
_links

ReferenceLinks

取得版本相關資源、API 和檢視的連結。

id

integer

取得發行的唯一識別碼。

name

string

取得或設定發行的名稱。

url

string

取得要存取版本的 REST API URL。