命名空间:microsoft.graph.identityGovernance
获取与生命周期工作流关联的工作流资源列表。
此 API 可用于以下国家级云部署。
全局服务 |
美国政府 L4 |
美国政府 L5 (DOD) |
由世纪互联运营的中国 |
✅ |
✅ |
✅ |
❌ |
权限
为此 API 选择标记为最低特权的权限。
只有在应用需要它时,才使用更高的特权权限。 有关委派权限和应用程序权限的详细信息,请参阅权限类型。 要了解有关这些权限的详细信息,请参阅 权限参考。
权限类型 |
最低特权权限 |
更高特权权限 |
委派(工作或学校帐户) |
LifecycleWorkflows-Workflow.ReadBasic.All |
LifecycleWorkflows-Workflow.Read.All、LifecycleWorkflows-Workflow.ReadWrite.All、LifecycleWorkflows.Read.All、LifecycleWorkflows.ReadWrite.All |
委派(个人 Microsoft 帐户) |
不支持。 |
不支持。 |
应用程序 |
LifecycleWorkflows-Workflow.ReadBasic.All |
LifecycleWorkflows-Workflow.Read.All、LifecycleWorkflows-Workflow.ReadWrite.All、LifecycleWorkflows.Read.All、LifecycleWorkflows.ReadWrite.All |
重要
在具有工作或学校帐户的委托方案中,必须为登录用户分配受支持的Microsoft Entra角色或具有支持的角色权限的自定义角色。
全局读取者和生命周期工作流管理员是此作支持的最低特权角色。
HTTP 请求
GET /identityGovernance/lifecycleWorkflows/workflows
可选的查询参数
此方法支持 $search
、 $orderby
和 $filter
OData 查询参数,以帮助自定义响应。
$expand
仅 受 createdBy 和 lastModifiedBy 关系支持。 若要了解一般信息,请参阅 OData 查询参数。
名称 |
说明 |
Authorization |
持有者 {token}。 必填。 详细了解 身份验证和授权。 |
请求正文
请勿提供此方法的请求正文。
响应
如果成功,此方法在 200 OK
响应正文中返回响应代码和 microsoft.graph.identityGovernance.workflow 对象的集合。
示例
示例 1:检索在租户中创建的所有工作流
请求
以下示例显示了一个请求。
GET https://graph.microsoft.com/v1.0/identityGovernance/lifecycleWorkflows/workflows
// Code snippets are only available for the latest version. Current version is 5.x
// To initialize your graphClient, see https://learn.microsoft.com/en-us/graph/sdks/create-client?from=snippets&tabs=csharp
var result = await graphClient.IdentityGovernance.LifecycleWorkflows.Workflows.GetAsync();
有关如何将 SDK 添加到项目并创建 authProvider 实例的详细信息,请参阅 SDK 文档。
// Code snippets are only available for the latest major version. Current major version is $v1.*
// Dependencies
import (
"context"
msgraphsdk "github.com/microsoftgraph/msgraph-sdk-go"
//other-imports
)
// To initialize your graphClient, see https://learn.microsoft.com/en-us/graph/sdks/create-client?from=snippets&tabs=go
workflows, err := graphClient.IdentityGovernance().LifecycleWorkflows().Workflows().Get(context.Background(), nil)
有关如何将 SDK 添加到项目并创建 authProvider 实例的详细信息,请参阅 SDK 文档。
// Code snippets are only available for the latest version. Current version is 6.x
GraphServiceClient graphClient = new GraphServiceClient(requestAdapter);
com.microsoft.graph.models.identitygovernance.WorkflowCollectionResponse result = graphClient.identityGovernance().lifecycleWorkflows().workflows().get();
有关如何将 SDK 添加到项目并创建 authProvider 实例的详细信息,请参阅 SDK 文档。
const options = {
authProvider,
};
const client = Client.init(options);
let workflows = await client.api('/identityGovernance/lifecycleWorkflows/workflows')
.get();
有关如何将 SDK 添加到项目并创建 authProvider 实例的详细信息,请参阅 SDK 文档。
<?php
use Microsoft\Graph\GraphServiceClient;
$graphServiceClient = new GraphServiceClient($tokenRequestContext, $scopes);
$result = $graphServiceClient->identityGovernance()->lifecycleWorkflows()->workflows()->get()->wait();
有关如何将 SDK 添加到项目并创建 authProvider 实例的详细信息,请参阅 SDK 文档。
Import-Module Microsoft.Graph.Identity.Governance
Get-MgIdentityGovernanceLifecycleWorkflow
有关如何将 SDK 添加到项目并创建 authProvider 实例的详细信息,请参阅 SDK 文档。
# Code snippets are only available for the latest version. Current version is 1.x
from msgraph import GraphServiceClient
# To initialize your graph_client, see https://learn.microsoft.com/en-us/graph/sdks/create-client?from=snippets&tabs=python
result = await graph_client.identity_governance.lifecycle_workflows.workflows.get()
有关如何将 SDK 添加到项目并创建 authProvider 实例的详细信息,请参阅 SDK 文档。
响应
以下示例显示了相应的响应。
HTTP/1.1 200 OK
Content-Type: application/json
{
"@odata.context": "https://graph.microsoft.com/v1.0/$metadata#identityGovernance/lifecycleWorkflows/workflows",
"value": [
{
"category": "joiner",
"description": "Configure pre-hire tasks for onboarding employees before their first day",
"displayName": "Global pre hire",
"lastModifiedDateTime": "2022-08-16T20:05:51.4618603Z",
"createdDateTime": "2022-01-10T20:04:30.619368Z",
"id": "c007a148-5bf1-4f38-82b4-377fb23b1711",
"isEnabled": true,
"isSchedulingEnabled": true,
"version": 12
},
{
"category": "joiner",
"description": "Configure new hire tasks for onboarding employees on their first day",
"displayName": "Global new hire",
"lastModifiedDateTime": "2022-08-18T17:24:42.6051254Z",
"createdDateTime": "2022-05-06T14:10:39.9700268Z",
"id": "559d8339-ab4e-4c41-a517-ed5d8dd9fbf5",
"isEnabled": true,
"isSchedulingEnabled": true,
"version": 5
},
{
"category": "joiner",
"description": "Configure pre-hire tasks for onboarding employees before their first day",
"displayName": "Onboard pre-hire employee",
"lastModifiedDateTime": "2022-08-16T20:01:28.3589067Z",
"createdDateTime": "2022-08-16T17:48:55.2262907Z",
"id": "d0454160-b8e9-432f-8a85-790021e64c9e",
"isEnabled": false,
"isSchedulingEnabled": false,
"version": 1
},
{
"category": "leaver",
"description": "Configure offboarding tasks for employees after their last day of work",
"displayName": "Post-Offboarding of an employee",
"lastModifiedDateTime": "2022-08-17T18:57:30.5091553Z",
"createdDateTime": "2022-08-17T18:57:07.1840042Z",
"id": "15f9c6db-ada8-4417-927f-17ac24b54b9b",
"isEnabled": true,
"isSchedulingEnabled": false,
"version": 1
},
{
"category": "leaver",
"description": "Execute real-time termination tasks for employees on their last day of work",
"displayName": "Real-time employee termination",
"lastModifiedDateTime": "2022-08-19T20:34:15.4212506Z",
"createdDateTime": "2022-08-19T20:34:15.4212481Z",
"id": "57bc6612-2c20-4141-9dab-aa11a95b8fbc",
"isEnabled": true,
"isSchedulingEnabled": false,
"version": 1
},
{
"category": "joiner",
"description": "Configure new hire tasks for onboarding employees on their first day",
"displayName": "Onboard new hire employee",
"lastModifiedDateTime": "2022-08-24T15:39:17.6496744Z",
"createdDateTime": "2022-08-24T15:39:17.6496704Z",
"id": "156ce798-1eb6-4e0a-8515-e79f54d04390",
"isEnabled": true,
"isSchedulingEnabled": false,
"version": 1
}
]
}
示例 2:仅检索“leaver”工作流的特定属性
请求
以下示例显示了一个请求。
GET https://graph.microsoft.com/v1.0/identityGovernance/lifecycleWorkflows/workflows?$filter=category eq 'leaver'&$select=id,category,displayName,isEnabled,isSchedulingEnabled
// Code snippets are only available for the latest version. Current version is 5.x
// To initialize your graphClient, see https://learn.microsoft.com/en-us/graph/sdks/create-client?from=snippets&tabs=csharp
var result = await graphClient.IdentityGovernance.LifecycleWorkflows.Workflows.GetAsync((requestConfiguration) =>
{
requestConfiguration.QueryParameters.Filter = "category eq 'leaver'";
requestConfiguration.QueryParameters.Select = new string []{ "id","category","displayName","isEnabled","isSchedulingEnabled" };
});
有关如何将 SDK 添加到项目并创建 authProvider 实例的详细信息,请参阅 SDK 文档。
mgc identity-governance lifecycle-workflows workflows list --filter "category eq 'leaver'" --select "id,category,displayName,isEnabled,isSchedulingEnabled"
有关如何将 SDK 添加到项目并创建 authProvider 实例的详细信息,请参阅 SDK 文档。
// Code snippets are only available for the latest major version. Current major version is $v1.*
// Dependencies
import (
"context"
msgraphsdk "github.com/microsoftgraph/msgraph-sdk-go"
graphidentitygovernance "github.com/microsoftgraph/msgraph-sdk-go/identitygovernance"
//other-imports
)
requestFilter := "category eq 'leaver'"
requestParameters := &graphidentitygovernance.LifecycleWorkflowsWorkflowsRequestBuilderGetQueryParameters{
Filter: &requestFilter,
Select: [] string {"id","category","displayName","isEnabled","isSchedulingEnabled"},
}
configuration := &graphidentitygovernance.LifecycleWorkflowsWorkflowsRequestBuilderGetRequestConfiguration{
QueryParameters: requestParameters,
}
// To initialize your graphClient, see https://learn.microsoft.com/en-us/graph/sdks/create-client?from=snippets&tabs=go
workflows, err := graphClient.IdentityGovernance().LifecycleWorkflows().Workflows().Get(context.Background(), configuration)
有关如何将 SDK 添加到项目并创建 authProvider 实例的详细信息,请参阅 SDK 文档。
// Code snippets are only available for the latest version. Current version is 6.x
GraphServiceClient graphClient = new GraphServiceClient(requestAdapter);
com.microsoft.graph.models.identitygovernance.WorkflowCollectionResponse result = graphClient.identityGovernance().lifecycleWorkflows().workflows().get(requestConfiguration -> {
requestConfiguration.queryParameters.filter = "category eq 'leaver'";
requestConfiguration.queryParameters.select = new String []{"id", "category", "displayName", "isEnabled", "isSchedulingEnabled"};
});
有关如何将 SDK 添加到项目并创建 authProvider 实例的详细信息,请参阅 SDK 文档。
const options = {
authProvider,
};
const client = Client.init(options);
let workflows = await client.api('/identityGovernance/lifecycleWorkflows/workflows')
.filter('category eq \'leaver\'')
.select('id,category,displayName,isEnabled,isSchedulingEnabled')
.get();
有关如何将 SDK 添加到项目并创建 authProvider 实例的详细信息,请参阅 SDK 文档。
<?php
use Microsoft\Graph\GraphServiceClient;
use Microsoft\Graph\Generated\IdentityGovernance\LifecycleWorkflows\Workflows\WorkflowsRequestBuilderGetRequestConfiguration;
$graphServiceClient = new GraphServiceClient($tokenRequestContext, $scopes);
$requestConfiguration = new WorkflowsRequestBuilderGetRequestConfiguration();
$queryParameters = WorkflowsRequestBuilderGetRequestConfiguration::createQueryParameters();
$queryParameters->filter = "category eq 'leaver'";
$queryParameters->select = ["id","category","displayName","isEnabled","isSchedulingEnabled"];
$requestConfiguration->queryParameters = $queryParameters;
$result = $graphServiceClient->identityGovernance()->lifecycleWorkflows()->workflows()->get($requestConfiguration)->wait();
有关如何将 SDK 添加到项目并创建 authProvider 实例的详细信息,请参阅 SDK 文档。
Import-Module Microsoft.Graph.Identity.Governance
Get-MgIdentityGovernanceLifecycleWorkflow -Filter "category eq 'leaver'" -Property "id,category,displayName,isEnabled,isSchedulingEnabled"
有关如何将 SDK 添加到项目并创建 authProvider 实例的详细信息,请参阅 SDK 文档。
# Code snippets are only available for the latest version. Current version is 1.x
from msgraph import GraphServiceClient
from msgraph.generated.identity_governance.lifecycle_workflows.workflows.workflows_request_builder import WorkflowsRequestBuilder
from kiota_abstractions.base_request_configuration import RequestConfiguration
# To initialize your graph_client, see https://learn.microsoft.com/en-us/graph/sdks/create-client?from=snippets&tabs=python
query_params = WorkflowsRequestBuilder.WorkflowsRequestBuilderGetQueryParameters(
filter = "category eq 'leaver'",
select = ["id","category","displayName","isEnabled","isSchedulingEnabled"],
)
request_configuration = RequestConfiguration(
query_parameters = query_params,
)
result = await graph_client.identity_governance.lifecycle_workflows.workflows.get(request_configuration = request_configuration)
有关如何将 SDK 添加到项目并创建 authProvider 实例的详细信息,请参阅 SDK 文档。
响应
以下示例显示了相应的响应。
HTTP/1.1 200 OK
Content-Type: application/json
{
"@odata.context": "https://graph.microsoft.com/v1.0/$metadata#identityGovernance/lifecycleWorkflows/workflows(category,displayName,isEnabled,isSchedulingEnabled)",
"value": [
{
"category": "leaver",
"displayName": "Pre-Offboarding employees in the R&D department",
"id": "c0548e6c-8849-46e8-be14-8b6d2b04957e",
"isEnabled": true,
"isSchedulingEnabled": true
}
]
}