Environments - Get
按环境 ID 获取环境。
GET https://dev.azure.com/{organization}/{project}/_apis/pipelines/environments/{environmentId}?api-version=7.2-preview.1
GET https://dev.azure.com/{organization}/{project}/_apis/pipelines/environments/{environmentId}?expands={expands}&api-version=7.2-preview.1
URI 参数
名称 | 在 | 必需 | 类型 | 说明 |
---|---|---|---|---|
environment
|
path | True |
integer int32 |
环境的 ID。 |
organization
|
path | True |
string |
Azure DevOps 组织的名称。 |
project
|
path | True |
string |
项目 ID 或项目名称 |
api-version
|
query | True |
string |
要使用的 API 版本。 应将其设置为“7.2-preview.1”才能使用此版本的 API。 |
expands
|
query |
在返回的对象中包含这些附加详细信息。 |
响应
名称 | 类型 | 说明 |
---|---|---|
200 OK |
成功的操作 |
安全性
oauth2
类型:
oauth2
流向:
accessCode
授权 URL:
https://app.vssps.visualstudio.com/oauth2/authorize&response_type=Assertion
令牌 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
作用域
名称 | 说明 |
---|---|
vso.environment_manage | 提供管理环境的功能 |
vso.build | 授予访问生成项目(包括生成结果、定义和请求)以及通过服务挂钩接收有关生成事件的通知的能力。 |
定义
名称 | 说明 |
---|---|
Environment |
在返回的对象中包含这些附加详细信息。 |
Environment |
环境。 |
Environment |
EnvironmentResourceReference。 |
Environment |
资源的类型。 |
Identity |
|
Project |
|
Reference |
EnvironmentExpands
在返回的对象中包含这些附加详细信息。
值 | 说明 |
---|---|
none |
没有其他属性 |
resourceReferences |
包括引用环境的资源引用。 |
EnvironmentInstance
环境。
名称 | 类型 | 说明 |
---|---|---|
createdBy |
创建环境的用户的标识引用。 |
|
createdOn |
string |
环境的创建时间 |
description |
string |
环境的说明。 |
id |
integer |
环境 ID |
lastModifiedBy |
上次修改环境的用户的标识引用。 |
|
lastModifiedOn |
string |
环境的上次修改时间 |
name |
string |
环境的名称。 |
project |
环境的项目信息。 |
|
resources |
EnvironmentResourceReference。 |
EnvironmentResourceReference
EnvironmentResourceReference。
名称 | 类型 | 说明 |
---|---|---|
id |
integer |
资源的 ID。 |
name |
string |
资源的名称。 |
tags |
string[] |
环境资源参考的标记。 |
type |
资源的类型。 |
EnvironmentResourceType
资源的类型。
值 | 说明 |
---|---|
generic |
未知资源类型 |
kubernetes |
Kubernetes 资源类型 |
undefined | |
virtualMachine |
虚拟机资源类型 |
IdentityRef
名称 | 类型 | 说明 |
---|---|---|
_links | ||
descriptor |
string |
|
directoryAlias |
string |
|
displayName |
string |
|
id |
string |
|
imageUrl |
string |
|
inactive |
boolean |
|
isAadIdentity |
boolean |
|
isContainer |
boolean |
|
isDeletedInOrigin |
boolean |
|
profileUrl |
string |
|
uniqueName |
string |
|
url |
string |
ProjectReference
名称 | 类型 | 说明 |
---|---|---|
id |
string |
|
name |
string |
ReferenceLinks
名称 | 类型 | 说明 |
---|---|---|
links |
object |